CMS 3D CMS Logo

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

#include <RPCDaqInfo.h>

Inheritance diagram for RPCDaqInfo:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 RPCDaqInfo (const edm::ParameterSet &)
 
 ~RPCDaqInfo () override=default
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginJob () override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Member Functions

void myBooker (DQMStore::IBooker &)
 

Private Attributes

MonitorElementdaqDiskFractions [nDisks_]
 
MonitorElementDaqFraction_
 
MonitorElementDaqMap_
 
MonitorElementdaqWheelFractions [nWheels_]
 
std::pair< int, int > FEDRange_
 
bool init_
 
int numberOfDisks_
 
int NumberOfFeds_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 

Static Private Attributes

static constexpr int nDisks_ = 10
 
static constexpr int nWheels_ = 5
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::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
 
- 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 Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 11 of file RPCDaqInfo.h.

Constructor & Destructor Documentation

◆ RPCDaqInfo()

RPCDaqInfo::RPCDaqInfo ( const edm::ParameterSet ps)
explicit

Definition at line 11 of file RPCDaqInfo.cc.

References FEDRange_, edm::ParameterSet::getUntrackedParameter(), init_, numberOfDisks_, NumberOfFeds_, and runInfoToken_.

11  {
12  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
13  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
14 
15  NumberOfFeds_ = FEDRange_.second - FEDRange_.first + 1;
16 
17  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
18 
19  runInfoToken_ = esConsumes<edm::Transition::EndLuminosityBlock>();
20 
21  init_ = false;
22 }
bool init_
Definition: RPCDaqInfo.h:29
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: RPCDaqInfo.h:27
T getUntrackedParameter(std::string const &, T const &) const
std::pair< int, int > FEDRange_
Definition: RPCDaqInfo.h:38
int numberOfDisks_
Definition: RPCDaqInfo.h:40
int NumberOfFeds_
Definition: RPCDaqInfo.h:40

◆ ~RPCDaqInfo()

RPCDaqInfo::~RPCDaqInfo ( )
overridedefault

Member Function Documentation

◆ beginJob()

void RPCDaqInfo::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 24 of file RPCDaqInfo.cc.

24 {}

◆ dqmEndJob()

