CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes
DiDispStaMuonMonitor Class Reference

#include <DiDispStaMuonMonitor.h>

Inheritance diagram for DiDispStaMuonMonitor:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  DiDispStaMuonME
 
struct  MEbinning
 

Public Member Functions

 DiDispStaMuonMonitor (const edm::ParameterSet &)
 
 ~DiDispStaMuonMonitor () 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
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillHistoLSPSetDescription (edm::ParameterSetDescription &pset)
 
static void fillHistoPSetDescription (edm::ParameterSetDescription &pset)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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
 
void bookME (DQMStore::IBooker &, DiDispStaMuonME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
 
void bookME (DQMStore::IBooker &, DiDispStaMuonME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX)
 
void bookME (DQMStore::IBooker &, DiDispStaMuonME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, double ymin, double ymax, bool bookDen)
 
void bookME (DQMStore::IBooker &, DiDispStaMuonME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, int nbinsY, double ymin, double ymax)
 
void bookME (DQMStore::IBooker &, DiDispStaMuonME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const std::vector< double > &binningY)
 
void setTitle (DiDispStaMuonME &me, const std::string &titleX, const std::string &titleY, bool bookDen)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Static Private Member Functions

static MEbinning getHistoLSPSet (const edm::ParameterSet &pset)
 
static MEbinning getHistoPSet (const edm::ParameterSet &pset)
 

Private Attributes

std::unique_ptr< GenericTriggerEventFlagden_genTriggerEventFlag_
 
std::string folderName_
 
std::string histoSuffix_
 
MEbinning ls_binning_
 
MEbinning muonDxy_binning_
 
DiDispStaMuonME muonDxyME_
 
MEbinning muonEta_binning_
 
DiDispStaMuonME muonEtaME_
 
MEbinning muonPhi_binning_
 
DiDispStaMuonME muonPhiME_
 
MEbinning muonPt_binning_
 
std::vector< double > muonPt_variable_binning_
 
DiDispStaMuonME muonPtME_
 
DiDispStaMuonME muonPtME_variableBinning_
 
DiDispStaMuonME muonPtNoDxyCutME_
 
DiDispStaMuonME muonPtVsLS_
 
StringCutObjectSelector< reco::Track, true > muonSelectionDxy_
 
StringCutObjectSelector< reco::Track, true > muonSelectionGeneral_
 
StringCutObjectSelector< reco::Track, true > muonSelectionPt_
 
edm::EDGetTokenT< reco::TrackCollectionmuonToken_
 
unsigned int nmuons_
 
std::unique_ptr< GenericTriggerEventFlagnum_genTriggerEventFlag_
 
DiDispStaMuonME subMuonDxyME_
 
DiDispStaMuonME subMuonEtaME_
 
DiDispStaMuonME subMuonPhiME_
 
DiDispStaMuonME subMuonPtME_
 
DiDispStaMuonME subMuonPtME_variableBinning_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 38 of file DiDispStaMuonMonitor.h.

Constructor & Destructor Documentation

DiDispStaMuonMonitor::DiDispStaMuonMonitor ( const edm::ParameterSet iConfig)

Definition at line 7 of file DiDispStaMuonMonitor.cc.

References DiDispStaMuonMonitor::DiDispStaMuonME::denominator, muonDxyME_, muonEtaME_, muonPhiME_, muonPtME_, muonPtME_variableBinning_, muonPtNoDxyCutME_, muonPtVsLS_, DiDispStaMuonMonitor::DiDispStaMuonME::numerator, subMuonDxyME_, subMuonEtaME_, subMuonPhiME_, subMuonPtME_, subMuonPtME_variableBinning_, and ~DiDispStaMuonMonitor().

8  : folderName_(iConfig.getParameter<std::string>("FolderName")),
9  muonToken_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("muons"))),
11  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double>>("muonPtBinning")),
13  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("muonPtPSet"))),
15  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("muonEtaPSet"))),
17  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("muonPhiPSet"))),
19  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("muonDxyPSet"))),
23  iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
25  iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
27  iConfig.getParameter<edm::ParameterSet>("muonSelection").getParameter<std::string>("general")),
29  muonSelectionDxy_(iConfig.getParameter<edm::ParameterSet>("muonSelection").getParameter<std::string>("dxy")),
30  nmuons_(iConfig.getParameter<unsigned int>("nmuons")) {
31  muonPtME_.numerator = nullptr;
32  muonPtME_.denominator = nullptr;
33  muonPtNoDxyCutME_.numerator = nullptr;
37  muonPtVsLS_.numerator = nullptr;
38  muonPtVsLS_.denominator = nullptr;
39  muonEtaME_.numerator = nullptr;
40  muonEtaME_.denominator = nullptr;
41  muonPhiME_.numerator = nullptr;
42  muonPhiME_.denominator = nullptr;
43  muonDxyME_.numerator = nullptr;
44  muonDxyME_.denominator = nullptr;
45 
46  subMuonPtME_.numerator = nullptr;
47  subMuonPtME_.denominator = nullptr;
50  subMuonEtaME_.numerator = nullptr;
51  subMuonEtaME_.denominator = nullptr;
52  subMuonPhiME_.numerator = nullptr;
53  subMuonPhiME_.denominator = nullptr;
54  subMuonDxyME_.numerator = nullptr;
55  subMuonDxyME_.denominator = nullptr;
56 }
DiDispStaMuonME subMuonPtME_
T getParameter(std::string const &) const
DiDispStaMuonME subMuonEtaME_
std::vector< double > muonPt_variable_binning_
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
DiDispStaMuonME muonPtNoDxyCutME_
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
DiDispStaMuonME subMuonDxyME_
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
StringCutObjectSelector< reco::Track, true > muonSelectionDxy_
StringCutObjectSelector< reco::Track, true > muonSelectionGeneral_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
StringCutObjectSelector< reco::Track, true > muonSelectionPt_
DiDispStaMuonME subMuonPtME_variableBinning_
edm::EDGetTokenT< reco::TrackCollection > muonToken_
DiDispStaMuonME subMuonPhiME_
DiDispStaMuonME muonPtME_variableBinning_
DiDispStaMuonMonitor::~DiDispStaMuonMonitor ( )
overridedefault

