CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
METMonitor Class Reference
Inheritance diagram for METMonitor:
DQMEDAnalyzer TriggerDQMBase edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Types

typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- 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
 
- Public Types inherited from TriggerDQMBase
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

 METMonitor (const edm::ParameterSet &)
 
 ~METMonitor () override throw ()
 
- 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
 
- Public Member Functions inherited from TriggerDQMBase
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbins, const double xmin, const double xmax, const bool bookDen=true)
 
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const bool bookDen=true)
 
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbinsX, const double xmin, const double xmax, const double ymin, const double ymax, const bool bookDen=true)
 
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbinsX, const double xmin, const double xmax, const uint nbinsY, const double ymin, const double ymax, const bool bookDen=true)
 
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const std::vector< double > &binningY, const bool bookDen=true)
 
void setMETitle (ObjME &me, const std::string &titleX, const std::string &titleY)
 
 TriggerDQMBase ()=default
 
virtual ~TriggerDQMBase ()=default
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Static Public Member Functions inherited from TriggerDQMBase
static void fillHistoLSPSetDescription (edm::ParameterSetDescription &pset)
 
static void fillHistoPSetDescription (edm::ParameterSetDescription &pset)
 
static MEbinning getHistoLSPSet (const edm::ParameterSet &pset)
 
static MEbinning getHistoPSet (const edm::ParameterSet &pset)
 

Protected Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Attributes

ObjME deltaphij1j2ME_
 
ObjME deltaphimetj1ME_
 
std::unique_ptr
< GenericTriggerEventFlag
den_genTriggerEventFlag_
 
edm::InputTag eleInputTag_
 
StringCutObjectSelector
< reco::GsfElectron, true > 
eleSelection_
 
edm::EDGetTokenT
< reco::GsfElectronCollection
eleToken_
 
const std::string folderName_
 
bool hltPathsAreValid_
 
edm::InputTag jetInputTag_
 
StringCutObjectSelector
< reco::PFJet, true > 
jetSelection_
 
edm::EDGetTokenT
< reco::PFJetCollection
jetToken_
 
MEbinning ls_binning_
 
MEbinning met_binning_
 
std::vector< double > met_variable_binning_
 
edm::InputTag metInputTag_
 
ObjME metME_
 
ObjME metME_variableBinning_
 
ObjME metPhiME_
 
StringCutObjectSelector
< reco::MET, true > 
metSelection_
 
edm::EDGetTokenT
< reco::PFMETCollection
metToken_
 
ObjME metVsLS_
 
edm::InputTag muoInputTag_
 
StringCutObjectSelector
< reco::Muon, true > 
muoSelection_
 
edm::EDGetTokenT
< reco::MuonCollection
muoToken_
 
unsigned nelectrons_
 
unsigned njets_
 
unsigned nmuons_
 
std::unique_ptr
< GenericTriggerEventFlag
num_genTriggerEventFlag_
 
const bool requireValidHLTPaths_
 
edm::InputTag vtxInputTag_
 
edm::EDGetTokenT
< reco::VertexCollection
vtxToken_
 
std::vector< bool > warningPrinted4token_
 

Static Private Attributes

static constexpr double MAX_PHI = 3.2
 
static constexpr int N_PHI = 64
 
static constexpr MEbinning phi_binning_ {N_PHI, -MAX_PHI, MAX_PHI}
 

Additional Inherited Members

- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 27 of file METMonitor.cc.

Member Typedef Documentation

Definition at line 30 of file METMonitor.cc.

Definition at line 29 of file METMonitor.cc.

Constructor & Destructor Documentation

METMonitor::METMonitor ( const edm::ParameterSet iConfig)

Definition at line 88 of file METMonitor.cc.

References warningPrinted4token_.

