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 Attributes
EcalMonitorPrescaler Class Reference

#include <EcalMonitorPrescaler.h>

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

Public Member Functions

 EcalMonitorPrescaler (const edm::ParameterSet &ps)
 
bool filter (edm::Event &e, const edm::EventSetup &c)
 
virtual ~EcalMonitorPrescaler ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

int clusterPrescaleFactor_
 
int cosmicPrescaleFactor_
 
int count_
 
edm::EDGetTokenT
< EcalRawDataCollection
EcalRawDataCollection_
 
int integrityPrescaleFactor_
 
int laserPrescaleFactor_
 
int ledPrescaleFactor_
 
int occupancyPrescaleFactor_
 
int pedestaloffsetPrescaleFactor_
 
int pedestalonlinePrescaleFactor_
 
int pedestalPrescaleFactor_
 
int physicsPrescaleFactor_
 
int statusflagsPrescaleFactor_
 
int testpulsePrescaleFactor_
 
int timingPrescaleFactor_
 
int triggertowerPrescaleFactor_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 17 of file EcalMonitorPrescaler.h.

Constructor & Destructor Documentation

EcalMonitorPrescaler::EcalMonitorPrescaler ( const edm::ParameterSet ps)

Definition at line 12 of file EcalMonitorPrescaler.cc.

References clusterPrescaleFactor_, cosmicPrescaleFactor_, count_, EcalRawDataCollection_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), integrityPrescaleFactor_, laserPrescaleFactor_, ledPrescaleFactor_, occupancyPrescaleFactor_, pedestaloffsetPrescaleFactor_, pedestalonlinePrescaleFactor_, pedestalPrescaleFactor_, physicsPrescaleFactor_, statusflagsPrescaleFactor_, testpulsePrescaleFactor_, timingPrescaleFactor_, and triggertowerPrescaleFactor_.

