CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
PSMonitor Class Reference
Inheritance diagram for PSMonitor:
DQMGlobalEDAnalyzer< Histograms > edm::global::EDAnalyzer< edm::RunCache< Histograms >, Args... > edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 PSMonitor (const edm::ParameterSet &)
 
 ~PSMonitor () override=default
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::RunCache< Histograms >, Args... >
 EDAnalyzer ()=default
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () 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 fillHistoPSetDescription (edm::ParameterSetDescription &pset, int value)
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms &) const override
 
void dqmAnalyze (edm::Event const &event, edm::EventSetup const &setup, Histograms const &) const override
 
- 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)
 

Private Member Functions

void getHistoPSet (edm::ParameterSet &pset, MEbinning &mebinning)
 

Private Attributes

std::string folderName_
 
MEbinning ls_binning_
 
MEbinning ps_binning_
 
edm::EDGetTokenT< GlobalAlgBlkBxCollectionugtBXToken_
 

Additional Inherited Members

- Public Types inherited from DQMGlobalEDAnalyzer< Histograms >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 39 of file PSMonitor.cc.

Constructor & Destructor Documentation

PSMonitor::PSMonitor ( const edm::ParameterSet config)

Definition at line 65 of file PSMonitor.cc.

References getHistoPSet(), edm::ParameterSet::getParameter(), LumiMonitor_cff::histoPSet, ls_binning_, LumiMonitor_cff::lsPSet, and ps_binning_.

66  : folderName_(config.getParameter<std::string>("FolderName")),
67  ugtBXToken_(consumes<GlobalAlgBlkBxCollection>(config.getParameter<edm::InputTag>("ugtBXInputTag"))) {
69  edm::ParameterSet psColumnPSet = histoPSet.getParameter<edm::ParameterSet>("psColumnPSet");
71 
72  getHistoPSet(psColumnPSet, ps_binning_);
73  getHistoPSet(lsPSet, ls_binning_);
74 }
T getParameter(std::string const &) const
std::string folderName_
Definition: PSMonitor.cc:53
edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugtBXToken_
Definition: PSMonitor.cc:55
void getHistoPSet(edm::ParameterSet &pset, MEbinning &mebinning)
Definition: PSMonitor.cc:76
MEbinning ps_binning_
Definition: PSMonitor.cc:57
MEbinning ls_binning_
Definition: PSMonitor.cc:58
PSMonitor::~PSMonitor ( )
overridedefault

Member Function Documentation

void PSMonitor::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  setup,
Histograms histograms 
) const
overrideprotectedvirtual

Implements DQMGlobalEDAnalyzer< Histograms >.

Definition at line 82 of file PSMonitor.cc.

References newFWLiteAna::bin, dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), folderName_, edm::service::PrescaleService::getLvl1Labels(), edm::Service< T >::isAvailable(), cmsLHEtoEOSManager::l, SummaryClient_cfi::labels, ls_binning_, hlt_dqm_clientPB-live_cfg::me, LaserClient_cfi::nbins, ps_binning_, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

85  {
86  std::string histname, histtitle;
87 
88  std::string currentFolder = folderName_;
89  booker.setCurrentFolder(currentFolder);
90 
91  int nbins;
92  double xmin, xmax;
93  std::vector<std::string> labels;
95  if (prescaleService.isAvailable() and not prescaleService->getLvl1Labels().empty()) {
96  labels = prescaleService->getLvl1Labels();
97  nbins = labels.size();
98  xmin = 0.;
99  xmax = double(labels.size());
100  } else {
101  nbins = ps_binning_.nbins;
102  xmin = ps_binning_.xmin;
103  xmax = ps_binning_.xmax;
104  labels.resize(nbins, "");
105  }
106 
107  histname = "psColumnIndexVsLS";
108  histtitle = "PS column index vs LS";
109  auto me =
110  booker.book2D(histname, histtitle, ls_binning_.nbins, ls_binning_.xmin, ls_binning_.xmax, nbins, xmin, xmax);
111  me->setAxisTitle("LS", 1);
112  me->setAxisTitle("PS column index", 2);
113  histograms.psColumnIndexVsLS = me;
114 
115  int bin = 1;
116  for (auto const& l : labels) {
117  histograms.psColumnIndexVsLS->setBinLabel(bin, l, 2);
118  bin++;
119  }
120 }
std::string folderName_
Definition: PSMonitor.cc:53
MEbinning ps_binning_
Definition: PSMonitor.cc:57
bool isAvailable() const
Definition: Service.h:40
const VString_t & getLvl1Labels() const
MEbinning ls_binning_
Definition: PSMonitor.cc:58
void PSMonitor::dqmAnalyze ( edm::Event const &  event,
edm::EventSetup const &  setup,
Histograms const &  histograms 
) const
overrideprotected

