1 |
anlevin |
1.1 |
//./bin/runPhotonEnergyRegressionTreeWriter.exe --catalogDir "/home/cmsprod/catalog" --book "t2mit/filefi/028" --dataset "s12-zllm50-2-v9" --fileset "0006" --output_filename "delete.root" --n_events_to_process 1000 --rho rho_kt_6_pf_jets
|
2 |
|
|
|
3 |
|
|
#include "PhotonEnergyRegressionTreeWriterMod.h"
|
4 |
|
|
#include "ElectronEnergyRegressionTreeWriterArgs.h"
|
5 |
|
|
#include "TChain.h"
|
6 |
|
|
|
7 |
|
|
int main(int argc, char** argv)
|
8 |
|
|
{
|
9 |
|
|
ElectronEnergyRegressionTreeWriterFlags ctrl;
|
10 |
|
|
|
11 |
|
|
parse_electron_energy_regression_tree_writer_args( argc, argv, ctrl );
|
12 |
|
|
if( ctrl.catalog_dir.empty() || ctrl.book.empty() || ctrl.dataset.empty()|| ctrl.fileset.empty()|| ctrl.output_filename.empty()|| ctrl.n_events_to_process == -2 || ctrl.rho.empty())
|
13 |
|
|
{
|
14 |
|
|
cerr << "usage: runPhotonEnergyRegressionTreeWriter.exe <flags> " << endl;
|
15 |
|
|
ctrl.dump();
|
16 |
|
|
|
17 |
|
|
return 1;
|
18 |
|
|
}
|
19 |
|
|
ctrl.dump();
|
20 |
|
|
assert(ctrl.rho == "rho" || ctrl.rho == "rho_kt_6_pf_jets");
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
mithep::PhotonEnergyRegressionTreeWriterMod *pertwMod = new mithep::PhotonEnergyRegressionTreeWriterMod;
|
24 |
|
|
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 |
|
|
ana->AddSuperModule(pertwMod);
|
30 |
|
|
|
31 |
|
|
if(ctrl.rho == "rho_kt_6_pf_jets")
|
32 |
|
|
pertwMod->rho_version = mithep::PhotonEnergyRegressionTreeWriterMod::e_rho_kt_6_pf_jets;
|
33 |
|
|
else if (ctrl.rho == "rho")
|
34 |
|
|
pertwMod->rho_version = mithep::PhotonEnergyRegressionTreeWriterMod::e_rho;
|
35 |
|
|
else
|
36 |
|
|
assert(0);
|
37 |
|
|
|
38 |
|
|
mithep::Catalog *c = new mithep::Catalog(TString(ctrl.catalog_dir));
|
39 |
|
|
mithep::Dataset *d = c->FindDataset(TString(ctrl.book),TString(ctrl.dataset),TString(ctrl.fileset));
|
40 |
|
|
ana->AddDataset(d);
|
41 |
|
|
//ana->AddFile("root://castorcms//castor/cern.ch/user/p/paus/filefi/028/r12a-dmu-pr-v1/FEF8A575-A785-E111-A21A-003048D37538.root");
|
42 |
|
|
pertwMod->fOutputName = ctrl.output_filename;
|
43 |
|
|
ana->Run(kFALSE);
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
}
|
47 |
|
|
|