CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Static Private Member Functions | Private Attributes
JetAnalyzer_HeavyIons_matching Class Reference

#include <JetAnalyzer_HeavyIons_matching.h>

Inheritance diagram for JetAnalyzer_HeavyIons_matching:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Classes

struct  CompareMatchedJets
 
struct  MyJet
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 JetAnalyzer_HeavyIons_matching (const edm::ParameterSet &)
 
 ~JetAnalyzer_HeavyIons_matching () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Types

typedef std::multiset< ABJetPair >::iterator ABItr
 
typedef std::pair< MyJet, MyJetABJetPair
 
typedef std::multiset< ABJetPair, CompareMatchedJetsABMatchedJets
 

Static Private Member Functions

static float deltaRR (float eta1, float phi1, float eta2, float phi2)
 

Private Attributes

edm::EDGetTokenT< reco::BasicJetCollectionbasicJetsToken_
 
edm::EDGetTokenT< reco::CaloJetCollectioncaloJet1Token_
 
edm::EDGetTokenT< reco::CaloJetCollectioncaloJet2Token_
 
std::string JetType1
 
std::string JetType2
 
edm::EDGetTokenT< reco::JPTJetCollectionjptJetsToken_
 
MonitorElementmChargedEmEnergy_Jet1_unmatched
 
MonitorElementmChargedEmEnergy_Jet2_unmatched
 
MonitorElementmChargedHadEnergyFraction_Jet1_unmatched
 
MonitorElementmChargedHadEnergyFraction_Jet2_unmatched
 
MonitorElementmChargedHadronEnergy_Jet1_unmatched
 
MonitorElementmChargedHadronEnergy_Jet2_unmatched
 
MonitorElementmChargedMuEnergy_Jet1_unmatched
 
MonitorElementmChargedMuEnergy_Jet2_unmatched
 
MonitorElementmElectronEnergyFraction_Jet1_unmatched
 
MonitorElementmElectronEnergyFraction_Jet2_unmatched
 
MonitorElementmEmEnergy_Jet1_unmatched
 
MonitorElementmEmEnergy_Jet2_unmatched
 
MonitorElementmHadEnergy_Jet1_unmatched
 
MonitorElementmHadEnergy_Jet2_unmatched
 
edm::InputTag mInputJet1Collection
 
edm::InputTag mInputJet2Collection
 
MonitorElementmMuonEnergyFraction_Jet1_unmatched
 
MonitorElementmMuonEnergyFraction_Jet2_unmatched
 
MonitorElementmNeutralEmEnergy_Jet1_unmatched
 
MonitorElementmNeutralEmEnergy_Jet2_unmatched
 
MonitorElementmNeutralHadEnergyFraction_Jet1_unmatched
 
MonitorElementmNeutralHadEnergyFraction_Jet2_unmatched
 
MonitorElementmNeutralHadronEnergy_Jet1_unmatched
 
MonitorElementmNeutralHadronEnergy_Jet2_unmatched
 
std::string mOutputFile
 
MonitorElementmPhotonEnergyFraction_Jet1_unmatched
 
MonitorElementmPhotonEnergyFraction_Jet2_unmatched
 
MonitorElementmpT_Jet1_matched
 
MonitorElementmpT_Jet1_unmatched
 
MonitorElementmpT_Jet2_matched
 
MonitorElementmpT_Jet2_unmatched
 
MonitorElementmpT_ratio_Jet1Jet2
 
double mRecoDelRMatch
 
double mRecoJetEtaCut
 
double mRecoJetPtThreshold
 
edm::EDGetTokenT< reco::PFJetCollectionpfJetsToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 74 of file JetAnalyzer_HeavyIons_matching.h.

Member Typedef Documentation

◆ ABItr

typedef std::multiset<ABJetPair>::iterator JetAnalyzer_HeavyIons_matching::ABItr
private

Definition at line 161 of file JetAnalyzer_HeavyIons_matching.h.

◆ ABJetPair

Definition at line 144 of file JetAnalyzer_HeavyIons_matching.h.

◆ ABMatchedJets

Definition at line 160 of file JetAnalyzer_HeavyIons_matching.h.

