CMS 3D CMS Logo

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

#include <LaserTask.h>

Inheritance diagram for ecaldqm::LaserTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Types

enum  Wavelength { kGreen, kBlue, kIRed, nWavelength }
 
- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 

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
 
bool filterRunType (short const *) override
 
 LaserTask ()
 
template<typename DigiCollection >
void runOnDigis (DigiCollection const &)
 
void runOnPnDigis (EcalPnDiodeDigiCollection const &)
 
void runOnRawData (EcalRawDataCollection const &)
 
void runOnUncalibRecHits (EcalUncalibratedRecHitCollection const &)
 
 ~LaserTask () 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 endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
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_ [nDCC]
 
int maxPedestal_
 
std::map< uint32_t, float > pnAmp_
 
unsigned rtHalf_ [nDCC]
 
unsigned wavelength_ [nDCC]
 
std::map< int, unsigned > wlToME_
 

Additional Inherited Members

- 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 LaserTask.h.

Member Enumeration Documentation

◆ Wavelength

Enumerator
kGreen 
kBlue 
kIRed 
nWavelength 

Definition at line 35 of file LaserTask.h.

Constructor & Destructor Documentation

◆ LaserTask()

LaserTask::LaserTask ( )

Definition at line 8 of file LaserTask.cc.

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

9  std::fill_n(enable_, nDCC, false);
10  std::fill_n(wavelength_, nDCC, 0);
11  std::fill_n(rtHalf_, nDCC, 0);
12  }
unsigned rtHalf_[nDCC]
Definition: LaserTask.h:44
std::map< int, unsigned > wlToME_
Definition: LaserTask.h:40
std::map< uint32_t, float > pnAmp_
Definition: LaserTask.h:45
unsigned wavelength_[nDCC]
Definition: LaserTask.h:43
static constexpr int nDCC
bool enable_[nDCC]
Definition: LaserTask.h:42

◆ ~LaserTask()

ecaldqm::LaserTask::~LaserTask ( )
inlineoverride

Definition at line 17 of file LaserTask.h.

17 {}

Member Function Documentation

◆ addDependencies()

void LaserTask::addDependencies ( DependencySet _dependencies)
overridevirtual

◆ analyze()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 52 of file LaserTask.h.

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

52  {
53  switch (_collection) {
54  case kEcalRawData:
55  if (_p)
56  runOnRawData(*static_cast<EcalRawDataCollection const*>(_p));
57  return true;
58  break;
59  case kEBDigi:
60  if (_p)
61  runOnDigis(*static_cast<EBDigiCollection const*>(_p));
62  return true;
63  break;
64  case kEEDigi:
65  if (_p)
66  runOnDigis(*static_cast<EEDigiCollection const*>(_p));
67  return true;
68  break;
69  case kPnDiodeDigi:
70  if (_p)
71  runOnPnDigis(*static_cast<EcalPnDiodeDigiCollection const*>(_p));
72  return true;
73  break;
76  if (_p)
77  runOnUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(_p));
78  return true;
79  break;
80  default:
81  break;
82  }
83 
84  return false;
85  }
void runOnDigis(DigiCollection const &)
Definition: LaserTask.cc:109
void runOnPnDigis(EcalPnDiodeDigiCollection const &)
Definition: LaserTask.cc:238
void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const &)
Definition: LaserTask.cc:284
void runOnRawData(EcalRawDataCollection const &)
Definition: LaserTask.cc:65

◆ beginEvent()

void LaserTask::beginEvent ( edm::Event const &  _evt,
edm::EventSetup const &  ,
bool const &  ,
bool &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 63 of file LaserTask.cc.

References pnAmp_.

63 { pnAmp_.clear(); }
std::map< uint32_t, float > pnAmp_
Definition: LaserTask.h:45

◆ beginLuminosityBlock()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 58 of file LaserTask.cc.

References emptyLS_, and emptyLSLimit_.

58  {
59  if (++emptyLS_ > emptyLSLimit_)
60  emptyLS_ = -1;
61  }

◆ beginRun()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 56 of file LaserTask.cc.

References emptyLS_.

56 { emptyLS_ = 0; }

◆ filterRunType()

bool LaserTask::filterRunType ( short const *  _runType)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 42 of file LaserTask.cc.

References DiMuonV_cfg::enable, enable_, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_STD, and ecaldqm::nDCC.

42  {
43  bool enable(false);
44 
45  for (unsigned iDCC(0); iDCC < nDCC; iDCC++) {
46  if (_runType[iDCC] == EcalDCCHeaderBlock::LASER_STD || _runType[iDCC] == EcalDCCHeaderBlock::LASER_GAP) {
47  enable = true;
48  enable_[iDCC] = true;
49  } else
50  enable_[iDCC] = false;
51  }
52 
53  return enable;
54  }
enable
Messages.
Definition: DiMuonV_cfg.py:93
static constexpr int nDCC
bool enable_[nDCC]
Definition: LaserTask.h:42

◆ runOnDigis()

template<typename DigiCollection >
void LaserTask::runOnDigis ( DigiCollection const &  _digis)

Definition at line 109 of file LaserTask.cc.

References gpuClustering::adc, EcalMGPASample::adc(), ecaldqm::MESetCollection::at(), ecaldqm::dccId(), emptyLS_, DiMuonV_cfg::enable, enable_, ecaldqm::MESetMulti::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), mps_fire::i, EcalPhiSymFlatTableProducers_cfi::id, WZElectronSkims53X_cff::max, maxPedestal_, EcalDataFrame::MAXSAMPLES, ecaldqm::DQWorker::MEs_, SiStripPI::min, ecaldqm::nDCC, DetId::null(), pnAmp_, ecaldqm::pnForCrystal(), DetId::rawId(), ecaldqm::rtHalf(), rtHalf_, EcalDataFrame::sample(), DiMuonV_cfg::threshold, wavelength_, and wlToME_.

