97 |
|
// |
98 |
|
// Setup |
99 |
|
//-------------------------------------------------------------------------------------------------------------- |
100 |
+ |
const char * ofname; |
101 |
+ |
if( strcmp( ctrl.outputfile.c_str(), "") ) { |
102 |
+ |
ofname = ctrl.outputfile.c_str(); |
103 |
+ |
} else { |
104 |
+ |
ofname = "tmp.root"; |
105 |
+ |
} |
106 |
+ |
TFile *file = new TFile(ofname, "RECREATE"); |
107 |
|
TH1F * h_evt = new TH1F("hevt", "hevt", 2, 0, 2 ); |
108 |
|
TH1F * h_evtfail = new TH1F("hevtfail", "hevtfail", 1024, 0, 1024 ); |
109 |
|
// TNtuple * passtuple = new TNtuple( "passtuple", "passtuple", "run:evt:lumi:channel:mZ1:mZ2:m4l:pt4l:w" ); |
125 |
|
initCiCSelection(); |
126 |
|
if(ctrl.eleSele=="lik") initLikSelection(); |
127 |
|
if(ctrl.eleSele=="bdt") initBDTSelection(); |
128 |
< |
if(ctrl.eleSele=="si" ) initSiMVAElectronSelection(); |
128 |
> |
// if(ctrl.eleSele=="si" ) initSiMVAElectronSelection(); |
129 |
|
initRunLumiRangeMap(); |
130 |
|
|
131 |
|
// |
132 |
|
// Loop |
133 |
|
//-------------------------------------------------------------------------------------------------------------- |
134 |
+ |
if(ctrl.fakeScheme!="none") {cout << "wrong executable!" << endl; assert(0);} |
135 |
|
|
136 |
|
// |
137 |
|
// Access samples and fill histograms |
160 |
|
|
161 |
|
int count=0, pass=0; |
162 |
|
cout << "nEntries: " << chain->GetEntries() << endl; |
163 |
< |
for(UInt_t ientry=0; ientry<chain->GetEntries(); ientry++) { |
164 |
< |
|
163 |
> |
cerr << "nEntries: " << chain->GetEntries() << endl; |
164 |
> |
UInt_t imax = chain->GetEntries(); |
165 |
> |
for(UInt_t ientry=0; ientry<imax; ientry++) { |
166 |
|
chain->GetEntry(ientry); |
167 |
< |
if(!(ientry%100000)) cout << "entry: " << ientry << endl; |
167 |
> |
if(!(ientry%100000)) cerr << "entry: " << ientry << endl; |
168 |
|
|
169 |
|
// get event weight for this file |
170 |
|
double eventweight=1; |
211 |
|
|
212 |
|
#endif |
213 |
|
|
214 |
< |
unsigned evtfail = fails_HZZ4L_selection(ctrl, info, electronArr, muonArr, eventweight, passtuple); |
214 |
> |
unsigned evtfail = fails_HZZ4L_selection(ctrl, info, electronArr, muonArr, eventweight, passtuple); |
215 |
> |
|
216 |
> |
#ifdef THEIR_EVENTS |
217 |
> |
if(evtfail!=0) cout << "Failed!" << endl; |
218 |
> |
#endif |
219 |
> |
|
220 |
|
h_evtfail->Fill( evtfail, eventweight ); |
221 |
|
|
222 |
|
count++; |
241 |
|
//-------------------------------------------------------------------------------------------------------------- |
242 |
|
// Save Histograms; |
243 |
|
//============================================================================================================== |
244 |
< |
const char * ofname; |
245 |
< |
if( strcmp( ctrl.outputfile.c_str(), "") ) { |
246 |
< |
ofname = ctrl.outputfile.c_str(); |
247 |
< |
} else { |
248 |
< |
ofname = "tmp.root"; |
249 |
< |
} |
244 |
> |
// const char * ofname; |
245 |
> |
// if( strcmp( ctrl.outputfile.c_str(), "") ) { |
246 |
> |
// ofname = ctrl.outputfile.c_str(); |
247 |
> |
// } else { |
248 |
> |
// ofname = "tmp.root"; |
249 |
> |
// } |
250 |
|
|
251 |
< |
TFile *file = new TFile(ofname, "RECREATE"); |
251 |
> |
// TFile *file = new TFile(ofname, "RECREATE"); |
252 |
> |
gROOT->cd(file->GetPath()); |
253 |
|
h_evt->Write(); |
254 |
|
h_evtfail->Write(); |
255 |
|
passtuple->Write(); |