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

#include <PSMonitor.h>

Inheritance diagram for PSMonitor:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 PSMonitor (const edm::ParameterSet &)
 
 ~PSMonitor () override=default
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::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
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
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
 
- 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 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_
 
MonitorElementpsColumnIndexVsLS_
 
edm::service::PrescaleServicepsService_
 Prescale service. More...
 
edm::EDGetTokenT< GlobalAlgBlkBxCollectionugtBXToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 45 of file PSMonitor.h.

Constructor & Destructor Documentation

PSMonitor::PSMonitor ( const edm::ParameterSet iConfig)

Prescale service

Definition at line 12 of file PSMonitor.cc.

References getHistoPSet(), edm::ParameterSet::getParameter(), ls_binning_, Utilities::operator, ps_binning_, psColumnIndexVsLS_, and psService_.

12  :
13  folderName_ ( iConfig.getParameter<std::string>("FolderName") )
14  , ugtBXToken_ ( consumes<GlobalAlgBlkBxCollection>(iConfig.getParameter<edm::InputTag>("ugtBXInputTag") ) )
15 {
16 
18  if ( edm::Service<edm::service::PrescaleService>().isAvailable() )
20 
21  psColumnIndexVsLS_ = nullptr;
22 
23  edm::ParameterSet histoPSet = iConfig.getParameter<edm::ParameterSet>("histoPSet");
24  edm::ParameterSet psColumnPSet = histoPSet.getParameter<edm::ParameterSet>("psColumnPSet");
25  edm::ParameterSet lsPSet = histoPSet.getParameter<edm::ParameterSet>("lsPSet");
26 
27  getHistoPSet(psColumnPSet, ps_binning_);
28  getHistoPSet(lsPSet, ls_binning_);
29 
30 }
T getParameter(std::string const &) const
std::string folderName_
Definition: PSMonitor.h:62
edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugtBXToken_
Definition: PSMonitor.h:64
void getHistoPSet(edm::ParameterSet &pset, MEbinning &mebinning)
Definition: PSMonitor.cc:32
MEbinning ps_binning_
Definition: PSMonitor.h:71
MonitorElement * psColumnIndexVsLS_
Definition: PSMonitor.h:69
edm::service::PrescaleService * psService_
Prescale service.
Definition: PSMonitor.h:67
MEbinning ls_binning_
Definition: PSMonitor.h:72
PSMonitor::~PSMonitor ( )
overridedefault

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 70 of file PSMonitor.cc.

References BXVector< T >::at(), MonitorElement::Fill(), edm::Event::getByToken(), GlobalAlgBlk::getPreScColumn(), edm::EventBase::id(), BXVector< T >::isEmpty(), edm::HandleBase::isValid(), eostools::ls(), edm::EventID::luminosityBlock(), psColumnIndexVsLS_, and ugtBXToken_.

70  {
71 
72  int ls = iEvent.id().luminosityBlock();
73 
74  int psColumn = -1;
75 
77  iEvent.getByToken(ugtBXToken_, ugtBXhandle);
78  if (ugtBXhandle.isValid() and not ugtBXhandle->isEmpty(0))
79  psColumn = ugtBXhandle->at(0, 0).getPreScColumn();
80 
81  psColumnIndexVsLS_->Fill(ls, psColumn);
82 
83 }
edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugtBXToken_
Definition: PSMonitor.h:64
bool isEmpty(int bx) const
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:230
const int getPreScColumn() const
Definition: GlobalAlgBlk.h:70
MonitorElement * psColumnIndexVsLS_
Definition: PSMonitor.h:69
bool isValid() const
Definition: HandleBase.h:74
def ls(path, rec=False)
Definition: eostools.py:348
const T & at(int bx, unsigned i) const
void PSMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 40 of file PSMonitor.cc.

References DQMStore::IBooker::book2D(), folderName_, edm::service::PrescaleService::getLvl1Labels(), checklumidiff::l, ls_binning_, MEbinning::nbins, pileupCalc::nbins, ps_binning_, psColumnIndexVsLS_, psService_, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TrackerOfflineValidation_Dqm_cff::xmax, MEbinning::xmax, TrackerOfflineValidation_Dqm_cff::xmin, and MEbinning::xmin.

