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";
198 std::vector<const Jet*> recoJet1;
200 std::vector<const Jet*> recoJet2;
211 for (
unsigned ijet = 0; ijet < caloJet1->size(); ++ijet)
212 recoJet1.push_back(&(*caloJet1)[ijet]);
216 for (
unsigned ijet = 0; ijet < caloJet1->size(); ++ijet)
217 recoJet1.push_back(&(*caloJet1)[ijet]);
221 for (
unsigned ijet = 0; ijet <
pfJets->size(); ++ijet)
222 recoJet1.push_back(&(*
pfJets)[ijet]);
226 for (
unsigned ijet = 0; ijet < basicJets->size(); ++ijet)
227 recoJet1.push_back(&(*basicJets)[ijet]);
232 for (
unsigned ijet = 0; ijet < caloJet2->size(); ++ijet)
233 recoJet2.push_back(&(*caloJet2)[ijet]);
237 for (
unsigned ijet = 0; ijet < caloJet2->size(); ++ijet)
238 recoJet2.push_back(&(*caloJet2)[ijet]);
242 for (
unsigned ijet = 0; ijet <
pfJets->size(); ++ijet)
243 recoJet2.push_back(&(*
pfJets)[ijet]);
247 for (
unsigned ijet = 0; ijet < basicJets->size(); ++ijet)
248 recoJet2.push_back(&(*basicJets)[ijet]);
253 Int_t Jet1_nref = recoJet1.size();
254 Int_t Jet2_nref = recoJet2.size();
259 std::vector<MyJet> vJet1, vJet2;
260 std::vector<int> Jet1_ID(Jet1_nref), Jet2_ID(Jet2_nref);
262 if (Jet1_nref == 0 || Jet2_nref == 0)
265 for (
unsigned ijet1 = 0; ijet1 < recoJet1.size(); ++ijet1) {
272 JET1.
eta = recoJet1[ijet1]->eta();
273 JET1.
phi = recoJet1[ijet1]->phi();
274 JET1.
pt = recoJet1[ijet1]->pt();
277 vJet1.push_back(JET1);
282 for (
unsigned ijet2 = 0; ijet2 < recoJet2.size(); ++ijet2) {
289 JET2.
eta = recoJet2[ijet2]->eta();
290 JET2.
phi = recoJet2[ijet2]->phi();
291 JET2.
pt = recoJet2[ijet2]->pt();
294 vJet2.push_back(JET2);
299 bool onlyJet1 = (jet1 > 0 && jet2 == 0) ?
true :
false;
300 bool onlyJet2 = (jet1 == 0 && jet2 > 0) ?
true :
false;
301 bool bothJet1Jet2 = (jet1 > 0 && jet2 > 0) ?
true :
false;
304 int unmatchedJet1 = 0;
305 int unmatchedJet2 = 0;
307 std::vector<MyJet>::const_iterator iJet, jJet;
310 for (iJet = vJet1.begin(); iJet != vJet1.end(); ++iJet) {
316 }
else if (onlyJet2) {
317 for (iJet = vJet2.begin(); iJet != vJet2.end(); ++iJet) {
323 }
else if (bothJet1Jet2) {
326 for (iJet = vJet1.begin(); iJet != vJet1.end(); ++iJet) {
327 for (jJet = vJet2.begin(); jJet != vJet2.end(); ++jJet) {
328 mABMatchedJets.insert(std::make_pair(*iJet, *jJet));
334 for (itr = mABMatchedJets.begin(); itr != mABMatchedJets.end(); ++itr) {
336 MyJet Aj = jetpair.first;
337 MyJet Bj = jetpair.second;
355 for (itr = mABMatchedJets.begin(); itr != mABMatchedJets.end(); ++itr) {
358 MyJet Aj = jetpair.first;
359 MyJet Bj = jetpair.second;
361 if (Jet1_ID[Aj.
id] == 0) {
368 (*caloJet1)[Aj.
id].hadEnergyInHF() + (*caloJet1)[Aj.
id].hadEnergyInHE());
370 (*caloJet1)[Aj.
id].emEnergyInHF());
388 if (Jet2_ID[Bj.
id] == 0) {
394 (*caloJet2)[Bj.
id].hadEnergyInHF() + (*caloJet2)[Bj.
id].hadEnergyInHE());
396 (*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_
~JetAnalyzer_HeavyIons_matching() override
MonitorElement * mpT_Jet1_matched
MonitorElement * mpT_ratio_Jet1Jet2
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * mEmEnergy_Jet1_unmatched
MonitorElement * mHadEnergy_Jet1_unmatched
MonitorElement * mChargedEmEnergy_Jet1_unmatched
MonitorElement * mChargedMuEnergy_Jet1_unmatched
MonitorElement * mpT_Jet2_matched
edm::InputTag mInputJet1Collection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * mNeutralHadronEnergy_Jet1_unmatched
MonitorElement * mNeutralHadEnergyFraction_Jet1_unmatched
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * mPhotonEnergyFraction_Jet1_unmatched
std::pair< MyJet, MyJet > ABJetPair
MonitorElement * mChargedHadronEnergy_Jet1_unmatched
edm::InputTag mInputJet2Collection
MonitorElement * mElectronEnergyFraction_Jet1_unmatched
MonitorElement * mNeutralHadEnergyFraction_Jet2_unmatched
double mRecoJetPtThreshold
MonitorElement * mPhotonEnergyFraction_Jet2_unmatched
MonitorElement * mElectronEnergyFraction_Jet2_unmatched
MonitorElement * mChargedMuEnergy_Jet2_unmatched
MonitorElement * mHadEnergy_Jet2_unmatched
std::multiset< ABJetPair >::iterator ABItr
MonitorElement * mChargedHadEnergyFraction_Jet1_unmatched
MonitorElement * mMuonEnergyFraction_Jet2_unmatched
Log< level::Info, false > LogInfo
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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
MonitorElement * mMuonEnergyFraction_Jet1_unmatched
edm::EDGetTokenT< reco::CaloJetCollection > caloJet2Token_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * mChargedEmEnergy_Jet2_unmatched
std::multiset< ABJetPair, CompareMatchedJets > ABMatchedJets
MonitorElement * mEmEnergy_Jet2_unmatched
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_