57 for (
int i = 0;
i < 36;
i++) {
102 for (
int i = 0;
i < 36;
i++) {
132 std::stringstream GainN, GN;
140 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
142 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
145 for (
int i = 0;
i < 36;
i++) {
147 meShapeMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
153 name =
"EBTPT amplitude " +
Numbers::sEB(i+1) +
" " + GN.str(),
154 meAmplMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
165 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 6;
167 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 6;
170 for (
int i = 0;
i < 36;
i++) {
172 meShapeMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
178 name =
"EBTPT amplitude " +
Numbers::sEB(i+1) +
" " + GN.str(),
179 meAmplMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
190 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 12;
192 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 12;
195 for (
int i = 0;
i < 36;
i++) {
197 meShapeMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
203 name =
"EBTPT amplitude " +
Numbers::sEB(i+1) +
" " + GN.str(),
204 meAmplMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
217 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
219 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
222 for (
int i = 0;
i < 36;
i++) {
223 name =
"EBTPT PNs amplitude " +
Numbers::sEB(
i+1) +
" " + GN.str();
229 name =
"EBTPT PNs pedestal " +
Numbers::sEB(i+1) +
" " + GN.str();
241 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 16;
243 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 16;
246 for (
int i = 0;
i < 36;
i++) {
247 name =
"EBTPT PNs amplitude " +
Numbers::sEB(
i+1) +
" " + GN.str();
253 name =
"EBTPT PNs pedestal " +
Numbers::sEB(i+1) +
" " + GN.str();
268 if ( !
init_ )
return;
276 for (
int i = 0;
i < 36;
i++) {
288 for (
int i = 0;
i < 36;
i++) {
300 for (
int i = 0;
i < 36;
i++) {
314 for (
int i = 0;
i < 36;
i++) {
327 for (
int i = 0;
i < 36;
i++) {
354 for (
int i=0;
i<36;
i++) runType[
i] = -1;
356 for (
int i=0;
i<36;
i++) mgpaGain[
i] = -1;
368 runType[ism-1] = dcchItr->getRunType();
369 mgpaGain[ism-1] = dcchItr->getMgpaGain();
378 edm::LogWarning(
"EBTestPulseTask") <<
"EcalRawDataCollection not available";
382 if ( ! enable )
return;
392 int nebd = digis->size();
393 LogDebug(
"EBTestPulseTask") <<
"event " <<
ievt_ <<
" digi collection size " << nebd;
408 for (
int i = 0;
i < 10;
i++) {
418 float xval = float(adc);
420 if ( meShapeMap ) meShapeMap->
Fill(ic - 0.5,
i + 0.5, xval);
428 edm::LogWarning(
"EBTestPulseTask") <<
"EBDigiCollection not available";
436 int neh = hits->size();
437 LogDebug(
"EBTestPulseTask") <<
"event " <<
ievt_ <<
" hits collection size " << neh;
444 int ie = (ic-1)/20 + 1;
445 int ip = (ic-1)%20 + 1;
449 float xie = ie - 0.5;
450 float xip = ip - 0.5;
457 if ( mgpaGain[ism-1] == 3 ) meAmplMap =
meAmplMapG01_[ism-1];
458 if ( mgpaGain[ism-1] == 2 ) meAmplMap =
meAmplMapG06_[ism-1];
459 if ( mgpaGain[ism-1] == 1 ) meAmplMap =
meAmplMapG12_[ism-1];
461 float xval = hitItr->amplitude();
462 if ( xval <= 0. ) xval = 0.0;
468 if ( meAmplMap ) meAmplMap->
Fill(xie, xip, xval);
474 edm::LogWarning(
"EBTestPulseTask") <<
"EcalUncalibratedRecHitCollection not available";
482 int nep = pns->size();
483 LogDebug(
"EBTestPulseTask") <<
"event " <<
ievt_ <<
" pns collection size " << nep;
491 int num = pnItr->id().iPnId();
498 for (
int i = 0;
i < 4;
i++) {
500 int adc = pnItr->sample(
i).adc();
507 float xval = float(adc);
509 if ( mePNPed ) mePNPed->
Fill(num - 0.5, xval);
511 xvalped = xvalped + xval;
515 xvalped = xvalped / 4;
521 for (
int i = 0;
i < 50;
i++) {
523 int adc = pnItr->sample(
i).adc();
525 float xval = float(adc);
527 if ( xval >= xvalmax ) xvalmax = xval;
531 xvalmax = xvalmax - xvalped;
536 if ( mePN ) mePN->
Fill(num - 0.5, xvalmax);
542 edm::LogWarning(
"EBTestPulseTask") <<
"EcalPnDiodeDigiCollection not available";
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.
edm::EDGetTokenT< EcalPnDiodeDigiCollection > EcalPnDiodeDigiCollection_
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]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Some "id" conversions.
MonitorElement * mePnAmplMapG16_[36]
static std::string sEB(const unsigned ism)
void cleanup(void)
Cleanup.
std::vector< EcalDCCHeaderBlock >::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.
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
MonitorElement * meShapeMapG12_[36]
void tag(MonitorElement *me, unsigned int myTag)
edm::EDGetTokenT< EcalUncalibratedRecHitCollection > EcalUncalibratedRecHitCollection_
void removeElement(const std::string &name)
MonitorElement * meShapeMapG01_[36]
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]
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_
static EcalSubdetector subDet(const EBDetId &id)
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.
edm::EDGetTokenT< EBDigiCollection > EBDigiCollection_
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")