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 > > 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 > >
 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
 
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)
 
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 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 68 of file PSMonitor.cc.

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

68  :
69  folderName_ (config.getParameter<std::string>("FolderName"))
70  , ugtBXToken_ (consumes<GlobalAlgBlkBxCollection>(config.getParameter<edm::InputTag>("ugtBXInputTag")))
71 {
72  edm::ParameterSet histoPSet = config.getParameter<edm::ParameterSet>("histoPSet");
73  edm::ParameterSet psColumnPSet = histoPSet.getParameter<edm::ParameterSet>("psColumnPSet");
74  edm::ParameterSet lsPSet = histoPSet.getParameter<edm::ParameterSet>("lsPSet");
75 
76  getHistoPSet(psColumnPSet, ps_binning_);
77  getHistoPSet(lsPSet, ls_binning_);
78 
79 }
T getParameter(std::string const &) const
std::string folderName_
Definition: PSMonitor.cc:54
edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugtBXToken_
Definition: PSMonitor.cc:56
void getHistoPSet(edm::ParameterSet &pset, MEbinning &mebinning)
Definition: PSMonitor.cc:81
MEbinning ps_binning_
Definition: PSMonitor.cc:58
MEbinning ls_binning_
Definition: PSMonitor.cc:59
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 89 of file PSMonitor.cc.

References DQMStore::ConcurrentBooker::book2D(), folderName_, checklumidiff::l, ls_binning_, pileupCalc::nbins, ps_binning_, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

90 {
91 
92  std::string histname, histtitle;
93 
94  std::string currentFolder = folderName_ ;
95  booker.setCurrentFolder(currentFolder);
96 
97  std::vector<std::string> const& psLabels = edm::Service<edm::service::PrescaleService>()->getLvl1Labels();
98  int nbins = ( !psLabels.empty() ? psLabels.size() : ps_binning_.nbins );
99  double xmin = ( !psLabels.empty() ? 0. : ps_binning_.xmin );
100  double xmax = ( !psLabels.empty() ? double(psLabels.size()) : ps_binning_.xmax );
101 
102  histname = "psColumnIndexVsLS"; histtitle = "PS column index vs LS";
103  histograms.psColumnIndexVsLS = booker.book2D(histname, histtitle,
104  ls_binning_.nbins, ls_binning_.xmin, ls_binning_.xmax,
105  nbins, xmin, xmax);
106  histograms.psColumnIndexVsLS.setAxisTitle("LS", 1);
107  histograms.psColumnIndexVsLS.setAxisTitle("PS column index", 2);
108 
109  int ibin = 1;
110  for ( auto l : psLabels ) {
111  histograms.psColumnIndexVsLS.setBinLabel(ibin, l, 2);
112  ibin++;
113  }
114 
115 }
std::string folderName_
Definition: PSMonitor.cc:54
ConcurrentMonitorElement book2D(Args &&...args)
Definition: DQMStore.h:244
MEbinning ps_binning_
Definition: PSMonitor.cc:58
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MEbinning ls_binning_
Definition: PSMonitor.cc:59
void PSMonitor::dqmAnalyze ( edm::Event const &  event,
edm::EventSetup const &  setup,
Histograms const &  histograms 
) const
overrideprotected

Definition at line 117 of file PSMonitor.cc.

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

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

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

Definition at line 130 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 81 of file PSMonitor.cc.

References edm::ParameterSet::getParameter().

Referenced by PSMonitor().

82 {
83  mebinning.nbins = pset.getParameter<int32_t>("nbins");
84  mebinning.xmin = 0.;
85  mebinning.xmax = double(pset.getParameter<int32_t>("nbins"));
86 }
T getParameter(std::string const &) const

Member Data Documentation

std::string PSMonitor::folderName_
private

Definition at line 54 of file PSMonitor.cc.

Referenced by bookHistograms().

MEbinning PSMonitor::ls_binning_
private

Definition at line 59 of file PSMonitor.cc.

Referenced by bookHistograms(), and PSMonitor().

MEbinning PSMonitor::ps_binning_
private

Definition at line 58 of file PSMonitor.cc.

Referenced by bookHistograms(), and PSMonitor().

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

Definition at line 56 of file PSMonitor.cc.

Referenced by dqmAnalyze().