Constructor & Destructor Documentation

◆ JetAnalyzer_HeavyIons_matching()

JetAnalyzer_HeavyIons_matching::JetAnalyzer_HeavyIons_matching ( const edm::ParameterSet iConfig)
explicit

Definition at line 17 of file JetAnalyzer_HeavyIons_matching.cc.

References basicJetsToken_, caloJet1Token_, caloJet2Token_, JetType1, JetType2, edm::InputTag::label(), mChargedEmEnergy_Jet1_unmatched, mChargedEmEnergy_Jet2_unmatched, mChargedHadEnergyFraction_Jet1_unmatched, mChargedHadEnergyFraction_Jet2_unmatched, mChargedHadronEnergy_Jet1_unmatched, mChargedHadronEnergy_Jet2_unmatched, mChargedMuEnergy_Jet1_unmatched, mChargedMuEnergy_Jet2_unmatched, mElectronEnergyFraction_Jet1_unmatched, mElectronEnergyFraction_Jet2_unmatched, mEmEnergy_Jet1_unmatched, mEmEnergy_Jet2_unmatched, mHadEnergy_Jet1_unmatched, mHadEnergy_Jet2_unmatched, mInputJet1Collection, mInputJet2Collection, mMuonEnergyFraction_Jet1_unmatched, mMuonEnergyFraction_Jet2_unmatched, mNeutralEmEnergy_Jet1_unmatched, mNeutralEmEnergy_Jet2_unmatched, mNeutralHadEnergyFraction_Jet1_unmatched, mNeutralHadEnergyFraction_Jet2_unmatched, mNeutralHadronEnergy_Jet1_unmatched, mNeutralHadronEnergy_Jet2_unmatched, mPhotonEnergyFraction_Jet1_unmatched, mPhotonEnergyFraction_Jet2_unmatched, mpT_Jet1_matched, mpT_Jet1_unmatched, mpT_Jet2_matched, mpT_Jet2_unmatched, mpT_ratio_Jet1Jet2, pfJetsToken_, and AlCaHLTBitMon_QueryRunRegistry::string.

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")) {
25  std::string inputCollectionLabelJet1(mInputJet1Collection.label());
26  std::string inputCollectionLabelJet2(mInputJet2Collection.label());
27 
28  //consumes
29 
30  if (std::string("VsCalo") == JetType1)
31  caloJet1Token_ = consumes<reco::CaloJetCollection>(mInputJet1Collection);
32  if (std::string("VsPF") == JetType1)
33  pfJetsToken_ = consumes<reco::PFJetCollection>(mInputJet1Collection);
34  if (std::string("PuCalo") == JetType1)
35  caloJet2Token_ = consumes<reco::CaloJetCollection>(mInputJet1Collection);
36  if (std::string("PuPF") == JetType1)
37  basicJetsToken_ = consumes<reco::BasicJetCollection>(mInputJet1Collection);
38 
39  if (std::string("VsCalo") == JetType2)
40  caloJet1Token_ = consumes<reco::CaloJetCollection>(mInputJet2Collection);
41  if (std::string("VsPF") == JetType2)
42  pfJetsToken_ = consumes<reco::PFJetCollection>(mInputJet2Collection);
43  if (std::string("PuCalo") == JetType2)
44  caloJet2Token_ = consumes<reco::CaloJetCollection>(mInputJet2Collection);
45  if (std::string("PuPF") == JetType2)
46  basicJetsToken_ = consumes<reco::BasicJetCollection>(mInputJet2Collection);
47 
48  // initialize the Jet matching histograms
49 
50  mpT_ratio_Jet1Jet2 = nullptr;
51  mpT_Jet1_matched = nullptr;
52  mpT_Jet2_matched = nullptr;
53  mpT_Jet1_unmatched = nullptr;
54  mpT_Jet2_unmatched = nullptr;
55 
56  // we need to add histograms which will hold the hadronic and electromagnetic energy content for the unmatched Jets.
57  if (std::string("VsCalo") == JetType1 || std::string("PuCalo") == JetType1) {
58  mHadEnergy_Jet1_unmatched = nullptr;
59  mEmEnergy_Jet1_unmatched = nullptr;
60  }
61  if (std::string("VsCalo") == JetType2 || std::string("PuCalo") == JetType2) {
62  mHadEnergy_Jet2_unmatched = nullptr;
63  mEmEnergy_Jet2_unmatched = nullptr;
64  }
65 
66  if (std::string("VsPF") == JetType1) {
77  }
78 
79  if (std::string("VsPF") == JetType2) {
90  }
91 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
std::string const & label() const
Definition: InputTag.h:36
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::CaloJetCollection > caloJet1Token_
edm::EDGetTokenT< reco::CaloJetCollection > caloJet2Token_
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_

