81 |
|
|
82 |
|
#include "SimpleLepton.h" |
83 |
|
|
84 |
+ |
#include "Cintex/Cintex.h" |
85 |
+ |
|
86 |
|
#ifndef CMSSW_BASE |
87 |
|
#define CMSSW_BASE "../" |
88 |
|
#endif |
134 |
|
int main(int argc, char** argv) |
135 |
|
//---------------------------------------------------------------------------- |
136 |
|
{ |
137 |
+ |
|
138 |
|
vector<TString> cuts; |
139 |
|
cuts.push_back("start"); // NOTE: is incremented in ReferenceSelection, so if you turn on JSONS be careful |
140 |
|
cuts.push_back("trigger"); |
190 |
|
ifstream f(ctrl.inputfiles.c_str()); |
191 |
|
while (f >> fname) { |
192 |
|
if( !(strncmp( fname.c_str(), "#", 1 ) ) ) continue; // skip commented lines |
193 |
< |
if(fname.find("/store/") != string::npos) fname = "root://eoscms//"+fname; |
193 |
> |
//if(fname.find("/store/") != string::npos) fname = "root://eoscms//"+fname; |
194 |
|
cout << "adding inputfile : " << fname.c_str() << endl; |
195 |
|
entrymap[string(fname.c_str())] = unskimmedEntries(fname.c_str()); |
196 |
|
cerr << "unskimmed entries: " << entrymap[string(fname.c_str())] << endl; |
200 |
|
runchain->AddFile(fname.c_str()); |
201 |
|
} |
202 |
|
} else { |
203 |
< |
if(ctrl.inputfile.find("/store/") != string::npos) ctrl.inputfile = "root://eoscms//"+ctrl.inputfile; |
203 |
> |
//if(ctrl.inputfile.find("/store/") != string::npos) ctrl.inputfile = "root://eoscms//"+ctrl.inputfile; |
204 |
|
cout << "adding inputfile : " << ctrl.inputfile.c_str() << endl; |
205 |
|
unsigned unsk_ents = unskimmedEntries(ctrl.inputfile.c_str()); |
206 |
|
entrymap[string(ctrl.inputfile.c_str())] = unsk_ents; |
228 |
|
if(ctrl.use_xs_weights) getWeight(xstab,entrymap,chain); // test *now* whether we've got the xs in here, so it fails before it creates the output |
229 |
|
} |
230 |
|
|
231 |
+ |
//root will write to this temporary file instead of to memory and the selection will run faster |
232 |
+ |
|
233 |
|
// |
234 |
|
// Setup |
235 |
|
//-------------------------------------------------------------------------------------------------------------- |
280 |
|
initMassErrors(); |
281 |
|
ti.dump(); |
282 |
|
|
283 |
< |
if(ctrl.do_escale) { |
283 |
> |
{ |
284 |
> |
TFile tmp_file("tmp_file.root","RECREATE"); |
285 |
> |
} |
286 |
> |
|
287 |
> |
if(ctrl.do_eregression) { |
288 |
|
string regPath("EGamma/EGammaAnalysisTools/data/eleEnergyRegWeights_V1.root"); |
289 |
|
// if(TString(getenv("HOSTNAME")).Contains(TRegexp("t3[bd][te][cs][hk]"))) |
290 |
< |
regPath = cmsswpath + "/" + regPath; |
290 |
> |
regPath = cmsswpath + "/" + regPath; |
291 |
|
electron_momentum_correction.initialize_regression(regPath); |
283 |
– |
if(ctrl.mc) { |
284 |
– |
if(ctrl.era == 2011) ctrl.smearing_scaling_dataset = "Fall11"; |
285 |
– |
else ctrl.smearing_scaling_dataset = "Summer12_DR53X_HCP2012"; |
286 |
– |
} else { |
287 |
– |
if(ctrl.era == 2011) ctrl.smearing_scaling_dataset = "Jan16ReReco"; |
288 |
– |
else ctrl.smearing_scaling_dataset = "2012Jul13ReReco"; |
289 |
– |
} |
292 |
|
} |
293 |
+ |
|
294 |
|
if(ctrl.correct_muon_momentum) { |
295 |
|
muCorr = new MuCorr; |
296 |
|
muCorr->corr2011 = new rochcor; |
369 |
|
chain->GetEntry(ientry); |
370 |
|
if(!(ientry%1000)) cerr << "entry: " << ientry << " ( / " << imax << " )" << endl; |
371 |
|
|
372 |
+ |
//if(info->EvtNum() != 217502611) continue; |
373 |
+ |
|
374 |
|
increment(counts,"start"); |
375 |
|
if( ctrl.debug ) { |
376 |
|
cout << "-----------------------------------------------------------------" << endl; |
499 |
|
if(ctrl.debug) cout << "failing PASS_GOODZ1" << endl; |
500 |
|
} |
501 |
|
} |
502 |
+ |
|
503 |
+ |
hltTable->Delete(); |
504 |
+ |
|
505 |
|
} |
506 |
|
|
507 |
|
if(ctrl.fakeScheme != "none") { |
515 |
|
cerr << setw(25) << cuts[icut] << "\t" << setw(9) << thisCount["all"] << " (" |
516 |
|
<< setw(9) << thisCount["4e"] << setw(9) << thisCount["4m"] << setw(9) << thisCount["2e2m"] << ")" << endl; |
517 |
|
} |
518 |
+ |
|
519 |
|
} |
520 |
|
//---------------------------------------------------------------------------------------- |
521 |
|
void addDummyZ2Lepotons(EventData &ret4l) |
539 |
|
//the last two arguments are usePt and useY respectively |
540 |
|
fillMela(kine,0,0); |
541 |
|
|
542 |
< |
fillMassErrors(ctrl,ret4l,muonArr,electronArr,kine,false); |
542 |
> |
fillMassErrors(ctrl,ret4l,muonArr,electronArr,kine); |
543 |
|
|
544 |
|
TLorentzVector pfmet; pfmet.SetPxPyPzE(metArr->At(0)->Mex(),metArr->At(0)->Mey(),0,0); |
545 |
|
fillEventInfo( info, pfmet, evtinfo, ctrl.mc ? getNPU(puArr) : 0, vtxArr->GetEntries()); |