CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

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 &)
 
virtual ~JetAnalyzer_HeavyIons_matching ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

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

Static Private Member Functions

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

Private Attributes

edm::EDGetTokenT
< reco::BasicJetCollection
basicJetsToken_
 
edm::EDGetTokenT
< reco::CaloJetCollection
caloJet1Token_
 
edm::EDGetTokenT
< reco::CaloJetCollection
caloJet2Token_
 
std::string JetType1
 
std::string JetType2
 
edm::EDGetTokenT
< reco::JPTJetCollection
jptJetsToken_
 
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::PFJetCollection
pfJetsToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 83 of file JetAnalyzer_HeavyIons_matching.h.

Member Typedef Documentation

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

Definition at line 176 of file JetAnalyzer_HeavyIons_matching.h.

typedef std::pair< MyJet, MyJet > JetAnalyzer_HeavyIons_matching::ABJetPair
private

Definition at line 157 of file JetAnalyzer_HeavyIons_matching.h.

Definition at line 175 of file JetAnalyzer_HeavyIons_matching.h.

Constructor & Destructor Documentation

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

Definition at line 19 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.

19  :
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"))
27 {
28  std::string inputCollectionLabelJet1(mInputJet1Collection.label());
29  std::string inputCollectionLabelJet2(mInputJet2Collection.label());
30 
31  //consumes
32 
33  if(std::string("VsCalo") == JetType1) caloJet1Token_ = consumes<reco::CaloJetCollection>(mInputJet1Collection);
34  if(std::string("VsPF") == JetType1) pfJetsToken_ = consumes<reco::PFJetCollection>(mInputJet1Collection);
35  if(std::string("PuCalo") == JetType1) caloJet2Token_ = consumes<reco::CaloJetCollection>(mInputJet1Collection);
36  if(std::string("PuPF") == JetType1) basicJetsToken_ = consumes<reco::BasicJetCollection>(mInputJet1Collection);
37 
38  if(std::string("VsCalo") == JetType2) caloJet1Token_ = consumes<reco::CaloJetCollection>(mInputJet2Collection);
39  if(std::string("VsPF") == JetType2) pfJetsToken_ = consumes<reco::PFJetCollection>(mInputJet2Collection);
40  if(std::string("PuCalo") == JetType2) caloJet2Token_ = consumes<reco::CaloJetCollection>(mInputJet2Collection);
41  if(std::string("PuPF") == JetType2) basicJetsToken_ = consumes<reco::BasicJetCollection>(mInputJet2Collection);
42 
43  // initialize the Jet matching histograms
44 
46  mpT_Jet1_matched = 0;
47  mpT_Jet2_matched = 0;
50 
51  // we need to add histograms which will hold the hadronic and electromagnetic energy content for the unmatched Jets.
52  if(std::string("VsCalo") == JetType1 || std::string("PuCalo") == JetType1){
55  }
56  if(std::string("VsCalo") == JetType2 || std::string("PuCalo") == JetType2) {
59  }
60 
61  if(std::string("VsPF") == JetType1){
72  }
73 
74  if(std::string("VsPF") == JetType2){
85  }
86 
87 
88 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
edm::EDGetTokenT< reco::CaloJetCollection > caloJet1Token_
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< reco::CaloJetCollection > caloJet2Token_
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_
JetAnalyzer_HeavyIons_matching::~JetAnalyzer_HeavyIons_matching ( )
virtual

Definition at line 154 of file JetAnalyzer_HeavyIons_matching.cc.

154 {}

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 180 of file JetAnalyzer_HeavyIons_matching.cc.

References basicJetsToken_, caloJet1Token_, caloJet2Token_, deltaRR(), eta, JetAnalyzer_HeavyIons_matching::MyJet::eta, 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, pfJets_cff::pfJets, pfJetsToken_, JetAnalyzer_HeavyIons_matching::MyJet::phi, EnergyCorrector::pt, JetAnalyzer_HeavyIons_matching::MyJet::pt, and AlCaHLTBitMon_QueryRunRegistry::string.

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

Implements DQMEDAnalyzer.

Definition at line 90 of file JetAnalyzer_HeavyIons_matching.cc.

References DQMStore::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, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

91  {
92 
93  ibooker.setCurrentFolder("JetMET/HIJetValidation/"+mInputJet1Collection.label()+"_DeltaRMatched_"+mInputJet2Collection.label());
94 
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);
100 
101  if(std::string("VsCalo") == JetType1 || std::string("PuCalo") == JetType1){
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);
104  }
105 
106  if(std::string("VsCalo") == JetType2 || std::string("PuCalo") == JetType2){
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);
109  }
110 
111  if(std::string("VsPF") == JetType1){
112  mChargedHadronEnergy_Jet1_unmatched = ibooker.book1D("ChargedHadronEnergy_Jet1_unmatched", Form(";charged HAD energy unmatched %s;counts","JetType1"), 100, 0, 300);
113  mNeutralHadronEnergy_Jet1_unmatched = ibooker.book1D("neutralHadronEnergy_Jet1_unmatched", Form(";neutral HAD energy unmatched %s;counts", "JetType1"), 100, 0, 300);
114  mChargedEmEnergy_Jet1_unmatched = ibooker.book1D("ChargedEmEnergy_Jet1_unmatched", Form(";charged EM energy unmatched %s;counts", "JetType1"), 100, 0, 300);
115  mNeutralEmEnergy_Jet1_unmatched = ibooker.book1D("neutralEmEnergy_Jet1_unmatched", Form(";neutral EM energy unmatched %s;counts", "JetType1"), 100, 0, 300);
116  mChargedMuEnergy_Jet1_unmatched = ibooker.book1D("ChargedMuEnergy_Jet1_unmatched", Form(";charged Mu energy unmatched %s;counts", "JetType1"), 100, 0, 300);
117 
118  mChargedHadEnergyFraction_Jet1_unmatched = ibooker.book1D("ChargedHadEnergyFraction_Jet1_unmatched",Form(";h^{+/-} Energy Fraction %s;counts", "JetType1"),50, 0, 1);
119  mNeutralHadEnergyFraction_Jet1_unmatched = ibooker.book1D("NeutralHadEnergyFraction_Jet1_unmatched",Form(";h^{0} Energy Fraction %s;counts", "JetType1"),50, 0, 1);
120  mPhotonEnergyFraction_Jet1_unmatched = ibooker.book1D("PhotonEnergyFraction_Jet1_unmatched",Form(";#gamma Energy Fraction %s;counts", "JetType1"),50, 0, 1);
121  mElectronEnergyFraction_Jet1_unmatched = ibooker.book1D("ElectronEnergyFraction_Jet1_unmatched",Form(";e Energy Fraction %s;counts", "JetType1"),50, 0, 1);
122  mMuonEnergyFraction_Jet1_unmatched = ibooker.book1D("MuonoEnergyFraction_Jet1_unmatched",Form(";#mu Energy Fraction %s;counts", "JetType1"),50, 0, 1);
123 
124  }
125 
126  if(std::string("VsPF") == JetType2){
127  mChargedHadronEnergy_Jet2_unmatched = ibooker.book1D("ChargedHadronEnergy_Jet2_unmatched", Form(";charged HAD energy unmatched %s;counts","JetType2"), 100, 0, 300);
128  mNeutralHadronEnergy_Jet2_unmatched = ibooker.book1D("neutralHadronEnergy_Jet2_unmatched", Form(";neutral HAD energy unmatched %s;counts", "JetType2"), 100, 0, 300);
129  mChargedEmEnergy_Jet2_unmatched = ibooker.book1D("ChargedEmEnergy_Jet2_unmatched", Form(";charged EM energy unmatched %s;counts", "JetType2"), 100, 0, 300);
130  mNeutralEmEnergy_Jet2_unmatched = ibooker.book1D("neutralEmEnergy_Jet2_unmatched", Form(";neutral EM energy unmatched %s;counts", "JetType2"), 100, 0, 300);
131  mChargedMuEnergy_Jet2_unmatched = ibooker.book1D("ChargedMuEnergy_Jet2_unmatched", Form(";charged Mu energy unmatched %s;counts", "JetType2"), 100, 0, 300);
132 
133  mChargedHadEnergyFraction_Jet2_unmatched = ibooker.book1D("ChargedHadEnergyFraction_Jet2_unmatched",Form(";h^{+/-} Energy Fraction %s;counts", "JetType2"),50, 0, 1);
134  mNeutralHadEnergyFraction_Jet2_unmatched = ibooker.book1D("NeutralHadEnergyFraction_Jet2_unmatched",Form(";h^{0} Energy Fraction %s;counts", "JetType2"),50, 0, 1);
135  mPhotonEnergyFraction_Jet2_unmatched = ibooker.book1D("PhotonEnergyFraction_Jet2_unmatched",Form(";#gamma Energy Fraction %s;counts", "JetType2"),50, 0, 1);
136  mElectronEnergyFraction_Jet2_unmatched = ibooker.book1D("ElectronEnergyFraction_Jet2_unmatched",Form(";e Energy Fraction %s;counts", "JetType2"),50, 0, 1);
137  mMuonEnergyFraction_Jet2_unmatched = ibooker.book1D("MuonoEnergyFraction_Jet2_unmatched",Form(";#mu Energy Fraction %s;counts", "JetType2"),50, 0, 1);
138 
139  }
140 
141  if (mOutputFile.empty ())
142  LogInfo("OutputInfo") << " Histograms will NOT be saved";
143  else
144  LogInfo("OutputInfo") << " Histograms will be saved to file:" << mOutputFile;
145 
146 
147  }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
std::string const & label() const
Definition: InputTag.h:36
static float JetAnalyzer_HeavyIons_matching::deltaRR ( float  eta1,
float  phi1,
float  eta2,
float  phi2 
)
inlinestaticprivate