Referenced by analyze().

109  {
110  MESet& meOccupancy(MEs_.at("Occupancy"));
111  MESet& meShape(MEs_.at("Shape"));
112  MESet& meSignalRate(MEs_.at("SignalRate"));
113 
114  bool inData[nDCC];
115  int nReadouts[nDCC];
116  int maxpos[nDCC][EcalDataFrame::MAXSAMPLES];
117  bool largeAmplitude[nDCC];
118  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
119  inData[iDCC] = false;
120  nReadouts[iDCC] = 0;
121  for (int i(0); i < EcalDataFrame::MAXSAMPLES; i++)
122  maxpos[iDCC][i] = 0;
123  largeAmplitude[iDCC] = false;
124  }
125 
126  for (typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
127  const DetId& id(digiItr->id());
128 
129  unsigned iDCC(dccId(id, GetElectronicsMap()) - 1);
130 
131  inData[iDCC] = true;
132 
133  if (!enable_[iDCC])
134  continue;
135  if (rtHalf(id, GetElectronicsMap()) != rtHalf_[iDCC])
136  continue;
137 
138  meOccupancy.fill(getEcalDQMSetupObjects(), id);
139 
140  ++nReadouts[iDCC];
141 
142  EcalDataFrame dataFrame(*digiItr);
143 
144  int iMax(-1);
145  int max(0);
146  int min(4096);
147  for (int i(0); i < EcalDataFrame::MAXSAMPLES; 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  if (adc > maxPedestal_)
156  largeAmplitude[iDCC] = true;
157  }
158  if (iMax >= 0 && max - min > 3) // normal RMS of pedestal is ~2.5
159  maxpos[iDCC][iMax] += 1;
160  }
161 
162  // signal existence check
163  bool enable(false);
164  bool laserOnExpected(emptyLS_ >= 0);
165 
166  unsigned iME(-1);
167 
168  for (int iDCC(0); iDCC < nDCC; ++iDCC) {
169  if (!inData[iDCC])
170  continue;
171 
172  if (nReadouts[iDCC] == 0) {
173  enable_[iDCC] = false;
174  continue;
175  }
176 
177  int threshold(nReadouts[iDCC] / 3);
178  if (laserOnExpected)
179  enable_[iDCC] = false;
180 
181  if (largeAmplitude[iDCC]) {
182  enable = true;
183  enable_[iDCC] = true;
184  } else {
185  for (int i(0); i < EcalDataFrame::MAXSAMPLES; i++) {
186  if (maxpos[iDCC][i] > threshold) {
187  enable = true;
188  enable_[iDCC] = true;
189  break;
190  }
191  }
192  }
193 
194  if (iME != wlToME_[wavelength_[iDCC]]) {
195  iME = wlToME_[wavelength_[iDCC]];
196  static_cast<MESetMulti&>(meSignalRate).use(iME);
197  }
198 
199  meSignalRate.fill(getEcalDQMSetupObjects(), iDCC + 1, enable_[iDCC] ? 1 : 0);
200  }
201 
202  if (enable)
203  emptyLS_ = 0;
204  else if (laserOnExpected)
205  return;
206 
207  iME = -1;
208 
209  for (typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
210  const DetId& id(digiItr->id());
211 
212  unsigned iDCC(dccId(id, GetElectronicsMap()) - 1);
213 
214  if (!enable_[iDCC])
215  continue;
216  if (rtHalf(id, GetElectronicsMap()) != rtHalf_[iDCC])
217  continue;
218 
219  EcalDataFrame dataFrame(*digiItr);
220 
221  if (iME != wlToME_[wavelength_[iDCC]]) {
222  iME = wlToME_[wavelength_[iDCC]];
223  static_cast<MESetMulti&>(meShape).use(iME);
224  }
225 
226  for (int iSample(0); iSample < EcalDataFrame::MAXSAMPLES; 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  }
unsigned rtHalf_[nDCC]
Definition: LaserTask.h:44
MESet & at(const std::string &key)
Definition: MESet.h:401
std::map< int, unsigned > wlToME_
Definition: LaserTask.h:40
std::map< uint32_t, float > pnAmp_
Definition: LaserTask.h:45
unsigned wavelength_[nDCC]
Definition: LaserTask.h:43
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalPnDiodeDetId pnForCrystal(DetId const &, char, EcalElectronicsMapping const *)
enable
Messages.
Definition: DiMuonV_cfg.py:93
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Definition: DetId.h:17
static constexpr int nDCC
MESetCollection MEs_
Definition: DQWorker.h:131
bool enable_[nDCC]
Definition: LaserTask.h:42
unsigned rtHalf(DetId const &, EcalElectronicsMapping const *)
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ runOnPnDigis()

void LaserTask::runOnPnDigis ( EcalPnDiodeDigiCollection const &  _digis)

Definition at line 238 of file LaserTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), ecaldqm::dccId(), DiMuonV_cfg::enable, enable_, edm::SortedCollection< T, SORT >::end(), ecaldqm::MESetMulti::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), EcalPhiSymFlatTableProducers_cfi::id, WZElectronSkims53X_cff::max, ecaldqm::DQWorker::MEs_, ecaldqm::nDCC, Hcal_Conditions_forGlobalTag_cff::pedestal, pnAmp_, wavelength_, and wlToME_.

