CMS 3D CMS Logo

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

#include <EcalMonitorPrescaler.h>

Inheritance diagram for EcalMonitorPrescaler:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 EcalMonitorPrescaler (edm::ParameterSet const &)
 
bool filter (edm::Event &, edm::EventSetup const &) override
 
 ~EcalMonitorPrescaler () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Private Types

enum  Prescalers {
  kPhysics, kCosmics, kCalibration, kLaser,
  kLed, kTestPulse, kPedestal, nPrescalers
}
 

Private Attributes

edm::EDGetTokenT< EcalRawDataCollectionEcalRawDataCollection_
 
std::pair< unsigned, unsigned > prescalers_ [nPrescalers]
 

Static Private Attributes

static uint32_t filterBits_ [nPrescalers]
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter 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::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 9 of file EcalMonitorPrescaler.h.

Member Enumeration Documentation

◆ Prescalers

Enumerator
kPhysics 
kCosmics 
kCalibration 
kLaser 
kLed 
kTestPulse 
kPedestal 
nPrescalers 

Definition at line 18 of file EcalMonitorPrescaler.h.

Constructor & Destructor Documentation

◆ EcalMonitorPrescaler()

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

Definition at line 29 of file EcalMonitorPrescaler.cc.

31  consumes<EcalRawDataCollection>(_ps.getParameter<edm::InputTag>("EcalRawDataCollection"))) {
32  for (unsigned iP(0); iP != nPrescalers; ++iP)
33  prescalers_[iP].first = 0;
34 
35  prescalers_[kPhysics].second = _ps.getUntrackedParameter<unsigned>("physics", -1);
36  prescalers_[kCosmics].second = _ps.getUntrackedParameter<unsigned>("cosmics", -1);
37  prescalers_[kCalibration].second = _ps.getUntrackedParameter<unsigned>("calibration", -1);
38  prescalers_[kLaser].second = _ps.getUntrackedParameter<unsigned>("laser", -1);
39  prescalers_[kLed].second = _ps.getUntrackedParameter<unsigned>("led", -1);
40  prescalers_[kTestPulse].second = _ps.getUntrackedParameter<unsigned>("testPulse", -1);
41  prescalers_[kPedestal].second = _ps.getUntrackedParameter<unsigned>("pedestal", -1);
42 
43  // Backward compatibility
44  prescalers_[kPhysics].second = std::min(
45  prescalers_[kPhysics].second, (unsigned int)(_ps.getUntrackedParameter<int>("occupancyPrescaleFactor", -1)));
46  prescalers_[kPhysics].second = std::min(
47  prescalers_[kPhysics].second, (unsigned int)(_ps.getUntrackedParameter<int>("integrityPrescaleFactor", -1)));
49  (unsigned int)(_ps.getUntrackedParameter<int>("cosmicPrescaleFactor", -1)));
50  prescalers_[kLaser].second =
51  std::min(prescalers_[kLaser].second, (unsigned int)(_ps.getUntrackedParameter<int>("laserPrescaleFactor", -1)));
52  prescalers_[kLed].second =
53  std::min(prescalers_[kLed].second, (unsigned int)(_ps.getUntrackedParameter<int>("ledPrescaleFactor", -1)));
54  prescalers_[kPedestal].second = std::min(
55  prescalers_[kPedestal].second, (unsigned int)(_ps.getUntrackedParameter<int>("pedestalPrescaleFactor", -1)));
56  prescalers_[kPedestal].second =
58  (unsigned int)(_ps.getUntrackedParameter<int>("pedestalonlinePrescaleFactor", -1)));
60  prescalers_[kTestPulse].second, (unsigned int)(_ps.getUntrackedParameter<int>("testpulsePrescaleFactor", -1)));
61  prescalers_[kPedestal].second =
63  (unsigned int)(_ps.getUntrackedParameter<int>("pedestaloffsetPrescaleFactor", -1)));
64  prescalers_[kPhysics].second = std::min(
65  prescalers_[kPhysics].second, (unsigned int)(_ps.getUntrackedParameter<int>("triggertowerPrescaleFactor", -1)));
67  (unsigned int)(_ps.getUntrackedParameter<int>("timingPrescaleFactor", -1)));
69  (unsigned int)(_ps.getUntrackedParameter<int>("physicsPrescaleFactor", -1)));
71  (unsigned int)(_ps.getUntrackedParameter<int>("clusterPrescaleFactor", -1)));
72 }

References first, edm::ParameterSet::getUntrackedParameter(), kCalibration, kCosmics, kLaser, kLed, kPedestal, kPhysics, kTestPulse, min(), nPrescalers, prescalers_, and edm::second().