89  : folderName_(iConfig.getParameter<std::string>("FolderName")),
90  requireValidHLTPaths_(iConfig.getParameter<bool>("requireValidHLTPaths")),
91  hltPathsAreValid_(false),
92  metInputTag_(iConfig.getParameter<edm::InputTag>("met")),
93  jetInputTag_(iConfig.getParameter<edm::InputTag>("jets")),
94  eleInputTag_(iConfig.getParameter<edm::InputTag>("electrons")),
95  muoInputTag_(iConfig.getParameter<edm::InputTag>("muons")),
96  vtxInputTag_(iConfig.getParameter<edm::InputTag>("vertices")),
97  metToken_(consumes<reco::PFMETCollection>(metInputTag_)),
98  jetToken_(mayConsume<reco::PFJetCollection>(jetInputTag_)),
99  eleToken_(mayConsume<reco::GsfElectronCollection>(eleInputTag_)),
100  muoToken_(mayConsume<reco::MuonCollection>(muoInputTag_)),
101  vtxToken_(mayConsume<reco::VertexCollection>(vtxInputTag_)),
103  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("metBinning")),
105  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("metPSet"))),
106  ls_binning_(
107  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("lsPSet"))),
109  iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
111  iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
112  metSelection_(iConfig.getParameter<std::string>("metSelection")),
113  jetSelection_(iConfig.getParameter<std::string>("jetSelection")),
114  eleSelection_(iConfig.getParameter<std::string>("eleSelection")),
115  muoSelection_(iConfig.getParameter<std::string>("muoSelection")),
116  njets_(iConfig.getParameter<unsigned>("njets")),
117  nelectrons_(iConfig.getParameter<unsigned>("nelectrons")),
118  nmuons_(iConfig.getParameter<unsigned>("nmuons")) {
119  // this vector has to be alligned to the the number of Tokens accessed by this module
120  warningPrinted4token_.push_back(false); // PFMETCollection
121  warningPrinted4token_.push_back(false); // JetCollection
122  warningPrinted4token_.push_back(false); // GsfElectronCollection
123  warningPrinted4token_.push_back(false); // MuonCollection
124  warningPrinted4token_.push_back(false); // VertexCollection
125 }
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.cc:73
unsigned nmuons_
Definition: METMonitor.cc:79
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.cc:70
edm::InputTag vtxInputTag_
Definition: METMonitor.cc:50
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.cc:74
edm::InputTag muoInputTag_
Definition: METMonitor.cc:49
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: METMonitor.cc:56
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.cc:69
edm::InputTag eleInputTag_
Definition: METMonitor.cc:48
unsigned njets_
Definition: METMonitor.cc:77
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.cc:54
MEbinning met_binning_
Definition: METMonitor.cc:59
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.cc:53
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.cc:52
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: METMonitor.cc:75
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.cc:55
unsigned nelectrons_
Definition: METMonitor.cc:78
const bool requireValidHLTPaths_
Definition: METMonitor.cc:43
std::vector< double > met_variable_binning_
Definition: METMonitor.cc:58
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag metInputTag_
Definition: METMonitor.cc:46
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.cc:72
MEbinning ls_binning_
Definition: METMonitor.cc:60
edm::InputTag jetInputTag_
Definition: METMonitor.cc:47
const std::string folderName_
Definition: METMonitor.cc:41
std::vector< bool > warningPrinted4token_
Definition: METMonitor.cc:85
bool hltPathsAreValid_
Definition: METMonitor.cc:44
METMonitor::~METMonitor ( )
throw (
)
override

Definition at line 127 of file METMonitor.cc.

References den_genTriggerEventFlag_, and num_genTriggerEventFlag_.

127  {
129  num_genTriggerEventFlag_.reset();
130  }
132  den_genTriggerEventFlag_.reset();
133  }
134 }
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.cc:70
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.cc:69

Member Function Documentation

void METMonitor::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 200 of file METMonitor.cc.

