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++) {
426 float xval = float(adc);
428 if ( meShapeMap ) meShapeMap->
Fill(ic - 0.5,
i + 0.5, xval);
444 int neh = hits->size();
445 LogDebug(
"EBTestPulseTask") <<
"event " <<
ievt_ <<
" hits collection size " << neh;
452 int ie = (ic-1)/20 + 1;
453 int ip = (ic-1)%20 + 1;
457 float xie = ie - 0.5;
458 float xip = ip - 0.5;
465 if ( mgpaGain[ism-1] == 3 ) meAmplMap =
meAmplMapG01_[ism-1];
466 if ( mgpaGain[ism-1] == 2 ) meAmplMap =
meAmplMapG06_[ism-1];
467 if ( mgpaGain[ism-1] == 1 ) meAmplMap =
meAmplMapG12_[ism-1];
469 float xval = hitItr->amplitude();
470 if ( xval <= 0. ) xval = 0.0;
476 if ( meAmplMap ) meAmplMap->
Fill(xie, xip, xval);
490 int nep = pns->size();
491 LogDebug(
"EBTestPulseTask") <<
"event " <<
ievt_ <<
" pns collection size " << nep;
499 int num = pnItr->id().iPnId();
506 for (
int i = 0;
i < 4;
i++) {
508 int adc = pnItr->sample(
i).adc();
515 float xval = float(adc);
517 if ( mePNPed ) mePNPed->
Fill(num - 0.5, xval);
519 xvalped = xvalped + xval;
523 xvalped = xvalped / 4;
529 for (
int i = 0;
i < 50;
i++) {
531 int adc = pnItr->sample(
i).adc();
533 float xval = float(adc);
535 if ( xval >= xvalmax ) xvalmax = xval;
539 xvalmax = xvalmax - xvalped;
544 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]
static std::string sEB(const int ism)
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]
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)
int gainId() const
get the gainId (2 bits)
void beginJob(void)
BeginJob.
MonitorElement * meShapeMapG12_[36]
void tag(MonitorElement *me, unsigned int myTag)
static int iSM(const int ism, const EcalSubdetector subdet)
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")
std::string getName(Reflex::Type &cc)
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]
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")