53 for (
int i = 0;
i < 18;
i++) {
97 for (
int i = 0;
i < 18;
i++) {
127 std::stringstream GainN, GN;
135 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
137 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
140 for (
int i = 0;
i < 18;
i++) {
142 meShapeMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096.,
"s");
148 name =
"EETPT amplitude " +
Numbers::sEE(i+1) +
" " + GN.str();
149 meAmplMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 50,
Numbers::ix0EE(i+1)+0.,
Numbers::ix0EE(i+1)+50., 50,
Numbers::iy0EE(i+1)+0.,
Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12.,
"s");
161 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 6;
163 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 6;
166 for (
int i = 0;
i < 18;
i++) {
168 meShapeMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096.,
"s");
174 name =
"EETPT amplitude " +
Numbers::sEE(i+1) +
" " + GN.str();
175 meAmplMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 50,
Numbers::ix0EE(i+1)+0.,
Numbers::ix0EE(i+1)+50., 50,
Numbers::iy0EE(i+1)+0.,
Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12.,
"s");
187 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 12;
189 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 12;
192 for (
int i = 0;
i < 18;
i++) {
194 meShapeMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096.,
"s");
200 name =
"EETPT amplitude " +
Numbers::sEE(i+1) +
" " + GN.str();
201 meAmplMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 50,
Numbers::ix0EE(i+1)+0.,
Numbers::ix0EE(i+1)+50., 50,
Numbers::iy0EE(i+1)+0.,
Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12.,
"s");
215 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
217 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
220 for (
int i = 0;
i < 18;
i++) {
221 name =
"EETPT PNs amplitude " +
Numbers::sEE(
i+1) +
" " + GN.str();
226 name =
"EETPT PNs pedestal " +
Numbers::sEE(i+1) +
" " + GN.str();
238 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 16;
240 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 16;
243 for (
int i = 0;
i < 18;
i++) {
244 name =
"EETPT PNs amplitude " +
Numbers::sEE(
i+1) +
" " + GN.str();
249 name =
"EETPT PNs pedestal " +
Numbers::sEE(i+1) +
" " + GN.str();
264 if ( !
init_ )
return;
272 for (
int i = 0;
i < 18;
i++) {
284 for (
int i = 0;
i < 18;
i++) {
296 for (
int i = 0;
i < 18;
i++) {
310 for (
int i = 0;
i < 18;
i++) {
322 for (
int i = 0;
i < 18;
i++) {
349 for (
int i=0;
i<18;
i++) runType[
i] = -1;
351 for (
int i=0;
i<18;
i++) mgpaGain[
i] = -1;
363 runType[ism-1] = dcchItr->getRunType();
364 mgpaGain[ism-1] = dcchItr->getMgpaGain();
373 edm::LogWarning(
"EETestPulseTask") <<
"EcalRawDataCollection not available";
377 if ( ! enable )
return;
387 int need = digis->size();
388 LogDebug(
"EETestPulseTask") <<
"event " <<
ievt_ <<
" digi collection size " << need;
406 for (
int i = 0;
i < 10;
i++) {
416 float xval = float(adc);
418 if ( meShapeMap ) meShapeMap->
Fill(ic - 0.5,
i + 0.5, xval);
426 edm::LogWarning(
"EETestPulseTask") <<
"EEDigiCollection not available";
434 int neh = hits->size();
435 LogDebug(
"EETestPulseTask") <<
"event " <<
ievt_ <<
" hits collection size " << neh;
446 if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
448 float xix = ix - 0.5;
449 float xiy = iy - 0.5;
456 if ( mgpaGain[ism-1] == 3 ) meAmplMap =
meAmplMapG01_[ism-1];
457 if ( mgpaGain[ism-1] == 2 ) meAmplMap =
meAmplMapG06_[ism-1];
458 if ( mgpaGain[ism-1] == 1 ) meAmplMap =
meAmplMapG12_[ism-1];
460 float xval = hitItr->amplitude();
461 if ( xval <= 0. ) xval = 0.0;
467 if ( meAmplMap ) meAmplMap->
Fill(xix, xiy, xval);
473 edm::LogWarning(
"EETestPulseTask") <<
"EcalUncalibratedRecHitCollection not available";
481 int nep = pns->size();
482 LogDebug(
"EETestPulseTask") <<
"event " <<
ievt_ <<
" pns collection size " << nep;
490 int num = pnItr->id().iPnId();
497 for (
int i = 0;
i < 4;
i++) {
499 int adc = pnItr->sample(
i).adc();
506 float xval = float(adc);
508 if ( mePNPed ) mePNPed->
Fill(num - 0.5, xval);
510 xvalped = xvalped + xval;
514 xvalped = xvalped / 4;
520 for (
int i = 0;
i < 50;
i++) {
522 int adc = pnItr->sample(
i).adc();
524 float xval = float(adc);
526 if ( xval >= xvalmax ) xvalmax = xval;
530 xvalmax = xvalmax - xvalped;
535 if ( mePN ) mePN->
Fill(num - 0.5, xvalmax);
541 edm::LogWarning(
"EETestPulseTask") <<
"EcalPnDiodeDigiCollection not available";
int adc(sample_type sample)
get the ADC sample (12 bits)
virtual ~EETestPulseTask()
Destructor.
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
static std::string sEE(const unsigned ism)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
static unsigned icEE(const unsigned ism, const unsigned ix, const unsigned iy)
void rmdir(const std::string &fullpath)
edm::EDGetTokenT< EEDigiCollection > EEDigiCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Some "id" conversions.
std::vector< int > MGPAGains_
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
MonitorElement * meShapeMapG06_[18]
EcalMGPASample sample(int i) const
MonitorElement * mePnAmplMapG01_[18]
static int ix0EE(const unsigned ism)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
static int iy0EE(const unsigned ism)
MonitorElement * meAmplMapG01_[18]
void tag(MonitorElement *me, unsigned int myTag)
EETestPulseTask(const edm::ParameterSet &ps)
Constructor.
void cleanup(void)
Cleanup.
MonitorElement * mePnAmplMapG16_[18]
void removeElement(const std::string &name)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
edm::EDGetTokenT< EcalPnDiodeDigiCollection > EcalPnDiodeDigiCollection_
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
MonitorElement * meAmplMapG12_[18]
void beginJob(void)
BeginJob.
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
MonitorElement * meShapeMapG12_[18]
MonitorElement * mePnPedMapG01_[18]
edm::EDGetTokenT< EcalUncalibratedRecHitCollection > EcalUncalibratedRecHitCollection_
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
MonitorElement * meAmplMapG06_[18]
MonitorElement * meShapeMapG01_[18]
MonitorElement * mePnPedMapG16_[18]
static EcalSubdetector subDet(const EBDetId &id)
int ism(int ieta, int iphi)
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)
int adc() const
get the ADC sample (12 bits)
std::vector< int > MGPAGainsPN_
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")