1 #include "../interface/PedestalTask.h"
31 unsigned nG(MGPAGains.size());
32 for(
unsigned iG(0); iG != nG; ++iG){
33 int gain(MGPAGains[iG]);
34 if(gain != 1 && gain != 6 && gain != 12)
throw cms::Exception(
"InvalidConfiguration") <<
"MGPA gain";
41 MESetMulti& pnPedestal(static_cast<MESetMulti&>(
MEs_.at(
"PNPedestal")));
42 unsigned nGPN(MGPAGainsPN.size());
43 for(
unsigned iG(0); iG != nGPN; ++iG){
44 int gain(MGPAGainsPN[iG]);
45 if(gain != 1 && gain != 16)
throw cms::Exception(
"InvalidConfiguration") <<
"PN MGPA gain";
56 for(
int iFED(0); iFED <
nDCC; iFED++){
69 template<
typename DigiCollection>
78 for(
typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr){
79 DetId id(digiItr->id());
81 int iDCC(
dccId(
id) - 1);
90 case 1: gain = 12;
break;
91 case 2: gain = 6;
break;
92 case 3: gain = 1;
break;
100 static_cast<MESetMulti&
>(mePedestal).use(iME);
103 meOccupancy.
fill(
id);
106 mePedestal.fill(
id,
double(dataFrame.
sample(iSample).
adc()));
113 MESet& mePNPedestal(
MEs_.at(
"PNPedestal"));
120 int iDCC(
dccId(
id) - 1);
125 switch(digiItr->sample(0).gainId()){
126 case 0: gain = 1;
break;
127 case 1: gain = 16;
break;
135 static_cast<MESetMulti&
>(mePNPedestal).use(iME);
138 for(
int iSample(0); iSample < 50; iSample++)
139 mePNPedestal.
fill(
id,
double(digiItr->sample(iSample).adc()));
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_ECALDQM_WORKER(TYPE)
bool filterRunType(short const *) override
std::vector< EcalPnDiodeDigi >::const_iterator const_iterator
EcalMGPASample sample(int i) const
void runOnDigis(DigiCollection const &)
int gainId() const
get the gainId (2 bits)
void fill(DetId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
std::map< int, unsigned > gainToME_
std::string to_string(const T &t)
const_iterator end() const
std::map< int, unsigned > pnGainToME_
void setParams(edm::ParameterSet const &) override
std::map< std::string, std::string > PathReplacements
unsigned dccId(DetId const &)
void runOnPnDigis(EcalPnDiodeDigiCollection const &)
static const int MAXSAMPLES
unsigned getIndex(PathReplacements const &) const
const_iterator begin() const
int adc() const
get the ADC sample (12 bits)