1 #include "../interface/LedTask.h"
30 MESetMulti& amplitude(static_cast<MESetMulti&>(
MEs_.at(
"Amplitude")));
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";
53 for(
unsigned iDCC(0); iDCC !=
nDCC; iDCC++){
90 unsigned iDCC(rItr->id() - 1);
99 if(rItr->getEventSettings().wavelength == 0)
101 else if(rItr->getEventSettings().wavelength == 2)
116 MESet& meOccupancy(
MEs_.at(
"Occupancy"));
118 MESet& meSignalRate(
MEs_.at(
"SignalRate"));
123 nReadouts[
index] = 0;
124 for(
int i(0);
i < 10;
i++) maxpos[
index][
i] = 0;
128 const DetId& id(digiItr->id());
130 unsigned iDCC(
dccId(
id) - 1);
137 meOccupancy.fill(
id);
146 for (
int i(0);
i < 10;
i++) {
154 if(iMax >= 0 && max - min > 3)
155 maxpos[
index][iMax] += 1;
165 if(nReadouts[
index] == 0){
173 for(
int i(0);
i < 10;
i++){
174 if(maxpos[
index][
i] > threshold){
183 static_cast<MESetMulti&
>(meSignalRate).use(iME);
190 else if(ledOnExpected)
return;
195 const DetId& id(digiItr->id());
197 unsigned iDCC(
dccId(
id) - 1);
212 for(
int iSample(0); iSample < 10; iSample++)
213 meShape.fill(
id, iSample + 0.5,
float(dataFrame.
sample(iSample).
adc()));
217 if(pnidA.
null() || pnidB.
null())
continue;
226 MESet& mePNAmplitude(
MEs_.at(
"PNAmplitude"));
231 if(digiItr->sample(0).gainId() != 0 && digiItr->sample(0).gainId() != 1)
continue;
235 std::map<uint32_t, float>::iterator ampItr(
pnAmp_.find(
id.rawId()));
236 if(ampItr ==
pnAmp_.end())
continue;
238 unsigned iDCC(
dccId(
id) - 1);
243 for(
int iSample(0); iSample < 4; iSample++)
244 pedestal += digiItr->sample(iSample).adc();
248 for(
int iSample(0); iSample < 50; iSample++){
249 float amp(digiItr->sample(iSample).adc() -
pedestal);
250 if(amp > max) max = amp;
255 static_cast<MESetMulti&
>(mePNAmplitude).use(iME);
258 mePNAmplitude.
fill(
id, max);
260 ampItr->second =
max;
269 MESet& meAmplitude(
MEs_.at(
"Amplitude"));
270 MESet& meAmplitudeSummary(
MEs_.at(
"AmplitudeSummary"));
279 unsigned iDCC(
dccId(
id) - 1);
288 static_cast<MESetMulti&
>(meAmplitude).use(iME);
289 static_cast<MESetMulti&
>(meAmplitudeSummary).use(iME);
294 float amp(
max((
double)uhitItr->amplitude(), 0.));
295 float jitter(
max((
double)uhitItr->jitter() + 5.0, 0.));
297 meAmplitude.
fill(
id, amp);
298 meAmplitudeSummary.fill(
id, amp);
299 meTiming.fill(
id, jitter);
305 if(ampItrA ==
pnAmp_.end() && ampItrB ==
pnAmp_.end())
continue;
306 else if(ampItrB ==
pnAmp_.end()) aop = amp / ampItrA->second;
307 else if(ampItrA ==
pnAmp_.end()) aop = amp / ampItrB->second;
308 else aop = amp / (ampItrA->second + ampItrB->second) * 2.;
310 meAOverP.fill(
id, aop);
int adc(sample_type sample)
get the ADC sample (12 bits)
T getUntrackedParameter(std::string const &, T const &) const
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
void setParams(edm::ParameterSet const &)
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
DEFINE_ECALDQM_WORKER(CalibrationSummaryClient)
void addDependencies(DependencySet &) override
uint32_t rawId() const
get the raw id
std::string to_string(const T &t)
void beginEvent(edm::Event const &, edm::EventSetup const &) override
const T & max(const T &a, const T &b)
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 &)
unsigned wavelength_[nEEDCC]
const_iterator end() const
bool null() const
is this a null id ?
std::map< unsigned, float > pnAmp_
std::map< int, unsigned > wlToME_
const_iterator end() const
bool filterRunType(short 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 &)