◆ ~JetAnalyzer_HeavyIons_matching()

JetAnalyzer_HeavyIons_matching::~JetAnalyzer_HeavyIons_matching ( )
override

Definition at line 189 of file JetAnalyzer_HeavyIons_matching.cc.

189 {}

Member Function Documentation

◆ analyze()

void JetAnalyzer_HeavyIons_matching::analyze ( const edm::Event mEvent,
const edm::EventSetup mSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 194 of file JetAnalyzer_HeavyIons_matching.cc.

References basicJetsToken_, caloJet1Token_, caloJet2Token_, deltaRR(), PVValHelper::eta, JetAnalyzer_HeavyIons_matching::MyJet::eta, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), JetAnalyzer_HeavyIons_matching::MyJet::id, JetType1, JetType2, mChargedEmEnergy_Jet1_unmatched, mChargedEmEnergy_Jet2_unmatched, mChargedHadEnergyFraction_Jet1_unmatched, mChargedHadEnergyFraction_Jet2_unmatched, mChargedHadronEnergy_Jet1_unmatched, mChargedHadronEnergy_Jet2_unmatched, mChargedMuEnergy_Jet1_unmatched, mChargedMuEnergy_Jet2_unmatched, mElectronEnergyFraction_Jet1_unmatched, mElectronEnergyFraction_Jet2_unmatched, mEmEnergy_Jet1_unmatched, mEmEnergy_Jet2_unmatched, mHadEnergy_Jet1_unmatched, mHadEnergy_Jet2_unmatched, mMuonEnergyFraction_Jet1_unmatched, mMuonEnergyFraction_Jet2_unmatched, mNeutralEmEnergy_Jet1_unmatched, mNeutralEmEnergy_Jet2_unmatched, mNeutralHadEnergyFraction_Jet1_unmatched, mNeutralHadEnergyFraction_Jet2_unmatched, mNeutralHadronEnergy_Jet1_unmatched, mNeutralHadronEnergy_Jet2_unmatched, mPhotonEnergyFraction_Jet1_unmatched, mPhotonEnergyFraction_Jet2_unmatched, mpT_Jet1_matched, mpT_Jet1_unmatched, mpT_Jet2_matched, mpT_Jet2_unmatched, mpT_ratio_Jet1Jet2, mRecoDelRMatch, mRecoJetEtaCut, mRecoJetPtThreshold, pfJetBenchmark_cfi::pfJets, pfJetsToken_, JetAnalyzer_HeavyIons_matching::MyJet::phi, DiDispStaMuonMonitor_cfi::pt, JetAnalyzer_HeavyIons_matching::MyJet::pt, and AlCaHLTBitMon_QueryRunRegistry::string.