Referenced by DiDispStaMuonMonitor().

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 285 of file DiDispStaMuonMonitor.cc.

References den_genTriggerEventFlag_, DiDispStaMuonMonitor::DiDispStaMuonME::denominator, PVValHelper::dxy, PVValHelper::eta, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), mps_fire::i, edm::EventBase::id(), eostools::ls(), edm::EventID::luminosityBlock(), visualization-live-secondInstance_cfg::m, muonDxyME_, muonEtaME_, muonPhiME_, muonPtME_, muonPtME_variableBinning_, muonPtNoDxyCutME_, muonPtVsLS_, PDWG_BPHSkim_cff::muons, muonSelectionDxy_, muonSelectionGeneral_, muonSelectionPt_, muonToken_, nmuons_, num_genTriggerEventFlag_, DiDispStaMuonMonitor::DiDispStaMuonME::numerator, phi, DiDispStaMuonMonitor_cfi::pt, reco::TrackBase::pt(), subMuonDxyME_, subMuonEtaME_, subMuonPhiME_, subMuonPtME_, and subMuonPtME_variableBinning_.

285  {
286  // Filter out events if Trigger Filtering is requested
287  if (den_genTriggerEventFlag_->on() && !den_genTriggerEventFlag_->accept(iEvent, iSetup))
288  return;
289 
290  int ls = iEvent.id().luminosityBlock();
291 
293  iEvent.getByToken(muonToken_, DSAHandle);
294  if ((unsigned int)(DSAHandle->size()) < nmuons_)
295  return;
296  std::vector<edm::Ptr<reco::Track>> dsaMuonPtrs_{}; // = DSAHandle->ptrs();
297  for (size_t i(0); i != DSAHandle->size(); ++i) {
298  dsaMuonPtrs_.emplace_back(DSAHandle, i);
299  }
300  std::vector<edm::Ptr<reco::Track>> muons{}, muonsCutOnPt{}, muonsCutOnDxy{}, muonsCutOnPtAndDxy{};
301 
302  // general selection
303  auto selectGeneral_([this](edm::Ptr<reco::Track> const& m) -> bool { return muonSelectionGeneral_(*m); });
304  std::copy_if(dsaMuonPtrs_.begin(), dsaMuonPtrs_.end(), back_inserter(muons), selectGeneral_);
305  if ((unsigned int)(muons.size()) < nmuons_)
306  return;
307 
308  // sort by pt
309  auto ptSorter_ = [](edm::Ptr<reco::Track> const& lhs, edm::Ptr<reco::Track> const& rhs) -> bool {
310  return lhs->pt() > rhs->pt();
311  };
312  std::sort(muons.begin(), muons.end(), ptSorter_);
313 
314  // cut on pt
315  auto selectOnPt_([this](edm::Ptr<reco::Track> const& m) -> bool { return muonSelectionPt_(*m); });
316  std::copy_if(muons.begin(), muons.end(), back_inserter(muonsCutOnPt), selectOnPt_);
317  // cut on dxy
318  auto selectOnDxy_([this](edm::Ptr<reco::Track> const& m) -> bool { return muonSelectionDxy_(*m); });
319  std::copy_if(muons.begin(), muons.end(), back_inserter(muonsCutOnDxy), selectOnDxy_);
320  // cut on pt and dxy
321  auto selectOnPtAndDxy_(
322  [this](edm::Ptr<reco::Track> const& m) -> bool { return muonSelectionPt_(*m) && muonSelectionDxy_(*m); });
323  std::copy_if(muons.begin(), muons.end(), back_inserter(muonsCutOnPtAndDxy), selectOnPtAndDxy_);
324 
325  std::sort(muonsCutOnPt.begin(), muonsCutOnPt.end(), ptSorter_);
326  std::sort(muonsCutOnDxy.begin(), muonsCutOnDxy.end(), ptSorter_);
327  std::sort(muonsCutOnPtAndDxy.begin(), muonsCutOnPtAndDxy.end(), ptSorter_);
328 
329  // --------------------------------
330  // filling histograms (denominator)
331  // --------------------------------
332  if (muonsCutOnDxy.size() >= nmuons_) {
333  // pt has cut on dxy
334  muonPtME_.denominator->Fill(muonsCutOnDxy[0]->pt());
336  muonPtME_variableBinning_.denominator->Fill(muonsCutOnDxy[0]->pt());
337  muonPtVsLS_.denominator->Fill(ls, muonsCutOnDxy[0]->pt());
338  if (nmuons_ > 1) {
339  subMuonPtME_.denominator->Fill(muonsCutOnDxy[1]->pt());
340  subMuonPtME_variableBinning_.denominator->Fill(muonsCutOnDxy[1]->pt());
341  }
342  }
343  if (muonsCutOnPtAndDxy.size() >= nmuons_) {
344  // eta, phi have cut on pt and dxy
345  muonEtaME_.denominator->Fill(muonsCutOnPtAndDxy[0]->eta());
346  muonPhiME_.denominator->Fill(muonsCutOnPtAndDxy[0]->phi());
347  if (nmuons_ > 1) {
348  subMuonEtaME_.denominator->Fill(muonsCutOnPtAndDxy[1]->eta());
349  subMuonPhiME_.denominator->Fill(muonsCutOnPtAndDxy[1]->phi());
350  }
351  }
352  if (muonsCutOnPt.size() >= nmuons_) {
353  // dxy has cut on pt
354  muonDxyME_.denominator->Fill(muonsCutOnPt[0]->dxy());
355  if (nmuons_ > 1) {
356  subMuonDxyME_.denominator->Fill(muonsCutOnPt[1]->dxy());
357  }
358  }
359 
360  // --------------------------------
361  // filling histograms (numerator)
362  // --------------------------------
363  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
364  return;
365 
366  if (muonsCutOnDxy.size() >= nmuons_) {
367  // pt has cut on dxy
368  muonPtME_.numerator->Fill(muonsCutOnDxy[0]->pt());
370  muonPtME_variableBinning_.numerator->Fill(muonsCutOnDxy[0]->pt());
371  muonPtVsLS_.numerator->Fill(ls, muonsCutOnDxy[0]->pt());
372  if (nmuons_ > 1) {
373  subMuonPtME_.numerator->Fill(muonsCutOnDxy[1]->pt());
374  subMuonPtME_variableBinning_.numerator->Fill(muonsCutOnDxy[1]->pt());
375  }
376  }
377  if (muonsCutOnPtAndDxy.size() >= nmuons_) {
378  // eta, phi have cut on pt and dxy
379  muonEtaME_.numerator->Fill(muonsCutOnPtAndDxy[0]->eta());
380  muonPhiME_.numerator->Fill(muonsCutOnPtAndDxy[0]->phi());
381  if (nmuons_ > 1) {
382  subMuonEtaME_.numerator->Fill(muonsCutOnPtAndDxy[1]->eta());
383  subMuonPhiME_.numerator->Fill(muonsCutOnPtAndDxy[1]->phi());
384  }
385  }
386  if (muonsCutOnPt.size() >= nmuons_) {
387  // dxy has cut on pt
388  muonDxyME_.numerator->Fill(muonsCutOnPt[0]->dxy());
389  if (nmuons_ > 1) {
390  subMuonDxyME_.numerator->Fill(muonsCutOnPt[1]->dxy());
391  }
392  }
393 }
DiDispStaMuonME subMuonPtME_
DiDispStaMuonME subMuonEtaME_
DiDispStaMuonME muonPtNoDxyCutME_
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
DiDispStaMuonME subMuonDxyME_
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
StringCutObjectSelector< reco::Track, true > muonSelectionDxy_
StringCutObjectSelector< reco::Track, true > muonSelectionGeneral_
double pt() const
track transverse momentum
Definition: TrackBase.h:602
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
def ls(path, rec=False)
Definition: eostools.py:349
StringCutObjectSelector< reco::Track, true > muonSelectionPt_
DiDispStaMuonME subMuonPtME_variableBinning_
edm::EDGetTokenT< reco::TrackCollection > muonToken_
DiDispStaMuonME subMuonPhiME_
DiDispStaMuonME muonPtME_variableBinning_
void DiDispStaMuonMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 153 of file DiDispStaMuonMonitor.cc.