12  {
13 
14  count_ = 0;
15 
16  EcalRawDataCollection_ = consumes<EcalRawDataCollection>(ps.getParameter<edm::InputTag>("EcalRawDataCollection"));
17 
18  occupancyPrescaleFactor_ = ps.getUntrackedParameter<int>("occupancyPrescaleFactor" , 0);
19  integrityPrescaleFactor_ = ps.getUntrackedParameter<int>("integrityPrescaleFactor", 0);
20  statusflagsPrescaleFactor_ = ps.getUntrackedParameter<int>("statusflagsPrescaleFactor" , 0);
21 
22  pedestalonlinePrescaleFactor_ = ps.getUntrackedParameter<int>("pedestalonlinePrescaleFactor", 0);
23 
24  laserPrescaleFactor_ = ps.getUntrackedParameter<int>("laserPrescaleFactor", 0);
25  ledPrescaleFactor_ = ps.getUntrackedParameter<int>("ledPrescaleFactor", 0);
26  pedestalPrescaleFactor_ = ps.getUntrackedParameter<int>("pedestalPrescaleFactor", 0);
27  testpulsePrescaleFactor_ = ps.getUntrackedParameter<int>("testpulsePrescaleFactor", 0);
28 
29  pedestaloffsetPrescaleFactor_ = ps.getUntrackedParameter<int>("pedestaloffsetPrescaleFactor", 0);
30 
31  triggertowerPrescaleFactor_ = ps.getUntrackedParameter<int>("triggertowerPrescaleFactor" , 0);
32  timingPrescaleFactor_ = ps.getUntrackedParameter<int>("timingPrescaleFactor" , 0);
33 
34  cosmicPrescaleFactor_ = ps.getUntrackedParameter<int>("cosmicPrescaleFactor", 0);
35 
36  physicsPrescaleFactor_ = ps.getUntrackedParameter<int>("physicsPrescaleFactor", 0);
37 
38  clusterPrescaleFactor_ = ps.getUntrackedParameter<int>("clusterPrescaleFactor", 0);
39 
40 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
EcalMonitorPrescaler::~EcalMonitorPrescaler ( )
virtual

Definition at line 42 of file EcalMonitorPrescaler.cc.

42 { }

Member Function Documentation

bool EcalMonitorPrescaler::filter ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDFilter.

Definition at line 44 of file EcalMonitorPrescaler.cc.

References clusterPrescaleFactor_, EcalDCCHeaderBlock::COSMIC, cosmicPrescaleFactor_, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, count_, EcalRawDataCollection_, edm::Event::getByToken(), integrityPrescaleFactor_, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_STD, laserPrescaleFactor_, EcalDCCHeaderBlock::LED_GAP, EcalDCCHeaderBlock::LED_STD, ledPrescaleFactor_, EcalDCCHeaderBlock::MTCC, occupancyPrescaleFactor_, EcalDCCHeaderBlock::PEDESTAL_GAP, EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN, EcalDCCHeaderBlock::PEDESTAL_STD, pedestaloffsetPrescaleFactor_, pedestalonlinePrescaleFactor_, pedestalPrescaleFactor_, EcalDCCHeaderBlock::PHYSICS_GLOBAL, EcalDCCHeaderBlock::PHYSICS_LOCAL, physicsPrescaleFactor_, ntuplemaker::status, statusflagsPrescaleFactor_, EcalDCCHeaderBlock::TESTPULSE_GAP, EcalDCCHeaderBlock::TESTPULSE_MGPA, testpulsePrescaleFactor_, timingPrescaleFactor_, and triggertowerPrescaleFactor_.

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().

44  {
45 
46  count_++;
47 
48  bool status = false;
49 
51  if ( count_ % occupancyPrescaleFactor_ == 0 ) status = true;
52  }
54  if ( count_ % integrityPrescaleFactor_ == 0 ) status = true;
55  }
57  if ( count_ % statusflagsPrescaleFactor_ == 0 ) status = true;
58  }
59 
61  if ( count_ % pedestalonlinePrescaleFactor_ == 0 ) status = true;
62  }
63 
65  if ( count_ % triggertowerPrescaleFactor_ == 0 ) status = true;
66  }
67  if ( timingPrescaleFactor_ ) {
68  if ( count_ % timingPrescaleFactor_ == 0 ) status = true;
69  }
70 
72 
73  if ( e.getByToken(EcalRawDataCollection_, dcchs) ) {
74 
75  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
76 
77  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::LASER_STD ||
78  dcchItr->getRunType() == EcalDCCHeaderBlock::LASER_GAP ) {
79  if ( laserPrescaleFactor_ ) {
80  if ( count_ % laserPrescaleFactor_ == 0 ) status = true;
81  }
82  }
83  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::LED_STD ||
84  dcchItr->getRunType() == EcalDCCHeaderBlock::LED_GAP ) {
85  if ( ledPrescaleFactor_ ) {
86  if ( count_ % ledPrescaleFactor_ == 0 ) status = true;
87  }
88  }
89  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_STD ||
90  dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_GAP ) {
91  if ( pedestalPrescaleFactor_ ) {
92  if ( count_ % pedestalPrescaleFactor_ == 0 ) status = true;
93  }
94  }
95  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::TESTPULSE_MGPA ||
96  dcchItr->getRunType() == EcalDCCHeaderBlock::TESTPULSE_GAP ) {
97  if ( testpulsePrescaleFactor_ ) {
98  if ( count_ % testpulsePrescaleFactor_ == 0 ) status = true;
99  }
100  }
101 
102  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN ) {
104  if ( count_ % pedestaloffsetPrescaleFactor_ == 0 ) status = true;
105  }
106  }
107 
108  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::COSMIC ||
109  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
110  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_LOCAL ) {
111  if ( cosmicPrescaleFactor_ ) {
112  if ( count_ % cosmicPrescaleFactor_ == 0 ) status = true;
113  }
114  }
115 
116  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::MTCC ||
117  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
118  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_LOCAL ) {
119  if ( physicsPrescaleFactor_ ) {
120  if ( count_ % physicsPrescaleFactor_ == 0 ) status = true;
121  }
122  }
123 
124  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::COSMIC ||
125  dcchItr->getRunType() == EcalDCCHeaderBlock::MTCC ||
126  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
127  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
128  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_LOCAL ||
129  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_LOCAL ) {
130  if ( clusterPrescaleFactor_ ) {
131  if ( count_ % clusterPrescaleFactor_ == 0 ) status = true;
132  }
133  }
134 
135  }
136 
137  } else {
138 
139  edm::LogWarning("EcalMonitorPrescaler") << "EcalRawDataCollection not available";
140 
141  }
142 
143  return status;
144 
145 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
tuple status
Definition: ntuplemaker.py:245

Member Data Documentation

int EcalMonitorPrescaler::clusterPrescaleFactor_
private

Definition at line 54 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::cosmicPrescaleFactor_
private

Definition at line 50 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::count_
private

Definition at line 30 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

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

Definition at line 28 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::integrityPrescaleFactor_
private

Definition at line 35 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::laserPrescaleFactor_
private

Definition at line 40 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::ledPrescaleFactor_
private

Definition at line 41 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::occupancyPrescaleFactor_
private

Definition at line 34 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::pedestaloffsetPrescaleFactor_
private

Definition at line 45 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::pedestalonlinePrescaleFactor_
private

Definition at line 38 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::pedestalPrescaleFactor_
private

Definition at line 42 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::physicsPrescaleFactor_
private

Definition at line 52 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::statusflagsPrescaleFactor_
private

Definition at line 36 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::testpulsePrescaleFactor_
private

Definition at line 43 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::timingPrescaleFactor_
private

Definition at line 48 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().

int EcalMonitorPrescaler::triggertowerPrescaleFactor_
private

Definition at line 47 of file EcalMonitorPrescaler.h.

Referenced by EcalMonitorPrescaler(), and filter().