194  {
195  // Get the Jet collection
196  //----------------------------------------------------------------------------
197 
198  std::vector<const Jet*> recoJet1;
199  recoJet1.clear();
200  std::vector<const Jet*> recoJet2;
201  recoJet2.clear();
202 
208 
209  if (std::string("VsCalo") == JetType1) {
210  mEvent.getByToken(caloJet1Token_, caloJet1);
211  for (unsigned ijet = 0; ijet < caloJet1->size(); ++ijet)
212  recoJet1.push_back(&(*caloJet1)[ijet]);
213  }
214  if (std::string("PuCalo") == JetType1) {
215  mEvent.getByToken(caloJet2Token_, caloJet1);
216  for (unsigned ijet = 0; ijet < caloJet1->size(); ++ijet)
217  recoJet1.push_back(&(*caloJet1)[ijet]);
218  }
219  if (std::string("VsPF") == JetType1) {
220  mEvent.getByToken(pfJetsToken_, pfJets);
221  for (unsigned ijet = 0; ijet < pfJets->size(); ++ijet)
222  recoJet1.push_back(&(*pfJets)[ijet]);
223  }
224  if (std::string("PuPF") == JetType1) {
225  mEvent.getByToken(basicJetsToken_, basicJets);
226  for (unsigned ijet = 0; ijet < basicJets->size(); ++ijet)
227  recoJet1.push_back(&(*basicJets)[ijet]);
228  }
229 
230  if (std::string("VsCalo") == JetType2) {
231  mEvent.getByToken(caloJet1Token_, caloJet2);
232  for (unsigned ijet = 0; ijet < caloJet2->size(); ++ijet)
233  recoJet2.push_back(&(*caloJet2)[ijet]);
234  }
235  if (std::string("PuCalo") == JetType2) {
236  mEvent.getByToken(caloJet2Token_, caloJet2);
237  for (unsigned ijet = 0; ijet < caloJet2->size(); ++ijet)
238  recoJet2.push_back(&(*caloJet2)[ijet]);
239  }
240  if (std::string("VsPF") == JetType2) {
241  mEvent.getByToken(pfJetsToken_, pfJets);
242  for (unsigned ijet = 0; ijet < pfJets->size(); ++ijet)
243  recoJet2.push_back(&(*pfJets)[ijet]);
244  }
245  if (std::string("PuPF") == JetType2) {
246  mEvent.getByToken(basicJetsToken_, basicJets);
247  for (unsigned ijet = 0; ijet < basicJets->size(); ++ijet)
248  recoJet2.push_back(&(*basicJets)[ijet]);
249  }
250 
251  // start to perform the matching - between recoJet1 and recoJet2.
252 
253  Int_t Jet1_nref = recoJet1.size();
254  Int_t Jet2_nref = recoJet2.size();
255 
256  int jet1 = 0;
257  int jet2 = 0;
258 
259  std::vector<MyJet> vJet1, vJet2;
260  std::vector<int> Jet1_ID(Jet1_nref), Jet2_ID(Jet2_nref);
261 
262  if (Jet1_nref == 0 || Jet2_nref == 0)
263  return;
264 
265  for (unsigned ijet1 = 0; ijet1 < recoJet1.size(); ++ijet1) {
266  if (recoJet1[ijet1]->pt() < mRecoJetPtThreshold)
267  continue;
268  if (fabs(recoJet1[ijet1]->eta()) < mRecoJetEtaCut)
269  continue;
270 
271  MyJet JET1;
272  JET1.eta = recoJet1[ijet1]->eta();
273  JET1.phi = recoJet1[ijet1]->phi();
274  JET1.pt = recoJet1[ijet1]->pt();
275  JET1.id = ijet1;
276 
277  vJet1.push_back(JET1);
278  jet1++;
279 
280  } // first jet loop
281 
282  for (unsigned ijet2 = 0; ijet2 < recoJet2.size(); ++ijet2) {
283  if (recoJet2[ijet2]->pt() < mRecoJetPtThreshold)
284  continue;
285  if (fabs(recoJet2[ijet2]->eta()) < mRecoJetEtaCut)
286  continue;
287 
288  MyJet JET2;
289  JET2.eta = recoJet2[ijet2]->eta();
290  JET2.phi = recoJet2[ijet2]->phi();
291  JET2.pt = recoJet2[ijet2]->pt();
292  JET2.id = ijet2;
293 
294  vJet2.push_back(JET2);
295  jet2++;
296 
297  } // second jet loop
298 
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;
302 
303  int matchedJets = 0;
304  int unmatchedJet1 = 0;
305  int unmatchedJet2 = 0;
306 
307  std::vector<MyJet>::const_iterator iJet, jJet;
308 
309  if (onlyJet1) {
310  for (iJet = vJet1.begin(); iJet != vJet1.end(); ++iJet) {
311  int pj = (*iJet).id;
312 
313  mpT_Jet1_unmatched->Fill(recoJet1[pj]->pt());
314  }
315 
316  } else if (onlyJet2) {
317  for (iJet = vJet2.begin(); iJet != vJet2.end(); ++iJet) {
318  int cj = (*iJet).id;
319 
320  mpT_Jet2_unmatched->Fill(recoJet2[cj]->pt());
321  }
322 
323  } else if (bothJet1Jet2) {
324  ABMatchedJets mABMatchedJets;
325 
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));
329  }
330  }
331 
332  ABItr itr;
333  // matched Jets matching Jet 1 to Jet 2
334  for (itr = mABMatchedJets.begin(); itr != mABMatchedJets.end(); ++itr) {
335  ABJetPair jetpair = (*itr);
336  MyJet Aj = jetpair.first;
337  MyJet Bj = jetpair.second;
338 
339  float delr = JetAnalyzer_HeavyIons_matching::deltaRR(Bj.eta, Bj.phi, Aj.eta, Aj.phi);
340 
341  if (delr < mRecoDelRMatch && Jet1_ID[Aj.id] == 0) {
342  mpT_ratio_Jet1Jet2->Fill((Float_t)recoJet2[Bj.id]->pt() / recoJet1[Aj.id]->pt());
343 
344  mpT_Jet1_matched->Fill(recoJet1[Aj.id]->pt());
345  mpT_Jet2_matched->Fill(recoJet2[Bj.id]->pt());
346 
347  Jet1_ID[Aj.id] = 1;
348  Jet2_ID[Bj.id] = 1;
349 
350  matchedJets++;
351  }
352  }
353 
354  // for unmatched Jets
355  for (itr = mABMatchedJets.begin(); itr != mABMatchedJets.end(); ++itr) {
356  ABJetPair jetpair = (*itr);
357 
358  MyJet Aj = jetpair.first;
359  MyJet Bj = jetpair.second;
360 
361  if (Jet1_ID[Aj.id] == 0) {
362  mpT_Jet1_unmatched->Fill(recoJet1[Aj.id]->pt());
363  unmatchedJet1++;
364  Jet1_ID[Aj.id] = 1;
365 
366  if (std::string("VsCalo") == JetType1 || std::string("PuCalo") == JetType1) {
367  mHadEnergy_Jet1_unmatched->Fill((*caloJet1)[Aj.id].hadEnergyInHO() + (*caloJet1)[Aj.id].hadEnergyInHB() +
368  (*caloJet1)[Aj.id].hadEnergyInHF() + (*caloJet1)[Aj.id].hadEnergyInHE());
369  mEmEnergy_Jet1_unmatched->Fill((*caloJet1)[Aj.id].emEnergyInEB() + (*caloJet1)[Aj.id].emEnergyInEE() +
370  (*caloJet1)[Aj.id].emEnergyInHF());
371  }
372 
373  if (std::string("VsPF") == JetType1) {
374  mChargedHadronEnergy_Jet1_unmatched->Fill((*pfJets)[Aj.id].chargedHadronEnergy());
375  mNeutralHadronEnergy_Jet1_unmatched->Fill((*pfJets)[Aj.id].neutralHadronEnergy());
376  mChargedEmEnergy_Jet1_unmatched->Fill((*pfJets)[Aj.id].chargedEmEnergy());
377  mNeutralEmEnergy_Jet1_unmatched->Fill((*pfJets)[Aj.id].neutralEmEnergy());
378  mChargedMuEnergy_Jet1_unmatched->Fill((*pfJets)[Aj.id].chargedMuEnergy());
379 
380  mChargedHadEnergyFraction_Jet1_unmatched->Fill((*pfJets)[Aj.id].chargedHadronEnergyFraction());
381  mNeutralHadEnergyFraction_Jet1_unmatched->Fill((*pfJets)[Aj.id].neutralHadronEnergyFraction());
382  mPhotonEnergyFraction_Jet1_unmatched->Fill((*pfJets)[Aj.id].photonEnergyFraction());
383  mElectronEnergyFraction_Jet1_unmatched->Fill((*pfJets)[Aj.id].electronEnergyFraction());
384  mMuonEnergyFraction_Jet1_unmatched->Fill((*pfJets)[Aj.id].muonEnergyFraction());
385  }
386  }
387 
388  if (Jet2_ID[Bj.id] == 0) {
389  mpT_Jet2_unmatched->Fill(recoJet2[Bj.id]->pt());
390  unmatchedJet2++;
391  Jet2_ID[Bj.id] = 2;
392  if (std::string("VsCalo") == JetType2 || std::string("PuCalo") == JetType2) {
393  mHadEnergy_Jet2_unmatched->Fill((*caloJet2)[Bj.id].hadEnergyInHO() + (*caloJet2)[Bj.id].hadEnergyInHB() +
394  (*caloJet2)[Bj.id].hadEnergyInHF() + (*caloJet2)[Bj.id].hadEnergyInHE());
395  mEmEnergy_Jet2_unmatched->Fill((*caloJet2)[Bj.id].emEnergyInEB() + (*caloJet2)[Bj.id].emEnergyInEE() +
396  (*caloJet2)[Bj.id].emEnergyInHF());
397  }
398 
399  if (std::string("VsPF") == JetType2) {
400  mChargedHadronEnergy_Jet2_unmatched->Fill((*pfJets)[Bj.id].chargedHadronEnergy());
401  mNeutralHadronEnergy_Jet2_unmatched->Fill((*pfJets)[Bj.id].neutralHadronEnergy());
402  mChargedEmEnergy_Jet2_unmatched->Fill((*pfJets)[Bj.id].chargedEmEnergy());
403  mNeutralEmEnergy_Jet2_unmatched->Fill((*pfJets)[Bj.id].neutralEmEnergy());
404  mChargedMuEnergy_Jet2_unmatched->Fill((*pfJets)[Bj.id].chargedMuEnergy());
405 
406  mChargedHadEnergyFraction_Jet2_unmatched->Fill((*pfJets)[Bj.id].chargedHadronEnergyFraction());
407  mNeutralHadEnergyFraction_Jet2_unmatched->Fill((*pfJets)[Bj.id].neutralHadronEnergyFraction());
408  mPhotonEnergyFraction_Jet2_unmatched->Fill((*pfJets)[Bj.id].photonEnergyFraction());
409  mElectronEnergyFraction_Jet2_unmatched->Fill((*pfJets)[Bj.id].electronEnergyFraction());
410  mMuonEnergyFraction_Jet2_unmatched->Fill((*pfJets)[Bj.id].muonEnergyFraction());
411  }
412  }
413  }
414 
415  } // both Jet1 and Jet2 in the event.
416 }
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:540
void Fill(long long x)
std::multiset< ABJetPair >::iterator ABItr
edm::EDGetTokenT< reco::CaloJetCollection > caloJet1Token_
static float deltaRR(float eta1, float phi1, float eta2, float phi2)
edm::EDGetTokenT< reco::CaloJetCollection > caloJet2Token_
std::multiset< ABJetPair, CompareMatchedJets > ABMatchedJets
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_

