59 |
|
#include "InfoStruct.h" |
60 |
|
#include "GenInfoStruct.h" |
61 |
|
#include "WeightStruct.h" |
62 |
– |
//#include "GlobalDataAndFuncs.h" |
63 |
– |
#include "RunLumiRangeMap.h" |
64 |
– |
|
62 |
|
#include "AngleTuple.h" |
63 |
|
#include "FOTuple.h" |
64 |
|
|
65 |
+ |
#include "RunLumiRangeMap.h" |
66 |
|
#include "SampleWeight.h" |
67 |
|
#include "EfficiencyWeightsInterface.h" |
68 |
|
|
217 |
|
nt.makeKinematicsBranch(kinematics); |
218 |
|
nt.makeInfoBranch(evtinfo); |
219 |
|
|
220 |
+ |
|
221 |
|
FOTuple foTree( nt.getFile(), (const char*)"FOtree"); |
222 |
|
foTree.makeFailedLeptonBranch(failingLeptons); |
223 |
< |
foTree.makeZLeptonBranch(passingLeptons); |
223 |
> |
foTree.makePassedLeptonBranch(passingLeptons); |
224 |
|
|
225 |
|
TH1F * h_wf11_hpt; |
226 |
|
if(ctrl.mc) { |
227 |
|
nt.makeWeightBranch(weights); |
228 |
< |
nt.makeGenInfoBranch(geninfo); |
228 |
> |
if(ctrl.fillGen ) nt.makeGenInfoBranch(geninfo); |
229 |
|
initEfficiencyWeights(); |
230 |
|
initPUWeights(); |
231 |
|
|
244 |
|
} |
245 |
|
|
246 |
|
// initMuonIDMVA(); |
247 |
< |
initMuonIsoMVA(); |
249 |
< |
initElectronIDMVA(); |
250 |
< |
initElectronIsoMVA(); |
247 |
> |
initElectronIDMVAV1(); |
248 |
|
initTrigger(); |
249 |
|
|
250 |
|
// hack |
328 |
|
chain->GetEntry(ientry); |
329 |
|
if(!(ientry%1000)) cerr << "entry: " << ientry << endl; |
330 |
|
|
334 |
– |
#ifdef HACKED_RHOS |
335 |
– |
float rho = evtrhoMap[info->EvtNum()]; |
336 |
– |
#endif |
331 |
|
string fname = string(chain->GetFile()->GetEndpointUrl()->GetFile()); |
332 |
|
setEra( fname, ctrl ); |
333 |
|
|
395 |
|
// |
396 |
|
// JSON |
397 |
|
// |
398 |
< |
/* |
399 |
< |
RunLumiRangeMap::RunLumiPairType rl(info->RunNum(), info->LumiSec()); |
400 |
< |
if( !(rlrm.HasRunLumi(rl)) ) { |
401 |
< |
if( ctrl.debug ) cout << "\tfails JSON" << endl; |
402 |
< |
continue; |
398 |
> |
// if(!(ctrl.noJSON) ) { |
399 |
> |
cout << "noJSON flag not in Control Flags" << endl; |
400 |
> |
assert(0); |
401 |
> |
RunLumiRangeMap::RunLumiPairType rl(info->RunNum(), info->LumiSec()); |
402 |
> |
if( !(rlrm.HasRunLumi(rl)) ) { |
403 |
> |
if( ctrl.debug ) cout << "\tfails JSON" << endl; |
404 |
> |
continue; |
405 |
> |
// } |
406 |
|
} |
407 |
< |
*/ |
407 |
> |
|
408 |
|
// |
409 |
|
// trigger |
410 |
|
// |
435 |
|
|
436 |
|
// reference |
437 |
|
apply_HZZ4L_reference_selection(ctrl, info, |
438 |
< |
vtxArr, |
439 |
< |
pfArr, |
440 |
< |
#ifdef HACKED_RHOS |
441 |
< |
rho, |
442 |
< |
#else |
443 |
< |
puDArr, |
444 |
< |
#endif |
445 |
< |
electronArr, |
446 |
< |
&electronReferencePreSelection, |
447 |
< |
&electronReferenceIDMVASelectionV1, |
448 |
< |
&electronReferenceIsoSelection, |
449 |
< |
muonArr, |
453 |
< |
&muonReferencePreSelection, |
454 |
< |
&muonIDPFSelection, |
455 |
< |
&muonReferenceIsoSelection); |
456 |
< |
|
457 |
< |
/* |
458 |
< |
// evolved |
459 |
< |
apply_HZZ4L_reference2_selection(ctrl, info, |
460 |
< |
vtx, |
461 |
< |
pfArr, |
462 |
< |
//rho, |
463 |
< |
puDArr, |
464 |
< |
electronArr, |
465 |
< |
&electronReferencePreSelection, |
466 |
< |
//&electronPreSelection, |
467 |
< |
&electronReferenceIDMVASelection, |
468 |
< |
&electronIsoMVASelection, |
469 |
< |
muonArr, |
470 |
< |
&muonReferencePreSelection, |
471 |
< |
//&muonPreSelection, |
472 |
< |
&muonIDPFSelection, |
473 |
< |
&muonIsoMVASelection); |
474 |
< |
*/ |
475 |
< |
|
438 |
> |
vtxArr, |
439 |
> |
pfArr, |
440 |
> |
puDArr, |
441 |
> |
electronArr, |
442 |
> |
&electronReferencePreSelection, |
443 |
> |
&electronReferenceIDMVASelectionV1, |
444 |
> |
&electronReferenceIsoSelection, |
445 |
> |
muonArr, |
446 |
> |
&muonReferencePreSelection, |
447 |
> |
&muonIDPFSelection, |
448 |
> |
&muonReferenceIsoSelection); |
449 |
> |
|
450 |
|
if( ctrl.debug ) cout << endl; |
451 |
|
|
452 |
|
|
495 |
|
pass++; |
496 |
|
// if( pass > 3 ) break; |
497 |
|
|
498 |
< |
} else if( ret4l.status.selectionBits.test(PASS_GOODZ1) ) { // save for fakes ... |
499 |
< |
// if(ctrl.debug) { |
498 |
> |
} else if( ret4l.status.selectionBits.test(PASS_GOODZ1) && |
499 |
> |
ret4l.status.selectionBits.to_ulong() < (1UL<<PASS_4L)) { // save for fakes ... |
500 |
> |
if(ctrl.debug) { |
501 |
|
cout << "failingLeptons : " << failingLeptons.size() << endl; |
502 |
|
for( int f=0; f<failingLeptons.size(); f++ ) { |
503 |
|
SimpleLepton l = failingLeptons[f]; |
506 |
|
<< "pT: " << l.vec.Pt() << "\t" |
507 |
|
<< "eta: " << l.vec.Eta() |
508 |
|
<< endl; |
509 |
< |
// } |
509 |
> |
} |
510 |
|
} |
511 |
|
foTree.Fill(); |
512 |
+ |
} else { |
513 |
+ |
cout << "failing with some other code : " << ret4l.status.selectionBits << endl; |
514 |
|
} |
515 |
|
} |
516 |
|
|
605 |
|
// r11b |
606 |
|
rlrm.AddJSONFile(std::string("./data/Cert_160404-180252_7TeV_PromptReco_Collisions11_JSON.txt")); |
607 |
|
*/ |
608 |
+ |
|
609 |
+ |
// 2012 only for now ... |
610 |
+ |
rlrm.AddJSONFile(std::string("./data/Cert_190456-194479_8TeV_PromptReco_Collisions12_JSON.txt")); |
611 |
+ |
|
612 |
|
}; |
613 |
|
|
614 |
|
|