1 #include "../interface/LedTask.h"
26 MGPAGainsPN_ = commonParams.getUntrackedParameter<std::vector<int> >(
"MGPAGainsPN");
29 ledWavelengths_ = taskParams.getUntrackedParameter<std::vector<int> >(
"ledWavelengths");
32 if(*wlItr != 1 && *wlItr != 2)
throw cms::Exception(
"InvalidConfiguration") <<
"Led Wavelength" << std::endl;
35 if(*gainItr != 1 && *gainItr != 16)
throw cms::Exception(
"InvalidConfiguration") <<
"PN diode gain" << std::endl;
37 map<string, string> replacements;
43 replacements[
"wl"] = ss.str();
45 unsigned offset(*wlItr - 1);
57 replacements[
"pngain"] = ss.str();
59 offset = (*wlItr - 1) *
nPNGain + (*gainItr == 1 ? 0 : 1);
74 unsigned offset(*wlItr - 1);
84 offset = (*wlItr - 1) *
nPNGain + (*gainItr == 1 ? 0 : 1);
133 int iDCC(dcchItr->id() - 1);
137 wavelength_[iDCC] = dcchItr->getEventSettings().wavelength + 1;
147 const DetId& id(digiItr->id());
149 int iDCC(
dccId(
id) - 1);
155 case 1: offset = 0;
break;
156 case 3: offset = 1;
break;
165 for(
int iSample(0); iSample < 10; iSample++)
176 int iDCC(
dccId(
id) - 1);
183 for(
int iSample(0); iSample < 4; iSample++)
184 pedestal += digiItr->sample(iSample).adc();
188 for(
int iSample(0); iSample < 50; iSample++){
191 float amp(digiItr->sample(iSample).adc() - pedestal);
193 if(amp > max) max = amp;
196 int gain(digiItr->sample(0).gainId() == 0 ? 1 : 16);
201 case 1: offset = (gain == 1 ? 0 : 1);
break;
202 case 3: offset =
nPNGain + (gain == 1 ? 0 : 1);
break;
221 int iDCC(
dccId(
id) - 1);
227 case 1: offset = 0;
break;
228 case 3: offset = 1;
break;
232 float amp(
max((
double)uhitItr->amplitude(), 0.));
233 float jitter(
max((
double)uhitItr->jitter() + 5.0, 0.));
242 float pn0(0.), pn1(0.);
252 pn0 =
pnAmp_[pnAFED][pnPair.first];
253 pn1 =
pnAmp_[pnBFED][pnPair.second];
255 if(pn0 < 10 && pn1 > 10){
257 }
else if(pn0 > 10 && pn1 < 10){
259 }
else if(pn0 + pn1 > 1){
260 aop = amp / (0.5 * (pn0 + pn1));
278 for(
unsigned iWL(0); iWL <
nWL; iWL++){
286 for(
unsigned iPNGain(0); iPNGain <
nPNGain; iPNGain++){
287 unsigned offset(iWL * nPNGain + iPNGain);
static int lmmod(SuperCrysCoord iX, SuperCrysCoord iY)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
void beginRun(const edm::Run &, const edm::EventSetup &) override
int wavelength_[BinService::nDCC]
unsigned getEEPnDCC(unsigned, unsigned)
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
EcalMGPASample sample(int i) const
void runOnRawData(const EcalRawDataCollection &)
unsigned dccId(const DetId &)
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
const_iterator begin() const
std::map< int, std::vector< float > > pnAmp_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< int > ledWavelengths_
static std::pair< int, int > pn(int dee, int ilmod)
const T & max(const T &a, const T &b)
void runOnUncalibRecHits(const EcalUncalibratedRecHitCollection &)
void endEvent(const edm::Event &, const edm::EventSetup &) override
static void setMEData(std::vector< MEData > &)
unsigned int offset(bool)
bool filterRunType(const std::vector< short > &) override
const_iterator end() const
std::vector< MESet * > MEs_
LedTask(const edm::ParameterSet &, const edm::ParameterSet &)
const_iterator end() const
void runOnPnDigis(const EcalPnDiodeDigiCollection &)
static int dee(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
DEFINE_ECALDQM_WORKER(CertificationClient)
bool enable_[BinService::nDCC]
void runOnDigis(const EcalDigiCollection &)
std::vector< int > MGPAGainsPN_
const_iterator begin() const
int adc() const
get the ADC sample (12 bits)