◆ bookHistograms()

void JetAnalyzer_HeavyIons_matching::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 93 of file JetAnalyzer_HeavyIons_matching.cc.

References dqm::implementation::IBooker::book1D(), JetType1, JetType2, edm::InputTag::label(), mChargedEmEnergy_Jet1_unmatched, mChargedEmEnergy_Jet2_unmatched, mChargedHadEnergyFraction_Jet1_unmatched, mChargedHadEnergyFraction_Jet2_unmatched, mChargedHadronEnergy_Jet1_unmatched, mChargedHadronEnergy_Jet2_unmatched, mChargedMuEnergy_Jet1_unmatched, mChargedMuEnergy_Jet2_unmatched, mElectronEnergyFraction_Jet1_unmatched, mElectronEnergyFraction_Jet2_unmatched, mEmEnergy_Jet1_unmatched, mEmEnergy_Jet2_unmatched, mHadEnergy_Jet1_unmatched, mHadEnergy_Jet2_unmatched, mInputJet1Collection, mInputJet2Collection, mMuonEnergyFraction_Jet1_unmatched, mMuonEnergyFraction_Jet2_unmatched, mNeutralEmEnergy_Jet1_unmatched, mNeutralEmEnergy_Jet2_unmatched, mNeutralHadEnergyFraction_Jet1_unmatched, mNeutralHadEnergyFraction_Jet2_unmatched, mNeutralHadronEnergy_Jet1_unmatched, mNeutralHadronEnergy_Jet2_unmatched, mOutputFile, mPhotonEnergyFraction_Jet1_unmatched, mPhotonEnergyFraction_Jet2_unmatched, mpT_Jet1_matched, mpT_Jet1_unmatched, mpT_Jet2_matched, mpT_Jet2_unmatched, mpT_ratio_Jet1Jet2, dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