◆ ~EcalMonitorPrescaler()

EcalMonitorPrescaler::~EcalMonitorPrescaler ( )
override

Definition at line 74 of file EcalMonitorPrescaler.cc.

74 {}

Member Function Documentation

◆ beginRun()

void EcalMonitorPrescaler::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from edm::EDFilter.

Definition at line 76 of file EcalMonitorPrescaler.cc.

76  {
77  for (unsigned iP(0); iP != nPrescalers; ++iP)
78  prescalers_[iP].first = 0;
79 }

References first, nPrescalers, and prescalers_.

◆ filter()

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

Implements edm::EDFilter.

Definition at line 81 of file EcalMonitorPrescaler.cc.

81  {
83 
84  if (!_event.getByToken(EcalRawDataCollection_, dcchs)) {
85  edm::LogWarning("EcalMonitorPrescaler") << "EcalRawDataCollection not available";
86  return false;
87  }
88 
89  uint32_t eventBits(0);
90  for (EcalRawDataCollection::const_iterator dcchItr(dcchs->begin()); dcchItr != dcchs->end(); ++dcchItr)
91  eventBits |= (1 << dcchItr->getRunType());
92 
93  for (unsigned iP(0); iP != nPrescalers; ++iP) {
94  if ((eventBits & filterBits_[iP]) != 0 && ++prescalers_[iP].first % prescalers_[iP].second == 0)
95  return true;
96  }
97 
98  return false;
99 }

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

Member Data Documentation

◆ EcalRawDataCollection_

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

Definition at line 22 of file EcalMonitorPrescaler.h.

Referenced by filter().

◆ filterBits_

uint32_t EcalMonitorPrescaler::filterBits_
staticprivate

◆ prescalers_

std::pair<unsigned, unsigned> EcalMonitorPrescaler::prescalers_[nPrescalers]
private

Definition at line 24 of file EcalMonitorPrescaler.h.

Referenced by beginRun(), EcalMonitorPrescaler(), and filter().

EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
min
T min(T a, T b)
Definition: MathUtil.h:58
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
EcalMonitorPrescaler::kLed
Definition: EcalMonitorPrescaler.h:18
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
EcalDCCHeaderBlock::LED_GAP
Definition: EcalDCCHeaderBlock.h:45
EcalMonitorPrescaler::kLaser
Definition: EcalMonitorPrescaler.h:18
EcalDCCHeaderBlock::TESTPULSE_GAP
Definition: EcalDCCHeaderBlock.h:43
EcalDCCHeaderBlock::LASER_GAP
Definition: EcalDCCHeaderBlock.h:42
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
EcalDCCHeaderBlock::LASER_STD
Definition: EcalDCCHeaderBlock.h:26
EcalMonitorPrescaler::filterBits_
static uint32_t filterBits_[nPrescalers]
Definition: EcalMonitorPrescaler.h:20
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
EcalDCCHeaderBlock::PEDESTAL_GAP
Definition: EcalDCCHeaderBlock.h:44
EcalMonitorPrescaler::nPrescalers
Definition: EcalMonitorPrescaler.h:18
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
EcalDCCHeaderBlock::TESTPULSE_MGPA
Definition: EcalDCCHeaderBlock.h:30
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
EcalMonitorPrescaler::EcalRawDataCollection_
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
Definition: EcalMonitorPrescaler.h:22
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
EcalMonitorPrescaler::kPhysics
Definition: EcalMonitorPrescaler.h:18
EcalDCCHeaderBlock::PEDESTAL_STD
Definition: EcalDCCHeaderBlock.h:31
EcalMonitorPrescaler::kPedestal
Definition: EcalMonitorPrescaler.h:18
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN
Definition: EcalDCCHeaderBlock.h:32
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
EcalDCCHeaderBlock::COSMIC
Definition: EcalDCCHeaderBlock.h:22
EcalDCCHeaderBlock::LED_STD
Definition: EcalDCCHeaderBlock.h:34
EcalMonitorPrescaler::kCalibration
Definition: EcalMonitorPrescaler.h:18
EcalMonitorPrescaler::kCosmics
Definition: EcalMonitorPrescaler.h:18
edm::InputTag
Definition: InputTag.h:15
EcalMonitorPrescaler::kTestPulse
Definition: EcalMonitorPrescaler.h:18
EcalMonitorPrescaler::prescalers_
std::pair< unsigned, unsigned > prescalers_[nPrescalers]
Definition: EcalMonitorPrescaler.h:24