CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DQM/EcalBarrelMonitorClient/src/EBLaserClient.cc

Go to the documentation of this file.
00001 /*
00002  * \file EBLaserClient.cc
00003  *
00004  * $Date: 2010/10/17 18:06:34 $
00005  * $Revision: 1.281 $
00006  * \author G. Della Ricca
00007  * \author G. Franzoni
00008  *
00009 */
00010 
00011 #include <memory>
00012 #include <iostream>
00013 #include <fstream>
00014 #include <iomanip>
00015 #include <math.h>
00016 
00017 #include "FWCore/ServiceRegistry/interface/Service.h"
00018 
00019 #include "DQMServices/Core/interface/DQMStore.h"
00020 
00021 #ifdef WITH_ECAL_COND_DB
00022 #include "OnlineDB/EcalCondDB/interface/MonLaserBlueDat.h"
00023 #include "OnlineDB/EcalCondDB/interface/MonLaserGreenDat.h"
00024 #include "OnlineDB/EcalCondDB/interface/MonLaserIRedDat.h"
00025 #include "OnlineDB/EcalCondDB/interface/MonLaserRedDat.h"
00026 #include "OnlineDB/EcalCondDB/interface/MonPNBlueDat.h"
00027 #include "OnlineDB/EcalCondDB/interface/MonPNGreenDat.h"
00028 #include "OnlineDB/EcalCondDB/interface/MonPNIRedDat.h"
00029 #include "OnlineDB/EcalCondDB/interface/MonPNRedDat.h"
00030 #include "OnlineDB/EcalCondDB/interface/MonTimingLaserBlueCrystalDat.h"
00031 #include "OnlineDB/EcalCondDB/interface/MonTimingLaserGreenCrystalDat.h"
00032 #include "OnlineDB/EcalCondDB/interface/MonTimingLaserIRedCrystalDat.h"
00033 #include "OnlineDB/EcalCondDB/interface/MonTimingLaserRedCrystalDat.h"
00034 #include "OnlineDB/EcalCondDB/interface/RunCrystalErrorsDat.h"
00035 #include "OnlineDB/EcalCondDB/interface/RunTTErrorsDat.h"
00036 #include "OnlineDB/EcalCondDB/interface/RunPNErrorsDat.h"
00037 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
00038 #include "DQM/EcalCommon/interface/LogicID.h"
00039 #endif
00040 
00041 #include "DQM/EcalCommon/interface/Masks.h"
00042 
00043 #include "DQM/EcalCommon/interface/UtilsClient.h"
00044 #include "DQM/EcalCommon/interface/Numbers.h"
00045 
00046 #include "DQM/EcalBarrelMonitorClient/interface/EBLaserClient.h"
00047 
00048 EBLaserClient::EBLaserClient(const edm::ParameterSet& ps) {
00049 
00050   // cloneME switch
00051   cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
00052 
00053   // verbose switch
00054   verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
00055 
00056   // debug switch
00057   debug_ = ps.getUntrackedParameter<bool>("debug", false);
00058 
00059   // prefixME path
00060   prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
00061 
00062   // enableCleanup_ switch
00063   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00064 
00065   // vector of selected Super Modules (Defaults to all 36).
00066   superModules_.reserve(36);
00067   for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
00068   superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
00069 
00070   laserWavelengths_.reserve(4);
00071   for ( unsigned int i = 1; i <= 4; i++ ) laserWavelengths_.push_back(i);
00072   laserWavelengths_ = ps.getUntrackedParameter<std::vector<int> >("laserWavelengths", laserWavelengths_);
00073 
00074   if ( verbose_ ) {
00075     std::cout << " Laser wavelengths:" << std::endl;
00076     for ( unsigned int i = 0; i < laserWavelengths_.size(); i++ ) {
00077       std::cout << " " << laserWavelengths_[i];
00078     }
00079     std::cout << std::endl;
00080   }
00081 
00082   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00083 
00084     int ism = superModules_[i];
00085 
00086     h01_[ism-1] = 0;
00087     h02_[ism-1] = 0;
00088     h03_[ism-1] = 0;
00089     h04_[ism-1] = 0;
00090     h05_[ism-1] = 0;
00091     h06_[ism-1] = 0;
00092     h07_[ism-1] = 0;
00093     h08_[ism-1] = 0;
00094 
00095     h09_[ism-1] = 0;
00096     h10_[ism-1] = 0;
00097     h11_[ism-1] = 0;
00098     h12_[ism-1] = 0;
00099 
00100     hs01_[ism-1] = 0;
00101     hs02_[ism-1] = 0;
00102     hs03_[ism-1] = 0;
00103     hs04_[ism-1] = 0;
00104 
00105     i01_[ism-1] = 0;
00106     i02_[ism-1] = 0;
00107     i03_[ism-1] = 0;
00108     i04_[ism-1] = 0;
00109     i05_[ism-1] = 0;
00110     i06_[ism-1] = 0;
00111     i07_[ism-1] = 0;
00112     i08_[ism-1] = 0;
00113 
00114     i09_[ism-1] = 0;
00115     i10_[ism-1] = 0;
00116     i11_[ism-1] = 0;
00117     i12_[ism-1] = 0;
00118     i13_[ism-1] = 0;
00119     i14_[ism-1] = 0;
00120     i15_[ism-1] = 0;
00121     i16_[ism-1] = 0;
00122 
00123   }
00124 
00125   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00126 
00127     int ism = superModules_[i];
00128 
00129     meg01_[ism-1] = 0;
00130     meg02_[ism-1] = 0;
00131     meg03_[ism-1] = 0;
00132     meg04_[ism-1] = 0;
00133 
00134     meg05_[ism-1] = 0;
00135     meg06_[ism-1] = 0;
00136     meg07_[ism-1] = 0;
00137     meg08_[ism-1] = 0;
00138     meg09_[ism-1] = 0;
00139     meg10_[ism-1] = 0;
00140     meg11_[ism-1] = 0;
00141     meg12_[ism-1] = 0;
00142 
00143     mea01_[ism-1] = 0;
00144     mea02_[ism-1] = 0;
00145     mea03_[ism-1] = 0;
00146     mea04_[ism-1] = 0;
00147 
00148     met01_[ism-1] = 0;
00149     met02_[ism-1] = 0;
00150     met03_[ism-1] = 0;
00151     met04_[ism-1] = 0;
00152 
00153     metav01_[ism-1] = 0;
00154     metav02_[ism-1] = 0;
00155     metav03_[ism-1] = 0;
00156     metav04_[ism-1] = 0;
00157 
00158     metrms01_[ism-1] = 0;
00159     metrms02_[ism-1] = 0;
00160     metrms03_[ism-1] = 0;
00161     metrms04_[ism-1] = 0;
00162 
00163     meaopn01_[ism-1] = 0;
00164     meaopn02_[ism-1] = 0;
00165     meaopn03_[ism-1] = 0;
00166     meaopn04_[ism-1] = 0;
00167 
00168     mepnprms01_[ism-1] = 0;
00169     mepnprms02_[ism-1] = 0;
00170     mepnprms03_[ism-1] = 0;
00171     mepnprms04_[ism-1] = 0;
00172     mepnprms05_[ism-1] = 0;
00173     mepnprms06_[ism-1] = 0;
00174     mepnprms07_[ism-1] = 0;
00175     mepnprms08_[ism-1] = 0;
00176 
00177     me_hs01_[ism-1] = 0;
00178     me_hs02_[ism-1] = 0;
00179     me_hs03_[ism-1] = 0;
00180     me_hs04_[ism-1] = 0;
00181 
00182   }
00183 
00184   percentVariation_ = 0.4;
00185 
00186   amplitudeThreshold_ = 100.;
00187 
00188   rmsThresholdRelative_ = 0.3;
00189 
00190   amplitudeThresholdPnG01_ = 100.;
00191   amplitudeThresholdPnG16_ = 100.;
00192 
00193   pedPnExpectedMean_[0] = 750.0;
00194   pedPnExpectedMean_[1] = 750.0;
00195 
00196   pedPnDiscrepancyMean_[0] = 100.0;
00197   pedPnDiscrepancyMean_[1] = 100.0;
00198 
00199   pedPnRMSThreshold_[0] = 999.;
00200   pedPnRMSThreshold_[1] = 999.;
00201 
00202 }
00203 
00204 EBLaserClient::~EBLaserClient() {
00205 
00206 }
00207 
00208 void EBLaserClient::beginJob(void) {
00209 
00210   dqmStore_ = edm::Service<DQMStore>().operator->();
00211 
00212   if ( debug_ ) std::cout << "EBLaserClient: beginJob" << std::endl;
00213 
00214   ievt_ = 0;
00215   jevt_ = 0;
00216 
00217 }
00218 
00219 void EBLaserClient::beginRun(void) {
00220 
00221   if ( debug_ ) std::cout << "EBLaserClient: beginRun" << std::endl;
00222 
00223   jevt_ = 0;
00224 
00225   this->setup();
00226 
00227 }
00228 
00229 void EBLaserClient::endJob(void) {
00230 
00231   if ( debug_ ) std::cout << "EBLaserClient: endJob, ievt = " << ievt_ << std::endl;
00232 
00233   this->cleanup();
00234 
00235 }
00236 
00237 void EBLaserClient::endRun(void) {
00238 
00239   if ( debug_ ) std::cout << "EBLaserClient: endRun, jevt = " << jevt_ << std::endl;
00240 
00241   this->cleanup();
00242 
00243 }
00244 
00245 void EBLaserClient::setup(void) {
00246 
00247   char histo[200];
00248 
00249   dqmStore_->setCurrentFolder( prefixME_ + "/EBLaserClient" );
00250 
00251   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00252 
00253     int ism = superModules_[i];
00254 
00255     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00256       if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
00257       sprintf(histo, "EBLT laser quality L1 %s", Numbers::sEB(ism).c_str());
00258       meg01_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00259       meg01_[ism-1]->setAxisTitle("ieta", 1);
00260       meg01_[ism-1]->setAxisTitle("iphi", 2);
00261     }
00262     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00263       if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
00264       sprintf(histo, "EBLT laser quality L2 %s", Numbers::sEB(ism).c_str());
00265       meg02_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00266       meg02_[ism-1]->setAxisTitle("ieta", 1);
00267       meg02_[ism-1]->setAxisTitle("iphi", 2);
00268     }
00269     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00270       if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
00271       sprintf(histo, "EBLT laser quality L3 %s", Numbers::sEB(ism).c_str());
00272       meg03_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00273       meg03_[ism-1]->setAxisTitle("ieta", 1);
00274       meg03_[ism-1]->setAxisTitle("iphi", 2);
00275     }
00276     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00277       if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
00278       sprintf(histo, "EBLT laser quality L4 %s", Numbers::sEB(ism).c_str());
00279       meg04_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00280       meg04_[ism-1]->setAxisTitle("ieta", 1);
00281       meg04_[ism-1]->setAxisTitle("iphi", 2);
00282     }
00283 
00284     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00285       if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
00286       sprintf(histo, "EBLT laser quality L1 PNs G01 %s", Numbers::sEB(ism).c_str());
00287       meg05_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00288       meg05_[ism-1]->setAxisTitle("pseudo-strip", 1);
00289       meg05_[ism-1]->setAxisTitle("channel", 2);
00290     }
00291     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00292       if ( meg06_[ism-1] ) dqmStore_->removeElement( meg06_[ism-1]->getName() );
00293       sprintf(histo, "EBLT laser quality L2 PNs G01 %s", Numbers::sEB(ism).c_str());
00294       meg06_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00295       meg06_[ism-1]->setAxisTitle("pseudo-strip", 1);
00296       meg06_[ism-1]->setAxisTitle("channel", 2);
00297     }
00298     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00299       if ( meg07_[ism-1] ) dqmStore_->removeElement( meg07_[ism-1]->getName() );
00300       sprintf(histo, "EBLT laser quality L3 PNs G01 %s", Numbers::sEB(ism).c_str());
00301       meg07_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00302       meg07_[ism-1]->setAxisTitle("pseudo-strip", 1);
00303       meg07_[ism-1]->setAxisTitle("channel", 2);
00304     }
00305     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00306       if ( meg08_[ism-1] ) dqmStore_->removeElement( meg08_[ism-1]->getName() );
00307       sprintf(histo, "EBLT laser quality L4 PNs G01 %s", Numbers::sEB(ism).c_str());
00308       meg08_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00309       meg08_[ism-1]->setAxisTitle("pseudo-strip", 1);
00310       meg08_[ism-1]->setAxisTitle("channel", 2);
00311     }
00312     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00313       if ( meg09_[ism-1] ) dqmStore_->removeElement( meg09_[ism-1]->getName() );
00314       sprintf(histo, "EBLT laser quality L1 PNs G16 %s", Numbers::sEB(ism).c_str());
00315       meg09_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00316       meg09_[ism-1]->setAxisTitle("pseudo-strip", 1);
00317       meg09_[ism-1]->setAxisTitle("channel", 2);
00318     }
00319     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00320       if ( meg10_[ism-1] ) dqmStore_->removeElement( meg10_[ism-1]->getName() );
00321       sprintf(histo, "EBLT laser quality L2 PNs G16 %s", Numbers::sEB(ism).c_str());
00322       meg10_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00323       meg10_[ism-1]->setAxisTitle("pseudo-strip", 1);
00324       meg10_[ism-1]->setAxisTitle("channel", 2);
00325     }
00326     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00327       if ( meg11_[ism-1] ) dqmStore_->removeElement( meg11_[ism-1]->getName() );
00328       sprintf(histo, "EBLT laser quality L3 PNs G16 %s", Numbers::sEB(ism).c_str());
00329       meg11_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00330       meg11_[ism-1]->setAxisTitle("pseudo-strip", 1);
00331       meg11_[ism-1]->setAxisTitle("channel", 2);
00332     }
00333     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00334       if ( meg12_[ism-1] ) dqmStore_->removeElement( meg12_[ism-1]->getName() );
00335       sprintf(histo, "EBLT laser quality L4 PNs G16 %s", Numbers::sEB(ism).c_str());
00336       meg12_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00337       meg12_[ism-1]->setAxisTitle("pseudo-strip", 1);
00338       meg12_[ism-1]->setAxisTitle("channel", 2);
00339     }
00340 
00341     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00342       if ( mea01_[ism-1] ) dqmStore_->removeElement( mea01_[ism-1]->getName() );;
00343       sprintf(histo, "EBLT amplitude L1 %s", Numbers::sEB(ism).c_str());
00344       mea01_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00345       mea01_[ism-1]->setAxisTitle("channel", 1);
00346       mea01_[ism-1]->setAxisTitle("amplitude", 2);
00347     }
00348     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00349       if ( mea02_[ism-1] ) dqmStore_->removeElement( mea02_[ism-1]->getName() );
00350       sprintf(histo, "EBLT amplitude L2 %s", Numbers::sEB(ism).c_str());
00351       mea02_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00352       mea02_[ism-1]->setAxisTitle("channel", 1);
00353       mea02_[ism-1]->setAxisTitle("amplitude", 2);
00354     }
00355     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00356       if ( mea03_[ism-1] ) dqmStore_->removeElement( mea03_[ism-1]->getName() );
00357       sprintf(histo, "EBLT amplitude L3 %s", Numbers::sEB(ism).c_str());
00358       mea03_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00359       mea03_[ism-1]->setAxisTitle("channel", 1);
00360       mea03_[ism-1]->setAxisTitle("amplitude", 2);
00361     }
00362     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00363       if ( mea04_[ism-1] ) dqmStore_->removeElement( mea04_[ism-1]->getName() );
00364       sprintf(histo, "EBLT amplitude L4 %s", Numbers::sEB(ism).c_str());
00365       mea04_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00366       mea04_[ism-1]->setAxisTitle("channel", 1);
00367       mea04_[ism-1]->setAxisTitle("amplitude", 2);
00368     }
00369 
00370     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00371       if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
00372       sprintf(histo, "EBLT laser timing L1 %s", Numbers::sEB(ism).c_str());
00373       met01_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00374       met01_[ism-1]->setAxisTitle("channel", 1);
00375       met01_[ism-1]->setAxisTitle("jitter", 2);
00376     }
00377     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00378       if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
00379       sprintf(histo, "EBLT laser timing L2 %s", Numbers::sEB(ism).c_str());
00380       met02_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00381       met02_[ism-1]->setAxisTitle("channel", 1);
00382       met02_[ism-1]->setAxisTitle("jitter", 2);
00383     }
00384     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00385       if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
00386       sprintf(histo, "EBLT laser timing L3 %s", Numbers::sEB(ism).c_str());
00387       met03_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00388       met03_[ism-1]->setAxisTitle("channel", 1);
00389       met03_[ism-1]->setAxisTitle("jitter", 2);
00390     }
00391     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00392       if ( met04_[ism-1] ) dqmStore_->removeElement( met04_[ism-1]->getName() );
00393       sprintf(histo, "EBLT laser timing L4 %s", Numbers::sEB(ism).c_str());
00394       met04_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00395       met04_[ism-1]->setAxisTitle("channel", 1);
00396       met04_[ism-1]->setAxisTitle("jitter", 2);
00397     }
00398 
00399     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00400       if ( metav01_[ism-1] ) dqmStore_->removeElement( metav01_[ism-1]->getName() );
00401       sprintf(histo, "EBLT laser timing mean L1 %s", Numbers::sEB(ism).c_str());
00402       metav01_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00403       metav01_[ism-1]->setAxisTitle("mean", 1);
00404     }
00405     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00406       if ( metav02_[ism-1] ) dqmStore_->removeElement( metav02_[ism-1]->getName() );
00407       sprintf(histo, "EBLT laser timing mean L2 %s", Numbers::sEB(ism).c_str());
00408       metav02_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00409       metav02_[ism-1]->setAxisTitle("mean", 1);
00410     }
00411     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00412       if ( metav03_[ism-1] ) dqmStore_->removeElement( metav03_[ism-1]->getName() );
00413       sprintf(histo, "EBLT laser timing mean L3 %s", Numbers::sEB(ism).c_str());
00414       metav03_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00415       metav03_[ism-1]->setAxisTitle("mean", 1);
00416     }
00417     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00418       if ( metav04_[ism-1] ) dqmStore_->removeElement( metav04_[ism-1]->getName() );
00419       sprintf(histo, "EBLT laser timing mean L4 %s", Numbers::sEB(ism).c_str());
00420       metav04_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00421       metav04_[ism-1]->setAxisTitle("mean", 1);
00422     }
00423 
00424     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00425       if ( metrms01_[ism-1] ) dqmStore_->removeElement( metrms01_[ism-1]->getName() );
00426       sprintf(histo, "EBLT laser timing rms L1 %s", Numbers::sEB(ism).c_str());
00427       metrms01_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 0.5);
00428       metrms01_[ism-1]->setAxisTitle("rms", 1);
00429     }
00430     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00431       if ( metrms02_[ism-1] ) dqmStore_->removeElement( metrms02_[ism-1]->getName() );
00432       sprintf(histo, "EBLT laser timing rms L2 %s", Numbers::sEB(ism).c_str());
00433       metrms02_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 0.5);
00434       metrms02_[ism-1]->setAxisTitle("rms", 1);
00435     }
00436     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00437       if ( metrms03_[ism-1] ) dqmStore_->removeElement( metrms03_[ism-1]->getName() );
00438       sprintf(histo, "EBLT laser timing rms L3 %s", Numbers::sEB(ism).c_str());
00439       metrms03_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 0.5);
00440       metrms03_[ism-1]->setAxisTitle("rms", 1);
00441     }
00442     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00443       if ( metrms04_[ism-1] ) dqmStore_->removeElement( metrms04_[ism-1]->getName() );
00444       sprintf(histo, "EBLT laser timing rms L4 %s", Numbers::sEB(ism).c_str());
00445       metrms04_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 0.5);
00446       metrms04_[ism-1]->setAxisTitle("rms", 1);
00447     }
00448 
00449     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00450       if ( meaopn01_[ism-1] ) dqmStore_->removeElement( meaopn01_[ism-1]->getName() );
00451       sprintf(histo, "EBLT amplitude over PN L1 %s", Numbers::sEB(ism).c_str());
00452       meaopn01_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00453       meaopn01_[ism-1]->setAxisTitle("channel", 1);
00454       meaopn01_[ism-1]->setAxisTitle("amplitude/PN", 2);
00455     }
00456     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00457       if ( meaopn02_[ism-1] ) dqmStore_->removeElement( meaopn02_[ism-1]->getName() );
00458       sprintf(histo, "EBLT amplitude over PN L2 %s", Numbers::sEB(ism).c_str());
00459       meaopn02_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00460       meaopn02_[ism-1]->setAxisTitle("channel", 1);
00461       meaopn02_[ism-1]->setAxisTitle("amplitude/PN", 2);
00462     }
00463     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00464       if ( meaopn03_[ism-1] ) dqmStore_->removeElement( meaopn03_[ism-1]->getName() );
00465       sprintf(histo, "EBLT amplitude over PN L3 %s", Numbers::sEB(ism).c_str());
00466       meaopn03_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00467       meaopn03_[ism-1]->setAxisTitle("channel", 1);
00468       meaopn03_[ism-1]->setAxisTitle("amplitude/PN", 2);
00469     }
00470     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00471       if ( meaopn04_[ism-1] ) dqmStore_->removeElement( meaopn04_[ism-1]->getName() );
00472       sprintf(histo, "EBLT amplitude over PN L4 %s", Numbers::sEB(ism).c_str());
00473       meaopn04_[ism-1] = dqmStore_->book1D(histo, histo, 1700, 0., 1700.);
00474       meaopn04_[ism-1]->setAxisTitle("channel", 1);
00475       meaopn04_[ism-1]->setAxisTitle("amplitude/PN", 2);
00476     }
00477 
00478     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00479       if ( mepnprms01_[ism-1] ) dqmStore_->removeElement( mepnprms01_[ism-1]->getName() );
00480       sprintf(histo, "EBLT PNs pedestal rms %s G01 L1", Numbers::sEB(ism).c_str());
00481       mepnprms01_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00482       mepnprms01_[ism-1]->setAxisTitle("rms", 1);
00483     }
00484     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00485       if ( mepnprms02_[ism-1] ) dqmStore_->removeElement( mepnprms02_[ism-1]->getName() );
00486       sprintf(histo, "EBLT PNs pedestal rms %s G01 L2", Numbers::sEB(ism).c_str());
00487       mepnprms02_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00488       mepnprms02_[ism-1]->setAxisTitle("rms", 1);
00489     }
00490     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00491       if ( mepnprms03_[ism-1] ) dqmStore_->removeElement( mepnprms03_[ism-1]->getName() );
00492       sprintf(histo, "EBLT PNs pedestal rms %s G01 L3", Numbers::sEB(ism).c_str());
00493       mepnprms03_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00494       mepnprms03_[ism-1]->setAxisTitle("rms", 1);
00495     }
00496     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00497       if ( mepnprms04_[ism-1] ) dqmStore_->removeElement( mepnprms04_[ism-1]->getName() );
00498       sprintf(histo, "EBLT PNs pedestal rms %s G01 L4", Numbers::sEB(ism).c_str());
00499       mepnprms04_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00500       mepnprms04_[ism-1]->setAxisTitle("rms", 1);
00501     }
00502     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00503       if ( mepnprms05_[ism-1] ) dqmStore_->removeElement( mepnprms05_[ism-1]->getName() );
00504       sprintf(histo, "EBLT PNs pedestal rms %s G16 L1", Numbers::sEB(ism).c_str());
00505       mepnprms05_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00506       mepnprms05_[ism-1]->setAxisTitle("rms", 1);
00507     }
00508     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00509       if ( mepnprms06_[ism-1] ) dqmStore_->removeElement( mepnprms06_[ism-1]->getName() );
00510       sprintf(histo, "EBLT PNs pedestal rms %s G16 L2", Numbers::sEB(ism).c_str());
00511       mepnprms06_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00512       mepnprms06_[ism-1]->setAxisTitle("rms", 1);
00513     }
00514     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00515       if ( mepnprms07_[ism-1] ) dqmStore_->removeElement( mepnprms07_[ism-1]->getName() );
00516       sprintf(histo, "EBLT PNs pedestal rms %s G16 L3", Numbers::sEB(ism).c_str());
00517       mepnprms07_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00518       mepnprms07_[ism-1]->setAxisTitle("rms", 1);
00519     }
00520     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00521       if ( mepnprms08_[ism-1] ) dqmStore_->removeElement( mepnprms08_[ism-1]->getName() );
00522       sprintf(histo, "EBLT PNs pedestal rms %s G16 L4", Numbers::sEB(ism).c_str());
00523       mepnprms08_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00524       mepnprms08_[ism-1]->setAxisTitle("rms", 1);
00525     }
00526     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00527       if ( me_hs01_[ism-1] ) dqmStore_->removeElement( me_hs01_[ism-1]->getName() );
00528       sprintf(histo, "EBLT laser shape L1 %s", Numbers::sEB(ism).c_str());
00529       me_hs01_[ism-1] = dqmStore_->book1D(histo, histo, 10, 0., 10.);
00530       me_hs01_[ism-1]->setAxisTitle("sample", 1);
00531       me_hs01_[ism-1]->setAxisTitle("amplitude", 2);
00532     }
00533     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00534       if ( me_hs02_[ism-1] ) dqmStore_->removeElement( me_hs02_[ism-1]->getName() );
00535       sprintf(histo, "EBLT laser shape L2 %s", Numbers::sEB(ism).c_str());
00536       me_hs02_[ism-1] = dqmStore_->book1D(histo, histo, 10, 0., 10.);
00537       me_hs02_[ism-1]->setAxisTitle("sample", 1);
00538       me_hs02_[ism-1]->setAxisTitle("amplitude", 2);
00539     }
00540     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00541       if ( me_hs03_[ism-1] ) dqmStore_->removeElement( me_hs03_[ism-1]->getName() );
00542       sprintf(histo, "EBLT laser shape L3 %s", Numbers::sEB(ism).c_str());
00543       me_hs03_[ism-1] = dqmStore_->book1D(histo, histo, 10, 0., 10.);
00544       me_hs03_[ism-1]->setAxisTitle("sample", 1);
00545       me_hs03_[ism-1]->setAxisTitle("amplitude", 2);
00546     }
00547     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00548       if ( me_hs04_[ism-1] ) dqmStore_->removeElement( me_hs04_[ism-1]->getName() );
00549       sprintf(histo, "EBLT laser shape L4 %s", Numbers::sEB(ism).c_str());
00550       me_hs04_[ism-1] = dqmStore_->book1D(histo, histo, 10, 0., 10.);
00551       me_hs04_[ism-1]->setAxisTitle("sample", 1);
00552       me_hs04_[ism-1]->setAxisTitle("amplitude", 2);
00553     }
00554 
00555   }
00556 
00557   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00558 
00559     int ism = superModules_[i];
00560 
00561     if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
00562     if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
00563     if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
00564     if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
00565 
00566     if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
00567     if ( meg06_[ism-1] ) meg06_[ism-1]->Reset();
00568     if ( meg07_[ism-1] ) meg07_[ism-1]->Reset();
00569     if ( meg08_[ism-1] ) meg08_[ism-1]->Reset();
00570     if ( meg09_[ism-1] ) meg09_[ism-1]->Reset();
00571     if ( meg10_[ism-1] ) meg10_[ism-1]->Reset();
00572     if ( meg11_[ism-1] ) meg11_[ism-1]->Reset();
00573     if ( meg12_[ism-1] ) meg12_[ism-1]->Reset();
00574 
00575     for ( int ie = 1; ie <= 85; ie++ ) {
00576       for ( int ip = 1; ip <= 20; ip++ ) {
00577 
00578         if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ie, ip, 2. );
00579         if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ie, ip, 2. );
00580         if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ie, ip, 2. );
00581         if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( ie, ip, 2. );
00582 
00583       }
00584     }
00585 
00586     for ( int i = 1; i <= 10; i++ ) {
00587 
00588         if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
00589         if ( meg06_[ism-1] ) meg06_[ism-1]->setBinContent( i, 1, 2. );
00590         if ( meg07_[ism-1] ) meg07_[ism-1]->setBinContent( i, 1, 2. );
00591         if ( meg08_[ism-1] ) meg08_[ism-1]->setBinContent( i, 1, 2. );
00592         if ( meg09_[ism-1] ) meg09_[ism-1]->setBinContent( i, 1, 2. );
00593         if ( meg10_[ism-1] ) meg10_[ism-1]->setBinContent( i, 1, 2. );
00594         if ( meg11_[ism-1] ) meg11_[ism-1]->setBinContent( i, 1, 2. );
00595         if ( meg12_[ism-1] ) meg12_[ism-1]->setBinContent( i, 1, 2. );
00596 
00597     }
00598 
00599     if ( mea01_[ism-1] ) mea01_[ism-1]->Reset();
00600     if ( mea02_[ism-1] ) mea02_[ism-1]->Reset();
00601     if ( mea03_[ism-1] ) mea03_[ism-1]->Reset();
00602     if ( mea04_[ism-1] ) mea04_[ism-1]->Reset();
00603 
00604     if ( met01_[ism-1] ) met01_[ism-1]->Reset();
00605     if ( met02_[ism-1] ) met02_[ism-1]->Reset();
00606     if ( met03_[ism-1] ) met03_[ism-1]->Reset();
00607     if ( met04_[ism-1] ) met04_[ism-1]->Reset();
00608 
00609     if ( metav01_[ism-1] ) metav01_[ism-1]->Reset();
00610     if ( metav02_[ism-1] ) metav02_[ism-1]->Reset();
00611     if ( metav03_[ism-1] ) metav03_[ism-1]->Reset();
00612     if ( metav04_[ism-1] ) metav04_[ism-1]->Reset();
00613 
00614     if ( metrms01_[ism-1] ) metrms01_[ism-1]->Reset();
00615     if ( metrms02_[ism-1] ) metrms02_[ism-1]->Reset();
00616     if ( metrms03_[ism-1] ) metrms03_[ism-1]->Reset();
00617     if ( metrms04_[ism-1] ) metrms04_[ism-1]->Reset();
00618 
00619     if ( meaopn01_[ism-1] ) meaopn01_[ism-1]->Reset();
00620     if ( meaopn02_[ism-1] ) meaopn02_[ism-1]->Reset();
00621     if ( meaopn03_[ism-1] ) meaopn03_[ism-1]->Reset();
00622     if ( meaopn04_[ism-1] ) meaopn04_[ism-1]->Reset();
00623 
00624     if ( mepnprms01_[ism-1] ) mepnprms01_[ism-1]->Reset();
00625     if ( mepnprms02_[ism-1] ) mepnprms02_[ism-1]->Reset();
00626     if ( mepnprms03_[ism-1] ) mepnprms03_[ism-1]->Reset();
00627     if ( mepnprms04_[ism-1] ) mepnprms04_[ism-1]->Reset();
00628     if ( mepnprms05_[ism-1] ) mepnprms01_[ism-1]->Reset();
00629     if ( mepnprms06_[ism-1] ) mepnprms02_[ism-1]->Reset();
00630     if ( mepnprms07_[ism-1] ) mepnprms03_[ism-1]->Reset();
00631     if ( mepnprms08_[ism-1] ) mepnprms04_[ism-1]->Reset();
00632 
00633     if ( me_hs01_[ism-1] ) me_hs01_[ism-1]->Reset();
00634     if ( me_hs02_[ism-1] ) me_hs02_[ism-1]->Reset();
00635     if ( me_hs03_[ism-1] ) me_hs03_[ism-1]->Reset();
00636     if ( me_hs04_[ism-1] ) me_hs04_[ism-1]->Reset();
00637 
00638   }
00639 
00640 }
00641 
00642 void EBLaserClient::cleanup(void) {
00643 
00644   if ( ! enableCleanup_ ) return;
00645 
00646   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00647 
00648     int ism = superModules_[i];
00649 
00650     if ( cloneME_ ) {
00651       if ( h01_[ism-1] ) delete h01_[ism-1];
00652       if ( h02_[ism-1] ) delete h02_[ism-1];
00653       if ( h03_[ism-1] ) delete h03_[ism-1];
00654       if ( h04_[ism-1] ) delete h04_[ism-1];
00655       if ( h05_[ism-1] ) delete h05_[ism-1];
00656       if ( h06_[ism-1] ) delete h06_[ism-1];
00657       if ( h07_[ism-1] ) delete h07_[ism-1];
00658       if ( h08_[ism-1] ) delete h08_[ism-1];
00659 
00660       if ( h09_[ism-1] ) delete h09_[ism-1];
00661       if ( h10_[ism-1] ) delete h10_[ism-1];
00662       if ( h11_[ism-1] ) delete h11_[ism-1];
00663       if ( h12_[ism-1] ) delete h12_[ism-1];
00664 
00665       if ( hs01_[ism-1] ) delete hs01_[ism-1];
00666       if ( hs02_[ism-1] ) delete hs02_[ism-1];
00667       if ( hs03_[ism-1] ) delete hs03_[ism-1];
00668       if ( hs04_[ism-1] ) delete hs04_[ism-1];
00669 
00670       if ( i01_[ism-1] ) delete i01_[ism-1];
00671       if ( i02_[ism-1] ) delete i02_[ism-1];
00672       if ( i03_[ism-1] ) delete i03_[ism-1];
00673       if ( i04_[ism-1] ) delete i04_[ism-1];
00674       if ( i05_[ism-1] ) delete i05_[ism-1];
00675       if ( i06_[ism-1] ) delete i06_[ism-1];
00676       if ( i07_[ism-1] ) delete i07_[ism-1];
00677       if ( i08_[ism-1] ) delete i08_[ism-1];
00678 
00679       if ( i09_[ism-1] ) delete i09_[ism-1];
00680       if ( i10_[ism-1] ) delete i10_[ism-1];
00681       if ( i11_[ism-1] ) delete i11_[ism-1];
00682       if ( i12_[ism-1] ) delete i12_[ism-1];
00683       if ( i13_[ism-1] ) delete i13_[ism-1];
00684       if ( i14_[ism-1] ) delete i14_[ism-1];
00685       if ( i15_[ism-1] ) delete i15_[ism-1];
00686       if ( i16_[ism-1] ) delete i16_[ism-1];
00687     }
00688 
00689     h01_[ism-1] = 0;
00690     h02_[ism-1] = 0;
00691     h03_[ism-1] = 0;
00692     h04_[ism-1] = 0;
00693     h05_[ism-1] = 0;
00694     h06_[ism-1] = 0;
00695     h07_[ism-1] = 0;
00696     h08_[ism-1] = 0;
00697 
00698     h09_[ism-1] = 0;
00699     h10_[ism-1] = 0;
00700     h11_[ism-1] = 0;
00701     h12_[ism-1] = 0;
00702 
00703     hs01_[ism-1] = 0;
00704     hs02_[ism-1] = 0;
00705     hs03_[ism-1] = 0;
00706     hs04_[ism-1] = 0;
00707 
00708     i01_[ism-1] = 0;
00709     i02_[ism-1] = 0;
00710     i03_[ism-1] = 0;
00711     i04_[ism-1] = 0;
00712     i05_[ism-1] = 0;
00713     i06_[ism-1] = 0;
00714     i07_[ism-1] = 0;
00715     i08_[ism-1] = 0;
00716 
00717     i09_[ism-1] = 0;
00718     i10_[ism-1] = 0;
00719     i11_[ism-1] = 0;
00720     i12_[ism-1] = 0;
00721     i13_[ism-1] = 0;
00722     i14_[ism-1] = 0;
00723     i15_[ism-1] = 0;
00724     i16_[ism-1] = 0;
00725 
00726   }
00727 
00728   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00729 
00730     int ism = superModules_[i];
00731 
00732     dqmStore_->setCurrentFolder( prefixME_ + "/EBLaserClient" );
00733 
00734     if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
00735     meg01_[ism-1] = 0;
00736     if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
00737     meg02_[ism-1] = 0;
00738     if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
00739     meg03_[ism-1] = 0;
00740     if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
00741     meg04_[ism-1] = 0;
00742 
00743     if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
00744     meg05_[ism-1] = 0;
00745     if ( meg06_[ism-1] ) dqmStore_->removeElement( meg06_[ism-1]->getName() );
00746     meg06_[ism-1] = 0;
00747     if ( meg07_[ism-1] ) dqmStore_->removeElement( meg07_[ism-1]->getName() );
00748     meg07_[ism-1] = 0;
00749     if ( meg08_[ism-1] ) dqmStore_->removeElement( meg08_[ism-1]->getName() );
00750     meg08_[ism-1] = 0;
00751     if ( meg09_[ism-1] ) dqmStore_->removeElement( meg09_[ism-1]->getName() );
00752     meg09_[ism-1] = 0;
00753     if ( meg10_[ism-1] ) dqmStore_->removeElement( meg10_[ism-1]->getName() );
00754     meg10_[ism-1] = 0;
00755     if ( meg11_[ism-1] ) dqmStore_->removeElement( meg11_[ism-1]->getName() );
00756     meg11_[ism-1] = 0;
00757     if ( meg12_[ism-1] ) dqmStore_->removeElement( meg12_[ism-1]->getName() );
00758     meg12_[ism-1] = 0;
00759 
00760     if ( mea01_[ism-1] ) dqmStore_->removeElement( mea01_[ism-1]->getName() );
00761     mea01_[ism-1] = 0;
00762     if ( mea02_[ism-1] ) dqmStore_->removeElement( mea02_[ism-1]->getName() );
00763     mea02_[ism-1] = 0;
00764     if ( mea03_[ism-1] ) dqmStore_->removeElement( mea03_[ism-1]->getName() );
00765     mea03_[ism-1] = 0;
00766     if ( mea04_[ism-1] ) dqmStore_->removeElement( mea04_[ism-1]->getName() );
00767     mea04_[ism-1] = 0;
00768 
00769     if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
00770     met01_[ism-1] = 0;
00771     if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
00772     met02_[ism-1] = 0;
00773     if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
00774     met03_[ism-1] = 0;
00775     if ( met04_[ism-1] ) dqmStore_->removeElement( met04_[ism-1]->getName() );
00776     met04_[ism-1] = 0;
00777 
00778     if ( metav01_[ism-1] ) dqmStore_->removeElement( metav01_[ism-1]->getName() );
00779     metav01_[ism-1] = 0;
00780     if ( metav02_[ism-1] ) dqmStore_->removeElement( metav02_[ism-1]->getName() );
00781     metav02_[ism-1] = 0;
00782     if ( metav03_[ism-1] ) dqmStore_->removeElement( metav03_[ism-1]->getName() );
00783     metav03_[ism-1] = 0;
00784     if ( metav04_[ism-1] ) dqmStore_->removeElement( metav04_[ism-1]->getName() );
00785     metav04_[ism-1] = 0;
00786 
00787     if ( metrms01_[ism-1] ) dqmStore_->removeElement( metrms01_[ism-1]->getName() );
00788     metrms01_[ism-1] = 0;
00789     if ( metrms02_[ism-1] ) dqmStore_->removeElement( metrms02_[ism-1]->getName() );
00790     metrms02_[ism-1] = 0;
00791     if ( metrms03_[ism-1] ) dqmStore_->removeElement( metrms03_[ism-1]->getName() );
00792     metrms03_[ism-1] = 0;
00793     if ( metrms04_[ism-1] ) dqmStore_->removeElement( metrms04_[ism-1]->getName() );
00794     metrms04_[ism-1] = 0;
00795 
00796     if ( meaopn01_[ism-1] ) dqmStore_->removeElement( meaopn01_[ism-1]->getName() );
00797     meaopn01_[ism-1] = 0;
00798     if ( meaopn02_[ism-1] ) dqmStore_->removeElement( meaopn02_[ism-1]->getName() );
00799     meaopn02_[ism-1] = 0;
00800     if ( meaopn03_[ism-1] ) dqmStore_->removeElement( meaopn03_[ism-1]->getName() );
00801     meaopn03_[ism-1] = 0;
00802     if ( meaopn04_[ism-1] ) dqmStore_->removeElement( meaopn04_[ism-1]->getName() );
00803     meaopn04_[ism-1] = 0;
00804 
00805     if ( mepnprms01_[ism-1] ) dqmStore_->removeElement( mepnprms01_[ism-1]->getName() );
00806     mepnprms01_[ism-1] = 0;
00807     if ( mepnprms02_[ism-1] ) dqmStore_->removeElement( mepnprms02_[ism-1]->getName() );
00808     mepnprms02_[ism-1] = 0;
00809     if ( mepnprms03_[ism-1] ) dqmStore_->removeElement( mepnprms03_[ism-1]->getName() );
00810     mepnprms03_[ism-1] = 0;
00811     if ( mepnprms04_[ism-1] ) dqmStore_->removeElement( mepnprms04_[ism-1]->getName() );
00812     mepnprms04_[ism-1] = 0;
00813     if ( mepnprms05_[ism-1] ) dqmStore_->removeElement( mepnprms05_[ism-1]->getName() );
00814     mepnprms05_[ism-1] = 0;
00815     if ( mepnprms06_[ism-1] ) dqmStore_->removeElement( mepnprms06_[ism-1]->getName() );
00816     mepnprms06_[ism-1] = 0;
00817     if ( mepnprms07_[ism-1] ) dqmStore_->removeElement( mepnprms07_[ism-1]->getName() );
00818     mepnprms07_[ism-1] = 0;
00819     if ( mepnprms08_[ism-1] ) dqmStore_->removeElement( mepnprms08_[ism-1]->getName() );
00820     mepnprms08_[ism-1] = 0;
00821 
00822     if ( me_hs01_[ism-1] ) dqmStore_->removeElement( me_hs01_[ism-1]->getName() );
00823     me_hs01_[ism-1] = 0;
00824     if ( me_hs02_[ism-1] ) dqmStore_->removeElement( me_hs02_[ism-1]->getName() );
00825     me_hs02_[ism-1] = 0;
00826     if ( me_hs03_[ism-1] ) dqmStore_->removeElement( me_hs03_[ism-1]->getName() );
00827     me_hs03_[ism-1] = 0;
00828     if ( me_hs04_[ism-1] ) dqmStore_->removeElement( me_hs04_[ism-1]->getName() );
00829     me_hs04_[ism-1] = 0;
00830 
00831   }
00832 
00833 }
00834 
00835 #ifdef WITH_ECAL_COND_DB
00836 bool EBLaserClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
00837 
00838   status = true;
00839 
00840   EcalLogicID ecid;
00841 
00842   MonLaserBlueDat apd_bl;
00843   std::map<EcalLogicID, MonLaserBlueDat> dataset1_bl;
00844   MonLaserGreenDat apd_gr;
00845   std::map<EcalLogicID, MonLaserGreenDat> dataset1_gr;
00846   MonLaserIRedDat apd_ir;
00847   std::map<EcalLogicID, MonLaserIRedDat> dataset1_ir;
00848   MonLaserRedDat apd_rd;
00849   std::map<EcalLogicID, MonLaserRedDat> dataset1_rd;
00850 
00851   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00852 
00853     int ism = superModules_[i];
00854 
00855     if ( verbose_ ) {
00856       std::cout << " " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
00857       std::cout << std::endl;
00858       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00859         UtilsClient::printBadChannels(meg01_[ism-1], h01_[ism-1]);
00860       }
00861       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00862         UtilsClient::printBadChannels(meg02_[ism-1], h03_[ism-1]);
00863       }
00864       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00865         UtilsClient::printBadChannels(meg03_[ism-1], h05_[ism-1]);
00866       }
00867       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00868         UtilsClient::printBadChannels(meg04_[ism-1], h07_[ism-1]);
00869       }
00870     }
00871 
00872     for ( int ie = 1; ie <= 85; ie++ ) {
00873       for ( int ip = 1; ip <= 20; ip++ ) {
00874 
00875         bool update01;
00876         bool update02;
00877         bool update03;
00878         bool update04;
00879         bool update05;
00880         bool update06;
00881         bool update07;
00882         bool update08;
00883 
00884         float num01, num02, num03, num04, num05, num06, num07, num08;
00885         float mean01, mean02, mean03, mean04, mean05, mean06, mean07, mean08;
00886         float rms01, rms02, rms03, rms04, rms05, rms06, rms07, rms08;
00887 
00888         update01 = UtilsClient::getBinStatistics(h01_[ism-1], ie, ip, num01, mean01, rms01);
00889         update02 = UtilsClient::getBinStatistics(h02_[ism-1], ie, ip, num02, mean02, rms02);
00890         update03 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num03, mean03, rms03);
00891         update04 = UtilsClient::getBinStatistics(h04_[ism-1], ie, ip, num04, mean04, rms04);
00892         update05 = UtilsClient::getBinStatistics(h05_[ism-1], ie, ip, num05, mean05, rms05);
00893         update06 = UtilsClient::getBinStatistics(h06_[ism-1], ie, ip, num06, mean06, rms06);
00894         update07 = UtilsClient::getBinStatistics(h07_[ism-1], ie, ip, num07, mean07, rms07);
00895         update08 = UtilsClient::getBinStatistics(h08_[ism-1], ie, ip, num08, mean08, rms08);
00896 
00897         if ( update01 || update02 ) {
00898 
00899           if ( Numbers::icEB(ism, ie, ip) == 1 ) {
00900 
00901             if ( verbose_ ) {
00902               std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
00903               std::cout << "L1 (" << ie << "," << ip << ") " << num01 << " " << mean01 << " " << rms01 << std::endl;
00904               std::cout << std::endl;
00905             }
00906 
00907           }
00908 
00909           apd_bl.setAPDMean(mean01);
00910           apd_bl.setAPDRMS(rms01);
00911 
00912           apd_bl.setAPDOverPNMean(mean02);
00913           apd_bl.setAPDOverPNRMS(rms02);
00914 
00915           if ( UtilsClient::getBinStatus(meg01_[ism-1], ie, ip) ) {
00916             apd_bl.setTaskStatus(true);
00917           } else {
00918             apd_bl.setTaskStatus(false);
00919           }
00920 
00921           status = status && UtilsClient::getBinQuality(meg01_[ism-1], ie, ip);
00922 
00923           int ic = Numbers::indexEB(ism, ie, ip);
00924 
00925           if ( econn ) {
00926             ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
00927             dataset1_bl[ecid] = apd_bl;
00928           }
00929 
00930         }
00931 
00932         if ( update03 || update04 ) {
00933 
00934           if ( Numbers::icEB(ism, ie, ip) == 1 ) {
00935 
00936             if ( verbose_ ) {
00937               std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
00938               std::cout << "L2 (" << ie << "," << ip << ") " << num03 << " " << mean03 << " " << rms03 << std::endl;
00939               std::cout << std::endl;
00940             }
00941 
00942           }
00943 
00944           apd_ir.setAPDMean(mean03);
00945           apd_ir.setAPDRMS(rms03);
00946 
00947           apd_ir.setAPDOverPNMean(mean04);
00948           apd_ir.setAPDOverPNRMS(rms04);
00949 
00950           if ( UtilsClient::getBinStatus(meg02_[ism-1], ie, ip) ) {
00951             apd_ir.setTaskStatus(true);
00952           } else {
00953             apd_ir.setTaskStatus(false);
00954           }
00955 
00956           status = status && UtilsClient::getBinQuality(meg02_[ism-1], ie, ip);
00957 
00958           int ic = Numbers::indexEB(ism, ie, ip);
00959 
00960           if ( econn ) {
00961             ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
00962             dataset1_ir[ecid] = apd_ir;
00963           }
00964 
00965         }
00966 
00967         if ( update05 || update06 ) {
00968 
00969           if ( Numbers::icEB(ism, ie, ip) == 1 ) {
00970 
00971             if ( verbose_ ) {
00972               std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
00973               std::cout << "L3 (" << ie << "," << ip << ") " << num05 << " " << mean05 << " " << rms05 << std::endl;
00974               std::cout << std::endl;
00975             }
00976 
00977           }
00978 
00979           apd_gr.setAPDMean(mean05);
00980           apd_gr.setAPDRMS(rms05);
00981 
00982           apd_gr.setAPDOverPNMean(mean06);
00983           apd_gr.setAPDOverPNRMS(rms06);
00984 
00985           if ( UtilsClient::getBinStatus(meg03_[ism-1], ie, ip) ) {
00986             apd_gr.setTaskStatus(true);
00987           } else {
00988             apd_gr.setTaskStatus(false);
00989           }
00990 
00991           status = status && UtilsClient::getBinQuality(meg03_[ism-1], ie, ip);
00992 
00993           int ic = Numbers::indexEB(ism, ie, ip);
00994 
00995           if ( econn ) {
00996             ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
00997             dataset1_gr[ecid] = apd_gr;
00998           }
00999 
01000         }
01001 
01002         if ( update07 || update08 ) {
01003 
01004           if ( Numbers::icEB(ism, ie, ip) == 1 ) {
01005 
01006             if ( verbose_ ) {
01007               std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01008               std::cout << "L4 (" << ie << "," << ip << ") " << num07 << " " << mean07 << " " << rms07 << std::endl;
01009               std::cout << std::endl;
01010             }
01011 
01012           }
01013 
01014           apd_rd.setAPDMean(mean07);
01015           apd_rd.setAPDRMS(rms07);
01016 
01017           apd_rd.setAPDOverPNMean(mean08);
01018           apd_rd.setAPDOverPNRMS(rms08);
01019 
01020           if ( UtilsClient::getBinStatus(meg04_[ism-1], ie, ip) ) {
01021             apd_rd.setTaskStatus(true);
01022           } else {
01023             apd_rd.setTaskStatus(false);
01024           }
01025 
01026           status = status && UtilsClient::getBinQuality(meg04_[ism-1], ie, ip);
01027 
01028           int ic = Numbers::indexEB(ism, ie, ip);
01029 
01030           if ( econn ) {
01031             ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
01032             dataset1_rd[ecid] = apd_rd;
01033           }
01034 
01035         }
01036 
01037       }
01038     }
01039 
01040   }
01041 
01042   if ( econn ) {
01043     try {
01044       if ( verbose_ ) std::cout << "Inserting MonLaserDat ..." << std::endl;
01045       if ( dataset1_bl.size() != 0 ) econn->insertDataArraySet(&dataset1_bl, moniov);
01046       if ( dataset1_ir.size() != 0 ) econn->insertDataArraySet(&dataset1_ir, moniov);
01047       if ( dataset1_gr.size() != 0 ) econn->insertDataArraySet(&dataset1_gr, moniov);
01048       if ( dataset1_rd.size() != 0 ) econn->insertDataArraySet(&dataset1_rd, moniov);
01049       if ( verbose_ ) std::cout << "done." << std::endl;
01050     } catch (std::runtime_error &e) {
01051       std::cerr << e.what() << std::endl;
01052     }
01053   }
01054 
01055   if ( verbose_ ) std::cout << std::endl;
01056 
01057   MonPNBlueDat pn_bl;
01058   std::map<EcalLogicID, MonPNBlueDat> dataset2_bl;
01059   MonPNGreenDat pn_gr;
01060   std::map<EcalLogicID, MonPNGreenDat> dataset2_gr;
01061   MonPNIRedDat pn_ir;
01062   std::map<EcalLogicID, MonPNIRedDat> dataset2_ir;
01063   MonPNRedDat pn_rd;
01064   std::map<EcalLogicID, MonPNRedDat> dataset2_rd;
01065 
01066   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
01067 
01068     int ism = superModules_[i];
01069 
01070     if ( verbose_ ) {
01071       std::cout << " " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01072       std::cout << std::endl;
01073       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01074         UtilsClient::printBadChannels(meg05_[ism-1], i01_[ism-1]);
01075         UtilsClient::printBadChannels(meg05_[ism-1], i05_[ism-1]);
01076       }
01077       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01078         UtilsClient::printBadChannels(meg06_[ism-1], i02_[ism-1]);
01079         UtilsClient::printBadChannels(meg06_[ism-1], i06_[ism-1]);
01080       }
01081       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01082         UtilsClient::printBadChannels(meg07_[ism-1], i03_[ism-1]);
01083         UtilsClient::printBadChannels(meg07_[ism-1], i07_[ism-1]);
01084       }
01085       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01086         UtilsClient::printBadChannels(meg08_[ism-1], i04_[ism-1]);
01087         UtilsClient::printBadChannels(meg08_[ism-1], i08_[ism-1]);
01088       }
01089       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01090         UtilsClient::printBadChannels(meg09_[ism-1], i09_[ism-1]);
01091         UtilsClient::printBadChannels(meg09_[ism-1], i13_[ism-1]);
01092       }
01093       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01094         UtilsClient::printBadChannels(meg10_[ism-1], i10_[ism-1]);
01095         UtilsClient::printBadChannels(meg10_[ism-1], i14_[ism-1]);
01096       }
01097       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01098         UtilsClient::printBadChannels(meg11_[ism-1], i11_[ism-1]);
01099         UtilsClient::printBadChannels(meg11_[ism-1], i15_[ism-1]);
01100       }
01101       if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01102         UtilsClient::printBadChannels(meg12_[ism-1], i12_[ism-1]);
01103         UtilsClient::printBadChannels(meg12_[ism-1], i16_[ism-1]);
01104       }
01105     }
01106 
01107     for ( int i = 1; i <= 10; i++ ) {
01108 
01109       bool update01;
01110       bool update02;
01111       bool update03;
01112       bool update04;
01113       bool update05;
01114       bool update06;
01115       bool update07;
01116       bool update08;
01117       bool update09;
01118       bool update10;
01119       bool update11;
01120       bool update12;
01121       bool update13;
01122       bool update14;
01123       bool update15;
01124       bool update16;
01125 
01126       float num01, num02, num03, num04, num05, num06, num07, num08;
01127       float num09, num10, num11, num12, num13, num14, num15, num16;
01128       float mean01, mean02, mean03, mean04, mean05, mean06, mean07, mean08;
01129       float mean09, mean10, mean11, mean12, mean13, mean14, mean15, mean16;
01130       float rms01, rms02, rms03, rms04, rms05, rms06, rms07, rms08;
01131       float rms09, rms10, rms11, rms12, rms13, rms14, rms15, rms16;
01132 
01133       update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
01134       update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
01135       update03 = UtilsClient::getBinStatistics(i03_[ism-1], i, 0, num03, mean03, rms03);
01136       update04 = UtilsClient::getBinStatistics(i04_[ism-1], i, 0, num04, mean04, rms04);
01137       update05 = UtilsClient::getBinStatistics(i05_[ism-1], i, 0, num05, mean05, rms05);
01138       update06 = UtilsClient::getBinStatistics(i06_[ism-1], i, 0, num06, mean06, rms06);
01139       update07 = UtilsClient::getBinStatistics(i07_[ism-1], i, 0, num07, mean07, rms07);
01140       update08 = UtilsClient::getBinStatistics(i08_[ism-1], i, 0, num08, mean08, rms08);
01141       update09 = UtilsClient::getBinStatistics(i09_[ism-1], i, 0, num09, mean09, rms09);
01142       update10 = UtilsClient::getBinStatistics(i10_[ism-1], i, 0, num10, mean10, rms10);
01143       update11 = UtilsClient::getBinStatistics(i11_[ism-1], i, 0, num11, mean11, rms11);
01144       update12 = UtilsClient::getBinStatistics(i12_[ism-1], i, 0, num12, mean12, rms12);
01145       update13 = UtilsClient::getBinStatistics(i13_[ism-1], i, 0, num13, mean13, rms13);
01146       update14 = UtilsClient::getBinStatistics(i14_[ism-1], i, 0, num14, mean14, rms14);
01147       update15 = UtilsClient::getBinStatistics(i15_[ism-1], i, 0, num15, mean15, rms15);
01148       update16 = UtilsClient::getBinStatistics(i16_[ism-1], i, 0, num16, mean16, rms16);
01149 
01150       if ( update01 || update05 || update09 || update13 ) {
01151 
01152         if ( i == 1 ) {
01153 
01154           if ( verbose_ ) {
01155             std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01156             std::cout << "PNs (" << i << ") L1 G01 " << num01  << " " << mean01 << " " << rms01  << std::endl;
01157             std::cout << "PNs (" << i << ") L1 G16 " << num09  << " " << mean09 << " " << rms09  << std::endl;
01158             std::cout << std::endl;
01159           }
01160 
01161         }
01162 
01163         pn_bl.setADCMeanG1(mean01);
01164         pn_bl.setADCRMSG1(rms01);
01165 
01166         pn_bl.setPedMeanG1(mean05);
01167         pn_bl.setPedRMSG1(rms05);
01168 
01169         pn_bl.setADCMeanG16(mean09);
01170         pn_bl.setADCRMSG16(rms09);
01171 
01172         pn_bl.setPedMeanG16(mean13);
01173         pn_bl.setPedRMSG16(rms13);
01174 
01175         if ( UtilsClient::getBinStatus(meg05_[ism-1], i, 1) ||
01176              UtilsClient::getBinStatus(meg09_[ism-1], i, 1) ) {
01177           pn_bl.setTaskStatus(true);
01178         } else {
01179           pn_bl.setTaskStatus(false);
01180         }
01181 
01182         status = status && ( UtilsClient::getBinQuality(meg05_[ism-1], i, 1) ||
01183                              UtilsClient::getBinQuality(meg09_[ism-1], i, 1) );
01184 
01185         if ( econn ) {
01186           ecid = LogicID::getEcalLogicID("EB_LM_PN", Numbers::iSM(ism, EcalBarrel), i-1);
01187           dataset2_bl[ecid] = pn_bl;
01188         }
01189 
01190       }
01191 
01192       if ( update02 || update06 || update10 || update14 ) {
01193 
01194         if ( i == 1 ) {
01195 
01196           if ( verbose_ ) {
01197             std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01198             std::cout << "PNs (" << i << ") L2 G01 " << num02  << " " << mean02 << " " << rms02  << std::endl;
01199             std::cout << "PNs (" << i << ") L2 G16 " << num10  << " " << mean10 << " " << rms10  << std::endl;
01200             std::cout << std::endl;
01201           }
01202 
01203         }
01204 
01205         pn_ir.setADCMeanG1(mean02);
01206         pn_ir.setADCRMSG1(rms02);
01207 
01208         pn_ir.setPedMeanG1(mean06);
01209         pn_ir.setPedRMSG1(rms06);
01210 
01211         pn_ir.setADCMeanG16(mean10);
01212         pn_ir.setADCRMSG16(rms10);
01213 
01214         pn_ir.setPedMeanG16(mean14);
01215         pn_ir.setPedRMSG16(rms14);
01216 
01217         if ( UtilsClient::getBinStatus(meg06_[ism-1], i, 1) ||
01218              UtilsClient::getBinStatus(meg10_[ism-1], i, 1) ) {
01219           pn_ir.setTaskStatus(true);
01220         } else {
01221           pn_ir.setTaskStatus(false);
01222         }
01223 
01224         status = status && ( UtilsClient::getBinQuality(meg06_[ism-1], i, 1) ||
01225                              UtilsClient::getBinQuality(meg10_[ism-1], i, 1) );
01226 
01227         if ( econn ) {
01228           ecid = LogicID::getEcalLogicID("EB_LM_PN", Numbers::iSM(ism, EcalBarrel), i-1);
01229           dataset2_ir[ecid] = pn_ir;
01230         }
01231 
01232       }
01233 
01234       if ( update03 || update07 || update11 || update15 ) {
01235 
01236         if ( i == 1 ) {
01237 
01238           if ( verbose_ ) {
01239             std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01240             std::cout << "PNs (" << i << ") L3 G01 " << num03  << " " << mean03 << " " << rms03  << std::endl;
01241             std::cout << "PNs (" << i << ") L3 G16 " << num11  << " " << mean11 << " " << rms11  << std::endl;
01242             std::cout << std::endl;
01243           }
01244 
01245         }
01246 
01247         pn_gr.setADCMeanG1(mean03);
01248         pn_gr.setADCRMSG1(rms03);
01249 
01250         pn_gr.setPedMeanG1(mean07);
01251         pn_gr.setPedRMSG1(rms07);
01252 
01253         pn_gr.setADCMeanG16(mean11);
01254         pn_gr.setADCRMSG16(rms11);
01255 
01256         pn_gr.setPedMeanG16(mean15);
01257         pn_gr.setPedRMSG16(rms15);
01258 
01259         if ( UtilsClient::getBinStatus(meg07_[ism-1], i, 1) ||
01260              UtilsClient::getBinStatus(meg11_[ism-1], i, 1) ) {
01261           pn_gr.setTaskStatus(true);
01262         } else {
01263           pn_gr.setTaskStatus(false);
01264         }
01265 
01266         status = status && ( UtilsClient::getBinQuality(meg07_[ism-1], i, 1) ||
01267                              UtilsClient::getBinQuality(meg11_[ism-1], i, 1) );
01268 
01269         if ( econn ) {
01270           ecid = LogicID::getEcalLogicID("EB_LM_PN", Numbers::iSM(ism, EcalBarrel), i-1);
01271           dataset2_gr[ecid] = pn_gr;
01272         }
01273 
01274       }
01275 
01276       if ( update04 || update08 || update12 || update16 ) {
01277 
01278         if ( i == 1 ) {
01279 
01280           if ( verbose_ ) {
01281             std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01282             std::cout << "PNs (" << i << ") L4 G01 " << num04  << " " << mean04 << " " << rms04  << std::endl;
01283             std::cout << "PNs (" << i << ") L4 G16 " << num12  << " " << mean12 << " " << rms12  << std::endl;
01284             std::cout << std::endl;
01285           }
01286 
01287         }
01288 
01289         pn_rd.setADCMeanG1(mean04);
01290         pn_rd.setADCRMSG1(rms04);
01291 
01292         pn_rd.setPedMeanG1(mean08);
01293         pn_rd.setPedRMSG1(mean08);
01294 
01295         pn_rd.setADCMeanG16(mean12);
01296         pn_rd.setADCRMSG16(rms12);
01297 
01298         pn_rd.setPedMeanG16(mean16);
01299         pn_rd.setPedRMSG16(rms16);
01300 
01301         if ( UtilsClient::getBinStatus(meg08_[ism-1], i, 1) ||
01302              UtilsClient::getBinStatus(meg12_[ism-1], i, 1) ) {
01303           pn_rd.setTaskStatus(true);
01304         } else {
01305           pn_rd.setTaskStatus(false);
01306         }
01307 
01308         status = status && ( UtilsClient::getBinQuality(meg08_[ism-1], i, 1) ||
01309                              UtilsClient::getBinQuality(meg12_[ism-1], i, 1) );
01310 
01311         if ( econn ) {
01312           ecid = LogicID::getEcalLogicID("EB_LM_PN", Numbers::iSM(ism, EcalBarrel), i-1);
01313           dataset2_rd[ecid] = pn_rd;
01314         }
01315 
01316       }
01317 
01318     }
01319 
01320   }
01321 
01322   if ( econn ) {
01323     try {
01324       if ( verbose_ ) std::cout << "Inserting MonPnDat ..." << std::endl;
01325       if ( dataset2_bl.size() != 0 ) econn->insertDataArraySet(&dataset2_bl, moniov);
01326       if ( dataset2_ir.size() != 0 ) econn->insertDataArraySet(&dataset2_ir, moniov);
01327       if ( dataset2_gr.size() != 0 ) econn->insertDataArraySet(&dataset2_gr, moniov);
01328       if ( dataset2_rd.size() != 0 ) econn->insertDataArraySet(&dataset2_rd, moniov);
01329       if ( verbose_ ) std::cout << "done." << std::endl;
01330     } catch (std::runtime_error &e) {
01331       std::cerr << e.what() << std::endl;
01332     }
01333   }
01334 
01335   if ( verbose_ ) std::cout << std::endl;
01336 
01337   MonTimingLaserBlueCrystalDat t_bl;
01338   std::map<EcalLogicID, MonTimingLaserBlueCrystalDat> dataset3_bl;
01339   MonTimingLaserGreenCrystalDat t_gr;
01340   std::map<EcalLogicID, MonTimingLaserGreenCrystalDat> dataset3_gr;
01341   MonTimingLaserIRedCrystalDat t_ir;
01342   std::map<EcalLogicID, MonTimingLaserIRedCrystalDat> dataset3_ir;
01343   MonTimingLaserRedCrystalDat t_rd;
01344   std::map<EcalLogicID, MonTimingLaserRedCrystalDat> dataset3_rd;
01345 
01346   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
01347 
01348     int ism = superModules_[i];
01349 
01350     if ( verbose_ ) {
01351       std::cout << " " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01352       std::cout << std::endl;
01353     }
01354 
01355     for ( int ie = 1; ie <= 85; ie++ ) {
01356       for ( int ip = 1; ip <= 20; ip++ ) {
01357 
01358         bool update01;
01359         bool update02;
01360         bool update03;
01361         bool update04;
01362 
01363         float num01, num02, num03, num04;
01364         float mean01, mean02, mean03, mean04;
01365         float rms01, rms02, rms03, rms04;
01366 
01367         update01 = UtilsClient::getBinStatistics(h09_[ism-1], ie, ip, num01, mean01, rms01);
01368         update02 = UtilsClient::getBinStatistics(h10_[ism-1], ie, ip, num02, mean02, rms02);
01369         update03 = UtilsClient::getBinStatistics(h11_[ism-1], ie, ip, num03, mean03, rms03);
01370         update04 = UtilsClient::getBinStatistics(h12_[ism-1], ie, ip, num04, mean04, rms04);
01371 
01372         if ( update01 ) {
01373 
01374           if ( Numbers::icEB(ism, ie, ip) == 1 ) {
01375 
01376             if ( verbose_ ) {
01377               std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01378               std::cout << "L1 crystal (" << ie << "," << ip << ") " << num01  << " " << mean01 << " " << rms01  << std::endl;
01379               std::cout << std::endl;
01380             }
01381 
01382           }
01383 
01384           t_bl.setTimingMean(mean01);
01385           t_bl.setTimingRMS(rms01);
01386 
01387           if ( UtilsClient::getBinStatus(meg01_[ism-1], ie, ip) ) {
01388             t_bl.setTaskStatus(true);
01389           } else {
01390             t_bl.setTaskStatus(false);
01391           }
01392 
01393           status = status && UtilsClient::getBinQuality(meg01_[ism-1], ie, ip);
01394 
01395           int ic = Numbers::indexEB(ism, ie, ip);
01396 
01397           if ( econn ) {
01398             ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
01399             dataset3_bl[ecid] = t_bl;
01400           }
01401 
01402         }
01403 
01404         if ( update02 ) {
01405 
01406           if ( Numbers::icEB(ism, ie, ip) == 1 ) {
01407 
01408             if ( verbose_ ) {
01409               std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01410               std::cout << "L2 crystal (" << ie << "," << ip << ") " << num02  << " " << mean02 << " " << rms02  << std::endl;
01411               std::cout << std::endl;
01412             }
01413 
01414           }
01415 
01416           t_gr.setTimingMean(mean02);
01417           t_gr.setTimingRMS(rms02);
01418 
01419           if ( UtilsClient::getBinStatus(meg02_[ism-1], ie, ip) ) {
01420             t_gr.setTaskStatus(true);
01421           } else {
01422             t_gr.setTaskStatus(false);
01423           }
01424 
01425           status = status && UtilsClient::getBinQuality(meg02_[ism-1], ie, ip);
01426 
01427           int ic = Numbers::indexEB(ism, ie, ip);
01428 
01429           if ( econn ) {
01430             ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
01431             dataset3_gr[ecid] = t_gr;
01432           }
01433 
01434         }
01435 
01436         if ( update03 ) {
01437 
01438           if ( Numbers::icEB(ism, ie, ip) == 1 ) {
01439 
01440             if ( verbose_ ) {
01441               std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01442               std::cout << "L3 crystal (" << ie << "," << ip << ") " << num03  << " " << mean03 << " " << rms03  << std::endl;
01443               std::cout << std::endl;
01444             }
01445 
01446           }
01447 
01448           t_ir.setTimingMean(mean03);
01449           t_ir.setTimingRMS(rms03);
01450 
01451           if ( UtilsClient::getBinStatus(meg03_[ism-1], ie, ip) ) {
01452             t_ir.setTaskStatus(true);
01453           } else {
01454             t_ir.setTaskStatus(false);
01455           }
01456 
01457           status = status && UtilsClient::getBinQuality(meg03_[ism-1], ie, ip);
01458 
01459           int ic = Numbers::indexEB(ism, ie, ip);
01460 
01461           if ( econn ) {
01462             ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
01463             dataset3_ir[ecid] = t_ir;
01464           }
01465 
01466         }
01467 
01468         if ( update04 ) {
01469 
01470           if ( Numbers::icEB(ism, ie, ip) == 1 ) {
01471 
01472             if ( verbose_ ) {
01473               std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
01474               std::cout << "L4 crystal (" << ie << "," << ip << ") " << num04  << " " << mean04 << " " << rms04  << std::endl;
01475               std::cout << std::endl;
01476             }
01477 
01478           }
01479 
01480           t_rd.setTimingMean(mean04);
01481           t_rd.setTimingRMS(rms04);
01482 
01483           if ( UtilsClient::getBinStatus(meg04_[ism-1], ie, ip) ) {
01484             t_rd.setTaskStatus(true);
01485           } else {
01486             t_rd.setTaskStatus(false);
01487           }
01488 
01489           status = status && UtilsClient::getBinQuality(meg04_[ism-1], ie, ip);
01490 
01491           int ic = Numbers::indexEB(ism, ie, ip);
01492 
01493           if ( econn ) {
01494             ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
01495             dataset3_rd[ecid] = t_rd;
01496           }
01497 
01498         }
01499 
01500       }
01501     }
01502 
01503   }
01504 
01505   if ( econn ) {
01506     try {
01507       if ( verbose_ ) std::cout << "Inserting MonTimingLaserCrystalDat ..." << std::endl;
01508       if ( dataset3_bl.size() != 0 ) econn->insertDataArraySet(&dataset3_bl, moniov);
01509       if ( dataset3_ir.size() != 0 ) econn->insertDataArraySet(&dataset3_ir, moniov);
01510       if ( dataset3_gr.size() != 0 ) econn->insertDataArraySet(&dataset3_gr, moniov);
01511       if ( dataset3_rd.size() != 0 ) econn->insertDataArraySet(&dataset3_rd, moniov);
01512       if ( verbose_ ) std::cout << "done." << std::endl;
01513     } catch (std::runtime_error &e) {
01514       std::cerr << e.what() << std::endl;
01515     }
01516   }
01517 
01518   return true;
01519 
01520 }
01521 #endif
01522 
01523 void EBLaserClient::analyze(void) {
01524 
01525   ievt_++;
01526   jevt_++;
01527   if ( ievt_ % 10 == 0 ) {
01528     if ( debug_ ) std::cout << "EBLaserClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
01529   }
01530 
01531   uint32_t bits01 = 0;
01532   bits01 |= 1 << EcalDQMStatusHelper::LASER_MEAN_ERROR;
01533   bits01 |= 1 << EcalDQMStatusHelper::LASER_RMS_ERROR;
01534 
01535   uint32_t bits02 = 0;
01536   bits02 |= 1 << EcalDQMStatusHelper::LASER_TIMING_MEAN_ERROR;
01537   bits02 |= 1 << EcalDQMStatusHelper::LASER_TIMING_RMS_ERROR;
01538 
01539   uint32_t bits03 = 0;
01540   bits03 |= 1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR;
01541   bits03 |= 1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_RMS_ERROR;
01542 
01543   uint32_t bits04 = 0;
01544   bits04 |= 1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR;
01545   bits04 |= 1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_RMS_ERROR;
01546 
01547   char histo[200];
01548 
01549   MonitorElement* me;
01550 
01551   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
01552 
01553     int ism = superModules_[i];
01554 
01555     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01556 
01557       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser1/EBLT amplitude %s L1").c_str(), Numbers::sEB(ism).c_str());
01558       me = dqmStore_->get(histo);
01559       h01_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h01_[ism-1] );
01560 
01561       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser1/EBLT amplitude over PN %s L1").c_str(), Numbers::sEB(ism).c_str());
01562       me = dqmStore_->get(histo);
01563       h02_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h02_[ism-1] );
01564 
01565     }
01566 
01567     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01568 
01569       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser2/EBLT amplitude %s L2").c_str(), Numbers::sEB(ism).c_str());
01570       me = dqmStore_->get(histo);
01571       h03_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h03_[ism-1] );
01572 
01573       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser2/EBLT amplitude over PN %s L2").c_str(), Numbers::sEB(ism).c_str());
01574       me = dqmStore_->get(histo);
01575       h04_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h04_[ism-1] );
01576 
01577     }
01578 
01579     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01580 
01581       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser3/EBLT amplitude %s L3").c_str(), Numbers::sEB(ism).c_str());
01582       me = dqmStore_->get(histo);
01583       h05_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h05_[ism-1] );
01584 
01585       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser3/EBLT amplitude over PN %s L3").c_str(), Numbers::sEB(ism).c_str());
01586       me = dqmStore_->get(histo);
01587       h06_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h06_[ism-1] );
01588 
01589     }
01590 
01591     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01592 
01593       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser4/EBLT amplitude %s L4").c_str(), Numbers::sEB(ism).c_str());
01594       me = dqmStore_->get(histo);
01595       h07_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h07_[ism-1] );
01596 
01597       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser4/EBLT amplitude over PN %s L4").c_str(), Numbers::sEB(ism).c_str());
01598       me = dqmStore_->get(histo);
01599       h08_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h08_[ism-1] );
01600 
01601     }
01602 
01603     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01604 
01605       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser1/EBLT timing %s L1").c_str(), Numbers::sEB(ism).c_str());
01606       me = dqmStore_->get(histo);
01607       h09_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h09_[ism-1] );
01608 
01609     }
01610 
01611     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01612 
01613       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser2/EBLT timing %s L2").c_str(), Numbers::sEB(ism).c_str());
01614       me = dqmStore_->get(histo);
01615       h10_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h10_[ism-1] );
01616 
01617     }
01618 
01619     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01620 
01621       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser3/EBLT timing %s L3").c_str(), Numbers::sEB(ism).c_str());
01622       me = dqmStore_->get(histo);
01623       h11_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h11_[ism-1] );
01624 
01625     }
01626 
01627     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01628 
01629       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser4/EBLT timing %s L4").c_str(), Numbers::sEB(ism).c_str());
01630       me = dqmStore_->get(histo);
01631       h12_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h12_[ism-1] );
01632 
01633     }
01634 
01635     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01636 
01637       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser1/EBLT shape %s L1").c_str(), Numbers::sEB(ism).c_str());
01638       me = dqmStore_->get(histo);
01639       hs01_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, hs01_[ism-1] );
01640 
01641     }
01642 
01643     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01644 
01645       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser2/EBLT shape %s L2").c_str(), Numbers::sEB(ism).c_str());
01646       me = dqmStore_->get(histo);
01647       hs02_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, hs02_[ism-1] );
01648 
01649     }
01650 
01651     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01652 
01653       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser3/EBLT shape %s L3").c_str(), Numbers::sEB(ism).c_str());
01654       me = dqmStore_->get(histo);
01655       hs03_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, hs03_[ism-1] );
01656 
01657     }
01658 
01659     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01660 
01661       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser4/EBLT shape %s L4").c_str(), Numbers::sEB(ism).c_str());
01662       me = dqmStore_->get(histo);
01663       hs04_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, hs04_[ism-1] );
01664 
01665     }
01666 
01667     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01668 
01669       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser1/PN/Gain01/EBLT PNs amplitude %s G01 L1").c_str(), Numbers::sEB(ism).c_str());
01670       me = dqmStore_->get(histo);
01671       i01_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i01_[ism-1] );
01672 
01673     }
01674 
01675 
01676     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01677 
01678       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser2/PN/Gain01/EBLT PNs amplitude %s G01 L2").c_str(), Numbers::sEB(ism).c_str());
01679       me = dqmStore_->get(histo);
01680       i02_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i02_[ism-1] );
01681 
01682     }
01683 
01684     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01685 
01686       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser3/PN/Gain01/EBLT PNs amplitude %s G01 L3").c_str(), Numbers::sEB(ism).c_str());
01687       me = dqmStore_->get(histo);
01688       i03_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i03_[ism-1] );
01689 
01690     }
01691 
01692     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01693 
01694       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser4/PN/Gain01/EBLT PNs amplitude %s G01 L4").c_str(), Numbers::sEB(ism).c_str());
01695       me = dqmStore_->get(histo);
01696       i04_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i04_[ism-1] );
01697 
01698     }
01699 
01700     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01701 
01702       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser1/PN/Gain01/EBLT PNs pedestal %s G01 L1").c_str(), Numbers::sEB(ism).c_str());
01703       me = dqmStore_->get(histo);
01704       i05_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i05_[ism-1] );
01705 
01706     }
01707 
01708     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01709 
01710       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser2/PN/Gain01/EBLT PNs pedestal %s G01 L2").c_str(), Numbers::sEB(ism).c_str());
01711       me = dqmStore_->get(histo);
01712       i06_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i06_[ism-1] );
01713 
01714     }
01715 
01716     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01717 
01718       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser3/PN/Gain01/EBLT PNs pedestal %s G01 L3").c_str(), Numbers::sEB(ism).c_str());
01719       me = dqmStore_->get(histo);
01720       i07_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i07_[ism-1] );
01721 
01722     }
01723 
01724     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01725 
01726       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser4/PN/Gain01/EBLT PNs pedestal %s G01 L4").c_str(), Numbers::sEB(ism).c_str());
01727       me = dqmStore_->get(histo);
01728       i08_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i08_[ism-1] );
01729 
01730     }
01731 
01732     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01733 
01734       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser1/PN/Gain16/EBLT PNs amplitude %s G16 L1").c_str(), Numbers::sEB(ism).c_str());
01735       me = dqmStore_->get(histo);
01736       i09_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i09_[ism-1] );
01737 
01738     }
01739 
01740     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01741 
01742       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser2/PN/Gain16/EBLT PNs amplitude %s G16 L2").c_str(), Numbers::sEB(ism).c_str());
01743       me = dqmStore_->get(histo);
01744       i10_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i10_[ism-1] );
01745 
01746     }
01747 
01748     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01749 
01750       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser3/PN/Gain16/EBLT PNs amplitude %s G16 L3").c_str(), Numbers::sEB(ism).c_str());
01751       me = dqmStore_->get(histo);
01752       i11_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i11_[ism-1] );
01753 
01754     }
01755 
01756     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01757 
01758       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser4/PN/Gain16/EBLT PNs amplitude %s G16 L4").c_str(), Numbers::sEB(ism).c_str());
01759       me = dqmStore_->get(histo);
01760       i12_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i12_[ism-1] );
01761 
01762     }
01763 
01764     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01765 
01766       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser1/PN/Gain16/EBLT PNs pedestal %s G16 L1").c_str(), Numbers::sEB(ism).c_str());
01767       me = dqmStore_->get(histo);
01768       i13_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i13_[ism-1] );
01769 
01770     }
01771 
01772     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01773 
01774       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser2/PN/Gain16/EBLT PNs pedestal %s G16 L2").c_str(), Numbers::sEB(ism).c_str());
01775       me = dqmStore_->get(histo);
01776       i14_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i14_[ism-1] );
01777 
01778     }
01779 
01780     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01781 
01782       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser3/PN/Gain16/EBLT PNs pedestal %s G16 L3").c_str(), Numbers::sEB(ism).c_str());
01783       me = dqmStore_->get(histo);
01784       i15_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i15_[ism-1] );
01785 
01786     }
01787 
01788     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01789 
01790       sprintf(histo, (prefixME_ + "/EBLaserTask/Laser4/PN/Gain16/EBLT PNs pedestal %s G16 L4").c_str(), Numbers::sEB(ism).c_str());
01791       me = dqmStore_->get(histo);
01792       i16_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i16_[ism-1] );
01793 
01794     }
01795 
01796     if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
01797     if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
01798     if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
01799     if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
01800 
01801     if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
01802     if ( meg06_[ism-1] ) meg06_[ism-1]->Reset();
01803     if ( meg07_[ism-1] ) meg07_[ism-1]->Reset();
01804     if ( meg08_[ism-1] ) meg08_[ism-1]->Reset();
01805     if ( meg09_[ism-1] ) meg09_[ism-1]->Reset();
01806     if ( meg10_[ism-1] ) meg10_[ism-1]->Reset();
01807     if ( meg11_[ism-1] ) meg11_[ism-1]->Reset();
01808     if ( meg12_[ism-1] ) meg12_[ism-1]->Reset();
01809 
01810     if ( mea01_[ism-1] ) mea01_[ism-1]->Reset();
01811     if ( mea02_[ism-1] ) mea02_[ism-1]->Reset();
01812     if ( mea03_[ism-1] ) mea03_[ism-1]->Reset();
01813     if ( mea04_[ism-1] ) mea04_[ism-1]->Reset();
01814 
01815     if ( met01_[ism-1] ) met01_[ism-1]->Reset();
01816     if ( met02_[ism-1] ) met02_[ism-1]->Reset();
01817     if ( met03_[ism-1] ) met03_[ism-1]->Reset();
01818     if ( met04_[ism-1] ) met04_[ism-1]->Reset();
01819 
01820     if ( metav01_[ism-1] ) metav01_[ism-1]->Reset();
01821     if ( metav02_[ism-1] ) metav02_[ism-1]->Reset();
01822     if ( metav03_[ism-1] ) metav03_[ism-1]->Reset();
01823     if ( metav04_[ism-1] ) metav04_[ism-1]->Reset();
01824 
01825     if ( metrms01_[ism-1] ) metrms01_[ism-1]->Reset();
01826     if ( metrms02_[ism-1] ) metrms02_[ism-1]->Reset();
01827     if ( metrms03_[ism-1] ) metrms03_[ism-1]->Reset();
01828     if ( metrms04_[ism-1] ) metrms04_[ism-1]->Reset();
01829 
01830     if ( meaopn01_[ism-1] ) meaopn01_[ism-1]->Reset();
01831     if ( meaopn02_[ism-1] ) meaopn02_[ism-1]->Reset();
01832     if ( meaopn03_[ism-1] ) meaopn03_[ism-1]->Reset();
01833     if ( meaopn04_[ism-1] ) meaopn04_[ism-1]->Reset();
01834 
01835     if ( mepnprms01_[ism-1] ) mepnprms01_[ism-1]->Reset();
01836     if ( mepnprms02_[ism-1] ) mepnprms02_[ism-1]->Reset();
01837     if ( mepnprms03_[ism-1] ) mepnprms03_[ism-1]->Reset();
01838     if ( mepnprms04_[ism-1] ) mepnprms04_[ism-1]->Reset();
01839     if ( mepnprms05_[ism-1] ) mepnprms05_[ism-1]->Reset();
01840     if ( mepnprms06_[ism-1] ) mepnprms06_[ism-1]->Reset();
01841     if ( mepnprms07_[ism-1] ) mepnprms07_[ism-1]->Reset();
01842     if ( mepnprms08_[ism-1] ) mepnprms08_[ism-1]->Reset();
01843 
01844     if ( me_hs01_[ism-1] ) me_hs01_[ism-1]->Reset();
01845     if ( me_hs02_[ism-1] ) me_hs02_[ism-1]->Reset();
01846     if ( me_hs03_[ism-1] ) me_hs03_[ism-1]->Reset();
01847     if ( me_hs04_[ism-1] ) me_hs04_[ism-1]->Reset();
01848 
01849     float meanAmplL1, meanAmplL2, meanAmplL3, meanAmplL4;
01850 
01851     int nCryL1, nCryL2, nCryL3, nCryL4;
01852 
01853     meanAmplL1 = meanAmplL2 = meanAmplL3 = meanAmplL4 = 0.;
01854 
01855     nCryL1 = nCryL2 = nCryL3 = nCryL4 = 0;
01856 
01857     for ( int ie = 1; ie <= 85; ie++ ) {
01858       for ( int ip = 1; ip <= 20; ip++ ) {
01859 
01860         bool update01;
01861         bool update02;
01862         bool update03;
01863         bool update04;
01864 
01865         float num01, num02, num03, num04;
01866         float mean01, mean02, mean03, mean04;
01867         float rms01, rms02, rms03, rms04;
01868 
01869         update01 = UtilsClient::getBinStatistics(h01_[ism-1], ie, ip, num01, mean01, rms01);
01870         update02 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num02, mean02, rms02);
01871         update03 = UtilsClient::getBinStatistics(h05_[ism-1], ie, ip, num03, mean03, rms03);
01872         update04 = UtilsClient::getBinStatistics(h07_[ism-1], ie, ip, num04, mean04, rms04);
01873 
01874         float xmean01 = mean01;
01875         float xmean02 = mean02;
01876         float xmean03 = mean03;
01877         float xmean04 = mean04;
01878 
01879         // special correction for EB+04
01880         if ( ism == 22 && ie <= 5 ) {
01881           xmean01 = xmean01 * 1.5;
01882           xmean02 = xmean02 * 1.5;
01883           xmean03 = xmean03 * 1.5;
01884           xmean04 = xmean04 * 1.5;
01885         }
01886 
01887         // special correction for EB+09
01888         if ( ism == 27 && ie > 5 && ip <= 10 ) {
01889           xmean01 = xmean01 * 1.5;
01890           xmean02 = xmean02 * 1.5;
01891           xmean03 = xmean03 * 1.5;
01892           xmean04 = xmean04 * 1.5;
01893         }
01894 
01895         // special correction for EB+18
01896         if ( ism == 36 && ie > 5 && ip <= 10 ) {
01897           xmean01 = xmean01 * 1.0;
01898           xmean02 = xmean02 * 1.0;
01899           xmean03 = xmean03 * 1.0;
01900           xmean04 = xmean04 * 2.0;
01901         }
01902 
01903         if ( update01 ) {
01904           meanAmplL1 += xmean01;
01905           nCryL1++;
01906         }
01907 
01908         if ( update02 ) {
01909           meanAmplL2 += xmean02;
01910           nCryL2++;
01911         }
01912 
01913         if ( update03 ) {
01914           meanAmplL3 += xmean03;
01915           nCryL3++;
01916         }
01917 
01918         if ( update04 ) {
01919           meanAmplL4 += xmean04;
01920           nCryL4++;
01921         }
01922 
01923       }
01924     }
01925 
01926     if ( nCryL1 > 0 ) meanAmplL1 /= float (nCryL1);
01927     if ( nCryL2 > 0 ) meanAmplL2 /= float (nCryL2);
01928     if ( nCryL3 > 0 ) meanAmplL3 /= float (nCryL3);
01929     if ( nCryL4 > 0 ) meanAmplL4 /= float (nCryL4);
01930 
01931     for ( int ie = 1; ie <= 85; ie++ ) {
01932       for ( int ip = 1; ip <= 20; ip++ ) {
01933 
01934         if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ie, ip, 2.);
01935         if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ie, ip, 2.);
01936         if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ie, ip, 2.);
01937         if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( ie, ip, 2.);
01938 
01939         bool update01;
01940         bool update02;
01941         bool update03;
01942         bool update04;
01943         bool update05;
01944         bool update06;
01945         bool update07;
01946         bool update08;
01947         bool update09;
01948         bool update10;
01949         bool update11;
01950         bool update12;
01951 
01952         float num01, num02, num03, num04, num05, num06, num07, num08;
01953         float num09, num10, num11, num12;
01954         float mean01, mean02, mean03, mean04, mean05, mean06, mean07, mean08;
01955         float mean09, mean10, mean11, mean12;
01956         float rms01, rms02, rms03, rms04, rms05, rms06, rms07, rms08;
01957         float rms09, rms10, rms11, rms12;
01958 
01959         update01 = UtilsClient::getBinStatistics(h01_[ism-1], ie, ip, num01, mean01, rms01);
01960         update02 = UtilsClient::getBinStatistics(h02_[ism-1], ie, ip, num02, mean02, rms02);
01961         update03 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num03, mean03, rms03);
01962         update04 = UtilsClient::getBinStatistics(h04_[ism-1], ie, ip, num04, mean04, rms04);
01963         update05 = UtilsClient::getBinStatistics(h05_[ism-1], ie, ip, num05, mean05, rms05);
01964         update06 = UtilsClient::getBinStatistics(h06_[ism-1], ie, ip, num06, mean06, rms06);
01965         update07 = UtilsClient::getBinStatistics(h07_[ism-1], ie, ip, num07, mean07, rms07);
01966         update08 = UtilsClient::getBinStatistics(h08_[ism-1], ie, ip, num08, mean08, rms08);
01967         update09 = UtilsClient::getBinStatistics(h09_[ism-1], ie, ip, num09, mean09, rms09);
01968         update10 = UtilsClient::getBinStatistics(h10_[ism-1], ie, ip, num10, mean10, rms10);
01969         update11 = UtilsClient::getBinStatistics(h11_[ism-1], ie, ip, num11, mean11, rms11);
01970         update12 = UtilsClient::getBinStatistics(h12_[ism-1], ie, ip, num12, mean12, rms12);
01971 
01972         float xmean01 = mean01;
01973         float xmean03 = mean03;
01974         float xmean05 = mean05;
01975         float xmean07 = mean07;
01976 
01977         // special correction for EB+04
01978         if ( ism == 22 && ie <= 5 ) {
01979           xmean01 = xmean01 * 1.5;
01980           xmean03 = xmean03 * 1.5;
01981           xmean05 = xmean05 * 1.5;
01982           xmean07 = xmean07 * 1.5;
01983         }
01984 
01985         // special correction for EB+09
01986         if ( ism == 27 && ie > 5 && ip <= 10 ) {
01987           xmean01 = xmean01 * 1.5;
01988           xmean03 = xmean03 * 1.5;
01989           xmean05 = xmean05 * 1.5;
01990           xmean07 = xmean07 * 1.5;
01991         }
01992 
01993         // special correction for EB+18
01994         if ( ism == 36 && ie > 5 && ip <= 10 ) {
01995           xmean01 = xmean01 * 1.0;
01996           xmean03 = xmean03 * 1.0;
01997           xmean05 = xmean05 * 1.0;
01998           xmean07 = xmean07 * 2.0;
01999         }
02000 
02001         if ( update01 ) {
02002 
02003           float val;
02004 
02005           val = 1.;
02006           if ( std::abs(xmean01 - meanAmplL1) > std::abs(percentVariation_ * meanAmplL1) || xmean01 < amplitudeThreshold_ || rms01 > rmsThresholdRelative_ * mean01 )
02007             val = 0.;
02008           if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ie, ip, val );
02009 
02010           int ic = Numbers::icEB(ism, ie, ip);
02011 
02012           if ( mea01_[ism-1] ) {
02013             if ( mean01 > 0. ) {
02014               mea01_[ism-1]->setBinContent( ic, mean01 );
02015               mea01_[ism-1]->setBinError( ic, rms01 );
02016             } else {
02017               mea01_[ism-1]->setEntries( 1.+mea01_[ism-1]->getEntries() );
02018             }
02019           }
02020 
02021         }
02022 
02023         if ( update03 ) {
02024 
02025           float val;
02026 
02027           val = 1.;
02028           if ( std::abs(xmean03 - meanAmplL2) > std::abs(percentVariation_ * meanAmplL2) || xmean03 < amplitudeThreshold_ || rms03 > rmsThresholdRelative_ * mean03 )
02029             val = 0.;
02030           if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ie, ip, val );
02031 
02032           int ic = Numbers::icEB(ism, ie, ip);
02033 
02034           if ( mea02_[ism-1] ) {
02035             if ( mean03 > 0. ) {
02036               mea02_[ism-1]->setBinContent( ic, mean03 );
02037               mea02_[ism-1]->setBinError( ic, rms03 );
02038             } else {
02039               mea02_[ism-1]->setEntries( 1.+mea02_[ism-1]->getEntries() );
02040             }
02041           }
02042 
02043         }
02044 
02045         if ( update05 ) {
02046 
02047           float val;
02048 
02049           val = 1.;
02050           if ( std::abs(xmean05 - meanAmplL3) > std::abs(percentVariation_ * meanAmplL3) || xmean05 < amplitudeThreshold_ || rms05 > rmsThresholdRelative_ * mean05 )
02051             val = 0.;
02052           if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ie, ip, val );
02053 
02054           int ic = Numbers::icEB(ism, ie, ip);
02055 
02056           if ( mea03_[ism-1] ) {
02057             if ( mean05 > 0. ) {
02058               mea03_[ism-1]->setBinContent( ic, mean05 );
02059               mea03_[ism-1]->setBinError( ic, rms05 );
02060             } else {
02061               mea03_[ism-1]->setEntries( 1.+mea03_[ism-1]->getEntries() );
02062             }
02063           }
02064 
02065         }
02066 
02067         if ( update07 ) {
02068 
02069           float val;
02070 
02071           val = 1.;
02072           if ( std::abs(xmean07 - meanAmplL4) > std::abs(percentVariation_ * meanAmplL4) || xmean07 < amplitudeThreshold_ || rms07 > rmsThresholdRelative_ * mean07 )
02073             val = 0.;
02074           if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( ie, ip, val );
02075 
02076           int ic = Numbers::icEB(ism, ie, ip);
02077 
02078           if ( mea04_[ism-1] ) {
02079             if ( mean07 > 0. ) {
02080               mea04_[ism-1]->setBinContent( ic, mean07 );
02081               mea04_[ism-1]->setBinError( ic, rms07 );
02082             } else {
02083               mea04_[ism-1]->setEntries( 1.+mea04_[ism-1]->getEntries() );
02084             }
02085           }
02086 
02087         }
02088 
02089         if ( Masks::maskChannel(ism, ie, ip, bits01, EcalBarrel) ) {
02090           UtilsClient::maskBinContent( meg01_[ism-1], ie, ip );
02091           UtilsClient::maskBinContent( meg02_[ism-1], ie, ip );
02092           UtilsClient::maskBinContent( meg03_[ism-1], ie, ip );
02093           UtilsClient::maskBinContent( meg04_[ism-1], ie, ip );
02094         }
02095 
02096         if ( update02 ) {
02097 
02098           int ic = Numbers::icEB(ism, ie, ip);
02099 
02100           if ( meaopn01_[ism-1] ) {
02101             if ( mean02 > 0. ) {
02102               meaopn01_[ism-1]->setBinContent( ic, mean02 );
02103               meaopn01_[ism-1]->setBinError( ic, rms02 );
02104             } else {
02105               meaopn01_[ism-1]->setEntries( 1.+meaopn01_[ism-1]->getEntries() );
02106             }
02107           }
02108 
02109         }
02110 
02111         if ( update04 ) {
02112 
02113           int ic = Numbers::icEB(ism, ie, ip);
02114 
02115           if ( meaopn02_[ism-1] ) {
02116             if ( mean04 > 0. ) {
02117               meaopn02_[ism-1]->setBinContent( ic, mean04 );
02118               meaopn02_[ism-1]->setBinError( ic, rms04 );
02119             } else {
02120               meaopn02_[ism-1]->setEntries( 1.+meaopn02_[ism-1]->getEntries() );
02121             }
02122           }
02123 
02124         }
02125 
02126         if ( update06 ) {
02127 
02128           int ic = Numbers::icEB(ism, ie, ip);
02129 
02130           if ( meaopn03_[ism-1] ) {
02131             if ( mean06 > 0. ) {
02132               meaopn03_[ism-1]->setBinContent( ic, mean06 );
02133               meaopn03_[ism-1]->setBinError( ic, rms06 );
02134             } else {
02135               meaopn03_[ism-1]->setEntries( 1.+meaopn03_[ism-1]->getEntries() );
02136             }
02137           }
02138 
02139         }
02140 
02141         if ( update08 ) {
02142 
02143           int ic = Numbers::icEB(ism, ie, ip);
02144 
02145           if ( meaopn04_[ism-1] ) {
02146             if ( mean08 > 0. ) {
02147               meaopn04_[ism-1]->setBinContent( ic, mean08 );
02148               meaopn04_[ism-1]->setBinError( ic, rms08 );
02149             } else {
02150               meaopn04_[ism-1]->setEntries( 1.+meaopn04_[ism-1]->getEntries() );
02151             }
02152           }
02153 
02154         }
02155 
02156         if ( update09 ) {
02157 
02158           int ic = Numbers::icEB(ism, ie, ip);
02159 
02160           if ( met01_[ism-1] ) {
02161             if ( mean09 > 0. ) {
02162               met01_[ism-1]->setBinContent( ic, mean09 );
02163               met01_[ism-1]->setBinError( ic, rms09 );
02164             } else {
02165               met01_[ism-1]->setEntries(1.+met01_[ism-1]->getEntries());
02166             }
02167           }
02168 
02169           if ( metav01_[ism-1] ) metav01_[ism-1] ->Fill(mean09);
02170           if ( metrms01_[ism-1] ) metrms01_[ism-1]->Fill(rms09);
02171 
02172         }
02173 
02174         if ( update10 ) {
02175 
02176           int ic = Numbers::icEB(ism, ie, ip);
02177 
02178           if ( met02_[ism-1] ) {
02179             if ( mean10 > 0. ) {
02180               met02_[ism-1]->setBinContent( ic, mean10 );
02181               met02_[ism-1]->setBinError( ic, rms10 );
02182             } else {
02183               met02_[ism-1]->setEntries(1.+met02_[ism-1]->getEntries());
02184             }
02185           }
02186 
02187           if ( metav02_[ism-1] ) metav02_[ism-1] ->Fill(mean10);
02188           if ( metrms02_[ism-1] ) metrms02_[ism-1]->Fill(rms10);
02189 
02190         }
02191 
02192         if ( update11 ) {
02193 
02194           int ic = Numbers::icEB(ism, ie, ip);
02195 
02196           if ( met03_[ism-1] ) {
02197             if ( mean11 > 0. ) {
02198               met03_[ism-1]->setBinContent( ic, mean11 );
02199               met03_[ism-1]->setBinError( ic, rms11 );
02200             } else {
02201               met03_[ism-1]->setEntries(1.+met03_[ism-1]->getEntries());
02202             }
02203           }
02204 
02205           if ( metav03_[ism-1] ) metav03_[ism-1] ->Fill(mean11);
02206           if ( metrms03_[ism-1] ) metrms03_[ism-1]->Fill(rms11);
02207 
02208         }
02209 
02210         if ( update12 ) {
02211 
02212           int ic = Numbers::icEB(ism, ie, ip);
02213 
02214           if ( met04_[ism-1] ) {
02215             if ( mean12 > 0. ) {
02216               met04_[ism-1]->setBinContent( ic, mean12 );
02217               met04_[ism-1]->setBinError( ic, rms12 );
02218             } else {
02219               met04_[ism-1]->setEntries(1.+met04_[ism-1]->getEntries());
02220             }
02221           }
02222 
02223           if ( metav04_[ism-1] ) metav04_[ism-1] ->Fill(mean12);
02224           if ( metrms04_[ism-1] ) metrms04_[ism-1]->Fill(rms12);
02225 
02226         }
02227 
02228       }
02229     }
02230 
02231     for ( int i = 1; i <= 10; i++ ) {
02232 
02233       if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
02234       if ( meg06_[ism-1] ) meg06_[ism-1]->setBinContent( i, 1, 2. );
02235       if ( meg07_[ism-1] ) meg07_[ism-1]->setBinContent( i, 1, 2. );
02236       if ( meg08_[ism-1] ) meg08_[ism-1]->setBinContent( i, 1, 2. );
02237       if ( meg09_[ism-1] ) meg09_[ism-1]->setBinContent( i, 1, 2. );
02238       if ( meg10_[ism-1] ) meg10_[ism-1]->setBinContent( i, 1, 2. );
02239       if ( meg11_[ism-1] ) meg11_[ism-1]->setBinContent( i, 1, 2. );
02240       if ( meg12_[ism-1] ) meg12_[ism-1]->setBinContent( i, 1, 2. );
02241 
02242       bool update01;
02243       bool update02;
02244       bool update03;
02245       bool update04;
02246       bool update05;
02247       bool update06;
02248       bool update07;
02249       bool update08;
02250       bool update09;
02251       bool update10;
02252       bool update11;
02253       bool update12;
02254       bool update13;
02255       bool update14;
02256       bool update15;
02257       bool update16;
02258 
02259       float num01, num02, num03, num04, num05, num06, num07, num08;
02260       float num09, num10, num11, num12, num13, num14, num15, num16;
02261       float mean01, mean02, mean03, mean04, mean05, mean06, mean07, mean08;
02262       float mean09, mean10, mean11, mean12, mean13, mean14, mean15, mean16;
02263       float rms01, rms02, rms03, rms04, rms05, rms06, rms07, rms08;
02264       float rms09, rms10, rms11, rms12, rms13, rms14, rms15, rms16;
02265 
02266       update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
02267       update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
02268       update03 = UtilsClient::getBinStatistics(i03_[ism-1], i, 0, num03, mean03, rms03);
02269       update04 = UtilsClient::getBinStatistics(i04_[ism-1], i, 0, num04, mean04, rms04);
02270       update05 = UtilsClient::getBinStatistics(i05_[ism-1], i, 0, num05, mean05, rms05);
02271       update06 = UtilsClient::getBinStatistics(i06_[ism-1], i, 0, num06, mean06, rms06);
02272       update07 = UtilsClient::getBinStatistics(i07_[ism-1], i, 0, num07, mean07, rms07);
02273       update08 = UtilsClient::getBinStatistics(i08_[ism-1], i, 0, num08, mean08, rms08);
02274       update09 = UtilsClient::getBinStatistics(i09_[ism-1], i, 0, num09, mean09, rms09);
02275       update10 = UtilsClient::getBinStatistics(i10_[ism-1], i, 0, num10, mean10, rms10);
02276       update11 = UtilsClient::getBinStatistics(i11_[ism-1], i, 0, num11, mean11, rms11);
02277       update12 = UtilsClient::getBinStatistics(i12_[ism-1], i, 0, num12, mean12, rms12);
02278       update13 = UtilsClient::getBinStatistics(i13_[ism-1], i, 0, num13, mean13, rms13);
02279       update14 = UtilsClient::getBinStatistics(i14_[ism-1], i, 0, num14, mean14, rms14);
02280       update15 = UtilsClient::getBinStatistics(i15_[ism-1], i, 0, num15, mean15, rms15);
02281       update16 = UtilsClient::getBinStatistics(i16_[ism-1], i, 0, num16, mean16, rms16);
02282 
02283       if ( update01 && update05 ) {
02284 
02285         float val;
02286 
02287         val = 1.;
02288         if ( mean01 < amplitudeThresholdPnG01_ )
02289           val = 0.;
02290         if ( mean05 <  pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
02291              pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean05)
02292           val = 0.;
02293         if ( rms05 > pedPnRMSThreshold_[0] )
02294           val = 0.;
02295 
02296         if ( meg05_[ism-1] )           meg05_[ism-1]->setBinContent(i, 1, val);
02297         if ( mepnprms01_[ism-1] ) mepnprms01_[ism-1]->Fill(rms05);
02298 
02299       }
02300 
02301       if ( update02 && update06 ) {
02302 
02303        float val;
02304 
02305         val = 1.;
02306         if ( mean02 < amplitudeThresholdPnG01_ )
02307           val = 0.;
02308         if ( mean06 <  pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
02309              pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean06)
02310           val = 0.;
02311         if ( rms06 > pedPnRMSThreshold_[0] )
02312           val = 0.;
02313 
02314         if ( meg06_[ism-1] )           meg06_[ism-1]->setBinContent(i, 1, val);
02315         if ( mepnprms02_[ism-1] ) mepnprms02_[ism-1]->Fill(rms06);
02316       }
02317 
02318       if ( update03 && update07 ) {
02319 
02320         float val;
02321 
02322         val = 1.;
02323         if ( mean03 < amplitudeThresholdPnG01_ )
02324           val = 0.;
02325         if ( mean07 <  pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
02326              pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean07)
02327           val = 0.;
02328         if ( rms07 > pedPnRMSThreshold_[0] )
02329           val = 0.;
02330 
02331         if ( meg07_[ism-1] )           meg07_[ism-1]->setBinContent(i, 1, val);
02332         if ( mepnprms03_[ism-1] ) mepnprms03_[ism-1]->Fill(rms07);
02333       }
02334 
02335       if ( update04 && update08 ) {
02336 
02337         float val;
02338 
02339         val = 1.;
02340         if ( mean04 < amplitudeThresholdPnG01_ )
02341           val = 0.;
02342         if ( mean08 <  pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
02343              pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean08)
02344           val = 0.;
02345         if ( rms08 > pedPnRMSThreshold_[0] )
02346           val = 0.;
02347 
02348         if ( meg08_[ism-1] )           meg08_[ism-1]->setBinContent(i, 1, val);
02349         if ( mepnprms04_[ism-1] ) mepnprms04_[ism-1]->Fill(rms08);
02350       }
02351 
02352       if ( update09 && update13 ) {
02353 
02354         float val;
02355 
02356         val = 1.;
02357         if ( mean09 < amplitudeThresholdPnG16_ )
02358           val = 0.;
02359         if ( mean13 <  pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
02360              pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean13)
02361           val = 0.;
02362         if ( rms13 > pedPnRMSThreshold_[1] )
02363           val = 0.;
02364 
02365         if ( meg09_[ism-1] )           meg09_[ism-1]->setBinContent(i, 1, val);
02366         if ( mepnprms05_[ism-1] ) mepnprms05_[ism-1]->Fill(rms13);
02367       }
02368 
02369       if ( update10 && update14 ) {
02370 
02371         float val;
02372 
02373         val = 1.;
02374         if ( mean10 < amplitudeThresholdPnG16_ )
02375           val = 0.;
02376         if ( mean14 <  pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
02377              pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean14)
02378           val = 0.;
02379         if ( rms14 > pedPnRMSThreshold_[1] )
02380           val = 0.;
02381 
02382         if ( meg10_[ism-1] )           meg10_[ism-1]->setBinContent(i, 1, val);
02383         if ( mepnprms06_[ism-1] ) mepnprms06_[ism-1]->Fill(rms14);
02384       }
02385 
02386       if ( update11 && update15 ) {
02387 
02388         float val;
02389 
02390         val = 1.;
02391         if ( mean11 < amplitudeThresholdPnG16_ )
02392           val = 0.;
02393         if ( mean15 <  pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
02394              pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean15)
02395           val = 0.;
02396         if ( rms15 > pedPnRMSThreshold_[1] )
02397           val = 0.;
02398 
02399         if ( meg11_[ism-1] )           meg11_[ism-1]->setBinContent(i, 1, val);
02400         if ( mepnprms07_[ism-1] ) mepnprms07_[ism-1]->Fill(rms15);
02401       }
02402 
02403       if ( update12 && update16 ) {
02404 
02405         float val;
02406 
02407         val = 1.;
02408         if ( mean12 < amplitudeThresholdPnG16_ )
02409           val = 0.;
02410         if ( mean16 <  pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
02411              pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean16)
02412           val = 0.;
02413         if ( rms16 > pedPnRMSThreshold_[1] )
02414           val = 0.;
02415 
02416         if ( meg12_[ism-1] )           meg12_[ism-1]->setBinContent(i, 1, val);
02417         if ( mepnprms08_[ism-1] ) mepnprms08_[ism-1]->Fill(rms16);
02418       }
02419 
02420       if ( Masks::maskPn(ism, i, bits01|bits03, EcalBarrel) ) {
02421         UtilsClient::maskBinContent( meg05_[ism-1], i, 1 );
02422         UtilsClient::maskBinContent( meg06_[ism-1], i, 1 );
02423         UtilsClient::maskBinContent( meg07_[ism-1], i, 1 );
02424         UtilsClient::maskBinContent( meg08_[ism-1], i, 1 );
02425       }
02426 
02427       if ( Masks::maskPn(ism, i, bits01|bits04, EcalBarrel) ) {
02428         UtilsClient::maskBinContent( meg09_[ism-1], i, 1 );
02429         UtilsClient::maskBinContent( meg10_[ism-1], i, 1 );
02430         UtilsClient::maskBinContent( meg11_[ism-1], i, 1 );
02431         UtilsClient::maskBinContent( meg12_[ism-1], i, 1 );
02432       }
02433 
02434     }
02435 
02436     for ( int i = 1; i <= 10; i++ ) {
02437 
02438       if ( hs01_[ism-1] ) {
02439         int ic = UtilsClient::getFirstNonEmptyChannel( hs01_[ism-1] );
02440         if ( me_hs01_[ism-1] ) {
02441           me_hs01_[ism-1]->setBinContent( i, hs01_[ism-1]->GetBinContent(ic, i) );
02442           me_hs01_[ism-1]->setBinError( i, hs01_[ism-1]->GetBinError(ic, i) );
02443         }
02444       }
02445 
02446       if ( hs02_[ism-1] ) {
02447         int ic = UtilsClient::getFirstNonEmptyChannel( hs02_[ism-1] );
02448         if ( me_hs02_[ism-1] ) {
02449           me_hs02_[ism-1]->setBinContent( i, hs02_[ism-1]->GetBinContent(ic, i) );
02450           me_hs02_[ism-1]->setBinError( i, hs02_[ism-1]->GetBinError(ic, i) );
02451         }
02452       }
02453 
02454       if ( hs03_[ism-1] ) {
02455         int ic = UtilsClient::getFirstNonEmptyChannel( hs03_[ism-1] );
02456         if ( me_hs03_[ism-1] ) {
02457           me_hs03_[ism-1]->setBinContent( i, hs03_[ism-1]->GetBinContent(ic, i) );
02458           me_hs03_[ism-1]->setBinError( i, hs03_[ism-1]->GetBinError(ic, i) );
02459         }
02460       }
02461 
02462       if ( hs04_[ism-1] ) {
02463         int ic = UtilsClient::getFirstNonEmptyChannel( hs04_[ism-1] );
02464         if ( me_hs04_[ism-1] ) {
02465           me_hs04_[ism-1]->setBinContent( i, hs04_[ism-1]->GetBinContent(ic, i) );
02466           me_hs04_[ism-1]->setBinError( i, hs04_[ism-1]->GetBinError(ic, i) );
02467         }
02468       }
02469 
02470     }
02471 
02472   }
02473 
02474 }
02475