20 mInputJet1Collection (iConfig.getParameter<
edm::
InputTag> (
"src_Jet1")),
21 mInputJet2Collection (iConfig.getParameter<
edm::
InputTag> (
"src_Jet2")),
22 JetType1 (iConfig.getUntrackedParameter<
std::
string>(
"Jet1")),
23 JetType2 (iConfig.getUntrackedParameter<
std::
string>(
"Jet2")),
24 mRecoJetPtThreshold (iConfig.getParameter<double> (
"recoJetPtThreshold")),
25 mRecoDelRMatch (iConfig.getParameter<double> (
"recoDelRMatch")),
26 mRecoJetEtaCut (iConfig.getParameter<double> (
"recoJetEtaCut"))
95 mpT_ratio_Jet1Jet2 = ibooker.
book1D(
"Ratio_Jet1pT_vs_Jet2pT",Form(
";Matched %s Jet pT / %s Jet pT;Counts",
"JetType1",
"JetType2"),100, 0, 10);
96 mpT_Jet1_matched = ibooker.
book1D(
"Jet1_matched_jet_Spectra",Form(
";Matched %s Spectra; counts",
"JetType1"),100, 0, 1000);
97 mpT_Jet2_matched = ibooker.
book1D(
"Jet2_matched_jet_Spectra",Form(
";Matched %s Spectra; counts",
"JetType2"),100, 0, 1000);
98 mpT_Jet1_unmatched = ibooker.
book1D(
"Jet1_unmatched_jet_Spectra",Form(
";Unmatched %s spectra;counts",
"JetType1"),100, 0, 1000);
99 mpT_Jet2_unmatched = ibooker.
book1D(
"Jet2_unmatched_jet_Spectra",Form(
";Unmatched %s spectra;counts",
"JetType2"),100, 0, 1000);
102 mHadEnergy_Jet1_unmatched = ibooker.
book1D(
"HadEnergy_Jet1_unmatched", Form(
"HadEnergy_Jet1_unmatched;HadEnergy unmatched %s;counts",
"JetType1"), 50, 0, 200);
103 mEmEnergy_Jet1_unmatched = ibooker.
book1D(
"EmEnergy_Jet1_unmatched", Form(
"EmEnergy_Jet1_unmatched;EMEnergy unmatched %s;counts",
"JetType1"), 50, 0, 200);
107 mHadEnergy_Jet2_unmatched = ibooker.
book1D(
"HadEnergy_Jet2_unmatched", Form(
"HadEnergy_Jet2_unmatched;HadEnergy unmatched %s;counts",
"JetType2"), 50, 0, 200);
108 mEmEnergy_Jet2_unmatched = ibooker.
book1D(
"EmEnergy_Jet2_unmatched", Form(
"EmEnergy_Jet2_unmatched;EMEnergy unmatched %s;counts",
"JetType2"), 50, 0, 200);
142 LogInfo(
"OutputInfo") <<
" Histograms will NOT be saved";
186 std::vector<const Jet*> recoJet1;
188 std::vector<const Jet*> recoJet2;
199 for (
unsigned ijet=0; ijet<caloJet1->size(); ++ijet) recoJet1.push_back(&(*caloJet1)[ijet]);
203 for (
unsigned ijet=0; ijet<caloJet1->size(); ++ijet) recoJet1.push_back(&(*caloJet1)[ijet]);
207 for (
unsigned ijet=0; ijet<pfJets->size(); ++ijet) recoJet1.push_back(&(*pfJets)[ijet]);
211 for (
unsigned ijet=0; ijet<basicJets->size(); ++ijet) recoJet1.push_back(&(*basicJets)[ijet]);
216 for (
unsigned ijet=0; ijet<caloJet2->size(); ++ijet) recoJet2.push_back(&(*caloJet2)[ijet]);
220 for (
unsigned ijet=0; ijet<caloJet2->size(); ++ijet) recoJet2.push_back(&(*caloJet2)[ijet]);
224 for (
unsigned ijet=0; ijet<pfJets->size(); ++ijet) recoJet2.push_back(&(*pfJets)[ijet]);
228 for (
unsigned ijet=0; ijet<basicJets->size(); ++ijet) recoJet2.push_back(&(*basicJets)[ijet]);
233 Int_t Jet1_nref = recoJet1.size();
234 Int_t Jet2_nref = recoJet2.size();
239 std::vector <MyJet> vJet1, vJet2;
240 std::vector <int> Jet1_ID(Jet1_nref), Jet2_ID(Jet2_nref);
242 if(Jet1_nref == 0 || Jet2_nref == 0)
return;
244 for(
unsigned ijet1 = 0; ijet1 < recoJet1.size(); ++ijet1){
251 JET1.
eta = recoJet1[ijet1]->eta();
252 JET1.
phi = recoJet1[ijet1]->phi();
253 JET1.
pt = recoJet1[ijet1]->pt();
256 vJet1.push_back(JET1);
261 for(
unsigned ijet2 = 0; ijet2 < recoJet2.size(); ++ijet2){
267 JET2.
eta = recoJet2[ijet2]->eta();
268 JET2.
phi = recoJet2[ijet2]->phi();
269 JET2.
pt = recoJet2[ijet2]->pt();
272 vJet2.push_back(JET2);
277 bool onlyJet1 = (jet1>0 && jet2==0) ?
true :
false;
278 bool onlyJet2 = (jet1==0 && jet2 >0) ?
true :
false;
279 bool bothJet1Jet2 = (jet1>0 && jet2 >0) ?
true :
false;
282 int unmatchedJet1 = 0;
283 int unmatchedJet2 = 0;
285 std::vector < MyJet >::const_iterator iJet, jJet;
289 for(iJet = vJet1.begin(); iJet != vJet1.end(); ++iJet){
299 for(iJet = vJet2.begin(); iJet != vJet2.end(); ++iJet){
306 }
else if (bothJet1Jet2){
310 for(iJet = vJet1.begin(); iJet != vJet1.end(); ++iJet){
311 for(jJet = vJet2.begin(); jJet != vJet2.end(); ++jJet){
312 mABMatchedJets.insert(std::make_pair(*iJet, *jJet));
319 for(itr = mABMatchedJets.begin(); itr != mABMatchedJets.end(); ++itr){
322 MyJet Aj = jetpair.first;
323 MyJet Bj = jetpair.second;
345 for(itr = mABMatchedJets.begin(); itr != mABMatchedJets.end(); ++itr){
349 MyJet Aj = jetpair.first;
350 MyJet Bj = jetpair.second;
352 if(Jet1_ID[Aj.
id] == 0) {
360 + (*caloJet1)[Aj.
id].hadEnergyInHB()
361 + (*caloJet1)[Aj.
id].hadEnergyInHF()
362 + (*caloJet1)[Aj.
id].hadEnergyInHE()
365 + (*caloJet1)[Aj.
id].emEnergyInEE()
366 + (*caloJet1)[Aj.
id].emEnergyInHF()
386 if(Jet2_ID[Bj.
id] == 0) {
393 + (*caloJet2)[Bj.
id].hadEnergyInHB()
394 + (*caloJet2)[Bj.
id].hadEnergyInHF()
395 + (*caloJet2)[Bj.
id].hadEnergyInHE()
398 + (*caloJet2)[Bj.
id].emEnergyInEE()
399 + (*caloJet2)[Bj.
id].emEnergyInHF()
MonitorElement * mNeutralEmEnergy_Jet2_unmatched
MonitorElement * mChargedHadEnergyFraction_Jet2_unmatched
MonitorElement * mpT_Jet2_unmatched
MonitorElement * mNeutralEmEnergy_Jet1_unmatched
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
MonitorElement * mpT_Jet1_matched
MonitorElement * mpT_ratio_Jet1Jet2
std::multiset< ABJetPair, CompareMatchedJets > ABMatchedJets
MonitorElement * mEmEnergy_Jet1_unmatched
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * mHadEnergy_Jet1_unmatched
MonitorElement * mChargedEmEnergy_Jet1_unmatched
MonitorElement * mChargedMuEnergy_Jet1_unmatched
MonitorElement * mpT_Jet2_matched
edm::InputTag mInputJet1Collection
MonitorElement * mNeutralHadronEnergy_Jet1_unmatched
MonitorElement * mNeutralHadEnergyFraction_Jet1_unmatched
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * mPhotonEnergyFraction_Jet1_unmatched
virtual ~JetAnalyzer_HeavyIons_matching()
MonitorElement * mChargedHadronEnergy_Jet1_unmatched
edm::InputTag mInputJet2Collection
MonitorElement * mElectronEnergyFraction_Jet1_unmatched
MonitorElement * mNeutralHadEnergyFraction_Jet2_unmatched
double mRecoJetPtThreshold
MonitorElement * mPhotonEnergyFraction_Jet2_unmatched
MonitorElement * book1D(Args &&...args)
MonitorElement * mElectronEnergyFraction_Jet2_unmatched
MonitorElement * mChargedMuEnergy_Jet2_unmatched
MonitorElement * mHadEnergy_Jet2_unmatched
MonitorElement * mChargedHadEnergyFraction_Jet1_unmatched
MonitorElement * mMuonEnergyFraction_Jet2_unmatched
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void setCurrentFolder(const std::string &fullpath)
edm::EDGetTokenT< reco::CaloJetCollection > caloJet1Token_
static float deltaRR(float eta1, float phi1, float eta2, float phi2)
MonitorElement * mChargedHadronEnergy_Jet2_unmatched
MonitorElement * mpT_Jet1_unmatched
JetAnalyzer_HeavyIons_matching(const edm::ParameterSet &)
MonitorElement * mNeutralHadronEnergy_Jet2_unmatched
std::pair< MyJet, MyJet > ABJetPair
MonitorElement * mMuonEnergyFraction_Jet1_unmatched
std::multiset< ABJetPair >::iterator ABItr
edm::EDGetTokenT< reco::CaloJetCollection > caloJet2Token_
MonitorElement * mChargedEmEnergy_Jet2_unmatched
MonitorElement * mEmEnergy_Jet2_unmatched
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_