1 |
anlevin |
1.3 |
//./bin/runZeeTreeWriter.exe --catalogDir "/home/cmsprod/catalog" --book "t2mit/filefi/028" --dataset "s12-zllm50-2-v9" --fileset "0000" --output_filename "delete.root" --is_data 0 --n_events_to_process 1000 --rho rho_kt_6_pf_jets
|
2 |
anlevin |
1.1 |
|
3 |
|
|
#include "ZeeTreeWriterMod.h"
|
4 |
|
|
#include "ZeeTreeWriterArgs.h"
|
5 |
|
|
#include "TChain.h"
|
6 |
|
|
|
7 |
|
|
int main(int argc, char** argv)
|
8 |
|
|
{
|
9 |
|
|
ZeeTreeWriterFlags ctrl;
|
10 |
|
|
|
11 |
|
|
parse_zee_tree_writer_args( argc, argv, ctrl );
|
12 |
anlevin |
1.3 |
if( ctrl.catalogDir.empty() || ctrl.book.empty() || ctrl.dataset.empty()|| ctrl.fileset.empty()|| ctrl.output_filename.empty()|| !(ctrl.is_data == 0 || ctrl.is_data == 1) || ctrl.n_events_to_process == -2 || ctrl.rho.empty())
|
13 |
anlevin |
1.1 |
{
|
14 |
|
|
cerr << "usage: runZeeTreeWriter.exe <flags> " << endl;
|
15 |
|
|
ctrl.dump();
|
16 |
|
|
|
17 |
|
|
return 1;
|
18 |
|
|
}
|
19 |
|
|
ctrl.dump();
|
20 |
anlevin |
1.3 |
assert(ctrl.rho == "rho" || ctrl.rho == "rho_kt_6_pf_jets");
|
21 |
|
|
|
22 |
anlevin |
1.1 |
|
23 |
anlevin |
1.2 |
mithep::ZeeTreeWriterMod *zeetwMod = new mithep::ZeeTreeWriterMod;
|
24 |
anlevin |
1.1 |
mithep::Analysis *ana = new mithep::Analysis;
|
25 |
|
|
if(ctrl.n_events_to_process == -1)
|
26 |
|
|
ana->SetProcessNEvents(TChain::kBigNumber);
|
27 |
|
|
else
|
28 |
|
|
ana->SetProcessNEvents(ctrl.n_events_to_process);
|
29 |
anlevin |
1.2 |
|
30 |
|
|
ana->AddSuperModule(zeetwMod);
|
31 |
anlevin |
1.1 |
|
32 |
anlevin |
1.3 |
if(ctrl.rho == "rho_kt_6_pf_jets")
|
33 |
|
|
zeetwMod->rho_version = mithep::ZeeTreeWriterMod::e_rho_kt_6_pf_jets;
|
34 |
|
|
else if (ctrl.rho == "rho")
|
35 |
|
|
zeetwMod->rho_version = mithep::ZeeTreeWriterMod::e_rho;
|
36 |
|
|
else
|
37 |
|
|
assert(0);
|
38 |
|
|
|
39 |
|
|
|
40 |
anlevin |
1.1 |
mithep::Catalog *c = new mithep::Catalog(TString(ctrl.catalogDir));
|
41 |
|
|
mithep::Dataset *d = c->FindDataset(TString(ctrl.book),TString(ctrl.dataset),TString(ctrl.fileset));
|
42 |
|
|
ana->AddDataset(d);
|
43 |
|
|
//ana->AddFile("root://castorcms//castor/cern.ch/user/p/paus/filefi/028/r12a-dmu-pr-v1/FEF8A575-A785-E111-A21A-003048D37538.root");
|
44 |
anlevin |
1.2 |
zeetwMod->fOutputName = ctrl.output_filename;
|
45 |
|
|
zeetwMod->massLo = 60;
|
46 |
|
|
zeetwMod->massHi = 120;
|
47 |
|
|
zeetwMod->use_gen = !ctrl.is_data;
|
48 |
|
|
zeetwMod->use_JSON = ctrl.is_data;
|
49 |
|
|
|
50 |
anlevin |
1.1 |
ana->Run(kFALSE);
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
}
|
54 |
|
|
|