Referenced by analyze().

238  {
239  MESet& mePNAmplitude(MEs_.at("PNAmplitude"));
240 
241  bool enable(false);
242  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC)
243  enable |= enable_[iDCC];
244  if (!enable)
245  return;
246 
247  unsigned iME(-1);
248 
249  for (EcalPnDiodeDigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
250  if (digiItr->sample(0).gainId() != 0 && digiItr->sample(0).gainId() != 1)
251  continue;
252 
253  const EcalPnDiodeDetId& id(digiItr->id());
254 
255  std::map<uint32_t, float>::iterator ampItr(pnAmp_.find(id.rawId()));
256  if (ampItr == pnAmp_.end())
257  continue;
258 
259  unsigned iDCC(dccId(id, GetElectronicsMap()) - 1);
260 
261  double pedestal(0.);
262  for (int iSample(0); iSample < 4; iSample++)
263  pedestal += digiItr->sample(iSample).adc();
264  pedestal /= 4.;
265 
266  double max(0.);
267  for (int iSample(0); iSample < 50; iSample++) {
268  float amp(digiItr->sample(iSample).adc() - pedestal);
269  if (amp > max)
270  max = amp;
271  }
272 
273  if (iME != wlToME_[wavelength_[iDCC]]) {
274  iME = wlToME_[wavelength_[iDCC]];
275  static_cast<MESetMulti&>(mePNAmplitude).use(iME);
276  }
277 
278  mePNAmplitude.fill(getEcalDQMSetupObjects(), id, max);
279 
280  ampItr->second = max;
281  }
282  }
MESet & at(const std::string &key)
Definition: MESet.h:401
std::map< int, unsigned > wlToME_
Definition: LaserTask.h:40
std::vector< T >::const_iterator const_iterator
std::map< uint32_t, float > pnAmp_
Definition: LaserTask.h:45
unsigned wavelength_[nDCC]
Definition: LaserTask.h:43
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
enable
Messages.
Definition: DiMuonV_cfg.py:93
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
static constexpr int nDCC
MESetCollection MEs_
Definition: DQWorker.h:131
bool enable_[nDCC]
Definition: LaserTask.h:42

◆ runOnRawData()

void LaserTask::runOnRawData ( EcalRawDataCollection const &  _rawData)