References bookME(), den_genTriggerEventFlag_, folderName_, ls_binning_, muonDxy_binning_, muonDxyME_, muonEta_binning_, muonEtaME_, muonPhi_binning_, muonPhiME_, muonPt_binning_, muonPt_variable_binning_, muonPtME_, muonPtME_variableBinning_, muonPtNoDxyCutME_, muonPtVsLS_, DiDispStaMuonMonitor::MEbinning::nbins, nmuons_, num_genTriggerEventFlag_, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), setTitle(), AlCaHLTBitMon_QueryRunRegistry::string, subMuonDxyME_, subMuonEtaME_, subMuonPhiME_, subMuonPtME_, subMuonPtME_variableBinning_, DiDispStaMuonMonitor::MEbinning::xmax, and DiDispStaMuonMonitor::MEbinning::xmin.

155  {
156  std::string histname, histtitle;
157  bool bookDen;
158 
159  std::string currentFolder = folderName_;
160  ibooker.setCurrentFolder(currentFolder);
161 
162  histname = "muonPt";
163  histtitle = "muonPt";
164  bookDen = true;
165  bookME(ibooker, muonPtME_, histname, histtitle, muonPt_binning_.nbins, muonPt_binning_.xmin, muonPt_binning_.xmax);
166  setTitle(muonPtME_, "DisplacedStandAlone Muon p_{T} [GeV]", "Events / [GeV]", bookDen);
167 
168  histname = "muonPtNoDxyCut";
169  histtitle = "muonPtNoDxyCut";
170  bookDen = true;
171  bookME(ibooker,
173  histname,
174  histtitle,
178  setTitle(muonPtNoDxyCutME_, "DisplacedStandAlone Muon p_{T} [GeV] without Dxy cut", "Events / [GeV]", bookDen);
179 
180  histname = "muonPt_variable";
181  histtitle = "muonPt";
182  bookDen = true;
183  bookME(ibooker, muonPtME_variableBinning_, histname, histtitle, muonPt_variable_binning_);
184  setTitle(muonPtME_variableBinning_, "DisplacedStandAlone Muon p_{T} [GeV]", "Events / [GeV]", bookDen);
185 
186  histname = "muonPtVsLS";
187  histtitle = "muonPt vs LS";
188  bookDen = true;
189  bookME(ibooker,
190  muonPtVsLS_,
191  histname,
192  histtitle,
198  bookDen);
199  setTitle(muonPtVsLS_, "LS", "DisplacedStandAlone Muon p_{T} [GeV]", bookDen);
200 
201  histname = "muonEta";
202  histtitle = "muonEta";
203  bookDen = true;
204  bookME(
205  ibooker, muonEtaME_, histname, histtitle, muonEta_binning_.nbins, muonEta_binning_.xmin, muonEta_binning_.xmax);
206  setTitle(muonEtaME_, "DisplacedStandAlone Muon #eta", "Events", bookDen);
207 
208  histname = "muonPhi";
209  histtitle = "muonPhi";
210  bookDen = true;
211  bookME(
212  ibooker, muonPhiME_, histname, histtitle, muonPhi_binning_.nbins, muonPhi_binning_.xmin, muonPhi_binning_.xmax);
213  setTitle(muonPhiME_, "DisplacedStandAlone Muon #phi", "Events", bookDen);
214 
215  histname = "muonDxy";
216  histtitle = "muonDxy";
217  bookDen = true;
218  bookME(
219  ibooker, muonDxyME_, histname, histtitle, muonDxy_binning_.nbins, muonDxy_binning_.xmin, muonDxy_binning_.xmax);
220  setTitle(muonDxyME_, "DisplacedStandAlone Muon #dxy", "Events", bookDen);
221 
222  //-----------------------
223  // |
224  //-----------------------
225 
226  if (nmuons_ > 1) {
227  histname = "subMuonPt";
228  histtitle = "subMuonPt";
229  bookDen = true;
230  bookME(
231  ibooker, subMuonPtME_, histname, histtitle, muonPt_binning_.nbins, muonPt_binning_.xmin, muonPt_binning_.xmax);
232  setTitle(subMuonPtME_, "Subleading DisplacedStandAlone Muon p_{T} [GeV]", "Events / [GeV]", bookDen);
233 
234  histname = "subMuonPt_variable";
235  histtitle = "subMuonPt";
236  bookDen = true;
237  bookME(ibooker, subMuonPtME_variableBinning_, histname, histtitle, muonPt_variable_binning_);
238  setTitle(
239  subMuonPtME_variableBinning_, "Subleading DisplacedStandAlone Muon p_{T} [GeV]", "Events / [GeV]", bookDen);
240 
241  histname = "subMuonEta";
242  histtitle = "subMuonEta";
243  bookDen = true;
244  bookME(ibooker,
246  histname,
247  histtitle,
251  setTitle(subMuonEtaME_, "Subleading DisplacedStandAlone Muon #eta", "Events", bookDen);
252 
253  histname = "subMuonPhi";
254  histtitle = "subMuonPhi";
255  bookDen = true;
256  bookME(ibooker,
258  histname,
259  histtitle,
263  setTitle(subMuonPhiME_, "Subleading DisplacedStandAlone Muon #phi", "Events", bookDen);
264 
265  histname = "subMuonDxy";
266  histtitle = "subMuonDxy";
267  bookDen = true;
268  bookME(ibooker,
270  histname,
271  histtitle,
275  setTitle(subMuonDxyME_, "Subleading DisplacedStandAlone Muon #dxy", "Events", bookDen);
276  }
277 
278  // Initialize the GenericTriggerEventFlag
280  num_genTriggerEventFlag_->initRun(iRun, iSetup);
282  den_genTriggerEventFlag_->initRun(iRun, iSetup);
283 }
DiDispStaMuonME subMuonPtME_
void setTitle(DiDispStaMuonME &me, const std::string &titleX, const std::string &titleY, bool bookDen)
DiDispStaMuonME subMuonEtaME_
std::vector< double > muonPt_variable_binning_
DiDispStaMuonME muonPtNoDxyCutME_
DiDispStaMuonME subMuonDxyME_
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
void bookME(DQMStore::IBooker &, DiDispStaMuonME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
DiDispStaMuonME subMuonPtME_variableBinning_
DiDispStaMuonME subMuonPhiME_
DiDispStaMuonME muonPtME_variableBinning_
void DiDispStaMuonMonitor::bookME ( DQMStore::IBooker ibooker,
DiDispStaMuonME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbins,
double  xmin,
double  xmax 
)
protected

Definition at line 84 of file DiDispStaMuonMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), DiDispStaMuonMonitor::DiDispStaMuonME::denominator, and DiDispStaMuonMonitor::DiDispStaMuonME::numerator.

Referenced by bookHistograms().

90  {
91  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, min, max);
92  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, min, max);
93 }
T min(T a, T b)
Definition: MathUtil.h:58
void DiDispStaMuonMonitor::bookME ( DQMStore::IBooker ibooker,
DiDispStaMuonME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX 
)
protected

Definition at line 94 of file DiDispStaMuonMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), DiDispStaMuonMonitor::DiDispStaMuonME::denominator, LaserClient_cfi::nbins, and DiDispStaMuonMonitor::DiDispStaMuonME::numerator.

98  {
99  int nbins = binning.size() - 1;
100  std::vector<float> fbinning(binning.begin(), binning.end());
101  float* arr = &fbinning[0];
102  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, arr);
103  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, arr);
104 }
void DiDispStaMuonMonitor::bookME ( DQMStore::IBooker ibooker,
DiDispStaMuonME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
bool  bookDen 
)
protected

