CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::LedTask Class Reference

#include <LedTask.h>

Inheritance diagram for ecaldqm::LedTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

void addDependencies (DependencySet &) override
 
bool analyze (void const *, Collections) override
 
void beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
bool filterRunType (short const *) override
 
 LedTask ()
 
void runOnDigis (EEDigiCollection const &)
 
void runOnPnDigis (EcalPnDiodeDigiCollection const &)
 
void runOnRawData (EcalRawDataCollection const &)
 
void runOnUncalibRecHits (EcalUncalibratedRecHitCollection const &)
 
 ~LedTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void bookMEs (DQMStore::IBooker &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 DQWorker ()
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap const * GetTrigTowerMap ()
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setSetupObjects (edm::EventSetup const &)
 
void setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

int emptyLS_
 
int emptyLSLimit_
 
bool enable_ [nEEDCC]
 
int isemptyLS
 
std::map< unsigned, float > pnAmp_
 
unsigned rtHalf_ [nEEDCC]
 
unsigned wavelength_ [nEEDCC]
 
std::map< int, unsigned > wlToME_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandle
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandle
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandleEndLumi
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandle
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandleEndLumi
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandle
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandleEndLumi
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 14 of file LedTask.h.

Constructor & Destructor Documentation

◆ LedTask()

ecaldqm::LedTask::LedTask ( )

Definition at line 9 of file LedTask.cc.

References enable_, ecaldqm::nEEDCC, rtHalf_, and wavelength_.

10  std::fill_n(enable_, nEEDCC, false);
11  std::fill_n(wavelength_, nEEDCC, 0);
12  std::fill_n(rtHalf_, nEEDCC, 0);
13  }
bool enable_[nEEDCC]
Definition: LedTask.h:41
unsigned rtHalf_[nEEDCC]
Definition: LedTask.h:43
int emptyLSLimit_
Definition: LedTask.h:47
unsigned wavelength_[nEEDCC]
Definition: LedTask.h:42
std::map< unsigned, float > pnAmp_
Definition: LedTask.h:44
std::map< int, unsigned > wlToME_
Definition: LedTask.h:39

◆ ~LedTask()

ecaldqm::LedTask::~LedTask ( )
inlineoverride

Definition at line 17 of file LedTask.h.

17 {}

Member Function Documentation

◆ addDependencies()

void ecaldqm::LedTask::addDependencies ( DependencySet _dependencies)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 33 of file LedTask.cc.

References ecaldqm::kEcalRawData, ecaldqm::kEEDigi, ecaldqm::kEELaserLedUncalibRecHit, ecaldqm::kPnDiodeDigi, and ecaldqm::DependencySet::push_back().

33  {
34  _dependencies.push_back(Dependency(kEEDigi, kEcalRawData));
35  _dependencies.push_back(Dependency(kPnDiodeDigi, kEEDigi, kEcalRawData));
36  _dependencies.push_back(Dependency(kEELaserLedUncalibRecHit, kPnDiodeDigi, kEEDigi, kEcalRawData));
37  }

◆ analyze()

bool ecaldqm::LedTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 51 of file LedTask.h.

References ecaldqm::kEcalRawData, ecaldqm::kEEDigi, ecaldqm::kEELaserLedUncalibRecHit, ecaldqm::kPnDiodeDigi, runOnDigis(), runOnPnDigis(), runOnRawData(), and runOnUncalibRecHits().

51  {
52  switch (_collection) {
53  case kEcalRawData:
54  if (_p)
55  runOnRawData(*static_cast<EcalRawDataCollection const*>(_p));
56  return true;
57  break;
58  case kEEDigi:
59  if (_p)
60  runOnDigis(*static_cast<EEDigiCollection const*>(_p));
61  return true;
62  break;
63  case kPnDiodeDigi:
64  if (_p)
65  runOnPnDigis(*static_cast<EcalPnDiodeDigiCollection const*>(_p));
66  return true;
67  break;
69  if (_p)
70  runOnUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(_p));
71  return true;
72  break;
73  default:
74  break;
75  }
76 
77  return false;
78  }
void runOnDigis(EEDigiCollection const &)
Definition: LedTask.cc:112
void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const &)
Definition: LedTask.cc:281
void runOnRawData(EcalRawDataCollection const &)
Definition: LedTask.cc:66
void runOnPnDigis(EcalPnDiodeDigiCollection const &)
Definition: LedTask.cc:238

