CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
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)
 
 ~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)
 

Private Types

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

Private Attributes

edm::EDGetTokenT
< EcalRawDataCollection
EcalRawDataCollection_
 
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
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< B > consumes (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 () noexcept
 
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...
 
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 9 of file EcalMonitorPrescaler.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 29 of file EcalMonitorPrescaler.cc.

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

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 }
U second(std::pair< T, U > const &p)
T min(T a, T b)
Definition: MathUtil.h:58
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
std::pair< unsigned, unsigned > prescalers_[nPrescalers]
EcalMonitorPrescaler::~EcalMonitorPrescaler ( )
override

Definition at line 74 of file EcalMonitorPrescaler.cc.

74 {}

Member Function Documentation

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

Reimplemented from edm::EDFilter.

Definition at line 76 of file EcalMonitorPrescaler.cc.

References first, nPrescalers, and prescalers_.

76  {
77  for (unsigned iP(0); iP != nPrescalers; ++iP)
78  prescalers_[iP].first = 0;
79 }
std::pair< unsigned, unsigned > prescalers_[nPrescalers]
bool EcalMonitorPrescaler::filter ( edm::Event _event,
edm::EventSetup const &   
)
overridevirtual

Implements edm::EDFilter.

Definition at line 81 of file EcalMonitorPrescaler.cc.

References EcalRawDataCollection_, filterBits_, edm::Event::getByToken(), nPrescalers, and prescalers_.

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 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
std::vector< T >::const_iterator const_iterator
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
std::pair< unsigned, unsigned > prescalers_[nPrescalers]
Log< level::Warning, false > LogWarning
static uint32_t filterBits_[nPrescalers]

Member Data Documentation

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

Definition at line 22 of file EcalMonitorPrescaler.h.

Referenced by filter().

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

Definition at line 24 of file EcalMonitorPrescaler.h.

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