31 unsigned nWL(ledWavelengths.size());
32 for(
unsigned iWL(0); iWL != nWL; ++iWL){
33 int wl(ledWavelengths[iWL]);
34 if(wl != 1 && wl != 2)
throw cms::Exception(
"InvalidConfiguration") <<
"Led Wavelength";
35 repl[
"wl"] = std::to_string(wl);
53 for(
unsigned iDCC(0); iDCC !=
nDCC; iDCC++){
90 MESet& meCalibStatus(
MEs_.at(
"CalibStatus"));
92 unsigned iDCC(rItr->id() - 1);
101 if(rItr->getEventSettings().wavelength == 0)
103 else if(rItr->getEventSettings().wavelength == 2)
114 for(
unsigned iW(0); iW < 2; iW++){
115 LedStatus[iW] =
false;
130 for(
unsigned iWL(0); iWL<2; iWL++){
131 meCalibStatus.fill(
double(iWL+3), LedStatus[iWL]? 1:0);
138 MESet& meOccupancy(
MEs_.at(
"Occupancy"));
140 MESet& meSignalRate(
MEs_.at(
"SignalRate"));
145 nReadouts[
index] = 0;
146 for(
int i(0);
i < 10;
i++) maxpos[
index][
i] = 0;
150 const DetId&
id(digiItr->id());
152 unsigned iDCC(
dccId(
id) - 1);
159 meOccupancy.fill(
id);
168 for (
int i(0);
i < 10;
i++) {
176 if(iMax >= 0 && max - min > 3)
177 maxpos[
index][iMax] += 1;
187 if(nReadouts[
index] == 0){
195 for(
int i(0);
i < 10;
i++){
196 if(maxpos[
index][
i] > threshold){
205 static_cast<MESetMulti&
>(meSignalRate).use(iME);
215 else if(ledOnExpected)
return;
220 const DetId&
id(digiItr->id());
222 unsigned iDCC(
dccId(
id) - 1);
237 for(
int iSample(0); iSample < 10; iSample++)
238 meShape.fill(
id, iSample + 0.5,
float(dataFrame.
sample(iSample).
adc()));
242 if(pnidA.
null() || pnidB.
null())
continue;
251 MESet& mePNAmplitude(
MEs_.at(
"PNAmplitude"));
256 if(digiItr->sample(0).gainId() != 0 && digiItr->sample(0).gainId() != 1)
continue;
260 std::map<uint32_t, float>::iterator ampItr(
pnAmp_.find(
id.rawId()));
261 if(ampItr ==
pnAmp_.end())
continue;
263 unsigned iDCC(
dccId(
id) - 1);
268 for(
int iSample(0); iSample < 4; iSample++)
269 pedestal += digiItr->sample(iSample).adc();
273 for(
int iSample(0); iSample < 50; iSample++){
274 float amp(digiItr->sample(iSample).adc() -
pedestal);
275 if(amp > max) max = amp;
280 static_cast<MESetMulti&
>(mePNAmplitude).use(iME);
283 mePNAmplitude.
fill(
id, max);
285 ampItr->second =
max;
294 MESet& meAmplitude(
MEs_.at(
"Amplitude"));
295 MESet& meAmplitudeSummary(
MEs_.at(
"AmplitudeSummary"));
304 unsigned iDCC(
dccId(
id) - 1);
313 static_cast<MESetMulti&
>(meAmplitude).use(iME);
314 static_cast<MESetMulti&
>(meAmplitudeSummary).use(iME);
319 float amp(
max((
double)uhitItr->amplitude(), 0.));
320 float jitter(
max((
double)uhitItr->jitter() + 5.0, 0.));
322 meAmplitude.
fill(
id, amp);
323 meAmplitudeSummary.fill(
id, amp);
324 meTiming.fill(
id, jitter);
330 if(ampItrA ==
pnAmp_.end() && ampItrB ==
pnAmp_.end())
continue;
331 else if(ampItrB ==
pnAmp_.end()) aop = amp / ampItrA->second;
332 else if(ampItrA ==
pnAmp_.end()) aop = amp / ampItrB->second;
333 else aop = amp / (ampItrA->second + ampItrB->second) * 2.;
335 meAOverP.fill(
id, aop);
int adc(sample_type sample)
get the ADC sample (12 bits)
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_ECALDQM_WORKER(TYPE)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
constexpr bool null() const
is this a null id ?
constexpr uint32_t rawId() const
get the raw id
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
EcalMGPASample sample(int i) const
const_iterator begin() const
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
void fill(DetId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
void addDependencies(DependencySet &) override
void beginEvent(edm::Event const &, edm::EventSetup const &) override
void runOnDigis(EEDigiCollection const &)
void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const &)
void beginRun(edm::Run const &, edm::EventSetup const &) override
EcalPnDiodeDetId pnForCrystal(DetId const &, char)
void runOnRawData(EcalRawDataCollection const &)
unsigned rtHalf(DetId const &)
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
unsigned wavelength_[nEEDCC]
const_iterator end() const
std::map< unsigned, float > pnAmp_
std::map< int, unsigned > wlToME_
const_iterator end() const
bool filterRunType(short const *) override
void setParams(edm::ParameterSet const &) override
std::map< std::string, std::string > PathReplacements
void push_back(Dependency const &_d)
unsigned dccId(DetId const &)
unsigned getIndex(PathReplacements const &) const
const_iterator begin() const
int adc() const
get the ADC sample (12 bits)
void runOnPnDigis(EcalPnDiodeDigiCollection const &)