CMS 3D CMS Logo

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

#include <EcalMonitorPrescaler.h>

Inheritance diagram for EcalMonitorPrescaler:
edm::global::EDFilter< edm::RunCache< ecaldqm::PrescaleCounter > > edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EcalMonitorPrescaler (edm::ParameterSet const &)
 
bool filter (edm::StreamID, edm::Event &, edm::EventSetup const &) const override
 
std::shared_ptr< ecaldqm::PrescaleCounterglobalBeginRun (edm::Run const &, edm::EventSetup const &) const override
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const override
 
 ~EcalMonitorPrescaler () override
 
- Public Member Functions inherited from edm::global::EDFilter< edm::RunCache< ecaldqm::PrescaleCounter > >
 EDFilter ()=default
 
 EDFilter (const EDFilter &)=delete
 
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 EDFilteroperator= (const EDFilter &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept final
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< EcalRawDataCollectionEcalRawDataCollection_
 
unsigned prescalers_ [ecaldqm::nPrescalers]
 

Static Private Attributes

static const uint32_t filterBits_ [ecaldqm::nPrescalers]
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 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)
 

Detailed Description

Definition at line 22 of file EcalMonitorPrescaler.h.

Constructor & Destructor Documentation

◆ EcalMonitorPrescaler()

EcalMonitorPrescaler::EcalMonitorPrescaler ( edm::ParameterSet const &  _ps)

Definition at line 29 of file EcalMonitorPrescaler.cc.

References edm::ParameterSet::getUntrackedParameter(), ecaldqm::kCalibration, ecaldqm::kCosmics, ecaldqm::kLaser, ecaldqm::kLed, ecaldqm::kPedestal, ecaldqm::kPhysics, ecaldqm::kTestPulse, SiStripPI::min, and prescalers_.

31  consumes<EcalRawDataCollection>(_ps.getParameter<edm::InputTag>("EcalRawDataCollection"))) {
32  prescalers_[ecaldqm::kPhysics] = _ps.getUntrackedParameter<unsigned>("physics", -1);
33  prescalers_[ecaldqm::kCosmics] = _ps.getUntrackedParameter<unsigned>("cosmics", -1);
34  prescalers_[ecaldqm::kCalibration] = _ps.getUntrackedParameter<unsigned>("calibration", -1);
35  prescalers_[ecaldqm::kLaser] = _ps.getUntrackedParameter<unsigned>("laser", -1);
36  prescalers_[ecaldqm::kLed] = _ps.getUntrackedParameter<unsigned>("led", -1);
37  prescalers_[ecaldqm::kTestPulse] = _ps.getUntrackedParameter<unsigned>("testPulse", -1);
38  prescalers_[ecaldqm::kPedestal] = _ps.getUntrackedParameter<unsigned>("pedestal", -1);
39 
40  // Backward compatibility
42  prescalers_[ecaldqm::kPhysics], (unsigned int)(_ps.getUntrackedParameter<int>("occupancyPrescaleFactor", -1)));
44  prescalers_[ecaldqm::kPhysics], (unsigned int)(_ps.getUntrackedParameter<int>("integrityPrescaleFactor", -1)));
46  (unsigned int)(_ps.getUntrackedParameter<int>("cosmicPrescaleFactor", -1)));
48  std::min(prescalers_[ecaldqm::kLaser], (unsigned int)(_ps.getUntrackedParameter<int>("laserPrescaleFactor", -1)));
50  std::min(prescalers_[ecaldqm::kLed], (unsigned int)(_ps.getUntrackedParameter<int>("ledPrescaleFactor", -1)));
52  prescalers_[ecaldqm::kPedestal], (unsigned int)(_ps.getUntrackedParameter<int>("pedestalPrescaleFactor", -1)));
55  (unsigned int)(_ps.getUntrackedParameter<int>("pedestalonlinePrescaleFactor", -1)));
57  prescalers_[ecaldqm::kTestPulse], (unsigned int)(_ps.getUntrackedParameter<int>("testpulsePrescaleFactor", -1)));
60  (unsigned int)(_ps.getUntrackedParameter<int>("pedestaloffsetPrescaleFactor", -1)));
62  prescalers_[ecaldqm::kPhysics], (unsigned int)(_ps.getUntrackedParameter<int>("triggertowerPrescaleFactor", -1)));
64  (unsigned int)(_ps.getUntrackedParameter<int>("timingPrescaleFactor", -1)));
66  prescalers_[ecaldqm::kPhysics], (unsigned int)(_ps.getUntrackedParameter<int>("physicsPrescaleFactor", -1)));
68  prescalers_[ecaldqm::kPhysics], (unsigned int)(_ps.getUntrackedParameter<int>("clusterPrescaleFactor", -1)));
69 }
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
unsigned prescalers_[ecaldqm::nPrescalers]

