18 : mInputJet1Collection(iConfig.getParameter<
edm::
InputTag>(
"src_Jet1")),
19 mInputJet2Collection(iConfig.getParameter<
edm::
InputTag>(
"src_Jet2")),
20 JetType1(iConfig.getUntrackedParameter<
std::
string>(
"Jet1")),
21 JetType2(iConfig.getUntrackedParameter<
std::
string>(
"Jet2")),
22 mRecoJetPtThreshold(iConfig.getParameter<double>(
"recoJetPtThreshold")),
23 mRecoDelRMatch(iConfig.getParameter<double>(
"recoDelRMatch")),
24 mRecoJetEtaCut(iConfig.getParameter<double>(
"recoJetEtaCut")) {
100 "Ratio_Jet1pT_vs_Jet2pT", Form(
";Matched %s Jet pT / %s Jet pT;Counts",
"JetType1",
"JetType2"), 100, 0, 10);
102 ibooker.
book1D(
"Jet1_matched_jet_Spectra", Form(
";Matched %s Spectra; counts",
"JetType1"), 100, 0, 1000);
104 ibooker.
book1D(
"Jet2_matched_jet_Spectra", Form(
";Matched %s Spectra; counts",
"JetType2"), 100, 0, 1000);
106 ibooker.
book1D(
"Jet1_unmatched_jet_Spectra", Form(
";Unmatched %s spectra;counts",
"JetType1"), 100, 0, 1000);
108 ibooker.
book1D(
"Jet2_unmatched_jet_Spectra", Form(
";Unmatched %s spectra;counts",
"JetType2"), 100, 0, 1000);
112 ibooker.
book1D(
"HadEnergy_Jet1_unmatched",
113 Form(
"HadEnergy_Jet1_unmatched;HadEnergy unmatched %s;counts",
"JetType1"),
118 "EmEnergy_Jet1_unmatched", Form(
"EmEnergy_Jet1_unmatched;EMEnergy unmatched %s;counts",
"JetType1"), 50, 0, 200);
123 ibooker.
book1D(
"HadEnergy_Jet2_unmatched",
124 Form(
"HadEnergy_Jet2_unmatched;HadEnergy unmatched %s;counts",
"JetType2"),
129 "EmEnergy_Jet2_unmatched", Form(
"EmEnergy_Jet2_unmatched;EMEnergy unmatched %s;counts",
"JetType2"), 50, 0, 200);
134 "ChargedHadronEnergy_Jet1_unmatched", Form(
";charged HAD energy unmatched %s;counts",
"JetType1"), 100, 0, 300);
136 "neutralHadronEnergy_Jet1_unmatched", Form(
";neutral HAD energy unmatched %s;counts",
"JetType1"), 100, 0, 300);
138 "ChargedEmEnergy_Jet1_unmatched", Form(
";charged EM energy unmatched %s;counts",
"JetType1"), 100, 0, 300);
140 "neutralEmEnergy_Jet1_unmatched", Form(
";neutral EM energy unmatched %s;counts",
"JetType1"), 100, 0, 300);
142 "ChargedMuEnergy_Jet1_unmatched", Form(
";charged Mu energy unmatched %s;counts",
"JetType1"), 100, 0, 300);
145 "ChargedHadEnergyFraction_Jet1_unmatched", Form(
";h^{+/-} Energy Fraction %s;counts",
"JetType1"), 50, 0, 1);
147 "NeutralHadEnergyFraction_Jet1_unmatched", Form(
";h^{0} Energy Fraction %s;counts",
"JetType1"), 50, 0, 1);
149 "PhotonEnergyFraction_Jet1_unmatched", Form(
";#gamma Energy Fraction %s;counts",
"JetType1"), 50, 0, 1);
151 "ElectronEnergyFraction_Jet1_unmatched", Form(
";e Energy Fraction %s;counts",
"JetType1"), 50, 0, 1);
153 "MuonoEnergyFraction_Jet1_unmatched", Form(
";#mu Energy Fraction %s;counts",
"JetType1"), 50, 0, 1);
158 "ChargedHadronEnergy_Jet2_unmatched", Form(
";charged HAD energy unmatched %s;counts",
"JetType2"), 100, 0, 300);
160 "neutralHadronEnergy_Jet2_unmatched", Form(
";neutral HAD energy unmatched %s;counts",
"JetType2"), 100, 0, 300);
162 "ChargedEmEnergy_Jet2_unmatched", Form(
";charged EM energy unmatched %s;counts",
"JetType2"), 100, 0, 300);
164 "neutralEmEnergy_Jet2_unmatched", Form(
";neutral EM energy unmatched %s;counts",
"JetType2"), 100, 0, 300);
166 "ChargedMuEnergy_Jet2_unmatched", Form(
";charged Mu energy unmatched %s;counts",
"JetType2"), 100, 0, 300);
169 "ChargedHadEnergyFraction_Jet2_unmatched", Form(
";h^{+/-} Energy Fraction %s;counts",
"JetType2"), 50, 0, 1);
171 "NeutralHadEnergyFraction_Jet2_unmatched", Form(
";h^{0} Energy Fraction %s;counts",
"JetType2"), 50, 0, 1);
173 "PhotonEnergyFraction_Jet2_unmatched", Form(
";#gamma Energy Fraction %s;counts",
"JetType2"), 50, 0, 1);
175 "ElectronEnergyFraction_Jet2_unmatched", Form(
";e Energy Fraction %s;counts",
"JetType2"), 50, 0, 1);
177 "MuonoEnergyFraction_Jet2_unmatched", Form(
";#mu Energy Fraction %s;counts",
"JetType2"), 50, 0, 1);
181 LogInfo(
"OutputInfo") <<
" Histograms will NOT be saved";
216 std::vector<const Jet*> recoJet1;
218 std::vector<const Jet*> recoJet2;
229 for (
unsigned ijet = 0; ijet < caloJet1->size(); ++ijet)
230 recoJet1.push_back(&(*caloJet1)[ijet]);
234 for (
unsigned ijet = 0; ijet < caloJet1->size(); ++ijet)
235 recoJet1.push_back(&(*caloJet1)[ijet]);
239 for (
unsigned ijet = 0; ijet <
pfJets->size(); ++ijet)
240 recoJet1.push_back(&(*
pfJets)[ijet]);
244 for (
unsigned ijet = 0; ijet < basicJets->size(); ++ijet)
245 recoJet1.push_back(&(*basicJets)[ijet]);
250 for (
unsigned ijet = 0; ijet < caloJet2->size(); ++ijet)
251 recoJet2.push_back(&(*caloJet2)[ijet]);
255 for (
unsigned ijet = 0; ijet < caloJet2->size(); ++ijet)
256 recoJet2.push_back(&(*caloJet2)[ijet]);
260 for (
unsigned ijet = 0; ijet <
pfJets->size(); ++ijet)
261 recoJet2.push_back(&(*
pfJets)[ijet]);
265 for (
unsigned ijet = 0; ijet < basicJets->size(); ++ijet)
266 recoJet2.push_back(&(*basicJets)[ijet]);
271 Int_t Jet1_nref = recoJet1.size();
272 Int_t Jet2_nref = recoJet2.size();
277 std::vector<MyJet> vJet1, vJet2;
278 std::vector<int> Jet1_ID(Jet1_nref), Jet2_ID(Jet2_nref);
280 if (Jet1_nref == 0 || Jet2_nref == 0)
283 for (
unsigned ijet1 = 0; ijet1 < recoJet1.size(); ++ijet1) {
290 JET1.
eta = recoJet1[ijet1]->eta();
291 JET1.
phi = recoJet1[ijet1]->phi();
292 JET1.
pt = recoJet1[ijet1]->pt();
295 vJet1.push_back(JET1);
300 for (
unsigned ijet2 = 0; ijet2 < recoJet2.size(); ++ijet2) {
307 JET2.
eta = recoJet2[ijet2]->eta();
308 JET2.
phi = recoJet2[ijet2]->phi();
309 JET2.
pt = recoJet2[ijet2]->pt();
312 vJet2.push_back(JET2);
317 bool onlyJet1 = (jet1 > 0 && jet2 == 0) ?
true :
false;
318 bool onlyJet2 = (jet1 == 0 && jet2 > 0) ?
true :
false;
319 bool bothJet1Jet2 = (jet1 > 0 && jet2 > 0) ?
true :
false;
322 int unmatchedJet1 = 0;
323 int unmatchedJet2 = 0;
325 std::vector<MyJet>::const_iterator iJet, jJet;
328 for (iJet = vJet1.begin(); iJet != vJet1.end(); ++iJet) {
334 }
else if (onlyJet2) {
335 for (iJet = vJet2.begin(); iJet != vJet2.end(); ++iJet) {
341 }
else if (bothJet1Jet2) {
344 for (iJet = vJet1.begin(); iJet != vJet1.end(); ++iJet) {
345 for (jJet = vJet2.begin(); jJet != vJet2.end(); ++jJet) {
346 mABMatchedJets.insert(std::make_pair(*iJet, *jJet));
352 for (
itr = mABMatchedJets.begin();
itr != mABMatchedJets.end(); ++
itr) {
354 MyJet Aj = jetpair.first;
355 MyJet Bj = jetpair.second;
373 for (
itr = mABMatchedJets.begin();
itr != mABMatchedJets.end(); ++
itr) {
376 MyJet Aj = jetpair.first;
377 MyJet Bj = jetpair.second;
379 if (Jet1_ID[Aj.
id] == 0) {
386 (*caloJet1)[Aj.
id].hadEnergyInHF() + (*caloJet1)[Aj.
id].hadEnergyInHE());
388 (*caloJet1)[Aj.
id].emEnergyInHF());
406 if (Jet2_ID[Bj.
id] == 0) {
412 (*caloJet2)[Bj.
id].hadEnergyInHF() + (*caloJet2)[Bj.
id].hadEnergyInHE());
414 (*caloJet2)[Bj.
id].emEnergyInHF());