1 |
anlevin |
1.4 |
//./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 --electron_id "2012_electron_id" --json "NONE"
|
2 |
|
|
//./bin/runZeeTreeWriter.exe --catalogDir "/home/cmsprod/catalog" --book "t2mit/filefi/028" --dataset "r12a-del-pr-v1" --fileset "0001" --output_filename "delete.root" --is_data 1 --n_events_to_process 1000 --rho rho_kt_6_pf_jets --electron_id "2012_electron_id" --json "/afs/cern.ch/user/m/mangano/public/ichep2012_json/Jun24_190456-196531_noLowPU.json" --trigger "HLT_Ele27_WP80"
|
3 |
anlevin |
1.1 |
|
4 |
|
|
#include "ZeeTreeWriterMod.h"
|
5 |
|
|
#include "ZeeTreeWriterArgs.h"
|
6 |
|
|
#include "TChain.h"
|
7 |
|
|
|
8 |
|
|
int main(int argc, char** argv)
|
9 |
|
|
{
|
10 |
|
|
ZeeTreeWriterFlags ctrl;
|
11 |
|
|
|
12 |
|
|
parse_zee_tree_writer_args( argc, argv, ctrl );
|
13 |
anlevin |
1.4 |
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() || ctrl.electron_id.empty() || ctrl.json.empty() || ctrl.trigger.empty())
|
14 |
anlevin |
1.1 |
{
|
15 |
|
|
cerr << "usage: runZeeTreeWriter.exe <flags> " << endl;
|
16 |
|
|
ctrl.dump();
|
17 |
|
|
|
18 |
|
|
return 1;
|
19 |
|
|
}
|
20 |
|
|
ctrl.dump();
|
21 |
anlevin |
1.3 |
assert(ctrl.rho == "rho" || ctrl.rho == "rho_kt_6_pf_jets");
|
22 |
anlevin |
1.4 |
assert(ctrl.electron_id == "2011_electron_id" || ctrl.electron_id == "2012_electron_id");
|
23 |
|
|
assert(ctrl.json == "NONE" || ctrl.is_data);
|
24 |
anlevin |
1.5 |
assert(ctrl.trigger == "NONE" || ctrl.trigger == "HLT_Ele27_WP80" || ctrl.trigger == "HLT_Ele17_CaloIdL_CaloIsoVL" || ctrl.trigger == "HLT_Ele17_CaloIdVT_CaloIsoVT_TrkIdT_TrkIsoVT_Ele8_Mass30");
|
25 |
anlevin |
1.4 |
|
26 |
anlevin |
1.3 |
|
27 |
anlevin |
1.1 |
|
28 |
anlevin |
1.2 |
mithep::ZeeTreeWriterMod *zeetwMod = new mithep::ZeeTreeWriterMod;
|
29 |
anlevin |
1.1 |
mithep::Analysis *ana = new mithep::Analysis;
|
30 |
anlevin |
1.4 |
ana->SetUseHLT(kTRUE);
|
31 |
anlevin |
1.1 |
if(ctrl.n_events_to_process == -1)
|
32 |
|
|
ana->SetProcessNEvents(TChain::kBigNumber);
|
33 |
|
|
else
|
34 |
|
|
ana->SetProcessNEvents(ctrl.n_events_to_process);
|
35 |
anlevin |
1.2 |
|
36 |
|
|
ana->AddSuperModule(zeetwMod);
|
37 |
anlevin |
1.1 |
|
38 |
anlevin |
1.3 |
if(ctrl.rho == "rho_kt_6_pf_jets")
|
39 |
|
|
zeetwMod->rho_version = mithep::ZeeTreeWriterMod::e_rho_kt_6_pf_jets;
|
40 |
|
|
else if (ctrl.rho == "rho")
|
41 |
|
|
zeetwMod->rho_version = mithep::ZeeTreeWriterMod::e_rho;
|
42 |
|
|
else
|
43 |
|
|
assert(0);
|
44 |
|
|
|
45 |
anlevin |
1.4 |
if(ctrl.electron_id == "2011_electron_id")
|
46 |
|
|
zeetwMod->electron_id_version = mithep::ZeeTreeWriterMod::e_2011_electron_id;
|
47 |
|
|
else if (ctrl.electron_id == "2012_electron_id")
|
48 |
|
|
zeetwMod->electron_id_version = mithep::ZeeTreeWriterMod::e_2012_electron_id;
|
49 |
|
|
else
|
50 |
|
|
assert(0);
|
51 |
|
|
|
52 |
|
|
if(ctrl.trigger == "HLT_Ele27_WP80")
|
53 |
|
|
zeetwMod->trigger = kHLT_Ele27_WP80;
|
54 |
|
|
else if (ctrl.trigger == "HLT_Ele17_CaloIdL_CaloIsoVL")
|
55 |
|
|
zeetwMod->trigger = kHLT_Ele17_CaloIdL_CaloIsoVL;
|
56 |
anlevin |
1.5 |
else if (ctrl.trigger == "HLT_Ele17_CaloIdVT_CaloIsoVT_TrkIdT_TrkIsoVT_Ele8_Mass30")
|
57 |
|
|
zeetwMod->trigger = kHLT_Ele17_CaloIdVT_CaloIsoVT_TrkIdT_TrkIsoVT_Ele8_Mass30;
|
58 |
anlevin |
1.4 |
else
|
59 |
|
|
assert(ctrl.trigger == "NONE");
|
60 |
anlevin |
1.3 |
|
61 |
anlevin |
1.1 |
mithep::Catalog *c = new mithep::Catalog(TString(ctrl.catalogDir));
|
62 |
|
|
mithep::Dataset *d = c->FindDataset(TString(ctrl.book),TString(ctrl.dataset),TString(ctrl.fileset));
|
63 |
|
|
ana->AddDataset(d);
|
64 |
|
|
//ana->AddFile("root://castorcms//castor/cern.ch/user/p/paus/filefi/028/r12a-dmu-pr-v1/FEF8A575-A785-E111-A21A-003048D37538.root");
|
65 |
anlevin |
1.2 |
zeetwMod->fOutputName = ctrl.output_filename;
|
66 |
anlevin |
1.5 |
zeetwMod->massLo = 0;
|
67 |
anlevin |
1.2 |
zeetwMod->massHi = 120;
|
68 |
|
|
zeetwMod->use_gen = !ctrl.is_data;
|
69 |
|
|
zeetwMod->use_JSON = ctrl.is_data;
|
70 |
anlevin |
1.4 |
zeetwMod->json_file = ctrl.json;
|
71 |
|
|
zeetwMod->apply_trigger = ctrl.is_data;
|
72 |
|
|
|
73 |
|
|
initTrigger();
|
74 |
anlevin |
1.2 |
|
75 |
anlevin |
1.1 |
ana->Run(kFALSE);
|
76 |
|
|
|
77 |
|
|
}
|
78 |
|
|
|