Definition at line 122 of file PSMonitor.cc.

References BXVector< T >::at(), BXVector< T >::isEmpty(), edm::HandleBase::isValid(), eostools::ls(), HLT_2018_cff::psColumn, and ugtBXToken_.

122  {
123  int ls = event.id().luminosityBlock();
124  int psColumn = -1;
125 
127  event.getByToken(ugtBXToken_, ugtBXhandle);
128  if (ugtBXhandle.isValid() and not ugtBXhandle->isEmpty(0)) {
129  psColumn = ugtBXhandle->at(0, 0).getPreScColumn();
130  }
131  histograms.psColumnIndexVsLS->Fill(ls, psColumn);
132 }
edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugtBXToken_
Definition: PSMonitor.cc:55
bool isEmpty(int bx) const
bool isValid() const
Definition: HandleBase.h:70
def ls(path, rec=False)
Definition: eostools.py:349
const T & at(int bx, unsigned i) const
void PSMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 138 of file PSMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, fillHistoPSetDescription(), LumiMonitor_cff::histoPSet, HLT_2018_cff::InputTag, LumiMonitor_cff::lsPSet, and AlCaHLTBitMon_QueryRunRegistry::string.

138  {
140  desc.add<edm::InputTag>("ugtBXInputTag", edm::InputTag("hltGtStage2Digis"));
141  desc.add<std::string>("FolderName", "HLT/PSMonitoring");
142 
144 
145  edm::ParameterSetDescription psColumnPSet;
146  fillHistoPSetDescription(psColumnPSet, 8);
147  histoPSet.add<edm::ParameterSetDescription>("psColumnPSet", psColumnPSet);
148 
150  fillHistoPSetDescription(lsPSet, 2500);
151  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
152 
153  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
154 
155  descriptions.add("psMonitoring", desc);
156 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset, int value)
Definition: PSMonitor.cc:134
void PSMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset,
int  value 
)
static

Definition at line 134 of file PSMonitor.cc.

References edm::ParameterSetDescription::add(), and relativeConstraints::value.

Referenced by fillDescriptions().

134  {
135  pset.add<int>("nbins", value);
136 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void PSMonitor::getHistoPSet ( edm::ParameterSet pset,
MEbinning mebinning 
)
private

Definition at line 76 of file PSMonitor.cc.

References edm::ParameterSet::getParameter().

Referenced by PSMonitor().

76  {
77  mebinning.nbins = pset.getParameter<int32_t>("nbins");
78  mebinning.xmin = 0.;
79  mebinning.xmax = double(pset.getParameter<int32_t>("nbins"));
80 }
T getParameter(std::string const &) const

Member Data Documentation

std::string PSMonitor::folderName_
private

Definition at line 53 of file PSMonitor.cc.

Referenced by bookHistograms().

MEbinning PSMonitor::ls_binning_
private

Definition at line 58 of file PSMonitor.cc.

Referenced by bookHistograms(), and PSMonitor().

MEbinning PSMonitor::ps_binning_
private

Definition at line 57 of file PSMonitor.cc.

Referenced by bookHistograms(), and PSMonitor().

edm::EDGetTokenT<GlobalAlgBlkBxCollection> PSMonitor::ugtBXToken_
private

Definition at line 55 of file PSMonitor.cc.

Referenced by dqmAnalyze().