◆ beginEvent()

void ecaldqm::LedTask::beginEvent ( edm::Event const &  ,
edm::EventSetup const &  ,
bool const &  ,
bool &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 64 of file LedTask.cc.

References pnAmp_.

64 { pnAmp_.clear(); }
std::map< unsigned, float > pnAmp_
Definition: LedTask.h:44

◆ beginLuminosityBlock()

void ecaldqm::LedTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 58 of file LedTask.cc.

References emptyLS_, emptyLSLimit_, and isemptyLS.

58  {
59  isemptyLS = 0;
60  if (emptyLS_ + 1 > emptyLSLimit_)
61  emptyLS_ = -1;
62  }
int emptyLSLimit_
Definition: LedTask.h:47

◆ beginRun()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 56 of file LedTask.cc.

References emptyLS_.

56 { emptyLS_ = 0; }

◆ endLuminosityBlock()

void ecaldqm::LedTask::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 336 of file LedTask.cc.

References emptyLS_, and isemptyLS.

336  {
337  if (isemptyLS == 1)
338  emptyLS_ += 1;
339  }

◆ filterRunType()

bool ecaldqm::LedTask::filterRunType ( short const *  _runType)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 39 of file LedTask.cc.

References remoteMonitoring_LED_IterMethod_cfg::enable, enable_, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEEmHigh, EcalDCCHeaderBlock::LED_GAP, EcalDCCHeaderBlock::LED_STD, ecaldqm::nDCC, and ecaldqm::nEBDCC.

39  {
40  bool enable(false);
41 
42  for (unsigned iDCC(0); iDCC != nDCC; iDCC++) {
43  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
44  continue;
45  unsigned index(iDCC <= kEEmHigh ? iDCC : iDCC - nEBDCC);
46  if (_runType[iDCC] == EcalDCCHeaderBlock::LED_STD || _runType[iDCC] == EcalDCCHeaderBlock::LED_GAP) {
47  enable = true;
48  enable_[index] = true;
49  } else
50  enable_[index] = false;
51  }
52 
53  return enable;
54  }
bool enable_[nEEDCC]
Definition: LedTask.h:41

◆ runOnDigis()

void ecaldqm::LedTask::runOnDigis ( EEDigiCollection const &  _digis)

Definition at line 112 of file LedTask.cc.

References gpuClustering::adc, EcalMGPASample::adc(), ecaldqm::MESetCollection::at(), edm::DataFrameContainer::begin(), ecaldqm::dccId(), emptyLS_, remoteMonitoring_LED_IterMethod_cfg::enable, enable_, edm::DataFrameContainer::end(), ecaldqm::MESetMulti::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), mps_fire::i, triggerObjects_cff::id, isemptyLS, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEEmHigh, SiStripPI::max, ecaldqm::DQWorker::MEs_, SiStripPI::min, ecaldqm::nEBDCC, ecaldqm::nEEDCC, DetId::null(), pnAmp_, ecaldqm::pnForCrystal(), DetId::rawId(), ecaldqm::rtHalf(), rtHalf_, EcalDataFrame::sample(), remoteMonitoring_LASER_era2018_cfg::threshold, wavelength_, and wlToME_.

Referenced by analyze().

