Skip to content

Commit b2a422a

Browse files
committed
Bug fix : if no t at parton level, the rest of the analyzer was not executed
1 parent f050c58 commit b2a422a

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

plugins/HHAnalyzer.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
298298
std::cout << "This is not a ttbar event" << std::endl;
299299
#endif
300300
gen_ttbar_decay_type = NotTT;
301-
return;
302301
}
302+
if (gen_ttbar_decay_type != NotTT) {
303303

304304
if ((gen_jet1_t != 0) && (gen_jet2_t != 0) && (gen_jet1_tbar != 0) && (gen_jet2_tbar != 0)) {
305305
#if TT_GEN_DEBUG
@@ -361,7 +361,6 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
361361
} else {
362362
std::cout << "Error: unknown dileptonic ttbar decay." << std::endl;
363363
gen_ttbar_decay_type = NotTT;
364-
return;
365364
}
366365
} else {
367366
std::cout << "Error: unknown ttbar decay." << std::endl;
@@ -376,6 +375,7 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
376375
gen_ttbar_lepton_t_beforeFSR_p4 = gp->pruned_p4[gen_lepton_t_beforeFSR];
377376
if (gen_lepton_tbar_beforeFSR != 0)
378377
gen_ttbar_lepton_tbar_beforeFSR_p4 = gp->pruned_p4[gen_lepton_tbar_beforeFSR];
378+
}
379379
} // end of if isMC
380380

381381
//float mh = event.isRealData() ? 125.02 : 125.0;
@@ -432,7 +432,6 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
432432
return index;
433433
};
434434

435-
436435
// **********
437436
// Leptons and dileptons
438437
// **********
@@ -607,6 +606,7 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
607606
muons.push_back(imuon);
608607
leptons.push_back(mu);
609608
}//end of loop on muons
609+
610610
if (leptons.size() < 2)
611611
return;
612612
nMuons = muons.size();
@@ -694,6 +694,7 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
694694
ll.push_back(dilep);
695695
}
696696
}
697+
697698
if (ll.size()<1)
698699
return;
699700
std::sort(ll.begin(), ll.end(), [](const HH::Dilepton& ll1, const HH::Dilepton& ll2) { return ll1.ht_l_l > ll2.ht_l_l; });
@@ -902,6 +903,7 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
902903
jets.push_back(myjet);
903904
}
904905
nJets = jets.size();
906+
905907
if (nJets < 2)
906908
return;
907909

test/HHConfiguration.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@
8484

8585
if runOnData :
8686
process.source.fileNames = cms.untracked.vstring(
87-
'/store/data/Run2015D/DoubleMuon/MINIAOD/16Dec2015-v1/60000/F8804BA6-90B3-E511-BE7C-00259059391E.root'
88-
#'/store/data/Run2015D/DoubleEG/MINIAOD/16Dec2015-v2/00000/000298CD-87A6-E511-9E56-002590593878.root'
87+
#'/store/data/Run2015D/DoubleMuon/MINIAOD/16Dec2015-v1/60000/F8804BA6-90B3-E511-BE7C-00259059391E.root'
88+
'/store/data/Run2015D/DoubleEG/MINIAOD/16Dec2015-v2/00000/000298CD-87A6-E511-9E56-002590593878.root'
8989
)
9090
else :
9191
process.source.fileNames = cms.untracked.vstring(
92-
'/store/mc/RunIIFall15MiniAODv2/TTTo2L2Nu_13TeV-powheg/MINIAODSIM/PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/00000/50FF8034-BEB9-E511-A09C-001EC9ADDD58.root'
92+
#'/store/mc/RunIIFall15MiniAODv2/GluGluToRadionToHHTo2B2VTo2L2Nu_M-650_narrow_13TeV-madgraph/MINIAODSIM/PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/70000/04A9FE44-8FBB-E511-A360-E03F49D6226B.root'
93+
'/store/mc/RunIIFall15MiniAODv2/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/MINIAODSIM/PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/70000/002ABFCA-A0B9-E511-B9BA-0CC47A57CD6A.root'
94+
#'/store/mc/RunIIFall15MiniAODv2/TTTo2L2Nu_13TeV-powheg/MINIAODSIM/PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/00000/50FF8034-BEB9-E511-A09C-001EC9ADDD58.root'
9395
)
9496

9597
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))

0 commit comments

Comments
 (0)