95  {
96  ibooker.setCurrentFolder("JetMET/HIJetValidation/" + mInputJet1Collection.label() + "_DeltaRMatched_" +
98 
99  mpT_ratio_Jet1Jet2 = ibooker.book1D(
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);
109 
110  if (std::string("VsCalo") == JetType1 || std::string("PuCalo") == JetType1) {
112  ibooker.book1D("HadEnergy_Jet1_unmatched",
113  Form("HadEnergy_Jet1_unmatched;HadEnergy unmatched %s;counts", "JetType1"),
114  50,
115  0,
116  200);
118  "EmEnergy_Jet1_unmatched", Form("EmEnergy_Jet1_unmatched;EMEnergy unmatched %s;counts", "JetType1"), 50, 0, 200);
119  }
120 
121  if (std::string("VsCalo") == JetType2 || std::string("PuCalo") == JetType2) {
123  ibooker.book1D("HadEnergy_Jet2_unmatched",
124  Form("HadEnergy_Jet2_unmatched;HadEnergy unmatched %s;counts", "JetType2"),
125  50,
126  0,
127  200);
129  "EmEnergy_Jet2_unmatched", Form("EmEnergy_Jet2_unmatched;EMEnergy unmatched %s;counts", "JetType2"), 50, 0, 200);
130  }
131 
132  if (std::string("VsPF") == JetType1) {
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);
143 
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);
154  }
155 
156  if (std::string("VsPF") == JetType2) {
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);
167 
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);
178  }
179 
180  if (mOutputFile.empty())
181  LogInfo("OutputInfo") << " Histograms will NOT be saved";
182  else
183  LogInfo("OutputInfo") << " Histograms will be saved to file:" << mOutputFile;
184 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::string const & label() const
Definition: InputTag.h:36
Log< level::Info, false > LogInfo
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ deltaRR()