112  {
113  MESet& meOccupancy(MEs_.at("Occupancy"));
114  MESet& meShape(MEs_.at("Shape"));
115  MESet& meSignalRate(MEs_.at("SignalRate"));
116 
117  int nReadouts[nEEDCC];
118  int maxpos[nEEDCC][10];
119  for (unsigned index(0); index < nEEDCC; ++index) {
120  nReadouts[index] = 0;
121  for (int i(0); i < 10; i++)
122  maxpos[index][i] = 0;
123  }
124 
125  for (EEDigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
126  const DetId& id(digiItr->id());
127 
128  unsigned iDCC(dccId(id, GetElectronicsMap()) - 1);
129  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
130  continue;
131  unsigned index(iDCC <= kEEmHigh ? iDCC : iDCC - nEBDCC);
132 
133  if (!enable_[index])
134  continue;
135  if (rtHalf(id, GetElectronicsMap()) != rtHalf_[index])
136  continue;
137 
138  meOccupancy.fill(getEcalDQMSetupObjects(), id);
139 
140  ++nReadouts[index];
141 
142  EcalDataFrame dataFrame(*digiItr);
143 
144  int iMax(-1);
145  int max(0);
146  int min(4096);
147  for (int i(0); i < 10; i++) {
148  int adc(dataFrame.sample(i).adc());
149  if (adc > max) {
150  max = adc;
151  iMax = i;
152  }
153  if (adc < min)
154  min = adc;
155  }
156  if (iMax >= 0 && max - min > 3) // normal RMS of pedestal is ~2.5
157  maxpos[index][iMax] += 1;
158  }
159 
160  // signal existence check
161  bool enable(false);
162  bool ledOnExpected(emptyLS_ >= 0);
163 
164  unsigned iME(-1);
165 
166  for (int index(0); index < nEEDCC; ++index) {
167  if (nReadouts[index] == 0) {
168  enable_[index] = false;
169  continue;
170  }
171 
172  int threshold(nReadouts[index] / 3);
173  if (ledOnExpected)
174  enable_[index] = false;
175 
176  for (int i(0); i < 10; i++) {
177  if (maxpos[index][i] > threshold) {
178  enable = true;
179  enable_[index] = true;
180  break;
181  }
182  }
183 
184  if (iME != wlToME_[wavelength_[index]]) {
185  iME = wlToME_[wavelength_[index]];
186  static_cast<MESetMulti&>(meSignalRate).use(iME);
187  }
188 
189  meSignalRate.fill(
190  getEcalDQMSetupObjects(), (index <= kEEmHigh ? index : index + nEBDCC) + 1, enable_[index] ? 1 : 0);
191  }
192 
193  if (!enable && isemptyLS >= 0)
194  isemptyLS = 1;
195  else if (enable)
196  isemptyLS = -1;
197 
198  if (enable)
199  emptyLS_ = 0;
200  else if (ledOnExpected)
201  return;
202 
203  iME = -1;
204 
205  for (EEDigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
206  const DetId& id(digiItr->id());
207 
208  unsigned iDCC(dccId(id, GetElectronicsMap()) - 1);
209  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
210  continue;
211  unsigned index(iDCC <= kEEmHigh ? iDCC : iDCC - nEBDCC);
212 
213  if (!enable_[index])
214  continue;
215  if (rtHalf(id, GetElectronicsMap()) != rtHalf_[index])
216  continue;
217 
218  if (iME != wlToME_[wavelength_[index]]) {
219  iME = wlToME_[wavelength_[index]];
220  static_cast<MESetMulti&>(meShape).use(iME);
221  }
222 
223  // EcalDataFrame is not a derived class of edm::DataFrame, but can take edm::DataFrame in the constructor
224  EcalDataFrame dataFrame(*digiItr);
225 
226  for (int iSample(0); iSample < 10; iSample++)
227  meShape.fill(getEcalDQMSetupObjects(), id, iSample + 0.5, float(dataFrame.sample(iSample).adc()));
228 
231  if (pnidA.null() || pnidB.null())
232  continue;
233  pnAmp_.insert(std::make_pair(pnidA.rawId(), 0.));
234  pnAmp_.insert(std::make_pair(pnidB.rawId(), 0.));
235  }
236  }
bool enable_[nEEDCC]
Definition: LedTask.h:41
MESet & at(const std::string &key)
Definition: MESet.h:399
unsigned rtHalf_[nEEDCC]
Definition: LedTask.h:43
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalPnDiodeDetId pnForCrystal(DetId const &, char, EcalElectronicsMapping const *)
unsigned wavelength_[nEEDCC]
Definition: LedTask.h:42
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:131
std::map< unsigned, float > pnAmp_
Definition: LedTask.h:44
std::map< int, unsigned > wlToME_
Definition: LedTask.h:39
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
unsigned rtHalf(DetId const &, EcalElectronicsMapping const *)
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ runOnPnDigis()

void ecaldqm::LedTask::runOnPnDigis ( EcalPnDiodeDigiCollection const &  _digis)

