Skip to content

Commit

Permalink
Bug fix : if no t at parton level, the rest of the analyzer was not e…
Browse files Browse the repository at this point in the history
…xecuted
  • Loading branch information
BrieucF committed Aug 19, 2016
1 parent f050c58 commit b2a422a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions plugins/HHAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
std::cout << "This is not a ttbar event" << std::endl;
#endif
gen_ttbar_decay_type = NotTT;
return;
}
if (gen_ttbar_decay_type != NotTT) {

if ((gen_jet1_t != 0) && (gen_jet2_t != 0) && (gen_jet1_tbar != 0) && (gen_jet2_tbar != 0)) {
#if TT_GEN_DEBUG
Expand Down Expand Up @@ -361,7 +361,6 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
} else {
std::cout << "Error: unknown dileptonic ttbar decay." << std::endl;
gen_ttbar_decay_type = NotTT;
return;
}
} else {
std::cout << "Error: unknown ttbar decay." << std::endl;
Expand All @@ -376,6 +375,7 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
gen_ttbar_lepton_t_beforeFSR_p4 = gp->pruned_p4[gen_lepton_t_beforeFSR];
if (gen_lepton_tbar_beforeFSR != 0)
gen_ttbar_lepton_tbar_beforeFSR_p4 = gp->pruned_p4[gen_lepton_tbar_beforeFSR];
}
} // end of if isMC

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


// **********
// Leptons and dileptons
// **********
Expand Down Expand Up @@ -607,6 +606,7 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
muons.push_back(imuon);
leptons.push_back(mu);
}//end of loop on muons

if (leptons.size() < 2)
return;
nMuons = muons.size();
Expand Down Expand Up @@ -694,6 +694,7 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
ll.push_back(dilep);
}
}

if (ll.size()<1)
return;
std::sort(ll.begin(), ll.end(), [](const HH::Dilepton& ll1, const HH::Dilepton& ll2) { return ll1.ht_l_l > ll2.ht_l_l; });
Expand Down Expand Up @@ -902,6 +903,7 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const
jets.push_back(myjet);
}
nJets = jets.size();

if (nJets < 2)
return;

Expand Down
8 changes: 5 additions & 3 deletions test/HHConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@

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

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

0 comments on commit b2a422a

Please sign in to comment.