References srCondWrite_cfg::deltaPhi, deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, TriggerDQMBase::ObjME::denominator, alignCSCRings::e, HI_PhotonSkim_cff::electrons, eleInputTag_, eleSelection_, eleToken_, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), hltPathsAreValid_, edm::EventBase::id(), edm::HandleBase::isValid(), dqmiolumiharvest::j, jetInputTag_, fwrapper::jets, jetSelection_, jetToken_, edm::InputTag::label(), eostools::ls(), edm::EventID::luminosityBlock(), visualization-live-secondInstance_cfg::m, objects.METAnalyzer::met, metInputTag_, metME_, metME_variableBinning_, metPhiME_, metSelection_, metToken_, metVsLS_, muoInputTag_, patZpeak::muons, muoSelection_, muoToken_, nelectrons_, njets_, nmuons_, num_genTriggerEventFlag_, TriggerDQMBase::ObjME::numerator, phi, reco::LeafCandidate::phi(), reco::Vertex::position(), reco::LeafCandidate::pt(), requireValidHLTPaths_, findQualityFiles::v, vtxInputTag_, vtxToken_, and warningPrinted4token_.

200  {
201  // if valid HLT paths are required,
202  // analyze event only if all paths are valid
204  return;
205  }
206 
207  // Filter out events if Trigger Filtering is requested
208  if (den_genTriggerEventFlag_->on() && !den_genTriggerEventFlag_->accept(iEvent, iSetup))
209  return;
210 
212  iEvent.getByToken(metToken_, metHandle);
213  if (!metHandle.isValid()) {
214  if (!warningPrinted4token_[0]) {
215  edm::LogWarning("METMonitor") << "skipping events because the collection " << metInputTag_.label().c_str()
216  << " is not available";
217  warningPrinted4token_[0] = true;
218  }
219  return;
220  }
221  reco::PFMET pfmet = metHandle->front();
222  if (!metSelection_(pfmet))
223  return;
224 
225  float met = pfmet.pt();
226  float phi = pfmet.phi();
227 
228  std::vector<reco::PFJet> jets;
230  iEvent.getByToken(jetToken_, jetHandle);
231  if (jetHandle.isValid()) {
232  if (jetHandle->size() < njets_)
233  return;
234  for (auto const& j : *jetHandle) {
235  if (jetSelection_(j)) {
236  jets.push_back(j);
237  }
238  }
239  } else {
240  if (!warningPrinted4token_[1]) {
241  if (jetInputTag_.label().empty())
242  edm::LogWarning("METMonitor") << "JetCollection not set";
243  else
244  edm::LogWarning("METMonitor") << "skipping events because the collection " << jetInputTag_.label().c_str()
245  << " is not available";
246  warningPrinted4token_[1] = true;
247  }
248  // if Handle is not valid, because the InputTag has been mis-configured, then skip the event
249  if (!jetInputTag_.label().empty())
250  return;
251  }
252  float deltaPhi_met_j1 = 10.0;
253  float deltaPhi_j1_j2 = 10.0;
254 
255  if (!jets.empty())
256  deltaPhi_met_j1 = fabs(deltaPhi(pfmet.phi(), jets[0].phi()));
257  if (jets.size() >= 2)
258  deltaPhi_j1_j2 = fabs(deltaPhi(jets[0].phi(), jets[1].phi()));
259 
260  std::vector<reco::GsfElectron> electrons;
262  iEvent.getByToken(eleToken_, eleHandle);
263  if (eleHandle.isValid()) {
264  if (eleHandle->size() < nelectrons_)
265  return;
266  for (auto const& e : *eleHandle) {
267  if (eleSelection_(e))
268  electrons.push_back(e);
269  }
270  if (electrons.size() < nelectrons_)
271  return;
272  } else {
273  if (!warningPrinted4token_[2]) {
274  warningPrinted4token_[2] = true;
275  if (eleInputTag_.label().empty())
276  edm::LogWarning("METMonitor") << "GsfElectronCollection not set";
277  else
278  edm::LogWarning("METMonitor") << "skipping events because the collection " << eleInputTag_.label().c_str()
279  << " is not available";
280  }
281  if (!eleInputTag_.label().empty())
282  return;
283  }
284 
285  reco::Vertex vtx;
287  iEvent.getByToken(vtxToken_, vtxHandle);
288  if (vtxHandle.isValid()) {
289  for (auto const& v : *vtxHandle) {
290  bool isFake = v.isFake();
291 
292  if (!isFake) {
293  vtx = v;
294  break;
295  }
296  }
297  } else {
298  if (!warningPrinted4token_[3]) {
299  warningPrinted4token_[3] = true;
300  if (vtxInputTag_.label().empty())
301  edm::LogWarning("METMonitor") << "VertexCollection is not set";
302  else
303  edm::LogWarning("METMonitor") << "skipping events because the collection " << vtxInputTag_.label().c_str()
304  << " is not available";
305  }
306  if (!vtxInputTag_.label().empty())
307  return;
308  }
309 
310  std::vector<reco::Muon> muons;
312  iEvent.getByToken(muoToken_, muoHandle);
313  if (muoHandle.isValid()) {
314  if (muoHandle->size() < nmuons_)
315  return;
316  for (auto const& m : *muoHandle) {
317  bool pass = m.isGlobalMuon() && m.isPFMuon() && m.globalTrack()->normalizedChi2() < 10. &&
318  m.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && m.numberOfMatchedStations() > 1 &&
319  fabs(m.muonBestTrack()->dxy(vtx.position())) < 0.2 &&
320  fabs(m.muonBestTrack()->dz(vtx.position())) < 0.5 &&
321  m.innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
322  m.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5;
323  if (muoSelection_(m) && pass)
324  muons.push_back(m);
325  }
326  if (muons.size() < nmuons_)
327  return;
328  } else {
329  if (!warningPrinted4token_[4]) {
330  warningPrinted4token_[4] = true;
331  if (muoInputTag_.label().empty())
332  edm::LogWarning("METMonitor") << "MuonCollection not set";
333  else
334  edm::LogWarning("METMonitor") << "skipping events because the collection " << muoInputTag_.label().c_str()
335  << " is not available";
336  }
337  if (!muoInputTag_.label().empty())
338  return;
339  }
340 
341  // filling histograms (denominator)
342  metME_.denominator->Fill(met);
344  metPhiME_.denominator->Fill(phi);
345  deltaphimetj1ME_.denominator->Fill(deltaPhi_met_j1);
346  deltaphij1j2ME_.denominator->Fill(deltaPhi_j1_j2);
347 
348  const int ls = iEvent.id().luminosityBlock();
349  metVsLS_.denominator->Fill(ls, met);
350  // applying selection for numerator
351  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
352  return;
353 
354  // filling histograms (num_genTriggerEventFlag_)
355  metME_.numerator->Fill(met);
357  metPhiME_.numerator->Fill(phi);
358  metVsLS_.numerator->Fill(ls, met);
359  deltaphimetj1ME_.numerator->Fill(deltaPhi_met_j1);
360  deltaphij1j2ME_.numerator->Fill(deltaPhi_j1_j2);
361 }
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.cc:73
unsigned nmuons_
Definition: METMonitor.cc:79
edm::InputTag vtxInputTag_
Definition: METMonitor.cc:50
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.cc:70
double pt() const final
transverse momentum
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.cc:74
def ls
Definition: eostools.py:349
edm::InputTag muoInputTag_
Definition: METMonitor.cc:49
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: METMonitor.cc:56
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.cc:69
edm::InputTag eleInputTag_
Definition: METMonitor.cc:48
const Point & position() const
position
Definition: Vertex.h:127
unsigned njets_
Definition: METMonitor.cc:77
ObjME metPhiME_
Definition: METMonitor.cc:65
void Fill(long long x)
ObjME deltaphimetj1ME_
Definition: METMonitor.cc:66
ObjME metME_variableBinning_
Definition: METMonitor.cc:63
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.cc:54
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.cc:53
vector< PseudoJet > jets
MonitorElement * denominator
MonitorElement * numerator
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.cc:52
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: METMonitor.cc:75
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.cc:55
bool isValid() const
Definition: HandleBase.h:70
ObjME metME_
Definition: METMonitor.cc:62
ObjME deltaphij1j2ME_
Definition: METMonitor.cc:67
unsigned nelectrons_
Definition: METMonitor.cc:78
const bool requireValidHLTPaths_
Definition: METMonitor.cc:43
std::string const & label() const
Definition: InputTag.h:36
edm::InputTag metInputTag_
Definition: METMonitor.cc:46
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.cc:72
tuple muons
Definition: patZpeak.py:41
edm::InputTag jetInputTag_
Definition: METMonitor.cc:47
Log< level::Warning, false > LogWarning
std::vector< bool > warningPrinted4token_
Definition: METMonitor.cc:85
double phi() const final
momentum azimuthal angle
bool hltPathsAreValid_
Definition: METMonitor.cc:44
ObjME metVsLS_
Definition: METMonitor.cc:64
void METMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 136 of file METMonitor.cc.

