CMS 3D CMS Logo

EEPedestalTask.cc

Go to the documentation of this file.
00001 /*
00002  * \file EEPedestalTask.cc
00003  *
00004  * $Date: 2008/12/04 06:22:48 $
00005  * $Revision: 1.44 $
00006  * \author G. Della Ricca
00007  *
00008 */
00009 
00010 #include <iostream>
00011 #include <fstream>
00012 #include <vector>
00013 
00014 #include "FWCore/ServiceRegistry/interface/Service.h"
00015 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00016 
00017 #include "DQMServices/Core/interface/MonitorElement.h"
00018 
00019 #include "DQMServices/Core/interface/DQMStore.h"
00020 
00021 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
00022 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00023 #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
00024 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00025 
00026 #include <DQM/EcalCommon/interface/Numbers.h>
00027 
00028 #include <DQM/EcalEndcapMonitorTasks/interface/EEPedestalTask.h>
00029 
00030 using namespace cms;
00031 using namespace edm;
00032 using namespace std;
00033 
00034 EEPedestalTask::EEPedestalTask(const ParameterSet& ps){
00035 
00036   init_ = false;
00037 
00038   dqmStore_ = Service<DQMStore>().operator->();
00039 
00040   prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
00041 
00042   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00043 
00044   mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
00045 
00046   EcalRawDataCollection_ = ps.getParameter<edm::InputTag>("EcalRawDataCollection");
00047   EEDigiCollection_ = ps.getParameter<edm::InputTag>("EEDigiCollection");
00048   EcalPnDiodeDigiCollection_ = ps.getParameter<edm::InputTag>("EcalPnDiodeDigiCollection");
00049 
00050   for (int i = 0; i < 18; i++) {
00051     mePedMapG01_[i] = 0;
00052     mePedMapG06_[i] = 0;
00053     mePedMapG12_[i] = 0;
00054     mePed3SumMapG01_[i] = 0;
00055     mePed3SumMapG06_[i] = 0;
00056     mePed3SumMapG12_[i] = 0;
00057     mePed5SumMapG01_[i] = 0;
00058     mePed5SumMapG06_[i] = 0;
00059     mePed5SumMapG12_[i] = 0;
00060     mePnPedMapG01_[i] = 0;
00061     mePnPedMapG16_[i] = 0;
00062   }
00063 
00064 }
00065 
00066 EEPedestalTask::~EEPedestalTask(){
00067 
00068 }
00069 
00070 void EEPedestalTask::beginJob(const EventSetup& c){
00071 
00072   ievt_ = 0;
00073 
00074   if ( dqmStore_ ) {
00075     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask");
00076     dqmStore_->rmdir(prefixME_ + "/EEPedestalTask");
00077   }
00078 
00079   Numbers::initGeometry(c, false);
00080 
00081 }
00082 
00083 void EEPedestalTask::beginRun(const Run& r, const EventSetup& c) {
00084 
00085   if ( ! mergeRuns_ ) this->reset();
00086 
00087 }
00088 
00089 void EEPedestalTask::endRun(const Run& r, const EventSetup& c) {
00090 
00091 }
00092 
00093 void EEPedestalTask::reset(void) {
00094 
00095   for (int i = 0; i < 18; i++) {
00096     if ( mePedMapG01_[i] ) mePedMapG01_[i]->Reset();
00097     if ( mePedMapG06_[i] ) mePedMapG06_[i]->Reset();
00098     if ( mePedMapG12_[i] ) mePedMapG12_[i]->Reset();
00099     if ( mePed3SumMapG01_[i] ) mePed3SumMapG01_[i]->Reset();
00100     if ( mePed3SumMapG06_[i] ) mePed3SumMapG06_[i]->Reset();
00101     if ( mePed3SumMapG12_[i] ) mePed3SumMapG12_[i]->Reset();
00102     if ( mePed5SumMapG01_[i] ) mePed5SumMapG01_[i]->Reset();
00103     if ( mePed5SumMapG06_[i] ) mePed5SumMapG06_[i]->Reset();
00104     if ( mePed5SumMapG12_[i] ) mePed5SumMapG12_[i]->Reset();
00105     if ( mePnPedMapG01_[i] ) mePnPedMapG01_[i]->Reset();
00106     if ( mePnPedMapG16_[i] ) mePnPedMapG16_[i]->Reset();
00107   }
00108 
00109 }
00110 
00111 void EEPedestalTask::setup(void){
00112 
00113   init_ = true;
00114 
00115   char histo[200];
00116 
00117   if ( dqmStore_ ) {
00118     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask");
00119 
00120     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain01");
00121     for (int i = 0; i < 18; i++) {
00122       sprintf(histo, "EEPT pedestal %s G01", Numbers::sEE(i+1).c_str());
00123       mePedMapG01_[i] = dqmStore_->bookProfile2D(histo, histo, 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., "s");
00124       mePedMapG01_[i]->setAxisTitle("jx", 1);
00125       mePedMapG01_[i]->setAxisTitle("jy", 2);
00126       dqmStore_->tag(mePedMapG01_[i], i+1);
00127       sprintf(histo, "EEPT pedestal 3sum %s G01", Numbers::sEE(i+1).c_str());
00128       mePed3SumMapG01_[i] = dqmStore_->bookProfile2D(histo, histo, 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., "s");
00129       mePed3SumMapG01_[i]->setAxisTitle("jx", 1);
00130       mePed3SumMapG01_[i]->setAxisTitle("jy", 2);
00131       dqmStore_->tag(mePed3SumMapG01_[i], i+1);
00132       sprintf(histo, "EEPT pedestal 5sum %s G01", Numbers::sEE(i+1).c_str());
00133       mePed5SumMapG01_[i] = dqmStore_->bookProfile2D(histo, histo, 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., "s");
00134       mePed5SumMapG01_[i]->setAxisTitle("jx", 1);
00135       mePed5SumMapG01_[i]->setAxisTitle("jy", 2);
00136       dqmStore_->tag(mePed5SumMapG01_[i], i+1);
00137     }
00138 
00139     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain06");
00140     for (int i = 0; i < 18; i++) {
00141       sprintf(histo, "EEPT pedestal %s G06", Numbers::sEE(i+1).c_str());
00142       mePedMapG06_[i] = dqmStore_->bookProfile2D(histo, histo, 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., "s");
00143       mePedMapG06_[i]->setAxisTitle("jx", 1);
00144       mePedMapG06_[i]->setAxisTitle("jy", 2);
00145       dqmStore_->tag(mePedMapG06_[i], i+1);
00146       sprintf(histo, "EEPT pedestal 3sum %s G06", Numbers::sEE(i+1).c_str());
00147       mePed3SumMapG06_[i] = dqmStore_->bookProfile2D(histo, histo, 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., "s");
00148       mePed3SumMapG06_[i]->setAxisTitle("jx", 1);
00149       mePed3SumMapG06_[i]->setAxisTitle("jy", 2);
00150       dqmStore_->tag(mePed3SumMapG06_[i], i+1);
00151       sprintf(histo, "EEPT pedestal 5sum %s G06", Numbers::sEE(i+1).c_str());
00152       mePed5SumMapG06_[i] = dqmStore_->bookProfile2D(histo, histo, 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., "s");
00153       mePed5SumMapG06_[i]->setAxisTitle("jx", 1);
00154       mePed5SumMapG06_[i]->setAxisTitle("jy", 2);
00155       dqmStore_->tag(mePed5SumMapG06_[i], i+1);
00156     }
00157 
00158     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain12");
00159     for (int i = 0; i < 18; i++) {
00160       sprintf(histo, "EEPT pedestal %s G12", Numbers::sEE(i+1).c_str());
00161       mePedMapG12_[i] = dqmStore_->bookProfile2D(histo, histo, 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., "s");
00162       mePedMapG12_[i]->setAxisTitle("jx", 1);
00163       mePedMapG12_[i]->setAxisTitle("jy", 2);
00164       dqmStore_->tag(mePedMapG12_[i], i+1);
00165       sprintf(histo, "EEPT pedestal 3sum %s G12", Numbers::sEE(i+1).c_str());
00166       mePed3SumMapG12_[i] = dqmStore_->bookProfile2D(histo, histo, 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., "s");
00167       mePed3SumMapG12_[i]->setAxisTitle("jx", 1);
00168       mePed3SumMapG12_[i]->setAxisTitle("jy", 2);
00169       dqmStore_->tag(mePed3SumMapG12_[i], i+1);
00170       sprintf(histo, "EEPT pedestal 5sum %s G12", Numbers::sEE(i+1).c_str());
00171       mePed5SumMapG12_[i] = dqmStore_->bookProfile2D(histo, histo, 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., "s");
00172       mePed5SumMapG12_[i]->setAxisTitle("jx", 1);
00173       mePed5SumMapG12_[i]->setAxisTitle("jy", 2);
00174       dqmStore_->tag(mePed5SumMapG12_[i], i+1);
00175     }
00176 
00177     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN");
00178 
00179     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain01");
00180     for (int i = 0; i < 18; i++) {
00181       sprintf(histo, "EEPDT PNs pedestal %s G01", Numbers::sEE(i+1).c_str());
00182       mePnPedMapG01_[i] =  dqmStore_->bookProfile(histo, histo, 10, 0., 10., 4096, 0., 4096., "s");
00183       mePnPedMapG01_[i]->setAxisTitle("channel", 1);
00184       mePnPedMapG01_[i]->setAxisTitle("pedestal", 2);
00185       dqmStore_->tag(mePnPedMapG01_[i], i+1);
00186     }
00187 
00188     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain16");
00189     for (int i = 0; i < 18; i++) {
00190       sprintf(histo, "EEPDT PNs pedestal %s G16", Numbers::sEE(i+1).c_str());
00191       mePnPedMapG16_[i] =  dqmStore_->bookProfile(histo, histo, 10, 0., 10., 4096, 0., 4096., "s");
00192       mePnPedMapG16_[i]->setAxisTitle("channel", 1);
00193       mePnPedMapG16_[i]->setAxisTitle("pedestal", 2);
00194       dqmStore_->tag(mePnPedMapG16_[i], i+1);
00195     }
00196 
00197   }
00198 
00199 }
00200 
00201 void EEPedestalTask::cleanup(void){
00202 
00203   if ( ! init_ ) return;
00204 
00205   if ( dqmStore_ ) {
00206     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask");
00207 
00208     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain01");
00209     for ( int i = 0; i < 18; i++ ) {
00210       if ( mePedMapG01_[i] ) dqmStore_->removeElement( mePedMapG01_[i]->getName() );
00211       mePedMapG01_[i] = 0;
00212       if ( mePed3SumMapG01_[i] ) dqmStore_->removeElement( mePed3SumMapG01_[i]->getName() );
00213       mePed3SumMapG01_[i] = 0;
00214       if ( mePed5SumMapG01_[i] ) dqmStore_->removeElement( mePed5SumMapG01_[i]->getName() );
00215       mePed5SumMapG01_[i] = 0;
00216     }
00217 
00218     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain06");
00219     for ( int i = 0; i < 18; i++ ) {
00220       if ( mePedMapG06_[i] ) dqmStore_->removeElement( mePedMapG06_[i]->getName() );
00221       mePedMapG06_[i] = 0;
00222       if ( mePed3SumMapG06_[i] ) dqmStore_->removeElement( mePed3SumMapG06_[i]->getName() );
00223       mePed3SumMapG06_[i] = 0;
00224       if ( mePed5SumMapG06_[i] ) dqmStore_->removeElement( mePed5SumMapG06_[i]->getName() );
00225       mePed5SumMapG06_[i] = 0;
00226     }
00227 
00228     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain12");
00229     for ( int i = 0; i < 18; i++ ) {
00230       if ( mePedMapG12_[i] ) dqmStore_->removeElement( mePedMapG12_[i]->getName() );
00231       mePedMapG12_[i] = 0;
00232       if ( mePed3SumMapG12_[i] ) dqmStore_->removeElement( mePed3SumMapG12_[i]->getName() );
00233       mePed3SumMapG12_[i] = 0;
00234       if ( mePed5SumMapG12_[i] ) dqmStore_->removeElement( mePed5SumMapG12_[i]->getName() );
00235       mePed5SumMapG12_[i] = 0;
00236     }
00237 
00238     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN");
00239 
00240     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain01");
00241     for ( int i = 0; i < 18; i++ ) {
00242       if ( mePnPedMapG01_[i]) dqmStore_->removeElement( mePnPedMapG01_[i]->getName() );
00243       mePnPedMapG01_[i] = 0;
00244     }
00245 
00246     dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain16");
00247     for ( int i = 0; i < 18; i++ ) {
00248       if ( mePnPedMapG16_[i]) dqmStore_->removeElement( mePnPedMapG16_[i]->getName() );
00249       mePnPedMapG16_[i] = 0;
00250     }
00251 
00252   }
00253 
00254   init_ = false;
00255 
00256 }
00257 
00258 void EEPedestalTask::endJob(void){
00259 
00260   LogInfo("EEPedestalTask") << "analyzed " << ievt_ << " events";
00261 
00262   if ( enableCleanup_ ) this->cleanup();
00263 
00264 }
00265 
00266 void EEPedestalTask::analyze(const Event& e, const EventSetup& c){
00267 
00268   bool enable = false;
00269   int runType[18] = { -1 };
00270 
00271   Handle<EcalRawDataCollection> dcchs;
00272 
00273   if ( e.getByLabel(EcalRawDataCollection_, dcchs) ) {
00274 
00275     for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
00276 
00277       if ( Numbers::subDet( *dcchItr ) != EcalEndcap ) continue;
00278 
00279       int ism = Numbers::iSM( *dcchItr, EcalEndcap );
00280 
00281       runType[ism-1] = dcchItr->getRunType();
00282 
00283       if ( dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_STD ||
00284            dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_GAP ) enable = true;
00285 
00286     }
00287 
00288   } else {
00289 
00290     LogWarning("EEPedestalTask") << EcalRawDataCollection_ << " not available";
00291 
00292   }
00293 
00294   if ( ! enable ) return;
00295 
00296   if ( ! init_ ) this->setup();
00297 
00298   ievt_++;
00299 
00300   Handle<EEDigiCollection> digis;
00301 
00302   if ( e.getByLabel(EEDigiCollection_, digis) ) {
00303 
00304     int need = digis->size();
00305     LogDebug("EEPedestalTask") << "event " << ievt_ << " digi collection size " << need;
00306 
00307     float xmap01[18][50][50];
00308     float xmap06[18][50][50];
00309     float xmap12[18][50][50];
00310 
00311     for ( int ism = 1; ism <= 18; ism++ ) {
00312       for ( int ix = 1; ix <= 50; ix++ ) {
00313         for ( int iy = 1; iy <= 50; iy++ ) {
00314 
00315           xmap01[ism-1][ix-1][iy-1] = 0.;
00316           xmap06[ism-1][ix-1][iy-1] = 0.;
00317           xmap12[ism-1][ix-1][iy-1] = 0.;
00318 
00319         }
00320       }
00321     }
00322 
00323     for ( EEDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr ) {
00324 
00325       EEDetId id = digiItr->id();
00326 
00327       int ix = id.ix();
00328       int iy = id.iy();
00329 
00330       int ism = Numbers::iSM( id );
00331 
00332       if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
00333 
00334       float xix = ix - 0.5;
00335       float xiy = iy - 0.5;
00336 
00337       if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_STD ||
00338                runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_GAP ) ) continue;
00339 
00340       LogDebug("EEPedestalTask") << " det id = " << id;
00341       LogDebug("EEPedestalTask") << " sm, ix, iy " << ism << " " << ix << " " << iy;
00342 
00343       EEDataFrame dataframe = (*digiItr);
00344 
00345       for (int i = 0; i < 10; i++) {
00346 
00347         int adc = dataframe.sample(i).adc();
00348 
00349         MonitorElement* mePedMap = 0;
00350 
00351         if ( dataframe.sample(i).gainId() == 1 ) mePedMap = mePedMapG12_[ism-1];
00352         if ( dataframe.sample(i).gainId() == 2 ) mePedMap = mePedMapG06_[ism-1];
00353         if ( dataframe.sample(i).gainId() == 3 ) mePedMap = mePedMapG01_[ism-1];
00354 
00355         float xval = float(adc);
00356 
00357         if ( mePedMap ) mePedMap->Fill(xix, xiy, xval);
00358 
00359         if ( dataframe.sample(i).gainId() == 1 ) xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] = xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] + xval;
00360         if ( dataframe.sample(i).gainId() == 2 ) xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] = xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] + xval;
00361         if ( dataframe.sample(i).gainId() == 3 ) xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] = xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] + xval;
00362 
00363       }
00364 
00365       xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]=xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]/10.;
00366       xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]=xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]/10.;
00367       xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]=xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]/10.;
00368 
00369     }
00370 
00371     // to be re-done using the 3x3 & 5x5 Selectors (if faster)
00372 
00373     for ( int ism = 1; ism <= 18; ism++ ) {
00374       for ( int ix = 1; ix <= 50; ix++ ) {
00375         for ( int iy = 1; iy <= 50; iy++ ) {
00376 
00377           int jx = ix + Numbers::ix0EE(ism);
00378           int jy = iy + Numbers::iy0EE(ism);
00379 
00380           if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
00381 
00382           if ( ! Numbers::validEE(ism, jx, jy) ) continue;
00383 
00384           float xix = ix - 0.5;
00385           float xiy = iy - 0.5;
00386 
00387           float x3val01;
00388           float x3val06;
00389           float x3val12;
00390 
00391           if ( ix >= 2 && ix <= 49 && iy >= 2 && iy <= 49 ) {
00392 
00393             x3val01 = 0.;
00394             x3val06 = 0.;
00395             x3val12 = 0.;
00396             for ( int i = -1; i <= +1; i++ ) {
00397               for ( int j = -1; j <= +1; j++ ) {
00398 
00399                 x3val01 = x3val01 + xmap01[ism-1][ix-1+i][iy-1+j];
00400                 x3val06 = x3val06 + xmap06[ism-1][ix-1+i][iy-1+j];
00401                 x3val12 = x3val12 + xmap12[ism-1][ix-1+i][iy-1+j];
00402 
00403               }
00404             }
00405             x3val01 = x3val01 / 9.;
00406             x3val06 = x3val06 / 9.;
00407             x3val12 = x3val12 / 9.;
00408             if ( mePed3SumMapG01_[ism-1] && x3val01 != 0. ) mePed3SumMapG01_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x3val01);
00409             if ( mePed3SumMapG06_[ism-1] && x3val06 != 0. ) mePed3SumMapG06_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x3val06);
00410             if ( mePed3SumMapG12_[ism-1] && x3val12 != 0. ) mePed3SumMapG12_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x3val12);
00411 
00412           }
00413 
00414           float x5val01;
00415           float x5val06;
00416           float x5val12;
00417 
00418           if ( ix >= 3 && ix <= 48 && iy >= 3 && iy <= 48 ) {
00419 
00420             x5val01 = 0.;
00421             x5val06 = 0.;
00422             x5val12 = 0.;
00423             for ( int i = -2; i <= +2; i++ ) {
00424               for ( int j = -2; j <= +2; j++ ) {
00425 
00426                 x5val01 = x5val01 + xmap01[ism-1][ix-1+i][iy-1+j];
00427                 x5val06 = x5val06 + xmap06[ism-1][ix-1+i][iy-1+j];
00428                 x5val12 = x5val12 + xmap12[ism-1][ix-1+i][iy-1+j];
00429 
00430               }
00431             }
00432             x5val01 = x5val01 / 25.;
00433             x5val06 = x5val06 / 25.;
00434             x5val12 = x5val12 / 25.;
00435             if ( mePed5SumMapG01_[ism-1] && x5val01 != 0. ) mePed5SumMapG01_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x5val01);
00436             if ( mePed5SumMapG06_[ism-1] && x5val06 != 0. ) mePed5SumMapG06_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x5val06);
00437             if ( mePed5SumMapG12_[ism-1] && x5val12 != 0. ) mePed5SumMapG12_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x5val12);
00438 
00439           }
00440 
00441         }
00442       }
00443     }
00444 
00445   } else {
00446 
00447     LogWarning("EEPedestalTask") << EEDigiCollection_ << " not available";
00448 
00449   }
00450 
00451   Handle<EcalPnDiodeDigiCollection> pns;
00452 
00453   if ( e.getByLabel(EcalPnDiodeDigiCollection_, pns) ) {
00454 
00455     int nep = pns->size();
00456     LogDebug("EEPedestalTask") << "event " << ievt_ << " pns collection size " << nep;
00457 
00458     for ( EcalPnDiodeDigiCollection::const_iterator pnItr = pns->begin(); pnItr != pns->end(); ++pnItr ) {
00459 
00460       if ( Numbers::subDet( pnItr->id() ) != EcalEndcap ) continue;
00461 
00462       int ism = Numbers::iSM( pnItr->id() );
00463 
00464       int num = pnItr->id().iPnId();
00465 
00466       if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_STD ||
00467                runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_GAP ) ) continue;
00468 
00469       LogDebug("EEPedestalTask") << " det id = " << pnItr->id();
00470       LogDebug("EEPedestalTask") << " sm, num " << ism << " " << num;
00471 
00472       for (int i = 0; i < 50; i++) {
00473 
00474         int adc = pnItr->sample(i).adc();
00475 
00476         MonitorElement* mePNPed = 0;
00477 
00478         if ( pnItr->sample(i).gainId() == 0 ) mePNPed = mePnPedMapG01_[ism-1];
00479         if ( pnItr->sample(i).gainId() == 1 ) mePNPed = mePnPedMapG16_[ism-1];
00480 
00481         float xval = float(adc);
00482 
00483         if ( mePNPed ) mePNPed->Fill(num - 0.5, xval);
00484 
00485       }
00486 
00487     }
00488 
00489   } else {
00490 
00491     LogWarning("EEPedestalTask") << EcalPnDiodeDigiCollection_ << " not available";
00492 
00493   }
00494 
00495 }
00496 

Generated on Tue Jun 9 17:32:53 2009 for CMSSW by  doxygen 1.5.4