static float JetAnalyzer_HeavyIons_matching::deltaRR ( float  eta1,
float  phi1,
float  eta2,
float  phi2 
)
inlinestaticprivate

Definition at line 163 of file JetAnalyzer_HeavyIons_matching.h.

References l1ctLayer1_cff::dr, HLT_2023v12_cff::eta1, HLT_2023v12_cff::eta2, M_PI, and mathSSE::sqrt().

Referenced by analyze(), and JetAnalyzer_HeavyIons_matching::CompareMatchedJets::operator()().

163  {
164  float deta = eta1 - eta2;
165  float dphi = fabs(phi1 - phi2);
166  if (dphi > M_PI)
167  dphi -= 2 * M_PI;
168  float dr = sqrt(deta * deta + dphi * dphi);
169  return dr;
170  }
T sqrt(T t)
Definition: SSEVec.h:19
#define M_PI

Member Data Documentation

◆ basicJetsToken_

edm::EDGetTokenT<reco::BasicJetCollection> JetAnalyzer_HeavyIons_matching::basicJetsToken_
private

Definition at line 100 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze(), and JetAnalyzer_HeavyIons_matching().

◆ caloJet1Token_

edm::EDGetTokenT<reco::CaloJetCollection> JetAnalyzer_HeavyIons_matching::caloJet1Token_
private

Definition at line 97 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze(), and JetAnalyzer_HeavyIons_matching().

◆ caloJet2Token_

edm::EDGetTokenT<reco::CaloJetCollection> JetAnalyzer_HeavyIons_matching::caloJet2Token_
private

Definition at line 98 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze(), and JetAnalyzer_HeavyIons_matching().

◆ JetType1

std::string JetAnalyzer_HeavyIons_matching::JetType1
private