Definition at line 105 of file DiDispStaMuonMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::bookProfile(), DiDispStaMuonMonitor::DiDispStaMuonME::denominator, and DiDispStaMuonMonitor::DiDispStaMuonME::numerator.

114  {
115  me.numerator =
116  ibooker.bookProfile(histname + "_numerator", histtitle + " (numerator)", nbinsX, xmin, xmax, ymin, ymax);
117  if (bookDen)
118  me.denominator =
119  ibooker.bookProfile(histname + "_denominator", histtitle + " (denominator)", nbinsX, xmin, xmax, ymin, ymax);
120 }
void DiDispStaMuonMonitor::bookME ( DQMStore::IBooker ibooker,
DiDispStaMuonME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
int  nbinsY,
double  ymin,
double  ymax 
)
protected
void DiDispStaMuonMonitor::bookME ( DQMStore::IBooker ibooker,
DiDispStaMuonME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX,
const std::vector< double > &  binningY 
)
protected

Definition at line 136 of file DiDispStaMuonMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), DiDispStaMuonMonitor::DiDispStaMuonME::denominator, hlt_dqm_clientPB-live_cfg::nbinsX, hlt_dqm_clientPB-live_cfg::nbinsY, and DiDispStaMuonMonitor::DiDispStaMuonME::numerator.

