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++){
91 unsigned iDCC(rItr->id() - 1);
100 if(rItr->getEventSettings().wavelength == 0)
102 else if(rItr->getEventSettings().wavelength == 2)
117 MESet& meOccupancy(
MEs_.at(
"Occupancy"));
119 MESet& meSignalRate(
MEs_.at(
"SignalRate"));
124 nReadouts[
index] = 0;
125 for(
int i(0);
i < 10;
i++) maxpos[
index][
i] = 0;
129 const DetId& id(digiItr->id());
131 unsigned iDCC(
dccId(
id) - 1);
138 meOccupancy.fill(
id);
147 for (
int i(0);
i < 10;
i++) {
155 if(iMax >= 0 && max - min > 3)
156 maxpos[
index][iMax] += 1;
166 if(nReadouts[
index] == 0){
174 for(
int i(0);
i < 10;
i++){
175 if(maxpos[
index][
i] > threshold){
184 static_cast<MESetMulti&
>(meSignalRate).use(iME);
194 else if(ledOnExpected)
return;
199 const DetId& id(digiItr->id());
201 unsigned iDCC(
dccId(
id) - 1);
216 for(
int iSample(0); iSample < 10; iSample++)
217 meShape.fill(
id, iSample + 0.5,
float(dataFrame.
sample(iSample).
adc()));
221 if(pnidA.
null() || pnidB.
null())
continue;
230 MESet& mePNAmplitude(
MEs_.at(
"PNAmplitude"));
235 if(digiItr->sample(0).gainId() != 0 && digiItr->sample(0).gainId() != 1)
continue;
239 std::map<uint32_t, float>::iterator ampItr(
pnAmp_.find(
id.rawId()));
240 if(ampItr ==
pnAmp_.end())
continue;
242 unsigned iDCC(
dccId(
id) - 1);
247 for(
int iSample(0); iSample < 4; iSample++)
248 pedestal += digiItr->sample(iSample).adc();
252 for(
int iSample(0); iSample < 50; iSample++){
253 float amp(digiItr->sample(iSample).adc() -
pedestal);
254 if(amp > max) max = amp;
259 static_cast<MESetMulti&
>(mePNAmplitude).use(iME);
262 mePNAmplitude.
fill(
id, max);
264 ampItr->second =
max;
273 MESet& meAmplitude(
MEs_.at(
"Amplitude"));
274 MESet& meAmplitudeSummary(
MEs_.at(
"AmplitudeSummary"));
283 unsigned iDCC(
dccId(
id) - 1);
292 static_cast<MESetMulti&
>(meAmplitude).use(iME);
293 static_cast<MESetMulti&
>(meAmplitudeSummary).use(iME);
298 float amp(
max((
double)uhitItr->amplitude(), 0.));
299 float jitter(
max((
double)uhitItr->jitter() + 5.0, 0.));
301 meAmplitude.
fill(
id, amp);
302 meAmplitudeSummary.fill(
id, amp);
303 meTiming.fill(
id, jitter);
309 if(ampItrA ==
pnAmp_.end() && ampItrB ==
pnAmp_.end())
continue;
310 else if(ampItrB ==
pnAmp_.end()) aop = amp / ampItrA->second;
311 else if(ampItrA ==
pnAmp_.end()) aop = amp / ampItrB->second;
312 else aop = amp / (ampItrA->second + ampItrB->second) * 2.;
314 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
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
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
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
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 &)