CMS 3D CMS Logo

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

#include <RPCDataCertification.h>

Inheritance diagram for RPCDataCertification:
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

 RPCDataCertification (const edm::ParameterSet &pset)
 
 ~RPCDataCertification () 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 checkFED (edm::EventSetup const &)
 
void myBooker (DQMStore::IBooker &)
 

Private Attributes

MonitorElementcertDiskFractions [nDisks_]
 
MonitorElementCertMap_
 
MonitorElementcertWheelFractions [nWheels_]
 
double defaultValue_
 
std::pair< int, int > FEDRange_
 
bool init_
 
int numberOfDisks_
 
int NumberOfFeds_
 
bool offlineDQM_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 
MonitorElementtotalCertFraction
 

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 RPCDataCertification.h.

Constructor & Destructor Documentation

◆ RPCDataCertification()

RPCDataCertification::RPCDataCertification ( const edm::ParameterSet pset)

Definition at line 10 of file RPCDataCertification.cc.

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

10  {
11  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
12  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
13  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
14  NumberOfFeds_ = FEDRange_.second - FEDRange_.first + 1;
15  offlineDQM_ = ps.getUntrackedParameter<bool>("OfflineDQM", true);
16 
17  runInfoToken_ = esConsumes<edm::Transition::EndLuminosityBlock>();
18 
19  init_ = false;
20  defaultValue_ = 1.;
21 }
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
std::pair< int, int > FEDRange_

◆ ~RPCDataCertification()

RPCDataCertification::~RPCDataCertification ( )
overridedefault

Member Function Documentation

◆ beginJob()

void RPCDataCertification::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 23 of file RPCDataCertification.cc.

23 {}

◆ checkFED()

void RPCDataCertification::checkFED ( edm::EventSetup const &  setup)
private

Definition at line 44 of file RPCDataCertification.cc.

References hltPixelClustersMultiplicity_cfi::defaultValue, defaultValue_, f, FEDRange_, RemoveAddSevLevel::flag, init_, runInfoToken_, and singleTopDQM_cfi::setup.

Referenced by dqmEndLuminosityBlock().

44  {
45  double defaultValue = 1.;
46 
47  if (auto runInfoRec = setup.tryToGet<RunInfoRcd>()) {
48  defaultValue = -1;
49  //get fed summary information
50  auto sumFED = runInfoRec->get(runInfoToken_);
51  const std::vector<int> FedsInIds = sumFED.m_fed_in;
52  unsigned int f = 0;
53  bool flag = false;
54  while (!flag && f < FedsInIds.size()) {
55  int fedID = FedsInIds[f];
56  //make sure fed id is in allowed range
57  if (fedID >= FEDRange_.first && fedID <= FEDRange_.second) {
58  defaultValue = 1;
59  flag = true;
60  }
61  f++;
62  }
63  }
64 
66 
67  init_ = true;
68 }
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
std::pair< int, int > FEDRange_
double f[11][100]

◆ dqmEndJob()

void RPCDataCertification::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 38 of file RPCDataCertification.cc.

References myBooker(), and offlineDQM_.

38  {
39  if (offlineDQM_) {
40  this->myBooker(ibooker);
41  }
42 }
void myBooker(DQMStore::IBooker &)

◆ dqmEndLuminosityBlock()

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

Reimplemented from DQMEDHarvester.

Definition at line 25 of file RPCDataCertification.cc.

References checkFED(), init_, myBooker(), and offlineDQM_.

28  {
29  if (!init_) {
30  this->checkFED(setup);
31 
32  if (!offlineDQM_) {
33  this->myBooker(ibooker);
34  }
35  }
36 }
void myBooker(DQMStore::IBooker &)
void checkFED(edm::EventSetup const &)

◆ myBooker()

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

Definition at line 70 of file RPCDataCertification.cc.

