56 for (
int i = 0;
i < 36;
i++) {
60 #ifdef COMMON_NOISE_ANALYSIS
103 for (
int i = 0;
i < 36;
i++) {
113 #ifdef COMMON_NOISE_ANALYSIS
136 std::stringstream GainN, GN;
144 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
146 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
149 for (
int i = 0;
i < 36;
i++) {
150 name =
"EBPT pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
151 mePedMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
155 #ifdef COMMON_NOISE_ANALYSIS
156 name =
"EBPT pedestal 3sum " +
Numbers::sEB(i+1) +
" " + GN.str();
157 mePed3SumMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
161 name =
"EBPT pedestal 5sum " +
Numbers::sEB(i+1) +
" " + GN.str();
162 mePed5SumMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
174 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 6;
176 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 6;
179 for (
int i = 0;
i < 36;
i++) {
180 name =
"EBPT pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
181 mePedMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
185 #ifdef COMMON_NOISE_ANALYSIS
186 name =
"EBPT pedestal 3sum " +
Numbers::sEB(i+1) +
" " + GN.str();
187 mePed3SumMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
191 name =
"EBPT pedestal 5sum " +
Numbers::sEB(i+1) +
" " + GN.str();
192 mePed5SumMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
204 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 12;
206 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 12;
209 for (
int i = 0;
i < 36;
i++) {
210 name =
"EBPT pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
211 mePedMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
215 #ifdef COMMON_NOISE_ANALYSIS
216 name =
"EBPT pedestal 3sum " +
Numbers::sEB(i+1) +
" " + GN.str();
217 mePed3SumMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
221 name =
"EBPT pedestal 5sum " +
Numbers::sEB(i+1) +
" " + GN.str();
222 mePed5SumMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
236 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
238 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
241 for (
int i = 0;
i < 36;
i++) {
242 name =
"EBPDT PNs pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
254 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 16;
256 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 16;
259 for (
int i = 0;
i < 36;
i++) {
260 name =
"EBPDT PNs pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
275 if ( !
init_ )
return;
283 for (
int i = 0;
i < 36;
i++ ) {
286 #ifdef COMMON_NOISE_ANALYSIS
299 for (
int i = 0;
i < 36;
i++ ) {
302 #ifdef COMMON_NOISE_ANALYSIS
315 for (
int i = 0;
i < 36;
i++ ) {
318 #ifdef COMMON_NOISE_ANALYSIS
333 for (
int i = 0;
i < 36;
i++ ) {
343 for (
int i = 0;
i < 36;
i++ ) {
368 for (
int i=0;
i<36;
i++) runType[
i] = -1;
380 runType[ism-1] = dcchItr->getRunType();
389 edm::LogWarning(
"EBPedestalTask") <<
"EcalRawDataCollection not available";
393 if ( ! enable )
return;
403 int nebd = digis->size();
404 LogDebug(
"EBPedestalTask") <<
"event " <<
ievt_ <<
" digi collection size " << nebd;
406 float xmap01[36][85][20];
407 float xmap06[36][85][20];
408 float xmap12[36][85][20];
411 for (
int ie = 1; ie <= 85; ie++ ) {
412 for (
int ip = 1; ip <= 20; ip++ ) {
414 xmap01[
ism-1][ie-1][ip-1] = 0.;
415 xmap06[
ism-1][ie-1][ip-1] = 0.;
416 xmap12[
ism-1][ie-1][ip-1] = 0.;
427 int ie = (ic-1)/20 + 1;
428 int ip = (ic-1)%20 + 1;
432 float xie = ie - 0.5;
433 float xip = ip - 0.5;
440 for (
int i = 0;
i < 10;
i++) {
450 float xval = float(adc);
452 if ( mePedMap ) mePedMap->
Fill(xie, xip, xval);
454 if ( dataframe.
sample(
i).
gainId() == 1 ) xmap12[ism-1][ie-1][ip-1] = xmap12[ism-1][ie-1][ip-1] + xval;
455 if ( dataframe.
sample(
i).
gainId() == 2 ) xmap06[ism-1][ie-1][ip-1] = xmap06[ism-1][ie-1][ip-1] + xval;
456 if ( dataframe.
sample(
i).
gainId() == 3 ) xmap01[ism-1][ie-1][ip-1] = xmap01[ism-1][ie-1][ip-1] + xval;
460 xmap12[ism-1][ie-1][ip-1]=xmap12[ism-1][ie-1][ip-1]/10.;
461 xmap06[ism-1][ie-1][ip-1]=xmap06[ism-1][ie-1][ip-1]/10.;
462 xmap01[ism-1][ie-1][ip-1]=xmap01[ism-1][ie-1][ip-1]/10.;
468 #ifdef COMMON_NOISE_ANALYSIS
470 for (
int ie = 1; ie <= 85; ie++ ) {
471 for (
int ip = 1; ip <= 20; ip++ ) {
473 float xie = ie - 0.5;
474 float xip = ip - 0.5;
480 if ( ie >= 2 && ie <= 84 && ip >= 2 && ip <= 19 ) {
485 for (
int i = -1;
i <= +1;
i++ ) {
486 for (
int j = -1;
j <= +1;
j++ ) {
488 x3val01 = x3val01 + xmap01[
ism-1][ie-1+
i][ip-1+
j];
489 x3val06 = x3val06 + xmap06[
ism-1][ie-1+
i][ip-1+
j];
490 x3val12 = x3val12 + xmap12[
ism-1][ie-1+
i][ip-1+
j];
494 x3val01 = x3val01 / 9.;
495 x3val06 = x3val06 / 9.;
496 x3val12 = x3val12 / 9.;
507 if ( ie >= 3 && ie <= 83 && ip >= 3 && ip <= 18 ) {
512 for (
int i = -2;
i <= +2;
i++ ) {
513 for (
int j = -2;
j <= +2;
j++ ) {
515 x5val01 = x5val01 + xmap01[
ism-1][ie-1+
i][ip-1+
j];
516 x5val06 = x5val06 + xmap06[
ism-1][ie-1+
i][ip-1+
j];
517 x5val12 = x5val12 + xmap12[
ism-1][ie-1+
i][ip-1+
j];
521 x5val01 = x5val01 / 25.;
522 x5val06 = x5val06 / 25.;
523 x5val12 = x5val12 / 25.;
545 int nep = pns->size();
546 LogDebug(
"EBPedestalTask") <<
"event " <<
ievt_ <<
" pns collection size " << nep;
554 int num = pnItr->id().iPnId();
559 for (
int i = 0;
i < 50;
i++) {
561 int adc = pnItr->sample(
i).adc();
568 float xval = float(adc);
570 if ( mePNPed ) mePNPed->
Fill(num - 0.5, xval);
578 edm::LogWarning(
"EBPedestalTask") <<
"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 * mePed3SumMapG12_[36]
EBPedestalTask(const edm::ParameterSet &ps)
Constructor.
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * mePedMapG06_[36]
void rmdir(const std::string &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Some "id" conversions.
static std::string sEB(const unsigned ism)
MonitorElement * mePed3SumMapG01_[36]
MonitorElement * mePed5SumMapG01_[36]
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)
int gainId() const
get the gainId (2 bits)
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
void tag(MonitorElement *me, unsigned int myTag)
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
edm::EDGetTokenT< EcalPnDiodeDigiCollection > EcalPnDiodeDigiCollection_
void removeElement(const std::string &name)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
MonitorElement * mePed5SumMapG12_[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 * mePed3SumMapG06_[36]
void beginJob(void)
BeginJob.
edm::EDGetTokenT< EBDigiCollection > EBDigiCollection_
MonitorElement * mePedMapG12_[36]
int ic() const
get ECAL/crystal number inside SM
std::vector< int > MGPAGainsPN_
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
virtual ~EBPedestalTask()
Destructor.
MonitorElement * mePed5SumMapG06_[36]
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
MonitorElement * mePedMapG01_[36]
static EcalSubdetector subDet(const EBDetId &id)
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
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 > MGPAGains_
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")