Definition at line 238 of file LedTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), ecaldqm::dccId(), edm::SortedCollection< T, SORT >::end(), ecaldqm::MESetMulti::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), triggerObjects_cff::id, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEEmHigh, SiStripPI::max, ecaldqm::DQWorker::MEs_, ecaldqm::nEBDCC, EcalCondDBWriter_cfi::pedestal, pnAmp_, wavelength_, and wlToME_.

Referenced by analyze().

238  {
239  MESet& mePNAmplitude(MEs_.at("PNAmplitude"));
240 
241  unsigned iME(-1);
242 
243  for (EcalPnDiodeDigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
244  if (digiItr->sample(0).gainId() != 0 && digiItr->sample(0).gainId() != 1)
245  continue;
246 
247  const EcalPnDiodeDetId& id(digiItr->id());
248 
249  std::map<uint32_t, float>::iterator ampItr(pnAmp_.find(id.rawId()));
250  if (ampItr == pnAmp_.end())
251  continue;
252 
253  unsigned iDCC(dccId(id, GetElectronicsMap()) - 1);
254  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
255  continue;
256  unsigned index(iDCC <= kEEmHigh ? iDCC : iDCC - nEBDCC);
257 
258  float pedestal(0.);
259  for (int iSample(0); iSample < 4; iSample++)
260  pedestal += digiItr->sample(iSample).adc();
261  pedestal /= 4.;
262 
263  float max(0.);
264  for (int iSample(0); iSample < 50; iSample++) {
265  float amp(digiItr->sample(iSample).adc() - pedestal);
266  if (amp > max)
267  max = amp;
268  }
269 
270  if (iME != wlToME_[wavelength_[index]]) {
271  iME = wlToME_[wavelength_[index]];
272  static_cast<MESetMulti&>(mePNAmplitude).use(iME);
273  }
274 
275  mePNAmplitude.fill(getEcalDQMSetupObjects(), id, max);
276 
277  ampItr->second = max;
278  }
279  }
MESet & at(const std::string &key)
Definition: MESet.h:399
std::vector< T >::const_iterator const_iterator
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
unsigned wavelength_[nEEDCC]
Definition: LedTask.h:42
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
MESetCollection MEs_
Definition: DQWorker.h:131
std::map< unsigned, float > pnAmp_
Definition: LedTask.h:44
std::map< int, unsigned > wlToME_
Definition: LedTask.h:39

◆ runOnRawData()

void ecaldqm::LedTask::runOnRawData ( EcalRawDataCollection const &  _rawData)

Definition at line 66 of file LedTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), enable_, edm::SortedCollection< T, SORT >::end(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEEmHigh, ecaldqm::DQWorker::MEs_, ecaldqm::nEBDCC, ecaldqm::nEEDCC, rtHalf_, wavelength_, and wlToME_.

Referenced by analyze().

66  {
67  MESet& meCalibStatus(MEs_.at("CalibStatus"));
68  for (EcalRawDataCollection::const_iterator rItr(_rawData.begin()); rItr != _rawData.end(); ++rItr) {
69  unsigned iDCC(rItr->id() - 1);
70  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
71  continue;
72  unsigned index(iDCC <= kEEmHigh ? iDCC : iDCC - nEBDCC);
73 
74  if (!enable_[index]) {
75  wavelength_[index] = -1;
76  rtHalf_[index] = -1;
77  continue;
78  }
79  if (rItr->getEventSettings().wavelength == 0)
80  wavelength_[index] = 1;
81  else if (rItr->getEventSettings().wavelength == 2)
82  wavelength_[index] = 2;
83  else
84  wavelength_[index] = -1;
85 
86  if (wlToME_.find(wavelength_[index]) == wlToME_.end())
87  enable_[index] = false;
88 
89  rtHalf_[index] = rItr->getRtHalf();
90  }
91  bool LedStatus[2];
92  for (unsigned iW(0); iW < 2; iW++) {
93  LedStatus[iW] = false;
94  }
95  for (unsigned index(0); index < nEEDCC; ++index) {
96  switch (wavelength_[index]) {
97  case 1:
98  LedStatus[0] = true;
99  break;
100  case 2:
101  LedStatus[1] = true;
102  break;
103  default:
104  break;
105  }
106  }
107  for (unsigned iWL(0); iWL < 2; iWL++) {
108  meCalibStatus.fill(getEcalDQMSetupObjects(), double(iWL + 3), LedStatus[iWL] ? 1 : 0);
109  }
110  }
bool enable_[nEEDCC]
Definition: LedTask.h:41
MESet & at(const std::string &key)
Definition: MESet.h:399
std::vector< T >::const_iterator const_iterator
unsigned rtHalf_[nEEDCC]
Definition: LedTask.h:43
unsigned wavelength_[nEEDCC]
Definition: LedTask.h:42
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
MESetCollection MEs_
Definition: DQWorker.h:131
std::map< int, unsigned > wlToME_
Definition: LedTask.h:39

◆ runOnUncalibRecHits()

void ecaldqm::LedTask::runOnUncalibRecHits ( EcalUncalibratedRecHitCollection const &  _uhits)

Definition at line 281 of file LedTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), ecaldqm::dccId(), enable_, edm::SortedCollection< T, SORT >::end(), ecaldqm::MESetMulti::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), triggerObjects_cff::id, if(), ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEEmHigh, SiStripPI::max, ecaldqm::DQWorker::MEs_, ecaldqm::nEBDCC, pnAmp_, ecaldqm::pnForCrystal(), ecaldqm::rtHalf(), rtHalf_, wavelength_, and wlToME_.