◆ JetType2

std::string JetAnalyzer_HeavyIons_matching::JetType2
private

◆ jptJetsToken_

edm::EDGetTokenT<reco::JPTJetCollection> JetAnalyzer_HeavyIons_matching::jptJetsToken_
private

Definition at line 101 of file JetAnalyzer_HeavyIons_matching.h.

◆ mChargedEmEnergy_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedEmEnergy_Jet1_unmatched
private

◆ mChargedEmEnergy_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedEmEnergy_Jet2_unmatched
private

◆ mChargedHadEnergyFraction_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedHadEnergyFraction_Jet1_unmatched
private

◆ mChargedHadEnergyFraction_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedHadEnergyFraction_Jet2_unmatched
private

◆ mChargedHadronEnergy_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedHadronEnergy_Jet1_unmatched
private

◆ mChargedHadronEnergy_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedHadronEnergy_Jet2_unmatched
private

◆ mChargedMuEnergy_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedMuEnergy_Jet1_unmatched
private

◆ mChargedMuEnergy_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedMuEnergy_Jet2_unmatched
private

◆ mElectronEnergyFraction_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mElectronEnergyFraction_Jet1_unmatched
private

◆ mElectronEnergyFraction_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mElectronEnergyFraction_Jet2_unmatched
private

◆ mEmEnergy_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mEmEnergy_Jet1_unmatched
private

◆ mEmEnergy_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mEmEnergy_Jet2_unmatched
private

◆ mHadEnergy_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mHadEnergy_Jet1_unmatched
private

◆ mHadEnergy_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mHadEnergy_Jet2_unmatched
private

◆ mInputJet1Collection

edm::InputTag JetAnalyzer_HeavyIons_matching::mInputJet1Collection
private

◆ mInputJet2Collection

edm::InputTag JetAnalyzer_HeavyIons_matching::mInputJet2Collection
private

◆ mMuonEnergyFraction_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mMuonEnergyFraction_Jet1_unmatched
private

◆ mMuonEnergyFraction_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mMuonEnergyFraction_Jet2_unmatched
private

◆ mNeutralEmEnergy_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralEmEnergy_Jet1_unmatched
private

◆ mNeutralEmEnergy_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralEmEnergy_Jet2_unmatched
private

◆ mNeutralHadEnergyFraction_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralHadEnergyFraction_Jet1_unmatched
private

◆ mNeutralHadEnergyFraction_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralHadEnergyFraction_Jet2_unmatched
private

◆ mNeutralHadronEnergy_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralHadronEnergy_Jet1_unmatched
private

◆ mNeutralHadronEnergy_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralHadronEnergy_Jet2_unmatched
private

◆ mOutputFile

std::string JetAnalyzer_HeavyIons_matching::mOutputFile
private

Definition at line 89 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by bookHistograms().

◆ mPhotonEnergyFraction_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mPhotonEnergyFraction_Jet1_unmatched
private

◆ mPhotonEnergyFraction_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mPhotonEnergyFraction_Jet2_unmatched
private

◆ mpT_Jet1_matched

MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_Jet1_matched
private

◆ mpT_Jet1_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_Jet1_unmatched
private

◆ mpT_Jet2_matched

MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_Jet2_matched
private

◆ mpT_Jet2_unmatched

MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_Jet2_unmatched
private

◆ mpT_ratio_Jet1Jet2

MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_ratio_Jet1Jet2
private

◆ mRecoDelRMatch

double JetAnalyzer_HeavyIons_matching::mRecoDelRMatch
private

Definition at line 93 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze().

◆ mRecoJetEtaCut

double JetAnalyzer_HeavyIons_matching::mRecoJetEtaCut
private

Definition at line 94 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze().

◆ mRecoJetPtThreshold

double JetAnalyzer_HeavyIons_matching::mRecoJetPtThreshold
private

Definition at line 92 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze().

◆ pfJetsToken_

edm::EDGetTokenT<reco::PFJetCollection> JetAnalyzer_HeavyIons_matching::pfJetsToken_
private

Definition at line 99 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze(), and JetAnalyzer_HeavyIons_matching().