Definition at line 178 of file JetAnalyzer_HeavyIons_matching.h.

References M_PI, and mathSSE::sqrt().

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

179  {
180  float deta = eta1 - eta2;
181  float dphi = fabs(phi1 - phi2);
182  if(dphi > M_PI )dphi -= 2*M_PI;
183  float dr = sqrt(deta*deta + dphi*dphi);
184  return dr;
185  }
T sqrt(T t)
Definition: SSEVec.h:18
#define M_PI

Member Data Documentation

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

Definition at line 111 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze(), and JetAnalyzer_HeavyIons_matching().

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

Definition at line 108 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze(), and JetAnalyzer_HeavyIons_matching().

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

Definition at line 109 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze(), and JetAnalyzer_HeavyIons_matching().

std::string JetAnalyzer_HeavyIons_matching::JetType1
private
std::string JetAnalyzer_HeavyIons_matching::JetType2
private
edm::EDGetTokenT<reco::JPTJetCollection> JetAnalyzer_HeavyIons_matching::jptJetsToken_
private

Definition at line 112 of file JetAnalyzer_HeavyIons_matching.h.

MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedEmEnergy_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedEmEnergy_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedHadEnergyFraction_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedHadEnergyFraction_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedHadronEnergy_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedHadronEnergy_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedMuEnergy_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mChargedMuEnergy_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mElectronEnergyFraction_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mElectronEnergyFraction_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mEmEnergy_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mEmEnergy_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mHadEnergy_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mHadEnergy_Jet2_unmatched
private
edm::InputTag JetAnalyzer_HeavyIons_matching::mInputJet1Collection
private
edm::InputTag JetAnalyzer_HeavyIons_matching::mInputJet2Collection
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mMuonEnergyFraction_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mMuonEnergyFraction_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralEmEnergy_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralEmEnergy_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralHadEnergyFraction_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralHadEnergyFraction_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralHadronEnergy_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mNeutralHadronEnergy_Jet2_unmatched
private
std::string JetAnalyzer_HeavyIons_matching::mOutputFile
private

Definition at line 100 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by bookHistograms().

MonitorElement* JetAnalyzer_HeavyIons_matching::mPhotonEnergyFraction_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mPhotonEnergyFraction_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_Jet1_matched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_Jet1_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_Jet2_matched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_Jet2_unmatched
private
MonitorElement* JetAnalyzer_HeavyIons_matching::mpT_ratio_Jet1Jet2
private
double JetAnalyzer_HeavyIons_matching::mRecoDelRMatch
private

Definition at line 104 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze().

double JetAnalyzer_HeavyIons_matching::mRecoJetEtaCut
private

Definition at line 105 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze().

double JetAnalyzer_HeavyIons_matching::mRecoJetPtThreshold
private

Definition at line 103 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze().

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

Definition at line 110 of file JetAnalyzer_HeavyIons_matching.h.

Referenced by analyze(), and JetAnalyzer_HeavyIons_matching().