CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQM/EcalBarrelMonitorTasks/src/EBIntegrityTask.cc

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