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 // $Id: EcalMonitorPrescaler.cc,v 1.16 2010/08/08 08:46:05 dellaric Exp $
2 
12 
14 
16 
18 
19  count_ = 0;
20 
21  EcalRawDataCollection_ = ps.getParameter<edm::InputTag>("EcalRawDataCollection");
22 
23  occupancyPrescaleFactor_ = ps.getUntrackedParameter<int>("occupancyPrescaleFactor" , 0);
24  integrityPrescaleFactor_ = ps.getUntrackedParameter<int>("integrityPrescaleFactor", 0);
25  statusflagsPrescaleFactor_ = ps.getUntrackedParameter<int>("statusflagsPrescaleFactor" , 0);
26 
27  pedestalonlinePrescaleFactor_ = ps.getUntrackedParameter<int>("pedestalonlinePrescaleFactor", 0);
28 
29  laserPrescaleFactor_ = ps.getUntrackedParameter<int>("laserPrescaleFactor", 0);
30  ledPrescaleFactor_ = ps.getUntrackedParameter<int>("ledPrescaleFactor", 0);
31  pedestalPrescaleFactor_ = ps.getUntrackedParameter<int>("pedestalPrescaleFactor", 0);
32  testpulsePrescaleFactor_ = ps.getUntrackedParameter<int>("testpulsePrescaleFactor", 0);
33 
34  pedestaloffsetPrescaleFactor_ = ps.getUntrackedParameter<int>("pedestaloffsetPrescaleFactor", 0);
35 
36  triggertowerPrescaleFactor_ = ps.getUntrackedParameter<int>("triggertowerPrescaleFactor" , 0);
37  timingPrescaleFactor_ = ps.getUntrackedParameter<int>("timingPrescaleFactor" , 0);
38 
39  cosmicPrescaleFactor_ = ps.getUntrackedParameter<int>("cosmicPrescaleFactor", 0);
40 
41  physicsPrescaleFactor_ = ps.getUntrackedParameter<int>("physicsPrescaleFactor", 0);
42 
43  clusterPrescaleFactor_ = ps.getUntrackedParameter<int>("clusterPrescaleFactor", 0);
44 
45 }
46 
48 
50 
51  count_++;
52 
53  bool status = false;
54 
56  if ( count_ % occupancyPrescaleFactor_ == 0 ) status = true;
57  }
59  if ( count_ % integrityPrescaleFactor_ == 0 ) status = true;
60  }
62  if ( count_ % statusflagsPrescaleFactor_ == 0 ) status = true;
63  }
64 
66  if ( count_ % pedestalonlinePrescaleFactor_ == 0 ) status = true;
67  }
68 
70  if ( count_ % triggertowerPrescaleFactor_ == 0 ) status = true;
71  }
72  if ( timingPrescaleFactor_ ) {
73  if ( count_ % timingPrescaleFactor_ == 0 ) status = true;
74  }
75 
77 
78  if ( e.getByLabel(EcalRawDataCollection_, dcchs) ) {
79 
80  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
81 
82  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::LASER_STD ||
83  dcchItr->getRunType() == EcalDCCHeaderBlock::LASER_GAP ) {
84  if ( laserPrescaleFactor_ ) {
85  if ( count_ % laserPrescaleFactor_ == 0 ) status = true;
86  }
87  }
88  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::LED_STD ||
89  dcchItr->getRunType() == EcalDCCHeaderBlock::LED_GAP ) {
90  if ( ledPrescaleFactor_ ) {
91  if ( count_ % ledPrescaleFactor_ == 0 ) status = true;
92  }
93  }
94  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_STD ||
95  dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_GAP ) {
96  if ( pedestalPrescaleFactor_ ) {
97  if ( count_ % pedestalPrescaleFactor_ == 0 ) status = true;
98  }
99  }
100  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::TESTPULSE_MGPA ||
101  dcchItr->getRunType() == EcalDCCHeaderBlock::TESTPULSE_GAP ) {
102  if ( testpulsePrescaleFactor_ ) {
103  if ( count_ % testpulsePrescaleFactor_ == 0 ) status = true;
104  }
105  }
106 
107  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN ) {
109  if ( count_ % pedestaloffsetPrescaleFactor_ == 0 ) status = true;
110  }
111  }
112 
113  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::COSMIC ||
114  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
115  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_LOCAL ) {
116  if ( cosmicPrescaleFactor_ ) {
117  if ( count_ % cosmicPrescaleFactor_ == 0 ) status = true;
118  }
119  }
120 
121  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::MTCC ||
122  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
123  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_LOCAL ) {
124  if ( physicsPrescaleFactor_ ) {
125  if ( count_ % physicsPrescaleFactor_ == 0 ) status = true;
126  }
127  }
128 
129  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::COSMIC ||
130  dcchItr->getRunType() == EcalDCCHeaderBlock::MTCC ||
131  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
132  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
133  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_LOCAL ||
134  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_LOCAL ) {
135  if ( clusterPrescaleFactor_ ) {
136  if ( count_ % clusterPrescaleFactor_ == 0 ) status = true;
137  }
138  }
139 
140  }
141 
142  } else {
143 
144  edm::LogWarning("EcalMonitorPrescaler") << EcalRawDataCollection_ << " not available";
145 
146  }
147 
148  return status;
149 
150 }
151 
bool filter(edm::Event &e, const edm::EventSetup &c)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< T >::const_iterator const_iterator
Ecal specific Prescaler.
edm::InputTag EcalRawDataCollection_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
EcalMonitorPrescaler(const edm::ParameterSet &ps)
tuple status
Definition: ntuplemaker.py:245