1 #include "../interface/TestPulseTask.h"
28 MGPAGains_ = commonParams.getUntrackedParameter<std::vector<int> >(
"MGPAGains");
29 MGPAGainsPN_ = commonParams.getUntrackedParameter<std::vector<int> >(
"MGPAGainsPN");
31 for(
int idcc(0); idcc < 54; idcc++){
36 for(std::vector<int>::iterator gainItr(
MGPAGains_.begin()); gainItr !=
MGPAGains_.end(); ++gainItr)
37 if(*gainItr != 1 && *gainItr != 6 && *gainItr != 12)
throw cms::Exception(
"InvalidConfiguration") <<
"MGPA gain" << std::endl;
40 if(*gainItr != 1 && *gainItr != 16)
throw cms::Exception(
"InvalidConfiguration") <<
"PN diode gain" << std::endl;
42 map<string, string> replacements;
48 replacements[
"gain"] = ss.str();
52 case 1: offset = 0;
break;
53 case 6: offset = 1;
break;
54 case 12: offset = 2;
break;
66 replacements[
"pngain"] = ss.str();
70 case 1: offset = 0;
break;
71 case 16: offset = 1;
break;
87 for(std::vector<int>::iterator gainItr(
MGPAGains_.begin()); gainItr !=
MGPAGains_.end(); ++gainItr){
90 case 1: offset = 0;
break;
91 case 6: offset = 1;
break;
92 case 12: offset = 2;
break;
103 case 1: offset = 0;
break;
104 case 16: offset = 1;
break;
116 for(
int idcc(0); idcc < 54; idcc++){
125 for(
int idcc(0); idcc < 54; idcc++){
136 for(
int iFED(0); iFED < 54; iFED++){
151 DetId id(digiItr->id());
153 int iDCC(
dccId(
id) - 1);
162 case 1: offset = 2;
gain_[iDCC] = 12;
break;
163 case 2: offset = 1;
gain_[iDCC] = 6;
break;
164 case 3: offset = 0;
gain_[iDCC] = 1;
break;
172 for(
int iSample(0); iSample < 10; iSample++)
183 int iDCC(
dccId(
id) - 1);
189 switch(digiItr->sample(0).gainId()){
190 case 0: offset = 0; gain = 1;
break;
191 case 1: offset = 1; gain = 16;
break;
200 for(
int iSample(0); iSample < 4; iSample++)
201 pedestal += digiItr->sample(iSample).adc();
205 for(
int iSample(0); iSample < 50; iSample++)
206 if(digiItr->sample(iSample).adc() >
max) max = digiItr->sample(iSample).adc();
208 float amplitude(max - pedestal);
218 DetId id(uhitItr->id());
220 int iDCC(
dccId(
id) - 1);
226 case 1: offset = 0;
break;
227 case 6: offset = 1;
break;
228 case 12: offset = 2;
break;
245 for(
unsigned iGain(0); iGain <
nGain; iGain++){
250 for(
unsigned iPNGain(0); iPNGain <
nPNGain; iPNGain++){
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
std::vector< int > MGPAGains_
std::vector< EcalPnDiodeDigi >::const_iterator const_iterator
EcalMGPASample sample(int i) const
unsigned dccId(const DetId &)
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
const_iterator begin() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int gainId() const
get the gainId (2 bits)
static void setMEData(std::vector< MEData > &)
void beginRun(const edm::Run &, const edm::EventSetup &) override
const T & max(const T &a, const T &b)
void endEvent(const edm::Event &, const edm::EventSetup &) override
TestPulseTask(const edm::ParameterSet &, const edm::ParameterSet &)
void runOnPnDigis(const EcalPnDiodeDigiCollection &)
unsigned int offset(bool)
const_iterator end() const
std::vector< MESet * > MEs_
void runOnDigis(const EcalDigiCollection &)
std::vector< int > MGPAGainsPN_
const_iterator end() const
bool filterRunType(const std::vector< short > &) override
DEFINE_ECALDQM_WORKER(CertificationClient)
void runOnUncalibRecHits(const EcalUncalibratedRecHitCollection &)
const_iterator begin() const
int adc() const
get the ADC sample (12 bits)