ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/NonMCBackground/src/runMuonFakeRate.cc
Revision: 1.4
Committed: Fri Jul 6 11:03:37 2012 UTC (12 years, 10 months ago) by anlevin
Content type: text/plain
Branch: MAIN
CVS Tags: compiled, HEAD
Changes since 1.3: +3 -1 lines
Log Message:
updated the electron and muon fake rates

File Contents

# User Rev Content
1 anlevin 1.3 //./bin/runMuonFakeRate.exe --catalogDir "/home/mitprod/catalog" --book "cern/filefi/028" --dataset "r12a-dmu-pr-v1" --fileset "0000" --outputFilename "delete.root" --dielectron_or_dimuon_data "dimuon_data" --isData 1 --n_events_to_process 1000
2    
3 anlevin 1.1 #include "MuonFakeRateMod.h"
4 anlevin 1.2 #include "MuonFakeRateArgs.h"
5 anlevin 1.4 #include "TChain.h"
6 anlevin 1.1
7 anlevin 1.2 int main(int argc, char** argv)
8 anlevin 1.1 {
9 anlevin 1.2 MuonFakeRateFlags ctrl;
10     parse_muon_fake_rate_args( argc, argv, ctrl );
11     if( ctrl.catalogDir.empty() || ctrl.book.empty() || ctrl.dataset.empty()|| ctrl.fileset.empty()|| ctrl.outputFilename.empty()|| ctrl.dielectron_or_dimuon_data.empty() || ctrl.isData == -2|| ctrl.n_events_to_process == -2)
12     {
13     cerr << "usage: runMuonFakeRate.exe <flags> " << endl;
14     ctrl.dump();
15 anlevin 1.1
16 anlevin 1.2 return 1;
17     }
18     ctrl.dump();
19    
20     initVBTFSelection();
21 anlevin 1.1
22     mithep::MuonFakeRateMod *frMod = new mithep::MuonFakeRateMod;
23     mithep::Analysis *ana = new mithep::Analysis;
24     ana->SetUseHLT(kTRUE);
25 anlevin 1.4 if(ctrl.n_events_to_process == -1)
26     ana->SetProcessNEvents(TChain::kBigNumber);
27 anlevin 1.1 ana->AddSuperModule(frMod);
28    
29     //ana->AddFile("/data/blue/cmsprod/test3_sync_Summer12/0CAA68E2-3491-E111-9F03-003048FFD760.root");
30    
31 anlevin 1.2 mithep::Catalog *c = new mithep::Catalog(TString(ctrl.catalogDir));
32     mithep::Dataset *d = c->FindDataset(TString(ctrl.book),TString(ctrl.dataset),TString(ctrl.fileset));
33 anlevin 1.1 ana->AddDataset(d);
34    
35     frMod->massLo = 80;
36     frMod->massHi = 120;
37 anlevin 1.2 frMod->useJSON = ctrl.isData;
38     frMod->useTrigger = ctrl.isData;
39     frMod->store_npu = !ctrl.isData;
40     assert(ctrl.dielectron_or_dimuon_data == "dielectron_data" || ctrl.dielectron_or_dimuon_data == "dimuon_data");
41     if(ctrl.dielectron_or_dimuon_data == "dielectron_data")
42 anlevin 1.1 frMod->die_or_dimu = mithep::MuonFakeRateMod::e_dielectron_data;
43 anlevin 1.2 else if (ctrl.dielectron_or_dimuon_data == "dimuon_data")
44 anlevin 1.1 frMod->die_or_dimu = mithep::MuonFakeRateMod::e_dimuon_data;
45     else
46     assert(0);
47 anlevin 1.2 frMod->fOutputName = ctrl.outputFilename;
48 anlevin 1.1
49     initTrigger();
50    
51     ana->Run(!gROOT->IsBatch());
52    
53     }
54