CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
QcdHighPtDQM Class Reference

#include <QcdHighPtDQM.h>

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 QcdHighPtDQM (const edm::ParameterSet &)
 
 ~QcdHighPtDQM () 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 Member Functions

float moverl (const reco::CaloMETCollection &metcollection, float &ljpt)
 
float movers (const reco::CaloMETCollection &metcollection)
 

Private Attributes

edm::EDGetTokenT< reco::CaloJetCollectionjetToken_
 
std::map< std::string, MonitorElement * > MEcontainer_
 
edm::EDGetTokenT< reco::CaloMETCollectionmetToken1_
 
edm::EDGetTokenT< reco::CaloMETCollectionmetToken2_
 
edm::EDGetTokenT< reco::CaloMETCollectionmetToken3_
 
edm::EDGetTokenT< reco::CaloMETCollectionmetToken4_
 

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

DQM Physics Module for High Pt QCD group

Based on DQM/SiPixel and DQM/Physics code Version 1.0, 7/7/09 By Keith Rose

Definition at line 21 of file QcdHighPtDQM.h.

Constructor & Destructor Documentation

◆ QcdHighPtDQM()

QcdHighPtDQM::QcdHighPtDQM ( const edm::ParameterSet iConfig)

Definition at line 31 of file QcdHighPtDQM.cc.

32  : jetToken_(consumes<CaloJetCollection>(iConfig.getUntrackedParameter<edm::InputTag>("jetTag"))),
33  metToken1_(consumes<CaloMETCollection>(iConfig.getUntrackedParameter<edm::InputTag>("metTag1"))),
34  metToken2_(consumes<CaloMETCollection>(iConfig.getUntrackedParameter<edm::InputTag>("metTag2"))),
35  metToken3_(consumes<CaloMETCollection>(iConfig.getUntrackedParameter<edm::InputTag>("metTag3"))),
36  metToken4_(consumes<CaloMETCollection>(iConfig.getUntrackedParameter<edm::InputTag>("metTag4"))) {}
edm::EDGetTokenT< reco::CaloMETCollection > metToken1_
Definition: QcdHighPtDQM.h:31
edm::EDGetTokenT< reco::CaloMETCollection > metToken2_
Definition: QcdHighPtDQM.h:32
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::CaloMETCollection > metToken4_
Definition: QcdHighPtDQM.h:34
edm::EDGetTokenT< reco::CaloMETCollection > metToken3_
Definition: QcdHighPtDQM.h:33
edm::EDGetTokenT< reco::CaloJetCollection > jetToken_
Definition: QcdHighPtDQM.h:30

◆ ~QcdHighPtDQM()

QcdHighPtDQM::~QcdHighPtDQM ( )
override

Definition at line 38 of file QcdHighPtDQM.cc.

38 {}

Member Function Documentation

◆ analyze()

void QcdHighPtDQM::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 121 of file QcdHighPtDQM.cc.

References reco::LeafCandidate::energy(), defaults_cfi::etabins, iEvent, PDWG_EXODelayedJetMET_cff::jets, jetToken_, M_PI, MEcontainer_, BTaggingMonitor_cfi::met, metToken1_, metToken2_, metToken3_, metToken4_, movers(), BTaggingMonitoring_cff::njets, particlelevel_cff::njets30, and reco::LeafCandidate::p4().

