59 for (
int i = 0;
i < 36;
i++) {
104 for (
int i = 0;
i < 36;
i++) {
134 std::stringstream GainN, GN;
142 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
144 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
147 for (
int i = 0;
i < 36;
i++) {
149 meShapeMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
155 name =
"EBTPT amplitude " +
Numbers::sEB(i+1) +
" " + GN.str(),
156 meAmplMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
167 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 6;
169 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 6;
172 for (
int i = 0;
i < 36;
i++) {
174 meShapeMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
180 name =
"EBTPT amplitude " +
Numbers::sEB(i+1) +
" " + GN.str(),
181 meAmplMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
192 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 12;
194 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 12;
197 for (
int i = 0;
i < 36;
i++) {
199 meShapeMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
205 name =
"EBTPT amplitude " +
Numbers::sEB(i+1) +
" " + GN.str(),
206 meAmplMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
219 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
221 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
224 for (
int i = 0;
i < 36;
i++) {
225 name =
"EBTPT PNs amplitude " +
Numbers::sEB(
i+1) +
" " + GN.str();
231 name =
"EBTPT PNs pedestal " +
Numbers::sEB(i+1) +
" " + GN.str();
243 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 16;
245 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 16;
248 for (
int i = 0;
i < 36;
i++) {
249 name =
"EBTPT PNs amplitude " +
Numbers::sEB(
i+1) +
" " + GN.str();
255 name =
"EBTPT PNs pedestal " +
Numbers::sEB(i+1) +
" " + GN.str();
270 if ( !
init_ )
return;
278 for (
int i = 0;
i < 36;
i++) {
290 for (
int i = 0;
i < 36;
i++) {
302 for (
int i = 0;
i < 36;
i++) {
316 for (
int i = 0;
i < 36;
i++) {
329 for (
int i = 0;
i < 36;
i++) {
356 for (
int i=0;
i<36;
i++) runType[
i] = -1;
358 for (
int i=0;
i<36;
i++) mgpaGain[
i] = -1;
370 runType[ism-1] = dcchItr->getRunType();
371 mgpaGain[ism-1] = dcchItr->getMgpaGain();
384 if ( ! enable )
return;
394 int nebd = digis->size();
395 LogDebug(
"EBTestPulseTask") <<
"event " <<
ievt_ <<
" digi collection size " << nebd;
410 for (
int i = 0;
i < 10;
i++) {
420 float xval = float(adc);
422 if ( meShapeMap ) meShapeMap->
Fill(ic - 0.5,
i + 0.5, xval);
438 int neh = hits->size();
439 LogDebug(
"EBTestPulseTask") <<
"event " <<
ievt_ <<
" hits collection size " << neh;
446 int ie = (ic-1)/20 + 1;
447 int ip = (ic-1)%20 + 1;
451 float xie = ie - 0.5;
452 float xip = ip - 0.5;
459 if ( mgpaGain[ism-1] == 3 ) meAmplMap =
meAmplMapG01_[ism-1];
460 if ( mgpaGain[ism-1] == 2 ) meAmplMap =
meAmplMapG06_[ism-1];
461 if ( mgpaGain[ism-1] == 1 ) meAmplMap =
meAmplMapG12_[ism-1];
463 float xval = hitItr->amplitude();
464 if ( xval <= 0. ) xval = 0.0;
470 if ( meAmplMap ) meAmplMap->
Fill(xie, xip, xval);
484 int nep = pns->size();
485 LogDebug(
"EBTestPulseTask") <<
"event " <<
ievt_ <<
" pns collection size " << nep;
493 int num = pnItr->id().iPnId();
500 for (
int i = 0;
i < 4;
i++) {
502 int adc = pnItr->sample(
i).adc();
509 float xval = float(adc);
511 if ( mePNPed ) mePNPed->
Fill(num - 0.5, xval);
513 xvalped = xvalped + xval;
517 xvalped = xvalped / 4;
523 for (
int i = 0;
i < 50;
i++) {
525 int adc = pnItr->sample(
i).adc();
527 float xval = float(adc);
529 if ( xval >= xvalmax ) xvalmax = xval;
533 xvalmax = xvalmax - xvalped;
538 if ( mePN ) mePN->
Fill(num - 0.5, xvalmax);
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meAmplMapG06_[36]
EBTestPulseTask(const edm::ParameterSet &ps)
Constructor.
MonitorElement * meShapeMapG06_[36]
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * mePnAmplMapG01_[36]
void rmdir(const std::string &fullpath)
MonitorElement * meAmplMapG01_[36]
Some "id" conversions.
MonitorElement * mePnAmplMapG16_[36]
static std::string sEB(const unsigned ism)
void cleanup(void)
Cleanup.
std::vector< T >::const_iterator const_iterator
EcalMGPASample sample(int i) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void beginJob(void)
BeginJob.
MonitorElement * meShapeMapG12_[36]
void tag(MonitorElement *me, unsigned int myTag)
void removeElement(const std::string &name)
MonitorElement * meShapeMapG01_[36]
edm::InputTag EcalRawDataCollection_
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
MonitorElement * meAmplMapG12_[36]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int ic() const
get ECAL/crystal number inside SM
MonitorElement * mePnPedMapG01_[36]
virtual ~EBTestPulseTask()
Destructor.
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
MonitorElement * mePnPedMapG16_[36]
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
std::vector< int > MGPAGainsPN_
edm::InputTag EBDigiCollection_
edm::InputTag EcalUncalibratedRecHitCollection_
static EcalSubdetector subDet(const EBDetId &id)
edm::InputTag EcalPnDiodeDigiCollection_
int ism(int ieta, int iphi)
std::vector< int > MGPAGains_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
void setCurrentFolder(const std::string &fullpath)
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
int adc() const
get the ADC sample (12 bits)
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")