◆ ~EcalMonitorPrescaler()

EcalMonitorPrescaler::~EcalMonitorPrescaler ( )
override

Definition at line 71 of file EcalMonitorPrescaler.cc.

71 {}

Member Function Documentation

◆ filter()

bool EcalMonitorPrescaler::filter ( edm::StreamID  ,
edm::Event _event,
edm::EventSetup const &   
) const
overridevirtual

Implements edm::global::EDFilterBase.

Definition at line 78 of file EcalMonitorPrescaler.cc.

References edm::SortedCollection< T, SORT >::begin(), EcalRawDataCollection_, edm::SortedCollection< T, SORT >::end(), filterBits_, edm::Event::getByToken(), edm::Event::getRun(), edm::Run::index(), ecaldqm::nPrescalers, and prescalers_.

78  {
80 
81  if (!_event.getByToken(EcalRawDataCollection_, dcchs)) {
82  edm::LogWarning("EcalMonitorPrescaler") << "EcalRawDataCollection not available";
83  return false;
84  }
85 
86  uint32_t eventBits(0);
87  for (EcalRawDataCollection::const_iterator dcchItr(dcchs->begin()); dcchItr != dcchs->end(); ++dcchItr)
88  eventBits |= (1 << dcchItr->getRunType());
89 
90  for (unsigned iP(0); iP != ecaldqm::nPrescalers; ++iP) {
91  if ((eventBits & filterBits_[iP]) != 0 &&
92  ++(runCache(_event.getRun().index())->counters_[iP]) % prescalers_[iP] == 0)
93  return true;
94  }
95 
96  return false;
97 }
std::vector< T >::const_iterator const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
Run const & getRun() const
Definition: Event.cc:112
const_iterator begin() const
const_iterator end() const
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
RunIndex index() const
Definition: Run.cc:28
unsigned prescalers_[ecaldqm::nPrescalers]
Log< level::Warning, false > LogWarning
static const uint32_t filterBits_[ecaldqm::nPrescalers]

◆ globalBeginRun()

std::shared_ptr< ecaldqm::PrescaleCounter > EcalMonitorPrescaler::globalBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
) const
override

Definition at line 73 of file EcalMonitorPrescaler.cc.

74  {
75  return std::make_shared<ecaldqm::PrescaleCounter>();
76 }

◆ globalEndRun()

void EcalMonitorPrescaler::globalEndRun ( edm::Run const &  ,
edm::EventSetup const &   
) const
override

Definition at line 99 of file EcalMonitorPrescaler.cc.

99 {}

Member Data Documentation

◆ EcalRawDataCollection_

edm::EDGetTokenT<EcalRawDataCollection> EcalMonitorPrescaler::EcalRawDataCollection_
private

Definition at line 34 of file EcalMonitorPrescaler.h.

Referenced by filter().

◆ filterBits_

const uint32_t EcalMonitorPrescaler::filterBits_
staticprivate

◆ prescalers_

unsigned EcalMonitorPrescaler::prescalers_[ecaldqm::nPrescalers]
private

Definition at line 36 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().