121  {
122  // Get Jets
124  iEvent.getByToken(jetToken_, jetHandle);
125  const CaloJetCollection &jets = *jetHandle;
126  CaloJetCollection::const_iterator jet_iter;
127 
128  // Get MET collections
130  iEvent.getByToken(metToken1_, metHandle);
131  const CaloMETCollection &met = *metHandle;
132 
133  edm::Handle<CaloMETCollection> metHOHandle;
134  iEvent.getByToken(metToken2_, metHOHandle);
135  const CaloMETCollection &metHO = *metHOHandle;
136 
137  edm::Handle<CaloMETCollection> metNoHFHandle;
138  iEvent.getByToken(metToken3_, metNoHFHandle);
139  const CaloMETCollection &metNoHF = *metNoHFHandle;
140 
141  edm::Handle<CaloMETCollection> metNoHFHOHandle;
142  iEvent.getByToken(metToken4_, metNoHFHOHandle);
143  const CaloMETCollection &metNoHFHO = *metNoHFHOHandle;
144 
145  // initialize leading jet value and jet multiplicity counter
146  int njets = 0;
147  int njets30 = 0;
148  float leading_jetpt = 0;
149  float leading_jeteta = 0;
150 
151  // initialize variables for picking out leading 2 barrel jets
152  reco::CaloJet leadingbarreljet;
153  reco::CaloJet secondbarreljet;
154  int nbarreljets = 0;
155 
156  // get bins in eta.
157  // Bins correspond to calotower regions.
158 
159  const float etabins[83] = {
160  -5.191, -4.889, -4.716, -4.538, -4.363, -4.191, -4.013, -3.839, -3.664, -3.489, -3.314, -3.139, -2.964, -2.853,
161  -2.650, -2.500, -2.322, -2.172, -2.043, -1.930, -1.830, -1.740, -1.653, -1.566, -1.479, -1.392, -1.305, -1.218,
162  -1.131, -1.044, -.957, -.879, -.783, -.696, -.609, -.522, -.435, -.348, -.261, -.174, -.087, 0,
163  .087, .174, .261, .348, .435, .522, .609, .696, .783, .879, .957, 1.044, 1.131, 1.218,
164  1.305, 1.392, 1.479, 1.566, 1.653, 1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.853,
165  2.964, 3.139, 3.314, 3.489, 3.664, 3.839, 4.013, 4.191, 4.363, 4.538, 4.889, 5.191};
166 
167  for (jet_iter = jets.begin(); jet_iter != jets.end(); ++jet_iter) {
168  njets++;
169 
170  // get Jet stats
171  float jet_pt = jet_iter->pt();
172  float jet_eta = jet_iter->eta();
173  float jet_phi = jet_iter->phi();
174 
175  // fill jet Pt and jet EMF
176  MEcontainer_["inclusive_jet_pt"]->Fill(jet_pt);
177  MEcontainer_["inclusive_jet_EMF"]->Fill(jet_iter->emEnergyFraction());
178 
179  // pick out up to the first 2 leading barrel jets
180  // for use in calculating dijet mass in barrel region
181  // also fill jet Pt histogram for barrel
182 
183  if (jet_eta <= 1.3) {
184  MEcontainer_["inclusive_jet_pt_barrel"]->Fill(jet_pt);
185  if (nbarreljets == 0) {
186  leadingbarreljet = jets[(njets - 1)];
187  nbarreljets++;
188  } else if (nbarreljets == 1) {
189  secondbarreljet = jets[(njets - 1)];
190  nbarreljets++;
191  }
192 
193  }
194 
195  // fill jet Pt for endcap and forward regions
196  else if (jet_eta <= 3.0 && jet_eta > 1.3) {
197  MEcontainer_["inclusive_jet_pt_endcap"]->Fill(jet_pt);
198  } else if (jet_eta <= 5.0 && jet_eta > 3.0) {
199  MEcontainer_["inclusive_jet_pt_forward"]->Fill(jet_pt);
200  }
201 
202  // count jet multiplicity for jets with Pt > 30
203  if ((jet_pt) > 30)
204  njets30++;
205 
206  // check leading jet quantities
207  if (jet_pt > leading_jetpt) {
208  leading_jetpt = jet_pt;
209  leading_jeteta = jet_eta;
210  }
211 
212  // fill eta-phi plot
213  for (int eit = 0; eit < 81; eit++) {
214  for (int pit = 0; pit < 72; pit++) {
215  float low_eta = etabins[eit];
216  float high_eta = etabins[eit + 1];
217  float low_phi = (-M_PI) + pit * (M_PI / 36);
218  float high_phi = low_phi + (M_PI / 36);
219  if (jet_eta > low_eta && jet_eta < high_eta && jet_phi > low_phi && jet_phi < high_phi) {
220  MEcontainer_["etaphi"]->Fill((eit - 41), jet_phi);
221  }
222  }
223  }
224  }
225 
226  // after iterating over all jets, fill leading jet quantity histograms
227  // and jet multiplicity histograms
228 
229  MEcontainer_["leading_jet_pt"]->Fill(leading_jetpt);
230 
231  if (leading_jeteta <= 1.3) {
232  MEcontainer_["leading_jet_pt_barrel"]->Fill(leading_jetpt);
233  } else if (leading_jeteta <= 3.0 && leading_jeteta > 1.3) {
234  MEcontainer_["leading_jet_pt_endcap"]->Fill(leading_jetpt);
235  } else if (leading_jeteta <= 5.0 && leading_jeteta > 3.0) {
236  MEcontainer_["leading_jet_pt_forward"]->Fill(leading_jetpt);
237  }
238 
239  MEcontainer_["njets"]->Fill(njets);
240 
241  MEcontainer_["njets30"]->Fill(njets30);
242 
243  // fill MET over Sum ET and Leading jet PT for all MET flavors
244  MEcontainer_["movers_met"]->Fill(movers(met));
245  MEcontainer_["moverl_met"]->Fill(movers(met), leading_jetpt);
246  MEcontainer_["movers_metho"]->Fill(movers(metHO));
247  MEcontainer_["moverl_metho"]->Fill(movers(metHO), leading_jetpt);
248  MEcontainer_["movers_metnohf"]->Fill(movers(metNoHF));
249  MEcontainer_["moverl_metnohf"]->Fill(movers(metNoHF), leading_jetpt);
250  MEcontainer_["movers_metnohfho"]->Fill(movers(metNoHFHO));
251  MEcontainer_["moverl_metnohfho"]->Fill(movers(metNoHFHO), leading_jetpt);
252 
253  // fetch first 3 jet EMF
254 
255  if (!jets.empty()) {
256  MEcontainer_["leading_jet_EMF"]->Fill(jets[0].emEnergyFraction());
257  if (jets.size() >= 2) {
258  MEcontainer_["second_jet_EMF"]->Fill(jets[1].emEnergyFraction());
259  if (jets.size() >= 3) {
260  MEcontainer_["third_jet_EMF"]->Fill(jets[2].emEnergyFraction());
261  }
262  }
263  }
264 
265  // if 2 nontrivial barrel jets, reconstruct dijet mass
266 
267  if (nbarreljets == 2) {
268  if (leadingbarreljet.energy() > 0 && secondbarreljet.energy() > 0) {
269  math::XYZTLorentzVector DiJet = leadingbarreljet.p4() + secondbarreljet.p4();
270  float dijet_mass = DiJet.mass();
271  MEcontainer_["dijet_mass"]->Fill(dijet_mass);
272  }
273  }
274 }
edm::EDGetTokenT< reco::CaloMETCollection > metToken1_
Definition: QcdHighPtDQM.h:31
Jets made from CaloTowers.
Definition: CaloJet.h:27
edm::EDGetTokenT< reco::CaloMETCollection > metToken2_
Definition: QcdHighPtDQM.h:32
const LorentzVector & p4() const final
four-momentum Lorentz vector
std::map< std::string, MonitorElement * > MEcontainer_
Definition: QcdHighPtDQM.h:37
Collection of Calo MET.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::CaloMETCollection > metToken4_
Definition: QcdHighPtDQM.h:34
edm::EDGetTokenT< reco::CaloMETCollection > metToken3_
Definition: QcdHighPtDQM.h:33
float movers(const reco::CaloMETCollection &metcollection)
Definition: QcdHighPtDQM.cc:95
#define M_PI
edm::EDGetTokenT< reco::CaloJetCollection > jetToken_
Definition: QcdHighPtDQM.h:30
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
double energy() const final
energy