Definition at line 65 of file LaserTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), enable_, edm::SortedCollection< T, SORT >::end(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::MEs_, ecaldqm::nDCC, nWavelength, rtHalf_, wavelength_, and wlToME_.

Referenced by analyze().

65  {
66  MESet& meCalibStatus(MEs_.at("CalibStatus"));
67  for (EcalRawDataCollection::const_iterator rItr(_rawData.begin()); rItr != _rawData.end(); ++rItr) {
68  unsigned iDCC(rItr->id() - 1);
69 
70  if (!enable_[iDCC]) {
71  wavelength_[iDCC] = -1;
72  rtHalf_[iDCC] = -1;
73  continue;
74  }
75  wavelength_[iDCC] = rItr->getEventSettings().wavelength + 1;
76 
77  if (wlToME_.find(wavelength_[iDCC]) == wlToME_.end())
78  enable_[iDCC] = false;
79 
80  rtHalf_[iDCC] = rItr->getRtHalf();
81  }
82  bool LaserStatus[nWavelength];
83  for (unsigned iW(0); iW < nWavelength; iW++) {
84  LaserStatus[iW] = false;
85  }
86  for (unsigned iDCC(0); iDCC < nDCC; iDCC++) {
87  switch (wavelength_[iDCC]) {
88  case 1:
89  break;
90  case 2:
91  LaserStatus[Wavelength::kGreen] = true;
92  break;
93  case 3:
94  LaserStatus[Wavelength::kBlue] = true;
95  break;
96  case 4:
97  LaserStatus[Wavelength::kIRed] = true;
98  break;
99  default:
100  break;
101  }
102  }
103  for (unsigned iWL(0); iWL < nWavelength; iWL++) {
104  meCalibStatus.fill(getEcalDQMSetupObjects(), double(iWL), LaserStatus[iWL] ? 1 : 0);
105  }
106  }
unsigned rtHalf_[nDCC]
Definition: LaserTask.h:44
MESet & at(const std::string &key)
Definition: MESet.h:401
std::map< int, unsigned > wlToME_
Definition: LaserTask.h:40
std::vector< T >::const_iterator const_iterator
unsigned wavelength_[nDCC]
Definition: LaserTask.h:43
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
static constexpr int nDCC
MESetCollection MEs_
Definition: DQWorker.h:131
bool enable_[nDCC]
Definition: LaserTask.h:42

◆ runOnUncalibRecHits()

void LaserTask::runOnUncalibRecHits ( EcalUncalibratedRecHitCollection const &  _uhits)

Definition at line 284 of file LaserTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), ecaldqm::dccId(), DiMuonV_cfg::enable, enable_, edm::SortedCollection< T, SORT >::end(), ecaldqm::MESetMulti::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), EcalPhiSymFlatTableProducers_cfi::id, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), WZElectronSkims53X_cff::max, ecaldqm::DQWorker::MEs_, ecaldqm::nDCC, pnAmp_, ecaldqm::pnForCrystal(), ecaldqm::rtHalf(), rtHalf_, wavelength_, and wlToME_.

Referenced by analyze().

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

◆ setParams()

void LaserTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 14 of file LaserTask.cc.

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

14  {
15  emptyLSLimit_ = _params.getUntrackedParameter<int>("emptyLSLimit");
16 
17  std::vector<int> laserWavelengths(_params.getUntrackedParameter<std::vector<int> >("laserWavelengths"));
18 
20 
21  MESetMulti& amplitude(static_cast<MESetMulti&>(MEs_.at("Amplitude")));
22  unsigned nWL(laserWavelengths.size());
23  for (unsigned iWL(0); iWL != nWL; ++iWL) {
24  int wl(laserWavelengths[iWL]);
25  if (wl <= 0 || wl >= 5)
26  throw cms::Exception("InvalidConfiguration") << "Laser Wavelength";
27  repl["wl"] = std::to_string(wl);
28  wlToME_[wl] = amplitude.getIndex(repl);
29  }
30 
31  maxPedestal_ = _params.getUntrackedParameter<int>("maxPedestal");
32  }
MESet & at(const std::string &key)
Definition: MESet.h:401
std::map< int, unsigned > wlToME_
Definition: LaserTask.h:40
static std::string to_string(const XMLCh *ch)
MESetCollection MEs_
Definition: DQWorker.h:131
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:46

Member Data Documentation

◆ emptyLS_

int ecaldqm::LaserTask::emptyLS_
private

Definition at line 47 of file LaserTask.h.

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

◆ emptyLSLimit_

int ecaldqm::LaserTask::emptyLSLimit_
private

Definition at line 48 of file LaserTask.h.

Referenced by beginLuminosityBlock(), and setParams().

◆ enable_

bool ecaldqm::LaserTask::enable_[nDCC]
private

◆ maxPedestal_

int ecaldqm::LaserTask::maxPedestal_
private

Definition at line 49 of file LaserTask.h.

Referenced by runOnDigis(), and setParams().

◆ pnAmp_

std::map<uint32_t, float> ecaldqm::LaserTask::pnAmp_
private

Definition at line 45 of file LaserTask.h.

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

◆ rtHalf_

unsigned ecaldqm::LaserTask::rtHalf_[nDCC]
private

Definition at line 44 of file LaserTask.h.

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

◆ wavelength_

unsigned ecaldqm::LaserTask::wavelength_[nDCC]
private

Definition at line 43 of file LaserTask.h.

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

◆ wlToME_

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

Definition at line 40 of file LaserTask.h.

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