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::ConcurrentBooker &, 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 edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 37 of file PSMonitor.cc.

Constructor & Destructor Documentation

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

Definition at line 63 of file PSMonitor.cc.

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

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

Member Function Documentation

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

Implements DQMGlobalEDAnalyzer< Histograms >.

Definition at line 80 of file PSMonitor.cc.

References stringResolutionProvider_cfi::bin, DQMStore::ConcurrentBooker::book2D(), folderName_, edm::service::PrescaleService::getLvl1Labels(), edm::Service< T >::isAvailable(), checklumidiff::l, tablePrinter::labels, ls_binning_, pileupCalc::nbins, ps_binning_, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

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

Definition at line 119 of file PSMonitor.cc.

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

119  {
120  int ls = event.id().luminosityBlock();
121  int psColumn = -1;
122 
124  event.getByToken(ugtBXToken_, ugtBXhandle);
125  if (ugtBXhandle.isValid() and not ugtBXhandle->isEmpty(0)) {
126  psColumn = ugtBXhandle->at(0, 0).getPreScColumn();
127  }
128  histograms.psColumnIndexVsLS.fill(ls, psColumn);
129 }
edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugtBXToken_
Definition: PSMonitor.cc:53
bool isEmpty(int bx) const
bool isValid() const
Definition: HandleBase.h:74
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 135 of file PSMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, fillHistoPSetDescription(), and AlCaHLTBitMon_QueryRunRegistry::string.

135  {
137  desc.add<edm::InputTag>("ugtBXInputTag", edm::InputTag("hltGtStage2Digis"));
138  desc.add<std::string>("FolderName", "HLT/PSMonitoring");
139 
141 
142  edm::ParameterSetDescription psColumnPSet;
143  fillHistoPSetDescription(psColumnPSet, 8);
144  histoPSet.add<edm::ParameterSetDescription>("psColumnPSet", psColumnPSet);
145 
147  fillHistoPSetDescription(lsPSet, 2500);
148  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
149 
150  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
151 
152  descriptions.add("psMonitoring", desc);
153 }
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:131
void PSMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset,
int  value 
)
static

Definition at line 131 of file PSMonitor.cc.

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

Referenced by fillDescriptions().

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

Definition at line 74 of file PSMonitor.cc.

References edm::ParameterSet::getParameter().

Referenced by PSMonitor().

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

Member Data Documentation

std::string PSMonitor::folderName_
private

Definition at line 51 of file PSMonitor.cc.

Referenced by bookHistograms().

MEbinning PSMonitor::ls_binning_
private

Definition at line 56 of file PSMonitor.cc.

Referenced by bookHistograms(), and PSMonitor().

MEbinning PSMonitor::ps_binning_
private

Definition at line 55 of file PSMonitor.cc.

Referenced by bookHistograms(), and PSMonitor().

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

Definition at line 53 of file PSMonitor.cc.

Referenced by dqmAnalyze().