CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
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 &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

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 40 of file EcalMonitorPrescaler.cc.

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

40  :
41  EcalRawDataCollection_(consumes<EcalRawDataCollection>(_ps.getParameter<edm::InputTag>("EcalRawDataCollection")))
42 {
43  for(unsigned iP(0); iP != nPrescalers; ++iP) prescalers_[iP].first = 0;
44 
45  prescalers_[kPhysics].second = _ps.getUntrackedParameter<unsigned>("physics", -1);
46  prescalers_[kCosmics].second = _ps.getUntrackedParameter<unsigned>("cosmics", -1);
47  prescalers_[kCalibration].second = _ps.getUntrackedParameter<unsigned>("calibration", -1);
48  prescalers_[kLaser].second = _ps.getUntrackedParameter<unsigned>("laser", -1);
49  prescalers_[kLed].second = _ps.getUntrackedParameter<unsigned>("led", -1);
50  prescalers_[kTestPulse].second = _ps.getUntrackedParameter<unsigned>("testPulse", -1);
51  prescalers_[kPedestal].second = _ps.getUntrackedParameter<unsigned>("pedestal", -1);
52 
53  // Backward compatibility
54  prescalers_[kPhysics].second = std::min(prescalers_[kPhysics].second, (unsigned int)(_ps.getUntrackedParameter<int>("occupancyPrescaleFactor", -1)));
55  prescalers_[kPhysics].second = std::min(prescalers_[kPhysics].second, (unsigned int)(_ps.getUntrackedParameter<int>("integrityPrescaleFactor", -1)));
56  prescalers_[kCosmics].second = std::min(prescalers_[kCosmics].second, (unsigned int)(_ps.getUntrackedParameter<int>("cosmicPrescaleFactor", -1)));
57  prescalers_[kLaser].second = std::min(prescalers_[kLaser].second, (unsigned int)(_ps.getUntrackedParameter<int>("laserPrescaleFactor", -1)));
58  prescalers_[kLed].second = std::min(prescalers_[kLed].second, (unsigned int)(_ps.getUntrackedParameter<int>("ledPrescaleFactor", -1)));
59  prescalers_[kPedestal].second = std::min(prescalers_[kPedestal].second, (unsigned int)(_ps.getUntrackedParameter<int>("pedestalPrescaleFactor", -1)));
60  prescalers_[kPedestal].second = std::min(prescalers_[kPedestal].second, (unsigned int)(_ps.getUntrackedParameter<int>("pedestalonlinePrescaleFactor", -1)));
61  prescalers_[kTestPulse].second = std::min(prescalers_[kTestPulse].second, (unsigned int)(_ps.getUntrackedParameter<int>("testpulsePrescaleFactor", -1)));
62  prescalers_[kPedestal].second = std::min(prescalers_[kPedestal].second, (unsigned int)(_ps.getUntrackedParameter<int>("pedestaloffsetPrescaleFactor", -1)));
63  prescalers_[kPhysics].second = std::min(prescalers_[kPhysics].second, (unsigned int)(_ps.getUntrackedParameter<int>("triggertowerPrescaleFactor", -1)));
64  prescalers_[kPhysics].second = std::min(prescalers_[kPhysics].second, (unsigned int)(_ps.getUntrackedParameter<int>("timingPrescaleFactor", -1)));
65  prescalers_[kPhysics].second = std::min(prescalers_[kPhysics].second, (unsigned int)(_ps.getUntrackedParameter<int>("physicsPrescaleFactor", -1)));
66  prescalers_[kPhysics].second = std::min(prescalers_[kPhysics].second, (unsigned int)(_ps.getUntrackedParameter<int>("clusterPrescaleFactor", -1)));
67 }
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 ( )

Definition at line 69 of file EcalMonitorPrescaler.cc.

70 {
71 }

Member Function Documentation

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

Reimplemented from edm::EDFilter.

Definition at line 74 of file EcalMonitorPrescaler.cc.

References plotBeamSpotDB::first, nPrescalers, and prescalers_.

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

Implements edm::EDFilter.

Definition at line 80 of file EcalMonitorPrescaler.cc.

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

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

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:464
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
std::pair< unsigned, unsigned > prescalers_[nPrescalers]
static uint32_t filterBits_[nPrescalers]

Member Data Documentation

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

Definition at line 31 of file EcalMonitorPrescaler.h.

Referenced by filter().

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

Definition at line 33 of file EcalMonitorPrescaler.h.

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