CMS 3D CMS Logo

EEIntegrityTask.cc

Go to the documentation of this file.
00001 /*
00002  * \file EEIntegrityTask.cc
00003  *
00004  * $Date: 2008/12/03 12:55:50 $
00005  * $Revision: 1.41 $
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/EcalDetId/interface/EEDetId.h"
00022 
00023 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
00024 #include "DataFormats/EcalDetId/interface/EcalDetIdCollections.h"
00025 
00026 #include <DQM/EcalCommon/interface/Numbers.h>
00027 
00028 #include <DQM/EcalEndcapMonitorTasks/interface/EEIntegrityTask.h>
00029 
00030 using namespace cms;
00031 using namespace edm;
00032 using namespace std;
00033 
00034 EEIntegrityTask::EEIntegrityTask(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   EEDetIdCollection0_ =  ps.getParameter<edm::InputTag>("EEDetIdCollection0");
00047   EEDetIdCollection1_ =  ps.getParameter<edm::InputTag>("EEDetIdCollection1");
00048   EEDetIdCollection2_ =  ps.getParameter<edm::InputTag>("EEDetIdCollection2");
00049   EEDetIdCollection3_ =  ps.getParameter<edm::InputTag>("EEDetIdCollection3");
00050   EcalElectronicsIdCollection1_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection1");
00051   EcalElectronicsIdCollection2_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection2");
00052   EcalElectronicsIdCollection3_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection3");
00053   EcalElectronicsIdCollection4_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection4");
00054   EcalElectronicsIdCollection5_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection5");
00055   EcalElectronicsIdCollection6_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection6");
00056 
00057   meIntegrityDCCSize = 0;
00058   for (int i = 0; i < 18; i++) {
00059     meIntegrityGain[i] = 0;
00060     meIntegrityChId[i] = 0;
00061     meIntegrityGainSwitch[i] = 0;
00062     meIntegrityTTId[i] = 0;
00063     meIntegrityTTBlockSize[i] = 0;
00064     meIntegrityMemChId[i] = 0;
00065     meIntegrityMemGain[i] = 0;
00066     meIntegrityMemTTId[i] = 0;
00067     meIntegrityMemTTBlockSize[i] = 0;
00068   }
00069 
00070 }
00071 
00072 
00073 EEIntegrityTask::~EEIntegrityTask(){
00074 
00075 }
00076 
00077 void EEIntegrityTask::beginJob(const EventSetup& c){
00078 
00079   ievt_ = 0;
00080 
00081   if ( dqmStore_ ) {
00082     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask");
00083     dqmStore_->rmdir(prefixME_ + "/EEIntegrityTask");
00084   }
00085 
00086   Numbers::initGeometry(c, false);
00087 
00088 }
00089 
00090 void EEIntegrityTask::beginRun(const Run& r, const EventSetup& c) {
00091 
00092   if ( ! mergeRuns_ ) this->reset();
00093 
00094 }
00095 
00096 void EEIntegrityTask::endRun(const Run& r, const EventSetup& c) {
00097 
00098 }
00099 
00100 void EEIntegrityTask::reset(void) {
00101 
00102   if ( meIntegrityDCCSize ) meIntegrityDCCSize->Reset();
00103   for (int i = 0; i < 18; i++) {
00104     if ( meIntegrityGain[i] ) meIntegrityGain[i]->Reset();
00105     if ( meIntegrityChId[i] ) meIntegrityChId[i]->Reset();
00106     if ( meIntegrityGainSwitch[i] ) meIntegrityGainSwitch[i]->Reset();
00107     if ( meIntegrityTTId[i] ) meIntegrityTTId[i]->Reset();
00108     if ( meIntegrityTTBlockSize[i] ) meIntegrityTTBlockSize[i]->Reset();
00109     if ( meIntegrityMemChId[i] ) meIntegrityMemChId[i]->Reset();
00110     if ( meIntegrityMemGain[i] ) meIntegrityMemGain[i]->Reset();
00111     if ( meIntegrityMemTTId[i] ) meIntegrityMemTTId[i]->Reset();
00112     if ( meIntegrityMemTTBlockSize[i] ) meIntegrityMemTTBlockSize[i]->Reset();
00113   }
00114 
00115 }
00116 
00117 void EEIntegrityTask::setup(void){
00118 
00119   init_ = true;
00120 
00121   char histo[200];
00122 
00123   if ( dqmStore_ ) {
00124     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask");
00125 
00126     // checking when number of towers in data different than expected from header
00127     sprintf(histo, "EEIT DCC size error");
00128     meIntegrityDCCSize = dqmStore_->book1D(histo, histo, 18, 1, 19.);
00129     for (int i = 0; i < 18; i++) {
00130       meIntegrityDCCSize->setBinLabel(i+1, Numbers::sEE(i+1).c_str(), 1);
00131     }
00132 
00133     // checking when the gain is 0
00134     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/Gain");
00135     for (int i = 0; i < 18; i++) {
00136       sprintf(histo, "EEIT gain %s", Numbers::sEE(i+1).c_str());
00137       meIntegrityGain[i] = dqmStore_->book2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50.);
00138       meIntegrityGain[i]->setAxisTitle("jx", 1);
00139       meIntegrityGain[i]->setAxisTitle("jy", 2);
00140       dqmStore_->tag(meIntegrityGain[i], i+1);
00141     }
00142 
00143     // checking when channel has unexpected or invalid ID
00144     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/ChId");
00145     for (int i = 0; i < 18; i++) {
00146       sprintf(histo, "EEIT ChId %s", Numbers::sEE(i+1).c_str());
00147       meIntegrityChId[i] = dqmStore_->book2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50.);
00148       meIntegrityChId[i]->setAxisTitle("jx", 1);
00149       meIntegrityChId[i]->setAxisTitle("jy", 2);
00150       dqmStore_->tag(meIntegrityChId[i], i+1);
00151     }
00152 
00153     // checking when channel has unexpected or invalid ID
00154     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/GainSwitch");
00155     for (int i = 0; i < 18; i++) {
00156       sprintf(histo, "EEIT gain switch %s", Numbers::sEE(i+1).c_str());
00157       meIntegrityGainSwitch[i] = dqmStore_->book2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50.);
00158       meIntegrityGainSwitch[i]->setAxisTitle("jx", 1);
00159       meIntegrityGainSwitch[i]->setAxisTitle("jy", 2);
00160       dqmStore_->tag(meIntegrityGainSwitch[i], i+1);
00161     }
00162 
00163     // checking when trigger tower has unexpected or invalid ID
00164     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/TTId");
00165     for (int i = 0; i < 18; i++) {
00166       sprintf(histo, "EEIT TTId %s", Numbers::sEE(i+1).c_str());
00167       meIntegrityTTId[i] = dqmStore_->book2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50.);
00168       meIntegrityTTId[i]->setAxisTitle("jx", 1);
00169       meIntegrityTTId[i]->setAxisTitle("jy", 2);
00170       dqmStore_->tag(meIntegrityTTId[i], i+1);
00171     }
00172 
00173     // checking when trigger tower has unexpected or invalid size
00174     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/TTBlockSize");
00175     for (int i = 0; i < 18; i++) {
00176       sprintf(histo, "EEIT TTBlockSize %s", Numbers::sEE(i+1).c_str());
00177       meIntegrityTTBlockSize[i] = dqmStore_->book2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50.);
00178       meIntegrityTTBlockSize[i]->setAxisTitle("jx", 1);
00179       meIntegrityTTBlockSize[i]->setAxisTitle("jy", 2);
00180       dqmStore_->tag(meIntegrityTTBlockSize[i], i+1);
00181     }
00182 
00183     // checking when mem channels have unexpected ID
00184     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/MemChId");
00185     for (int i = 0; i < 18; i++) {
00186       sprintf(histo, "EEIT MemChId %s", Numbers::sEE(i+1).c_str());
00187       meIntegrityMemChId[i] = dqmStore_->book2D(histo, histo, 10, 0., 10., 5, 0., 5.);
00188       meIntegrityMemChId[i]->setAxisTitle("pseudo-strip", 1);
00189       meIntegrityMemChId[i]->setAxisTitle("channel", 2);
00190       dqmStore_->tag(meIntegrityMemChId[i], i+1);
00191     }
00192 
00193     // checking when mem samples have second bit encoding the gain different from 0
00194     // note: strictly speaking, this does not corrupt the mem sample gain value (since only first bit is considered)
00195     // but indicates that data are not completely correct
00196     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/MemGain");
00197     for (int i = 0; i < 18; i++) {
00198       sprintf(histo, "EEIT MemGain %s", Numbers::sEE(i+1).c_str());
00199       meIntegrityMemGain[i] = dqmStore_->book2D(histo, histo, 10, 0., 10., 5, 0., 5.);
00200       meIntegrityMemGain[i]->setAxisTitle("pseudo-strip", 1);
00201       meIntegrityMemGain[i]->setAxisTitle("channel", 2);
00202       dqmStore_->tag(meIntegrityMemGain[i], i+1);
00203     }
00204 
00205     // checking when mem tower block has unexpected ID
00206     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/MemTTId");
00207     for (int i = 0; i < 18; i++) {
00208       sprintf(histo, "EEIT MemTTId %s", Numbers::sEE(i+1).c_str());
00209       meIntegrityMemTTId[i] = dqmStore_->book2D(histo, histo, 2, 0., 2., 1, 0., 1.);
00210       meIntegrityMemTTId[i]->setAxisTitle("pseudo-strip", 1);
00211       meIntegrityMemTTId[i]->setAxisTitle("channel", 2);
00212       dqmStore_->tag(meIntegrityMemTTId[i], i+1);
00213     }
00214 
00215     // checking when mem tower block has invalid size
00216     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/MemSize");
00217     for (int i = 0; i < 18; i++) {
00218       sprintf(histo, "EEIT MemSize %s", Numbers::sEE(i+1).c_str());
00219       meIntegrityMemTTBlockSize[i] = dqmStore_->book2D(histo, histo, 2, 0., 2., 1, 0., 1.);
00220       meIntegrityMemTTId[i]->setAxisTitle("pseudo-strip", 1);
00221       meIntegrityMemTTId[i]->setAxisTitle("channel", 2);
00222       dqmStore_->tag(meIntegrityMemTTBlockSize[i], i+1);
00223     }
00224 
00225   }
00226 
00227 }
00228 
00229 void EEIntegrityTask::cleanup(void){
00230 
00231   if ( ! init_ ) return;
00232 
00233   if ( dqmStore_ ) {
00234     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask");
00235 
00236     if ( meIntegrityDCCSize ) dqmStore_->removeElement( meIntegrityDCCSize->getName() );
00237     meIntegrityDCCSize = 0;
00238 
00239     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/Gain");
00240     for (int i = 0; i < 18; i++) {
00241       if ( meIntegrityGain[i] ) dqmStore_->removeElement( meIntegrityGain[i]->getName() );
00242       meIntegrityGain[i] = 0;
00243     }
00244 
00245     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/ChId");
00246     for (int i = 0; i < 18; i++) {
00247       if ( meIntegrityChId[i] ) dqmStore_->removeElement( meIntegrityChId[i]->getName() );
00248       meIntegrityChId[i] = 0;
00249     }
00250 
00251     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/GainSwitch");
00252     for (int i = 0; i < 18; i++) {
00253       if ( meIntegrityGainSwitch[i] ) dqmStore_->removeElement( meIntegrityGainSwitch[i]->getName() );
00254       meIntegrityGainSwitch[i] = 0;
00255     }
00256 
00257     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/TTId");
00258     for (int i = 0; i < 18; i++) {
00259       if ( meIntegrityTTId[i] ) dqmStore_->removeElement( meIntegrityTTId[i]->getName() );
00260       meIntegrityTTId[i] = 0;
00261     }
00262 
00263     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/TTBlockSize");
00264     for (int i = 0; i < 18; i++) {
00265       if ( meIntegrityTTBlockSize[i] ) dqmStore_->removeElement( meIntegrityTTBlockSize[i]->getName() );
00266       meIntegrityTTBlockSize[i] = 0;
00267     }
00268 
00269     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/MemChId");
00270     for (int i = 0; i < 18; i++) {
00271       if ( meIntegrityMemChId[i] ) dqmStore_->removeElement( meIntegrityMemChId[i]->getName() );
00272       meIntegrityMemChId[i] = 0;
00273     }
00274 
00275     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/MemGain");
00276     for (int i = 0; i < 18; i++) {
00277       if ( meIntegrityMemGain[i] ) dqmStore_->removeElement( meIntegrityMemGain[i]->getName() );
00278       meIntegrityMemGain[i] = 0;
00279     }
00280 
00281     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/MemTTId");
00282     for (int i = 0; i < 18; i++) {
00283       if ( meIntegrityMemTTId[i] ) dqmStore_->removeElement( meIntegrityMemTTId[i]->getName() );
00284       meIntegrityMemTTId[i] = 0;
00285     }
00286 
00287     dqmStore_->setCurrentFolder(prefixME_ + "/EEIntegrityTask/MemSize");
00288     for (int i = 0; i < 18; i++) {
00289       if ( meIntegrityMemTTBlockSize[i] ) dqmStore_->removeElement( meIntegrityMemTTBlockSize[i]->getName() );
00290       meIntegrityMemTTBlockSize[i] = 0;
00291     }
00292 
00293   }
00294 
00295   init_ = false;
00296 
00297 }
00298 
00299 void EEIntegrityTask::endJob(void){
00300 
00301   LogInfo("EEIntegrityTask") << "analyzed " << ievt_ << " events";
00302 
00303   if ( enableCleanup_ ) this->cleanup();
00304 
00305 }
00306 
00307 void EEIntegrityTask::analyze(const Event& e, const EventSetup& c){
00308 
00309   if ( ! init_ ) this->setup();
00310 
00311   ievt_++;
00312 
00313   Handle<EEDetIdCollection> ids0;
00314 
00315   if ( e.getByLabel(EEDetIdCollection0_, ids0) ) {
00316 
00317     for ( EEDetIdCollection::const_iterator idItr = ids0->begin(); idItr != ids0->end(); ++idItr ) {
00318 
00319       int ism = Numbers::iSM( *idItr );
00320 
00321       float xism = ism - 0.5;
00322 
00323       if ( meIntegrityDCCSize ) meIntegrityDCCSize->Fill(xism);
00324 
00325     }
00326 
00327   } else {
00328 
00329 //    LogWarning("EEIntegrityTask") << EEDetIdCollection0_ << " not available";
00330 
00331   }
00332 
00333   Handle<EEDetIdCollection> ids1;
00334 
00335   if ( e.getByLabel(EEDetIdCollection1_, ids1) ) {
00336 
00337     for ( EEDetIdCollection::const_iterator idItr = ids1->begin(); idItr != ids1->end(); ++idItr ) {
00338 
00339       EEDetId id = (*idItr);
00340 
00341       int ix = id.ix();
00342       int iy = id.iy();
00343 
00344       int ism = Numbers::iSM( id );
00345 
00346       if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
00347 
00348       float xix = ix - 0.5;
00349       float xiy = iy - 0.5;
00350 
00351       if ( meIntegrityGain[ism-1] ) meIntegrityGain[ism-1]->Fill(xix, xiy);
00352 
00353     }
00354 
00355   } else {
00356 
00357     LogWarning("EEIntegrityTask") << EEDetIdCollection1_ << " not available";
00358 
00359   }
00360 
00361   Handle<EEDetIdCollection> ids2;
00362 
00363   if ( e.getByLabel(EEDetIdCollection2_, ids2) ) {
00364 
00365     for ( EEDetIdCollection::const_iterator idItr = ids2->begin(); idItr != ids2->end(); ++idItr ) {
00366 
00367       EEDetId id = (*idItr);
00368 
00369       int ix = id.ix();
00370       int iy = id.iy();
00371 
00372       int ism = Numbers::iSM( id );
00373 
00374       if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
00375 
00376       float xix = ix - 0.5;
00377       float xiy = iy - 0.5;
00378 
00379       if ( meIntegrityChId[ism-1] ) meIntegrityChId[ism-1]->Fill(xix, xiy);
00380 
00381     }
00382 
00383   } else {
00384 
00385     LogWarning("EEIntegrityTask") << EEDetIdCollection2_ << " not available";
00386 
00387   }
00388 
00389   Handle<EEDetIdCollection> ids3;
00390 
00391   if ( e.getByLabel(EEDetIdCollection3_, ids3) ) {
00392 
00393     for ( EEDetIdCollection::const_iterator idItr = ids3->begin(); idItr != ids3->end(); ++idItr ) {
00394 
00395       EEDetId id = (*idItr);
00396 
00397       int ix = id.ix();
00398       int iy = id.iy();
00399 
00400       int ism = Numbers::iSM( id );
00401 
00402       if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
00403 
00404       float xix = ix - 0.5;
00405       float xiy = iy - 0.5;
00406 
00407       if ( meIntegrityGainSwitch[ism-1] ) meIntegrityGainSwitch[ism-1]->Fill(xix, xiy);
00408 
00409     }
00410 
00411   } else {
00412 
00413     LogWarning("EEIntegrityTask") << EEDetIdCollection3_ << " not available";
00414 
00415   }
00416 
00417   Handle<EcalElectronicsIdCollection> ids4;
00418 
00419   if ( e.getByLabel(EcalElectronicsIdCollection1_, ids4) ) {
00420 
00421     for ( EcalElectronicsIdCollection::const_iterator idItr = ids4->begin(); idItr != ids4->end(); ++idItr ) {
00422 
00423       if ( Numbers::subDet( *idItr ) != EcalEndcap ) continue;
00424 
00425       int ism = Numbers::iSM( *idItr );
00426 
00427       vector<DetId> crystals = Numbers::crystals( *idItr );
00428 
00429       for ( unsigned int i=0; i<crystals.size(); i++ ) {
00430 
00431       EEDetId id = crystals[i];
00432 
00433       int ix = id.ix();
00434       int iy = id.iy();
00435 
00436       if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
00437 
00438       float xix = ix - 0.5;
00439       float xiy = iy - 0.5;
00440 
00441       if ( meIntegrityTTId[ism-1] ) meIntegrityTTId[ism-1]->Fill(xix, xiy);
00442 
00443       }
00444 
00445     }
00446 
00447   } else {
00448 
00449     LogWarning("EEIntegrityTask") << EcalElectronicsIdCollection1_ << " not available";
00450 
00451   }
00452 
00453   Handle<EcalElectronicsIdCollection> ids5;
00454 
00455   if ( e.getByLabel(EcalElectronicsIdCollection2_, ids5) ) {
00456 
00457     for ( EcalElectronicsIdCollection::const_iterator idItr = ids5->begin(); idItr != ids5->end(); ++idItr ) {
00458 
00459       if ( Numbers::subDet( *idItr ) != EcalEndcap ) continue;
00460 
00461       int ism = Numbers::iSM( *idItr );
00462 
00463       vector<DetId> crystals = Numbers::crystals( *idItr );
00464 
00465       for ( unsigned int i=0; i<crystals.size(); i++ ) {
00466 
00467       EEDetId id = crystals[i];
00468 
00469       int ix = id.ix();
00470       int iy = id.iy();
00471 
00472       if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
00473 
00474       float xix = ix - 0.5;
00475       float xiy = iy - 0.5;
00476 
00477       if ( meIntegrityTTBlockSize[ism-1] ) meIntegrityTTBlockSize[ism-1]->Fill(xix, xiy);
00478 
00479       }
00480 
00481     }
00482 
00483   } else {
00484 
00485     LogWarning("EEIntegrityTask") << EcalElectronicsIdCollection2_ << " not available";
00486 
00487   }
00488 
00489   Handle<EcalElectronicsIdCollection> ids6;
00490 
00491   if ( e.getByLabel(EcalElectronicsIdCollection3_, ids6) ) {
00492 
00493     for ( EcalElectronicsIdCollection::const_iterator idItr = ids6->begin(); idItr != ids6->end(); ++idItr ) {
00494 
00495       if ( Numbers::subDet( *idItr ) != EcalEndcap ) continue;
00496 
00497       int ism = Numbers::iSM( *idItr );
00498 
00499       int itt   = idItr->towerId();
00500       float iTt = itt + 0.5 - 69;
00501 
00502       if ( meIntegrityMemTTId[ism-1] ) meIntegrityMemTTId[ism-1]->Fill(iTt,0);
00503 
00504     }
00505 
00506   } else {
00507 
00508     LogWarning("EEIntegrityTask") << EcalElectronicsIdCollection3_ << " not available";
00509 
00510   }
00511 
00512   Handle<EcalElectronicsIdCollection> ids7;
00513 
00514   if ( e.getByLabel(EcalElectronicsIdCollection4_, ids7) ) {
00515 
00516     for ( EcalElectronicsIdCollection::const_iterator idItr = ids7->begin(); idItr != ids7->end(); ++idItr ) {
00517 
00518       if ( Numbers::subDet( *idItr ) != EcalEndcap ) continue;
00519 
00520       int ism = Numbers::iSM( *idItr );
00521 
00522       int itt   = idItr->towerId();
00523       float iTt = itt + 0.5 - 69;
00524 
00525       if ( meIntegrityMemTTBlockSize[ism-1] ) meIntegrityMemTTBlockSize[ism-1]->Fill(iTt,0);
00526 
00527     }
00528 
00529   } else {
00530 
00531     LogWarning("EEIntegrityTask") << EcalElectronicsIdCollection4_ << " not available";
00532 
00533   }
00534 
00535   Handle<EcalElectronicsIdCollection> ids8;
00536 
00537   if (  e.getByLabel(EcalElectronicsIdCollection5_, ids8) ) {
00538 
00539     for ( EcalElectronicsIdCollection::const_iterator idItr = ids8->begin(); idItr != ids8->end(); ++idItr ) {
00540 
00541       if ( Numbers::subDet( *idItr ) != EcalEndcap ) continue;
00542 
00543       int ism = Numbers::iSM( *idItr );
00544 
00545       int chid = idItr->channelId();
00546       int ie = EEIntegrityTask::chMemAbscissa[chid-1];
00547       int ip = EEIntegrityTask::chMemOrdinate[chid-1];
00548 
00549       int itt = idItr->towerId();
00550       ie += (itt-69)*5;
00551 
00552       float xix = ie - 0.5;
00553       float xiy = ip - 0.5;
00554 
00555       if ( meIntegrityMemChId[ism-1] ) meIntegrityMemChId[ism-1]->Fill(xix,xiy);
00556 
00557     }
00558 
00559   } else {
00560 
00561     LogWarning("EEIntegrityTask") << EcalElectronicsIdCollection5_ << " not available";
00562 
00563   }
00564 
00565   Handle<EcalElectronicsIdCollection> ids9;
00566 
00567   if ( e.getByLabel(EcalElectronicsIdCollection6_, ids9) ) {
00568 
00569     for ( EcalElectronicsIdCollection::const_iterator idItr = ids9->begin(); idItr != ids9->end(); ++idItr ) {
00570 
00571       if ( Numbers::subDet( *idItr ) != EcalEndcap ) continue;
00572 
00573       int ism = Numbers::iSM( *idItr );
00574 
00575       int chid = idItr->channelId();
00576       int ie = EEIntegrityTask::chMemAbscissa[chid-1];
00577       int ip = EEIntegrityTask::chMemOrdinate[chid-1];
00578 
00579       int itt = idItr->towerId();
00580       ie += (itt-69)*5;
00581 
00582       float xix = ie - 0.5;
00583       float xiy = ip - 0.5;
00584 
00585       if ( meIntegrityMemGain[ism-1] ) meIntegrityMemGain[ism-1]->Fill(xix,xiy);
00586 
00587     }
00588 
00589   } else {
00590 
00591     LogWarning("EEIntegrityTask") << EcalElectronicsIdCollection6_ << " not available";
00592 
00593   }
00594 
00595 }//  end analyze
00596 
00597 const int  EEIntegrityTask::chMemAbscissa [25] = {
00598     1, 1, 1, 1, 1,
00599     2, 2, 2, 2, 2,
00600     3, 3, 3, 3, 3,
00601     4, 4, 4, 4, 4,
00602     5, 5, 5, 5, 5
00603 };
00604 
00605 const int  EEIntegrityTask::chMemOrdinate [25] = {
00606     1, 2, 3, 4, 5,
00607     5, 4, 3, 2, 1,
00608     1, 2, 3, 4, 5,
00609     5, 4, 3, 2, 1,
00610     1, 2, 3, 4, 5
00611 };
00612 

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