Referenced by analyze().

281  {
282  using namespace std;
283 
284  MESet& meAmplitude(MEs_.at("Amplitude"));
285  MESet& meAmplitudeSummary(MEs_.at("AmplitudeSummary"));
286  MESet& meTiming(MEs_.at("Timing"));
287  MESet& meAOverP(MEs_.at("AOverP"));
288 
289  unsigned iME(-1);
290 
291  for (EcalUncalibratedRecHitCollection::const_iterator uhitItr(_uhits.begin()); uhitItr != _uhits.end(); ++uhitItr) {
292  EEDetId id(uhitItr->id());
293 
294  unsigned iDCC(dccId(id, GetElectronicsMap()) - 1);
295  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
296  continue;
297  unsigned index(iDCC <= kEEmHigh ? iDCC : iDCC - nEBDCC);
298 
299  if (!enable_[index])
300  continue;
301  if (rtHalf(id, GetElectronicsMap()) != rtHalf_[index])
302  continue;
303 
304  if (iME != wlToME_[wavelength_[index]]) {
305  iME = wlToME_[wavelength_[index]];
306  static_cast<MESetMulti&>(meAmplitude).use(iME);
307  static_cast<MESetMulti&>(meAmplitudeSummary).use(iME);
308  static_cast<MESetMulti&>(meTiming).use(iME);
309  static_cast<MESetMulti&>(meAOverP).use(iME);
310  }
311 
312  float amp(max((double)uhitItr->amplitude(), 0.));
313  float jitter(max((double)uhitItr->jitter() + 5.0, 0.));
314 
315  meAmplitude.fill(getEcalDQMSetupObjects(), id, amp);
316  meAmplitudeSummary.fill(getEcalDQMSetupObjects(), id, amp);
317  meTiming.fill(getEcalDQMSetupObjects(), id, jitter);
318 
319  float aop(0.);
320 
321  map<uint32_t, float>::iterator ampItrA(pnAmp_.find(pnForCrystal(id, 'a', GetElectronicsMap())));
322  map<uint32_t, float>::iterator ampItrB(pnAmp_.find(pnForCrystal(id, 'b', GetElectronicsMap())));
323  if (ampItrA == pnAmp_.end() && ampItrB == pnAmp_.end())
324  continue;
325  else if (ampItrB == pnAmp_.end())
326  aop = amp / ampItrA->second;
327  else if (ampItrA == pnAmp_.end())
328  aop = amp / ampItrB->second;
329  else
330  aop = amp / (ampItrA->second + ampItrB->second) * 2.;
331 
332  meAOverP.fill(getEcalDQMSetupObjects(), id, aop);
333  }
334  }
bool enable_[nEEDCC]
Definition: LedTask.h:41
MESet & at(const std::string &key)
Definition: MESet.h:399
std::vector< T >::const_iterator const_iterator
unsigned rtHalf_[nEEDCC]
Definition: LedTask.h:43
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalPnDiodeDetId pnForCrystal(DetId const &, char, EcalElectronicsMapping const *)
unsigned wavelength_[nEEDCC]
Definition: LedTask.h:42
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
MESetCollection MEs_
Definition: DQWorker.h:131
std::map< unsigned, float > pnAmp_
Definition: LedTask.h:44
std::map< int, unsigned > wlToME_
Definition: LedTask.h:39
unsigned rtHalf(DetId const &, EcalElectronicsMapping const *)

