CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalMonitorPrescaler.cc
Go to the documentation of this file.
1 
9 
11 
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 }
41 
43 
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 }
146 
bool filter(edm::Event &e, const edm::EventSetup &c)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
Ecal specific Prescaler.
EcalMonitorPrescaler(const edm::ParameterSet &ps)
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
tuple status
Definition: ntuplemaker.py:245