◆ bookHistograms()

void QcdHighPtDQM::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 40 of file QcdHighPtDQM.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), M_PI, MEcontainer_, and dqm::implementation::NavigatorBase::setCurrentFolder().

40  {
41  iBooker.setCurrentFolder("Physics/QcdHighPt");
42 
43  MEcontainer_["dijet_mass"] =
44  iBooker.book1D("dijet_mass", "dijet resonance invariant mass, barrel region", 100, 0, 1000);
45  MEcontainer_["njets"] = iBooker.book1D("njets", "jet multiplicity", 10, 0, 10);
46  MEcontainer_["etaphi"] = iBooker.book2D("etaphi", "eta/phi distribution", 83, -42, 42, 72, -M_PI, M_PI);
47  MEcontainer_["njets30"] = iBooker.book1D("njets30", "jet multiplicity, pt > 30 GeV", 10, 0, 10);
48 
49  // book histograms for inclusive jet quantities
50  MEcontainer_["inclusive_jet_pt"] = iBooker.book1D("inclusive_jet_pt", "inclusive jet Pt spectrum", 100, 0, 1000);
51  MEcontainer_["inclusive_jet_pt_barrel"] =
52  iBooker.book1D("inclusive_jet_pt_barrel", "inclusive jet Pt, eta < 1.3", 100, 0, 1000);
53  MEcontainer_["inclusive_jet_pt_forward"] =
54  iBooker.book1D("inclusive_jet_pt_forward", "inclusive jet Pt, 3.0 < eta < 5.0", 100, 0, 1000);
55  MEcontainer_["inclusive_jet_pt_endcap"] =
56  iBooker.book1D("inclusive_jet_pt_endcap", "inclusive jet Pt, 1.3 < eta < 3.0", 100, 0, 1000);
57 
58  // book histograms for leading jet quantities
59  MEcontainer_["leading_jet_pt"] = iBooker.book1D("leading_jet_pt", "leading jet Pt", 100, 0, 1000);
60  MEcontainer_["leading_jet_pt_barrel"] =
61  iBooker.book1D("leading_jet_pt_barrel", "leading jet Pt, eta < 1.3", 100, 0, 1000);
62  MEcontainer_["leading_jet_pt_forward"] =
63  iBooker.book1D("leading_jet_pt_forward", "leading jet Pt, 3.0 < eta < 5.0", 100, 0, 1000);
64  MEcontainer_["leading_jet_pt_endcap"] =
65  iBooker.book1D("leading_jet_pt_endcap", "leading jet Pt, 1.3 < eta < 3.0", 100, 0, 1000);
66 
67  // book histograms for met over sum et and met over leading jet pt for various
68  // flavors of MET
69  MEcontainer_["movers_met"] = iBooker.book1D("movers_met", "MET over Sum ET for basic MET collection", 50, 0, 1);
70  MEcontainer_["moverl_met"] =
71  iBooker.book1D("moverl_met", "MET over leading jet Pt for basic MET collection", 50, 0, 2);
72 
73  MEcontainer_["movers_metho"] = iBooker.book1D("movers_metho", "MET over Sum ET for MET HO collection", 50, 0, 1);
74  MEcontainer_["moverl_metho"] =
75  iBooker.book1D("moverl_metho", "MET over leading jet Pt for MET HO collection", 50, 0, 2);
76 
77  MEcontainer_["movers_metnohf"] =
78  iBooker.book1D("movers_metnohf", "MET over Sum ET for MET no HF collection", 50, 0, 1);
79  MEcontainer_["moverl_metnohf"] =
80  iBooker.book1D("moverl_metnohf", "MET over leading jet Pt for MET no HF collection", 50, 0, 2);
81 
82  MEcontainer_["movers_metnohfho"] =
83  iBooker.book1D("movers_metnohfho", "MET over Sum ET for MET no HF HO collection", 50, 0, 1);
84  MEcontainer_["moverl_metnohfho"] =
85  iBooker.book1D("moverl_metnohfho", "MET over leading jet Pt for MET no HF HO collection", 50, 0, 2);
86 
87  // book histograms for EMF fraction for all jets and first 3 jets
88  MEcontainer_["inclusive_jet_EMF"] = iBooker.book1D("inclusive_jet_EMF", "inclusive jet EMF", 50, -1, 1);
89  MEcontainer_["leading_jet_EMF"] = iBooker.book1D("leading_jet_EMF", "leading jet EMF", 50, -1, 1);
90  MEcontainer_["second_jet_EMF"] = iBooker.book1D("second_jet_EMF", "second jet EMF", 50, -1, 1);
91  MEcontainer_["third_jet_EMF"] = iBooker.book1D("third_jet_EMF", "third jet EMF", 50, -1, 1);
92 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< std::string, MonitorElement * > MEcontainer_
Definition: QcdHighPtDQM.h:37
#define M_PI
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ moverl()

float QcdHighPtDQM::moverl ( const reco::CaloMETCollection metcollection,
float &  ljpt 
)
private

Definition at line 109 of file QcdHighPtDQM.cc.

References BTaggingMonitor_cfi::met, and mathSSE::sqrt().

109  {
110  float metoverl = 0;
111  CaloMETCollection::const_iterator met_iter;
112  for (met_iter = metcollection.begin(); met_iter != metcollection.end(); ++met_iter) {
113  float mex = met_iter->momentum().x();
114  float mey = met_iter->momentum().y();
115  float met = sqrt(mex * mex + mey * mey);
116  metoverl = (met / ljpt);
117  }
118  return metoverl;
119 }
T sqrt(T t)
Definition: SSEVec.h:23

◆ movers()

float QcdHighPtDQM::movers ( const reco::CaloMETCollection metcollection)
private

Definition at line 95 of file QcdHighPtDQM.cc.

References BTaggingMonitor_cfi::met, and mathSSE::sqrt().

Referenced by analyze().

95  {
96  float metovers = 0;
97  CaloMETCollection::const_iterator met_iter;
98  for (met_iter = metcollection.begin(); met_iter != metcollection.end(); ++met_iter) {
99  float mex = met_iter->momentum().x();
100  float mey = met_iter->momentum().y();
101  float met = sqrt(mex * mex + mey * mey);
102  float sumet = met_iter->sumEt();
103  metovers = (met / sumet);
104  }
105  return metovers;
106 }
T sqrt(T t)
Definition: SSEVec.h:23

Member Data Documentation

◆ jetToken_

edm::EDGetTokenT<reco::CaloJetCollection> QcdHighPtDQM::jetToken_
private

Definition at line 30 of file QcdHighPtDQM.h.

Referenced by analyze().

◆ MEcontainer_

std::map<std::string, MonitorElement*> QcdHighPtDQM::MEcontainer_
private

Definition at line 37 of file QcdHighPtDQM.h.

Referenced by analyze(), and bookHistograms().

◆ metToken1_

edm::EDGetTokenT<reco::CaloMETCollection> QcdHighPtDQM::metToken1_
private

Definition at line 31 of file QcdHighPtDQM.h.

Referenced by analyze().

◆ metToken2_

edm::EDGetTokenT<reco::CaloMETCollection> QcdHighPtDQM::metToken2_
private

Definition at line 32 of file QcdHighPtDQM.h.

Referenced by analyze().

◆ metToken3_

edm::EDGetTokenT<reco::CaloMETCollection> QcdHighPtDQM::metToken3_
private

Definition at line 33 of file QcdHighPtDQM.h.

Referenced by analyze().

◆ metToken4_

edm::EDGetTokenT<reco::CaloMETCollection> QcdHighPtDQM::metToken4_
private

Definition at line 34 of file QcdHighPtDQM.h.

Referenced by analyze().