◆ setParams()

void ecaldqm::LedTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 15 of file LedTask.cc.

References l1extraParticles_cfi::_params, CustomPhysics_cfi::amplitude, ecaldqm::MESetCollection::at(), emptyLSLimit_, Exception, CalibrationSummaryClient_cfi::ledWavelengths, ecaldqm::DQWorker::MEs_, cond::impl::to_string(), LaserClient_cfi::wl, and wlToME_.

15  {
16  emptyLSLimit_ = _params.getUntrackedParameter<int>("emptyLSLimit");
17 
18  std::vector<int> ledWavelengths(_params.getUntrackedParameter<std::vector<int> >("ledWavelengths"));
19 
21 
22  MESetMulti& amplitude(static_cast<MESetMulti&>(MEs_.at("Amplitude")));
23  unsigned nWL(ledWavelengths.size());
24  for (unsigned iWL(0); iWL != nWL; ++iWL) {
25  int wl(ledWavelengths[iWL]);
26  if (wl != 1 && wl != 2)
27  throw cms::Exception("InvalidConfiguration") << "Led Wavelength";
28  repl["wl"] = std::to_string(wl);
29  wlToME_[wl] = amplitude.getIndex(repl);
30  }
31  }
MESet & at(const std::string &key)
Definition: MESet.h:399
std::string to_string(const V &value)
Definition: OMSAccess.h:71
int emptyLSLimit_
Definition: LedTask.h:47
MESetCollection MEs_
Definition: DQWorker.h:131
std::map< int, unsigned > wlToME_
Definition: LedTask.h:39
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:46

Member Data Documentation

◆ emptyLS_

int ecaldqm::LedTask::emptyLS_
private

Definition at line 46 of file LedTask.h.

Referenced by beginLuminosityBlock(), beginRun(), endLuminosityBlock(), and runOnDigis().

◆ emptyLSLimit_

int ecaldqm::LedTask::emptyLSLimit_
private

Definition at line 47 of file LedTask.h.

Referenced by beginLuminosityBlock(), and setParams().

◆ enable_

bool ecaldqm::LedTask::enable_[nEEDCC]
private

Definition at line 41 of file LedTask.h.

Referenced by filterRunType(), LedTask(), runOnDigis(), runOnRawData(), and runOnUncalibRecHits().

◆ isemptyLS

int ecaldqm::LedTask::isemptyLS
private

Definition at line 48 of file LedTask.h.

Referenced by beginLuminosityBlock(), endLuminosityBlock(), and runOnDigis().

◆ pnAmp_

std::map<unsigned, float> ecaldqm::LedTask::pnAmp_
private

Definition at line 44 of file LedTask.h.

Referenced by beginEvent(), runOnDigis(), runOnPnDigis(), and runOnUncalibRecHits().

◆ rtHalf_

unsigned ecaldqm::LedTask::rtHalf_[nEEDCC]
private

Definition at line 43 of file LedTask.h.

Referenced by LedTask(), runOnDigis(), runOnRawData(), and runOnUncalibRecHits().

◆ wavelength_

unsigned ecaldqm::LedTask::wavelength_[nEEDCC]
private

Definition at line 42 of file LedTask.h.

Referenced by LedTask(), runOnDigis(), runOnPnDigis(), runOnRawData(), and runOnUncalibRecHits().

◆ wlToME_

std::map<int, unsigned> ecaldqm::LedTask::wlToME_
private

Definition at line 39 of file LedTask.h.

Referenced by runOnDigis(), runOnPnDigis(), runOnRawData(), runOnUncalibRecHits(), and setParams().