141  {
142  int nbinsX = binningX.size() - 1;
143  std::vector<float> fbinningX(binningX.begin(), binningX.end());
144  float* arrX = &fbinningX[0];
145  int nbinsY = binningY.size() - 1;
146  std::vector<float> fbinningY(binningY.begin(), binningY.end());
147  float* arrY = &fbinningY[0];
148 
149  me.numerator = ibooker.book2D(histname + "_numerator", histtitle + " (numerator)", nbinsX, arrX, nbinsY, arrY);
150  me.denominator = ibooker.book2D(histname + "_denominator", histtitle + " (denominator)", nbinsX, arrX, nbinsY, arrY);
151 }
void DiDispStaMuonMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 405 of file DiDispStaMuonMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), trigObjTnPSource_cfi::bins, DEFINE_FWK_MODULE, fillHistoPSetDescription(), SiStripSourceConfigTier0_cff::genericTriggerEventPSet, LumiMonitor_cff::histoPSet, HLT_2018_cff::InputTag, LumiMonitor_cff::lsPSet, DiDispStaMuonMonitor_cfi::muonDxyPSet, DiDispStaMuonMonitor_cfi::muonEtaPSet, DiDispStaMuonMonitor_cfi::muonPhiPSet, DiDispStaMuonMonitor_cfi::muonPtPSet, DiDispStaMuonMonitor_cfi::muonSelection, and AlCaHLTBitMon_QueryRunRegistry::string.