References TriggerDQMBase::bookME(), deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, folderName_, hltPathsAreValid_, ls_binning_, met_binning_, met_variable_binning_, metME_, metME_variableBinning_, metPhiME_, metVsLS_, TriggerDQMBase::MEbinning::nbins, num_genTriggerEventFlag_, phi_binning_, requireValidHLTPaths_, dqm::implementation::NavigatorBase::setCurrentFolder(), TriggerDQMBase::setMETitle(), AlCaHLTBitMon_QueryRunRegistry::string, TriggerDQMBase::MEbinning::xmax, and TriggerDQMBase::MEbinning::xmin.

136  {
137  // Initialize the GenericTriggerEventFlag
139  num_genTriggerEventFlag_->initRun(iRun, iSetup);
140  }
142  den_genTriggerEventFlag_->initRun(iRun, iSetup);
143  }
144 
145  // check if every HLT path specified in numerator and denominator has a valid match in the HLT Menu
147  den_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->allHLTPathsAreValid() &&
148  den_genTriggerEventFlag_->allHLTPathsAreValid());
149 
150  // if valid HLT paths are required,
151  // create DQM outputs only if all paths are valid
153  return;
154  }
155 
156  std::string histname, histtitle;
157 
158  std::string currentFolder = folderName_;
159  ibooker.setCurrentFolder(currentFolder);
160 
161  histname = "deltaphi_metjet1";
162  histtitle = "DPHI_METJ1";
163  bookME(ibooker, deltaphimetj1ME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
164  setMETitle(deltaphimetj1ME_, "delta phi (met, j1)", "events / 0.1 rad");
165 
166  histname = "deltaphi_jet1jet2";
167  histtitle = "DPHI_J1J2";
168  bookME(ibooker, deltaphij1j2ME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
169  setMETitle(deltaphij1j2ME_, "delta phi (j1, j2)", "events / 0.1 rad");
170 
171  histname = "met";
172  histtitle = "PFMET";
173  bookME(ibooker, metME_, histname, histtitle, met_binning_.nbins, met_binning_.xmin, met_binning_.xmax);
174  setMETitle(metME_, "PF MET [GeV]", "events / [GeV]");
175 
176  histname = "met_variable";
177  histtitle = "PFMET";
178  bookME(ibooker, metME_variableBinning_, histname, histtitle, met_variable_binning_);
179  setMETitle(metME_variableBinning_, "PF MET [GeV]", "events / [GeV]");
180 
181  histname = "metVsLS";
182  histtitle = "PFMET vs LS";
183  bookME(ibooker,
184  metVsLS_,
185  histname,
186  histtitle,
192  setMETitle(metVsLS_, "LS", "PF MET [GeV]");
193 
194  histname = "metPhi";
195  histtitle = "PFMET phi";
196  bookME(ibooker, metPhiME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
197  setMETitle(metPhiME_, "PF MET #phi", "events / 0.1 rad");
198 }
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.cc:70
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.cc:69
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
ObjME metPhiME_
Definition: METMonitor.cc:65
ObjME deltaphimetj1ME_
Definition: METMonitor.cc:66
ObjME metME_variableBinning_
Definition: METMonitor.cc:63
MEbinning met_binning_
Definition: METMonitor.cc:59
ObjME metME_
Definition: METMonitor.cc:62
ObjME deltaphij1j2ME_
Definition: METMonitor.cc:67
const bool requireValidHLTPaths_
Definition: METMonitor.cc:43
static constexpr MEbinning phi_binning_
Definition: METMonitor.cc:83
std::vector< double > met_variable_binning_
Definition: METMonitor.cc:58
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbins, const double xmin, const double xmax, const bool bookDen=true)
MEbinning ls_binning_
Definition: METMonitor.cc:60
const std::string folderName_
Definition: METMonitor.cc:41
bool hltPathsAreValid_
Definition: METMonitor.cc:44
ObjME metVsLS_
Definition: METMonitor.cc:64
void METMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 363 of file METMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, TriggerDQMBase::fillHistoLSPSetDescription(), TriggerDQMBase::fillHistoPSetDescription(), GenericTriggerEventFlag::fillPSetDescription(), HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

363  {
365  desc.add<std::string>("FolderName", "HLT/MET");
366  desc.add<bool>("requireValidHLTPaths", true);
367 
368  desc.add<edm::InputTag>("met", edm::InputTag("pfMet"));
369  desc.add<edm::InputTag>("jets", edm::InputTag("ak4PFJetsCHS"));
370  desc.add<edm::InputTag>("electrons", edm::InputTag("gedGsfElectrons"));
371  desc.add<edm::InputTag>("muons", edm::InputTag("muons"));
372  desc.add<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
373  desc.add<std::string>("metSelection", "pt > 0");
374  desc.add<std::string>("jetSelection", "pt > 0");
375  desc.add<std::string>("eleSelection", "pt > 0");
376  desc.add<std::string>("muoSelection", "pt > 0");
377  desc.add<unsigned>("njets", 0);
378  desc.add<unsigned>("nelectrons", 0);
379  desc.add<unsigned>("nmuons", 0);
380 
381  edm::ParameterSetDescription genericTriggerEventPSet;
382  GenericTriggerEventFlag::fillPSetDescription(genericTriggerEventPSet);
383 
384  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
385  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
386 
389  fillHistoPSetDescription(metPSet);
390  histoPSet.add<edm::ParameterSetDescription>("metPSet", metPSet);
391  std::vector<double> bins = {0., 20., 40., 60., 80., 90., 100., 110., 120., 130., 140., 150., 160.,
392  170., 180., 190., 200., 220., 240., 260., 280., 300., 350., 400., 450., 1000.};
393  histoPSet.add<std::vector<double> >("metBinning", bins);
394 
397  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
398 
399  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
400 
401  descriptions.add("metMonitoring", desc);
402 }
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillPSetDescription(edm::ParameterSetDescription &desc)

Member Data Documentation

ObjME METMonitor::deltaphij1j2ME_
private

Definition at line 67 of file METMonitor.cc.

Referenced by analyze(), and bookHistograms().

ObjME METMonitor::deltaphimetj1ME_
private

Definition at line 66 of file METMonitor.cc.

Referenced by analyze(), and bookHistograms().

std::unique_ptr<GenericTriggerEventFlag> METMonitor::den_genTriggerEventFlag_
private

Definition at line 70 of file METMonitor.cc.

Referenced by analyze(), bookHistograms(), and ~METMonitor().

edm::InputTag METMonitor::eleInputTag_
private

Definition at line 48 of file METMonitor.cc.

Referenced by analyze().

StringCutObjectSelector<reco::GsfElectron, true> METMonitor::eleSelection_
private

Definition at line 74 of file METMonitor.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::GsfElectronCollection> METMonitor::eleToken_
private

Definition at line 54 of file METMonitor.cc.

Referenced by analyze().

const std::string METMonitor::folderName_
private

Definition at line 41 of file METMonitor.cc.

Referenced by bookHistograms().

bool METMonitor::hltPathsAreValid_
private

Definition at line 44 of file METMonitor.cc.

Referenced by analyze(), and bookHistograms().

edm::InputTag METMonitor::jetInputTag_
private

Definition at line 47 of file METMonitor.cc.

Referenced by analyze().

StringCutObjectSelector<reco::PFJet, true> METMonitor::jetSelection_
private

Definition at line 73 of file METMonitor.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::PFJetCollection> METMonitor::jetToken_
private

Definition at line 53 of file METMonitor.cc.

Referenced by analyze().

MEbinning METMonitor::ls_binning_
private

Definition at line 60 of file METMonitor.cc.

Referenced by bookHistograms().

constexpr double METMonitor::MAX_PHI = 3.2
staticprivate

Definition at line 81 of file METMonitor.cc.

MEbinning METMonitor::met_binning_
private

Definition at line 59 of file METMonitor.cc.

Referenced by bookHistograms().

std::vector<double> METMonitor::met_variable_binning_
private

Definition at line 58 of file METMonitor.cc.

Referenced by bookHistograms().

edm::InputTag METMonitor::metInputTag_
private

Definition at line 46 of file METMonitor.cc.

Referenced by analyze().

ObjME METMonitor::metME_
private

Definition at line 62 of file METMonitor.cc.

Referenced by analyze(), and bookHistograms().

ObjME METMonitor::metME_variableBinning_
private

Definition at line 63 of file METMonitor.cc.

Referenced by analyze(), and bookHistograms().

ObjME METMonitor::metPhiME_
private

Definition at line 65 of file METMonitor.cc.

Referenced by analyze(), and bookHistograms().

StringCutObjectSelector<reco::MET, true> METMonitor::metSelection_
private

Definition at line 72 of file METMonitor.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::PFMETCollection> METMonitor::metToken_
private

Definition at line 52 of file METMonitor.cc.

Referenced by analyze().

ObjME METMonitor::metVsLS_
private

Definition at line 64 of file METMonitor.cc.

Referenced by analyze(), and bookHistograms().

edm::InputTag METMonitor::muoInputTag_
private

Definition at line 49 of file METMonitor.cc.

Referenced by analyze().

StringCutObjectSelector<reco::Muon, true> METMonitor::muoSelection_
private

Definition at line 75 of file METMonitor.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::MuonCollection> METMonitor::muoToken_
private

Definition at line 55 of file METMonitor.cc.

Referenced by analyze().

constexpr int METMonitor::N_PHI = 64
staticprivate

Definition at line 82 of file METMonitor.cc.

unsigned METMonitor::nelectrons_
private

Definition at line 78 of file METMonitor.cc.

Referenced by analyze().

unsigned METMonitor::njets_
private

Definition at line 77 of file METMonitor.cc.

Referenced by analyze().

unsigned METMonitor::nmuons_
private

Definition at line 79 of file METMonitor.cc.

Referenced by analyze().

std::unique_ptr<GenericTriggerEventFlag> METMonitor::num_genTriggerEventFlag_
private

Definition at line 69 of file METMonitor.cc.

Referenced by analyze(), bookHistograms(), and ~METMonitor().

constexpr MEbinning METMonitor::phi_binning_ {N_PHI, -MAX_PHI, MAX_PHI}
staticprivate

Definition at line 83 of file METMonitor.cc.

Referenced by bookHistograms().

const bool METMonitor::requireValidHLTPaths_
private

Definition at line 43 of file METMonitor.cc.

Referenced by analyze(), and bookHistograms().

edm::InputTag METMonitor::vtxInputTag_
private

Definition at line 50 of file METMonitor.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::VertexCollection> METMonitor::vtxToken_
private

Definition at line 56 of file METMonitor.cc.

Referenced by analyze().

std::vector<bool> METMonitor::warningPrinted4token_
private

Definition at line 85 of file METMonitor.cc.

Referenced by analyze(), and METMonitor().