void RPCDaqInfo::dqmEndJob ( DQMStore::IBooker ,
DQMStore::IGetter  
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 59 of file RPCDaqInfo.cc.

59 {}

◆ dqmEndLuminosityBlock()

void RPCDaqInfo::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  LB,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 25 of file RPCDaqInfo.cc.

References DaqFraction_, FEDRange_, dqm::impl::MonitorElement::Fill(), init_, myBooker(), NumberOfFeds_, runInfoToken_, and edm::EventSetup::tryToGet().

28  {
29  if (!init_) {
30  this->myBooker(ibooker);
31  }
32 
33  if (auto runInfoRec = iSetup.tryToGet<RunInfoRcd>()) {
34  //get fed summary information
35  auto sumFED = runInfoRec->get(runInfoToken_);
36  const std::vector<int> FedsInIds = sumFED.m_fed_in;
37 
38  int FedCount = 0;
39 
40  //loop on all active feds
41  for (const int fedID : FedsInIds) {
42  //make sure fed id is in allowed range
43  if (fedID >= FEDRange_.first && fedID <= FEDRange_.second)
44  ++FedCount;
45  }
46 
47  //Fill active fed fraction ME
48  if (NumberOfFeds_ > 0)
49  DaqFraction_->Fill(FedCount / NumberOfFeds_);
50  else
51  DaqFraction_->Fill(-1);
52 
53  } else {
54  DaqFraction_->Fill(-1);
55  return;
56  }
57 }
bool init_
Definition: RPCDaqInfo.h:29
MonitorElement * DaqFraction_
Definition: RPCDaqInfo.h:31
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: RPCDaqInfo.h:27
void Fill(long long x)
std::pair< int, int > FEDRange_
Definition: RPCDaqInfo.h:38
void myBooker(DQMStore::IBooker &)
Definition: RPCDaqInfo.cc:61
int NumberOfFeds_
Definition: RPCDaqInfo.h:40

◆ myBooker()

void RPCDaqInfo::myBooker ( DQMStore::IBooker ibooker)
private

Definition at line 61 of file RPCDaqInfo.cc.

References RPCSummaryMapHisto::book(), dqm::implementation::IBooker::bookFloat(), daqDiskFractions, DaqFraction_, DaqMap_, daqWheelFractions, dqm::impl::MonitorElement::Fill(), dqm-mbProfile::format, mps_fire::i, init_, remoteMonitoring_LASER_era2018_cfg::limit, SiStripPI::max, nDisks_, numberOfDisks_, nWheels_, RPCSummaryMapHisto::setBinsBarrel(), RPCSummaryMapHisto::setBinsEndcap(), dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmEndLuminosityBlock().

61  {
62  //fraction of alive FEDs
63  ibooker.setCurrentFolder("RPC/EventInfo/DAQContents");
64 
65  const int limit = std::max(2, numberOfDisks_);
66 
67  for (int i = -limit; i <= limit; ++i) { //loop on wheels and disks
68  if (i > -3 && i < nWheels_ - 2) { //wheels
69  const std::string meName = fmt::format("RPC_Wheel{}", i);
70  daqWheelFractions[i + 2] = ibooker.bookFloat(meName);
71  daqWheelFractions[i + 2]->Fill(-1);
72  }
73 
74  if (i == 0 || i > numberOfDisks_ || i < -numberOfDisks_)
75  continue;
76 
77  if (i > -3 && i < nDisks_ - 2) {
78  const std::string meName = fmt::format("RPC_Disk{}", i);
79  daqDiskFractions[i + 2] = ibooker.bookFloat(meName);
80  daqDiskFractions[i + 2]->Fill(-1);
81  }
82  }
83 
84  //daq summary for RPCs
85  ibooker.setCurrentFolder("RPC/EventInfo");
86 
87  DaqFraction_ = ibooker.bookFloat("DAQSummary");
88  DaqMap_ = RPCSummaryMapHisto::book(ibooker, "DAQSummaryMap", "RPC DAQ Summary Map");
91 
92  init_ = true;
93 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
bool init_
Definition: RPCDaqInfo.h:29
MonitorElement * daqWheelFractions[nWheels_]
Definition: RPCDaqInfo.h:34
static void setBinsEndcap(MonitorElement *me, const double value)
MonitorElement * DaqFraction_
Definition: RPCDaqInfo.h:31
static constexpr int nDisks_
Definition: RPCDaqInfo.h:35
MonitorElement * daqDiskFractions[nDisks_]
Definition: RPCDaqInfo.h:36
void Fill(long long x)
static MonitorElement * book(IBooker &booker, const std::string &name, const std::string &title)
static constexpr int nWheels_
Definition: RPCDaqInfo.h:33
MonitorElement * DaqMap_
Definition: RPCDaqInfo.h:32
static void setBinsBarrel(MonitorElement *me, const double value)
int numberOfDisks_
Definition: RPCDaqInfo.h:40

Member Data Documentation

◆ daqDiskFractions

MonitorElement* RPCDaqInfo::daqDiskFractions[nDisks_]
private

Definition at line 36 of file RPCDaqInfo.h.

Referenced by myBooker().

◆ DaqFraction_

MonitorElement* RPCDaqInfo::DaqFraction_
private

Definition at line 31 of file RPCDaqInfo.h.

Referenced by dqmEndLuminosityBlock(), and myBooker().

◆ DaqMap_

MonitorElement* RPCDaqInfo::DaqMap_
private

Definition at line 32 of file RPCDaqInfo.h.

Referenced by myBooker().

◆ daqWheelFractions

MonitorElement* RPCDaqInfo::daqWheelFractions[nWheels_]
private

Definition at line 34 of file RPCDaqInfo.h.

Referenced by myBooker().

◆ FEDRange_

std::pair<int, int> RPCDaqInfo::FEDRange_
private

Definition at line 38 of file RPCDaqInfo.h.

Referenced by dqmEndLuminosityBlock(), and RPCDaqInfo().

◆ init_

bool RPCDaqInfo::init_
private

Definition at line 29 of file RPCDaqInfo.h.

Referenced by dqmEndLuminosityBlock(), myBooker(), and RPCDaqInfo().

◆ nDisks_

constexpr int RPCDaqInfo::nDisks_ = 10
staticprivate

Definition at line 35 of file RPCDaqInfo.h.

Referenced by myBooker().

◆ numberOfDisks_

int RPCDaqInfo::numberOfDisks_
private

Definition at line 40 of file RPCDaqInfo.h.

Referenced by myBooker(), and RPCDaqInfo().

◆ NumberOfFeds_

int RPCDaqInfo::NumberOfFeds_
private

Definition at line 40 of file RPCDaqInfo.h.

Referenced by dqmEndLuminosityBlock(), and RPCDaqInfo().

◆ nWheels_

constexpr int RPCDaqInfo::nWheels_ = 5
staticprivate

Definition at line 33 of file RPCDaqInfo.h.

Referenced by myBooker().

◆ runInfoToken_

edm::ESGetToken<RunInfo, RunInfoRcd> RPCDaqInfo::runInfoToken_
private

Definition at line 27 of file RPCDaqInfo.h.

Referenced by dqmEndLuminosityBlock(), and RPCDaqInfo().