405  {
407  desc.add<std::string>("FolderName", "HLT/EXO/DiDispStaMuon");
408 
409  desc.add<edm::InputTag>("muons", edm::InputTag("displacedStandAloneMuons"));
410  desc.add<unsigned int>("nmuons", 2);
411 
413  muonSelection.add<std::string>("general", "pt > 0");
414  muonSelection.add<std::string>("pt", "");
415  muonSelection.add<std::string>("dxy", "pt > 0");
416  desc.add<edm::ParameterSetDescription>("muonSelection", muonSelection);
417 
419  genericTriggerEventPSet.add<bool>("andOr");
420  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi"));
421  genericTriggerEventPSet.add<std::vector<int>>("dcsPartitions", {});
422  genericTriggerEventPSet.add<bool>("andOrDcs", false);
423  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
424  genericTriggerEventPSet.add<std::string>("dbLabel", "");
425  genericTriggerEventPSet.add<bool>("andOrHlt", true);
426  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT"));
427  genericTriggerEventPSet.add<std::vector<std::string>>("hltPaths", {});
428  genericTriggerEventPSet.add<std::string>("hltDBKey", "");
429  genericTriggerEventPSet.add<bool>("errorReplyHlt", false);
430  genericTriggerEventPSet.add<unsigned int>("verbosityLevel", 1);
431 
432  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
433  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
434 
441  fillHistoPSetDescription(muonPtPSet);
442  fillHistoPSetDescription(muonEtaPSet);
443  fillHistoPSetDescription(muonPhiPSet);
444  fillHistoPSetDescription(muonDxyPSet);
445  fillHistoPSetDescription(lsPSet);
446  histoPSet.add<edm::ParameterSetDescription>("muonPtPSet", muonPtPSet);
447  histoPSet.add<edm::ParameterSetDescription>("muonEtaPSet", muonEtaPSet);
448  histoPSet.add<edm::ParameterSetDescription>("muonPhiPSet", muonPhiPSet);
449  histoPSet.add<edm::ParameterSetDescription>("muonDxyPSet", muonDxyPSet);
450  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
451  std::vector<double> bins = {0., 20., 40., 60., 80., 90., 100., 110., 120., 130., 140., 150., 160.,
452  170., 180., 190., 200., 220., 240., 260., 280., 300., 350., 400., 450., 1000.};
453  histoPSet.add<std::vector<double>>("muonPtBinning", bins);
454 
455  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
456 
457  descriptions.add("DiDispStaMuonMonitoring", desc);
458 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void DiDispStaMuonMonitor::fillHistoLSPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 401 of file DiDispStaMuonMonitor.cc.

References edm::ParameterSetDescription::add().

401  {
402  pset.add<unsigned int>("nbins", 2000);
403 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void DiDispStaMuonMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 395 of file DiDispStaMuonMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

395  {
396  pset.add<unsigned int>("nbins", 200);
397  pset.add<double>("xmin", -0.5);
398  pset.add<double>("xmax", 19999.5);
399 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
DiDispStaMuonMonitor::MEbinning DiDispStaMuonMonitor::getHistoLSPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 68 of file DiDispStaMuonMonitor.cc.

References edm::ParameterSet::getParameter().

68  {
69  return MEbinning{pset.getParameter<unsigned int>("nbins"), 0., double(pset.getParameter<unsigned int>("nbins"))};
70 }
T getParameter(std::string const &) const
DiDispStaMuonMonitor::MEbinning DiDispStaMuonMonitor::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 60 of file DiDispStaMuonMonitor.cc.

References edm::ParameterSet::getParameter().

60  {
61  return MEbinning{
62  pset.getParameter<unsigned int>("nbins"),
63  pset.getParameter<double>("xmin"),
64  pset.getParameter<double>("xmax"),
65  };
66 }
T getParameter(std::string const &) const
void DiDispStaMuonMonitor::setTitle ( DiDispStaMuonME me,
const std::string &  titleX,
const std::string &  titleY,
bool  bookDen 
)
protected

Definition at line 72 of file DiDispStaMuonMonitor.cc.

References DiDispStaMuonMonitor::DiDispStaMuonME::denominator, DiDispStaMuonMonitor::DiDispStaMuonME::numerator, and dqm::impl::MonitorElement::setAxisTitle().

Referenced by bookHistograms(), Vispa.Gui.PortWidget.PortWidget::setName(), and Vispa.Views.LineDecayView.LineDecayContainer::setPxlObject().

75  {
76  me.numerator->setAxisTitle(titleX, 1);
77  me.numerator->setAxisTitle(titleY, 2);
78  if (bookDen) {
79  me.denominator->setAxisTitle(titleX, 1);
80  me.denominator->setAxisTitle(titleY, 2);
81  }
82 }

Member Data Documentation

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

Definition at line 131 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), and bookHistograms().

std::string DiDispStaMuonMonitor::folderName_
private

Definition at line 105 of file DiDispStaMuonMonitor.h.

Referenced by bookHistograms().

std::string DiDispStaMuonMonitor::histoSuffix_
private

Definition at line 106 of file DiDispStaMuonMonitor.h.

MEbinning DiDispStaMuonMonitor::ls_binning_
private

Definition at line 115 of file DiDispStaMuonMonitor.h.

Referenced by bookHistograms().

MEbinning DiDispStaMuonMonitor::muonDxy_binning_
private

Definition at line 114 of file DiDispStaMuonMonitor.h.

Referenced by bookHistograms().

DiDispStaMuonME DiDispStaMuonMonitor::muonDxyME_
private

Definition at line 123 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

MEbinning DiDispStaMuonMonitor::muonEta_binning_
private

Definition at line 112 of file DiDispStaMuonMonitor.h.

Referenced by bookHistograms().

DiDispStaMuonME DiDispStaMuonMonitor::muonEtaME_
private

Definition at line 121 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

MEbinning DiDispStaMuonMonitor::muonPhi_binning_
private

Definition at line 113 of file DiDispStaMuonMonitor.h.

Referenced by bookHistograms().

DiDispStaMuonME DiDispStaMuonMonitor::muonPhiME_
private

Definition at line 122 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

MEbinning DiDispStaMuonMonitor::muonPt_binning_
private

Definition at line 111 of file DiDispStaMuonMonitor.h.

Referenced by bookHistograms().

std::vector<double> DiDispStaMuonMonitor::muonPt_variable_binning_
private

Definition at line 110 of file DiDispStaMuonMonitor.h.

Referenced by bookHistograms().

DiDispStaMuonME DiDispStaMuonMonitor::muonPtME_
private

Definition at line 117 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

DiDispStaMuonME DiDispStaMuonMonitor::muonPtME_variableBinning_
private

Definition at line 119 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

DiDispStaMuonME DiDispStaMuonMonitor::muonPtNoDxyCutME_
private

Definition at line 118 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

DiDispStaMuonME DiDispStaMuonMonitor::muonPtVsLS_
private

Definition at line 120 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

StringCutObjectSelector<reco::Track, true> DiDispStaMuonMonitor::muonSelectionDxy_
private

Definition at line 135 of file DiDispStaMuonMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::Track, true> DiDispStaMuonMonitor::muonSelectionGeneral_
private

Definition at line 133 of file DiDispStaMuonMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::Track, true> DiDispStaMuonMonitor::muonSelectionPt_
private

Definition at line 134 of file DiDispStaMuonMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::TrackCollection> DiDispStaMuonMonitor::muonToken_
private

Definition at line 108 of file DiDispStaMuonMonitor.h.

Referenced by analyze().

unsigned int DiDispStaMuonMonitor::nmuons_
private

Definition at line 136 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 130 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), and bookHistograms().

DiDispStaMuonME DiDispStaMuonMonitor::subMuonDxyME_
private

Definition at line 128 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

DiDispStaMuonME DiDispStaMuonMonitor::subMuonEtaME_
private

Definition at line 126 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

DiDispStaMuonME DiDispStaMuonMonitor::subMuonPhiME_
private

Definition at line 127 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

DiDispStaMuonME DiDispStaMuonMonitor::subMuonPtME_
private

Definition at line 124 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().

DiDispStaMuonME DiDispStaMuonMonitor::subMuonPtME_variableBinning_
private

Definition at line 125 of file DiDispStaMuonMonitor.h.

Referenced by analyze(), bookHistograms(), and DiDispStaMuonMonitor().