References RPCSummaryMapHisto::book(), dqm::implementation::IBooker::bookFloat(), certDiskFractions, CertMap_, certWheelFractions, defaultValue_, dqm::impl::MonitorElement::Fill(), dqm-mbProfile::format, mps_fire::i, remoteMonitoring_LASER_era2018_cfg::limit, SiStripPI::max, nDisks_, numberOfDisks_, nWheels_, RPCSummaryMapHisto::setBinsBarrel(), RPCSummaryMapHisto::setBinsEndcap(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and totalCertFraction.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

70  {
71  ibooker.setCurrentFolder("RPC/EventInfo");
72  // global fraction
73  totalCertFraction = ibooker.bookFloat("CertificationSummary");
75 
76  CertMap_ = RPCSummaryMapHisto::book(ibooker, "CertificationSummaryMap", "RPC Certification Summary Map");
77 
78  //fill the histo with "1" --- just for the moment
81 
82  // book the ME
83  ibooker.setCurrentFolder("RPC/EventInfo/CertificationContents");
84 
85  const int limit = std::max(2, numberOfDisks_);
86 
87  for (int i = -limit; i <= limit; ++i) { //loop on wheels and disks
88  if (i > -3 && i < nWheels_ - 2) { //wheels
89  const std::string binLabel = fmt::format("RPC_Wheel{}", i);
90  certWheelFractions[i + 2] = ibooker.bookFloat(binLabel);
92  }
93 
94  if (i == 0 || i > numberOfDisks_ || i < (-numberOfDisks_))
95  continue;
96 
97  if (i > -3 && i < nDisks_ - 2) {
98  const std::string binLabel = fmt::format("RPC_Disk{}", i);
99  certDiskFractions[i + 2] = ibooker.bookFloat(binLabel);
101  }
102  }
103 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
static void setBinsEndcap(MonitorElement *me, const double value)
void Fill(long long x)
MonitorElement * CertMap_
MonitorElement * totalCertFraction
static constexpr int nWheels_
static MonitorElement * book(IBooker &booker, const std::string &name, const std::string &title)
MonitorElement * certWheelFractions[nWheels_]
MonitorElement * certDiskFractions[nDisks_]
static void setBinsBarrel(MonitorElement *me, const double value)
static constexpr int nDisks_

Member Data Documentation

◆ certDiskFractions

MonitorElement* RPCDataCertification::certDiskFractions[nDisks_]
private

Definition at line 35 of file RPCDataCertification.h.

Referenced by myBooker().

◆ CertMap_

MonitorElement* RPCDataCertification::CertMap_
private

Definition at line 30 of file RPCDataCertification.h.

Referenced by myBooker().

◆ certWheelFractions

MonitorElement* RPCDataCertification::certWheelFractions[nWheels_]
private

Definition at line 33 of file RPCDataCertification.h.

Referenced by myBooker().

◆ defaultValue_

double RPCDataCertification::defaultValue_
private

Definition at line 40 of file RPCDataCertification.h.

Referenced by checkFED(), myBooker(), and RPCDataCertification().

◆ FEDRange_

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

Definition at line 36 of file RPCDataCertification.h.

Referenced by checkFED(), and RPCDataCertification().

◆ init_

bool RPCDataCertification::init_
private

Definition at line 39 of file RPCDataCertification.h.

Referenced by checkFED(), dqmEndLuminosityBlock(), and RPCDataCertification().

◆ nDisks_

constexpr int RPCDataCertification::nDisks_ = 10
staticprivate

Definition at line 34 of file RPCDataCertification.h.

Referenced by myBooker().

◆ numberOfDisks_

int RPCDataCertification::numberOfDisks_
private

Definition at line 37 of file RPCDataCertification.h.

Referenced by myBooker(), and RPCDataCertification().

◆ NumberOfFeds_

int RPCDataCertification::NumberOfFeds_
private

Definition at line 38 of file RPCDataCertification.h.

Referenced by RPCDataCertification().

◆ nWheels_

constexpr int RPCDataCertification::nWheels_ = 5
staticprivate

Definition at line 32 of file RPCDataCertification.h.

Referenced by myBooker().

◆ offlineDQM_

bool RPCDataCertification::offlineDQM_
private

Definition at line 39 of file RPCDataCertification.h.

Referenced by dqmEndJob(), dqmEndLuminosityBlock(), and RPCDataCertification().

◆ runInfoToken_

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

Definition at line 28 of file RPCDataCertification.h.

Referenced by checkFED(), and RPCDataCertification().

◆ totalCertFraction

MonitorElement* RPCDataCertification::totalCertFraction
private

Definition at line 31 of file RPCDataCertification.h.

Referenced by myBooker().