58 for (
int i = 0;
i < 36;
i++) {
62 #ifdef COMMON_NOISE_ANALYSIS
105 for (
int i = 0;
i < 36;
i++) {
115 #ifdef COMMON_NOISE_ANALYSIS
138 std::stringstream GainN, GN;
146 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
148 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
151 for (
int i = 0;
i < 36;
i++) {
152 name =
"EBPT pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
153 mePedMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
157 #ifdef COMMON_NOISE_ANALYSIS
158 name =
"EBPT pedestal 3sum " +
Numbers::sEB(i+1) +
" " + GN.str();
159 mePed3SumMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
163 name =
"EBPT pedestal 5sum " +
Numbers::sEB(i+1) +
" " + GN.str();
164 mePed5SumMapG01_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
176 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 6;
178 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 6;
181 for (
int i = 0;
i < 36;
i++) {
182 name =
"EBPT pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
183 mePedMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
187 #ifdef COMMON_NOISE_ANALYSIS
188 name =
"EBPT pedestal 3sum " +
Numbers::sEB(i+1) +
" " + GN.str();
189 mePed3SumMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
193 name =
"EBPT pedestal 5sum " +
Numbers::sEB(i+1) +
" " + GN.str();
194 mePed5SumMapG06_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
206 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 12;
208 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 12;
211 for (
int i = 0;
i < 36;
i++) {
212 name =
"EBPT pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
213 mePedMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
217 #ifdef COMMON_NOISE_ANALYSIS
218 name =
"EBPT pedestal 3sum " +
Numbers::sEB(i+1) +
" " + GN.str();
219 mePed3SumMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
223 name =
"EBPT pedestal 5sum " +
Numbers::sEB(i+1) +
" " + GN.str();
224 mePed5SumMapG12_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.,
"s");
238 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 1;
240 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 1;
243 for (
int i = 0;
i < 36;
i++) {
244 name =
"EBPDT PNs pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
256 GainN <<
"Gain" << std::setw(2) << std::setfill(
'0') << 16;
258 GN <<
"G" << std::setw(2) << std::setfill(
'0') << 16;
261 for (
int i = 0;
i < 36;
i++) {
262 name =
"EBPDT PNs pedestal " +
Numbers::sEB(
i+1) +
" " + GN.str();
277 if ( !
init_ )
return;
285 for (
int i = 0;
i < 36;
i++ ) {
288 #ifdef COMMON_NOISE_ANALYSIS
301 for (
int i = 0;
i < 36;
i++ ) {
304 #ifdef COMMON_NOISE_ANALYSIS
317 for (
int i = 0;
i < 36;
i++ ) {
320 #ifdef COMMON_NOISE_ANALYSIS
335 for (
int i = 0;
i < 36;
i++ ) {
345 for (
int i = 0;
i < 36;
i++ ) {
370 for (
int i=0;
i<36;
i++) runType[
i] = -1;
382 runType[ism-1] = dcchItr->getRunType();
395 if ( ! enable )
return;
405 int nebd = digis->size();
406 LogDebug(
"EBPedestalTask") <<
"event " <<
ievt_ <<
" digi collection size " << nebd;
408 float xmap01[36][85][20];
409 float xmap06[36][85][20];
410 float xmap12[36][85][20];
413 for (
int ie = 1; ie <= 85; ie++ ) {
414 for (
int ip = 1; ip <= 20; ip++ ) {
416 xmap01[
ism-1][ie-1][ip-1] = 0.;
417 xmap06[
ism-1][ie-1][ip-1] = 0.;
418 xmap12[
ism-1][ie-1][ip-1] = 0.;
429 int ie = (ic-1)/20 + 1;
430 int ip = (ic-1)%20 + 1;
434 float xie = ie - 0.5;
435 float xip = ip - 0.5;
442 for (
int i = 0;
i < 10;
i++) {
452 float xval = float(adc);
454 if ( mePedMap ) mePedMap->
Fill(xie, xip, xval);
456 if ( dataframe.
sample(
i).
gainId() == 1 ) xmap12[ism-1][ie-1][ip-1] = xmap12[ism-1][ie-1][ip-1] + xval;
457 if ( dataframe.
sample(
i).
gainId() == 2 ) xmap06[ism-1][ie-1][ip-1] = xmap06[ism-1][ie-1][ip-1] + xval;
458 if ( dataframe.
sample(
i).
gainId() == 3 ) xmap01[ism-1][ie-1][ip-1] = xmap01[ism-1][ie-1][ip-1] + xval;
462 xmap12[ism-1][ie-1][ip-1]=xmap12[ism-1][ie-1][ip-1]/10.;
463 xmap06[ism-1][ie-1][ip-1]=xmap06[ism-1][ie-1][ip-1]/10.;
464 xmap01[ism-1][ie-1][ip-1]=xmap01[ism-1][ie-1][ip-1]/10.;
470 #ifdef COMMON_NOISE_ANALYSIS
472 for (
int ie = 1; ie <= 85; ie++ ) {
473 for (
int ip = 1; ip <= 20; ip++ ) {
475 float xie = ie - 0.5;
476 float xip = ip - 0.5;
482 if ( ie >= 2 && ie <= 84 && ip >= 2 && ip <= 19 ) {
487 for (
int i = -1;
i <= +1;
i++ ) {
488 for (
int j = -1;
j <= +1;
j++ ) {
490 x3val01 = x3val01 + xmap01[
ism-1][ie-1+
i][ip-1+
j];
491 x3val06 = x3val06 + xmap06[
ism-1][ie-1+
i][ip-1+
j];
492 x3val12 = x3val12 + xmap12[
ism-1][ie-1+
i][ip-1+
j];
496 x3val01 = x3val01 / 9.;
497 x3val06 = x3val06 / 9.;
498 x3val12 = x3val12 / 9.;
509 if ( ie >= 3 && ie <= 83 && ip >= 3 && ip <= 18 ) {
514 for (
int i = -2;
i <= +2;
i++ ) {
515 for (
int j = -2;
j <= +2;
j++ ) {
517 x5val01 = x5val01 + xmap01[
ism-1][ie-1+
i][ip-1+
j];
518 x5val06 = x5val06 + xmap06[
ism-1][ie-1+
i][ip-1+
j];
519 x5val12 = x5val12 + xmap12[
ism-1][ie-1+
i][ip-1+
j];
523 x5val01 = x5val01 / 25.;
524 x5val06 = x5val06 / 25.;
525 x5val12 = x5val12 / 25.;
547 int nep = pns->size();
548 LogDebug(
"EBPedestalTask") <<
"event " <<
ievt_ <<
" pns collection size " << nep;
556 int num = pnItr->id().iPnId();
561 for (
int i = 0;
i < 50;
i++) {
563 int adc = pnItr->sample(
i).adc();
570 float xval = float(adc);
572 if ( mePNPed ) mePNPed->
Fill(num - 0.5, xval);
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)
Some "id" conversions.
static std::string sEB(const unsigned ism)
MonitorElement * mePed3SumMapG01_[36]
MonitorElement * mePed5SumMapG01_[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 analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
edm::InputTag EcalRawDataCollection_
void tag(MonitorElement *me, unsigned int myTag)
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
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.
MonitorElement * mePedMapG12_[36]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int ic() const
get ECAL/crystal number inside SM
std::vector< int > MGPAGainsPN_
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
edm::InputTag EcalPnDiodeDigiCollection_
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)
edm::InputTag EBDigiCollection_
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")