43 {
44 
45  std::string histname, histtitle;
46 
47  std::string currentFolder = folderName_ ;
48  ibooker.setCurrentFolder(currentFolder);
49 
50  std::vector<std::string> psLabels = psService_->getLvl1Labels();
51  int nbins = ( !psLabels.empty() ? psLabels.size() : ps_binning_.nbins );
52  double xmin = ( !psLabels.empty() ? 0. : ps_binning_.xmin );
53  double xmax = ( !psLabels.empty() ? double(psLabels.size()) : ps_binning_.xmax );
54 
55  histname = "psColumnIndexVsLS"; histtitle = "PS column index vs LS";
56  psColumnIndexVsLS_ = ibooker.book2D(histname, histtitle,
58  nbins, xmin, xmax);
60  psColumnIndexVsLS_->setAxisTitle("PS column index",2);
61 
62  int ibin = 1;
63  for ( auto l : psLabels ) {
65  ibin++;
66  }
67 
68 }
std::string folderName_
Definition: PSMonitor.h:62
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MEbinning ps_binning_
Definition: PSMonitor.h:71
double xmin
Definition: LumiMonitor.h:30
MonitorElement * psColumnIndexVsLS_
Definition: PSMonitor.h:69
edm::service::PrescaleService * psService_
Prescale service.
Definition: PSMonitor.h:67
const VString_t & getLvl1Labels() const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
double xmax
Definition: LumiMonitor.h:31
MEbinning ls_binning_
Definition: PSMonitor.h:72
void PSMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 90 of file PSMonitor.cc.

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

91 {
93  desc.add<edm::InputTag>( "ugtBXInputTag", edm::InputTag("hltGtStage2Digis") );
94  desc.add<std::string> ( "FolderName", "HLT/PSMonitoring" );
95 
97 
98  edm::ParameterSetDescription psColumnPSet;
99  fillHistoPSetDescription(psColumnPSet,8);
100  histoPSet.add<edm::ParameterSetDescription>("psColumnPSet", psColumnPSet);
101 
103  fillHistoPSetDescription(lsPSet,2500);
104  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
105 
106  desc.add<edm::ParameterSetDescription>("histoPSet",histoPSet);
107 
108  descriptions.add("psMonitoring", desc);
109 }
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:85
void PSMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset,
int  value 
)
static

Definition at line 85 of file PSMonitor.cc.

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

Referenced by fillDescriptions().

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

Definition at line 32 of file PSMonitor.cc.

References edm::ParameterSet::getParameter(), MEbinning::nbins, MEbinning::xmax, and MEbinning::xmin.

Referenced by PSMonitor().

33 {
34  mebinning.nbins = pset.getParameter<int32_t>("nbins");
35  mebinning.xmin = 0.;
36  mebinning.xmax = double(pset.getParameter<int32_t>("nbins"));
37 }
T getParameter(std::string const &) const
double xmin
Definition: LumiMonitor.h:30
double xmax
Definition: LumiMonitor.h:31

Member Data Documentation

std::string PSMonitor::folderName_
private

Definition at line 62 of file PSMonitor.h.

Referenced by bookHistograms().

MEbinning PSMonitor::ls_binning_
private

Definition at line 72 of file PSMonitor.h.

Referenced by bookHistograms(), and PSMonitor().

MEbinning PSMonitor::ps_binning_
private

Definition at line 71 of file PSMonitor.h.

Referenced by bookHistograms(), and PSMonitor().

MonitorElement* PSMonitor::psColumnIndexVsLS_
private

Definition at line 69 of file PSMonitor.h.

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

edm::service::PrescaleService* PSMonitor::psService_
private

Prescale service.

Definition at line 67 of file PSMonitor.h.

Referenced by bookHistograms(), and PSMonitor().

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

Definition at line 64 of file PSMonitor.h.

Referenced by analyze().