00001
00002
00003
00004
00005
00006
00007
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 #include "DQMServices/Core/interface/MonitorElement.h"
00021
00022 #ifdef WITH_ECAL_COND_DB
00023 #include "OnlineDB/EcalCondDB/interface/MonPedestalsDat.h"
00024 #include "OnlineDB/EcalCondDB/interface/MonPNPedDat.h"
00025 #include "OnlineDB/EcalCondDB/interface/RunCrystalErrorsDat.h"
00026 #include "OnlineDB/EcalCondDB/interface/RunTTErrorsDat.h"
00027 #include "OnlineDB/EcalCondDB/interface/RunPNErrorsDat.h"
00028 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
00029 #include "DQM/EcalCommon/interface/LogicID.h"
00030 #endif
00031
00032 #include "DQM/EcalCommon/interface/Masks.h"
00033
00034 #include "DQM/EcalCommon/interface/UtilsClient.h"
00035 #include "DQM/EcalCommon/interface/Numbers.h"
00036
00037 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00038
00039 #include "DQM/EcalEndcapMonitorClient/interface/EEPedestalClient.h"
00040
00041
00042
00043 EEPedestalClient::EEPedestalClient(const edm::ParameterSet& ps) {
00044
00045
00046 cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
00047
00048
00049 verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
00050
00051
00052 debug_ = ps.getUntrackedParameter<bool>("debug", false);
00053
00054
00055 prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
00056
00057
00058 enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00059
00060
00061 superModules_.reserve(18);
00062 for ( unsigned int i = 1; i <= 18; i++ ) superModules_.push_back(i);
00063 superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
00064
00065 MGPAGains_.reserve(3);
00066 for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
00067 MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
00068
00069 MGPAGainsPN_.reserve(2);
00070 for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
00071 MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
00072
00073 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00074
00075 int ism = superModules_[i];
00076
00077 h01_[ism-1] = 0;
00078 h02_[ism-1] = 0;
00079 h03_[ism-1] = 0;
00080
00081 j01_[ism-1] = 0;
00082 j02_[ism-1] = 0;
00083 j03_[ism-1] = 0;
00084
00085 k01_[ism-1] = 0;
00086 k02_[ism-1] = 0;
00087 k03_[ism-1] = 0;
00088
00089 i01_[ism-1] = 0;
00090 i02_[ism-1] = 0;
00091
00092 }
00093
00094 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00095
00096 int ism = superModules_[i];
00097
00098 meg01_[ism-1] = 0;
00099 meg02_[ism-1] = 0;
00100 meg03_[ism-1] = 0;
00101
00102 meg04_[ism-1] = 0;
00103 meg05_[ism-1] = 0;
00104
00105 mep01_[ism-1] = 0;
00106 mep02_[ism-1] = 0;
00107 mep03_[ism-1] = 0;
00108
00109 mer01_[ism-1] = 0;
00110 mer02_[ism-1] = 0;
00111 mer03_[ism-1] = 0;
00112
00113 mer04_[ism-1] = 0;
00114 mer05_[ism-1] = 0;
00115
00116 #ifdef COMMON_NOISE_ANALYSIS
00117 mes01_[ism-1] = 0;
00118 mes02_[ism-1] = 0;
00119 mes03_[ism-1] = 0;
00120
00121 met01_[ism-1] = 0;
00122 met02_[ism-1] = 0;
00123 met03_[ism-1] = 0;
00124 #endif
00125
00126 }
00127
00128 expectedMean_[0] = 200.0;
00129 expectedMean_[1] = 200.0;
00130 expectedMean_[2] = 200.0;
00131
00132 discrepancyMean_[0] = 25.0;
00133 discrepancyMean_[1] = 25.0;
00134 discrepancyMean_[2] = 25.0;
00135
00136 RMSThreshold_[0] = 1.0;
00137 RMSThreshold_[1] = 1.5;
00138 RMSThreshold_[2] = 2.5;
00139
00140 RMSThresholdInner_[0] = 2.0;
00141 RMSThresholdInner_[1] = 2.5;
00142 RMSThresholdInner_[2] = 3.5;
00143
00144 expectedMeanPn_[0] = 750.0;
00145 expectedMeanPn_[1] = 750.0;
00146
00147 discrepancyMeanPn_[0] = 100.0;
00148 discrepancyMeanPn_[1] = 100.0;
00149
00150 RMSThresholdPn_[0] = 999.;
00151 RMSThresholdPn_[1] = 999.;
00152
00153 }
00154
00155 EEPedestalClient::~EEPedestalClient() {
00156
00157 }
00158
00159 void EEPedestalClient::beginJob(void) {
00160
00161 dqmStore_ = edm::Service<DQMStore>().operator->();
00162
00163 if ( debug_ ) std::cout << "EEPedestalClient: beginJob" << std::endl;
00164
00165 ievt_ = 0;
00166 jevt_ = 0;
00167
00168 }
00169
00170 void EEPedestalClient::beginRun(void) {
00171
00172 if ( debug_ ) std::cout << "EEPedestalClient: beginRun" << std::endl;
00173
00174 jevt_ = 0;
00175
00176 this->setup();
00177
00178 }
00179
00180 void EEPedestalClient::endJob(void) {
00181
00182 if ( debug_ ) std::cout << "EEPedestalClient: endJob, ievt = " << ievt_ << std::endl;
00183
00184 this->cleanup();
00185
00186 }
00187
00188 void EEPedestalClient::endRun(void) {
00189
00190 if ( debug_ ) std::cout << "EEPedestalClient: endRun, jevt = " << jevt_ << std::endl;
00191
00192 this->cleanup();
00193
00194 }
00195
00196 void EEPedestalClient::setup(void) {
00197
00198 std::string name;
00199
00200 dqmStore_->setCurrentFolder( prefixME_ + "/EEPedestalClient" );
00201
00202 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00203
00204 int ism = superModules_[i];
00205
00206 if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00207 if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
00208 name = "EEPT pedestal quality G01 " + Numbers::sEE(ism);
00209 meg01_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
00210 meg01_[ism-1]->setAxisTitle("ix", 1);
00211 if ( ism >= 1 && ism <= 9 ) meg01_[ism-1]->setAxisTitle("101-ix", 1);
00212 meg01_[ism-1]->setAxisTitle("iy", 2);
00213 }
00214 if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00215 if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
00216 name = "EEPT pedestal quality G06 " + Numbers::sEE(ism);
00217 meg02_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
00218 meg02_[ism-1]->setAxisTitle("ix", 1);
00219 if ( ism >= 1 && ism <= 9 ) meg02_[ism-1]->setAxisTitle("101-ix", 1);
00220 meg02_[ism-1]->setAxisTitle("iy", 2);
00221 }
00222 if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00223 if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
00224 name = "EEPT pedestal quality G12 " + Numbers::sEE(ism);
00225 meg03_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
00226 meg03_[ism-1]->setAxisTitle("ix", 1);
00227 if ( ism >= 1 && ism <= 9 ) meg03_[ism-1]->setAxisTitle("101-ix", 1);
00228 meg03_[ism-1]->setAxisTitle("iy", 2);
00229 }
00230
00231 if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
00232 if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
00233 name = "EEPT pedestal quality PNs G01 " + Numbers::sEE(ism);
00234 meg04_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
00235 meg04_[ism-1]->setAxisTitle("pseudo-strip", 1);
00236 meg04_[ism-1]->setAxisTitle("channel", 2);
00237 }
00238 if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
00239 if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
00240 name = "EEPT pedestal quality PNs G16 " + Numbers::sEE(ism);
00241 meg05_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
00242 meg05_[ism-1]->setAxisTitle("pseudo-strip", 1);
00243 meg05_[ism-1]->setAxisTitle("channel", 2);
00244 }
00245
00246 if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00247 if ( mep01_[ism-1] ) dqmStore_->removeElement( mep01_[ism-1]->getName() );
00248 name = "EEPT pedestal mean G01 " + Numbers::sEE(ism);
00249 mep01_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
00250 mep01_[ism-1]->setAxisTitle("mean", 1);
00251 }
00252 if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00253 if ( mep02_[ism-1] ) dqmStore_->removeElement( mep02_[ism-1]->getName() );
00254 name = "EEPT pedestal mean G06 " + Numbers::sEE(ism);
00255 mep02_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
00256 mep02_[ism-1]->setAxisTitle("mean", 1);
00257 }
00258 if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00259 if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
00260 name = "EEPT pedestal mean G12 " + Numbers::sEE(ism);
00261 mep03_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
00262 mep03_[ism-1]->setAxisTitle("mean", 1);
00263 }
00264
00265 if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00266 if ( mer01_[ism-1] ) dqmStore_->removeElement( mer01_[ism-1]->getName() );
00267 name = "EEPT pedestal rms G01 " + Numbers::sEE(ism);
00268 mer01_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
00269 mer01_[ism-1]->setAxisTitle("rms", 1);
00270 }
00271 if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00272 if ( mer02_[ism-1] ) dqmStore_->removeElement( mer02_[ism-1]->getName() );
00273 name = "EEPT pedestal rms G06 " + Numbers::sEE(ism);
00274 mer02_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
00275 mer02_[ism-1]->setAxisTitle("rms", 1);
00276 }
00277 if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00278 if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
00279 name = "EEPT pedestal rms G12 " + Numbers::sEE(ism);
00280 mer03_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
00281 mer03_[ism-1]->setAxisTitle("rms", 1);
00282 }
00283
00284 if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
00285 if ( mer04_[ism-1] ) dqmStore_->removeElement( mer04_[ism-1]->getName() );
00286 name = "EEPDT PNs pedestal rms " + Numbers::sEE(ism) + " G01";
00287 mer04_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
00288 mer04_[ism-1]->setAxisTitle("rms", 1);
00289 }
00290 if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
00291 if ( mer05_[ism-1] ) dqmStore_->removeElement( mer05_[ism-1]->getName() );
00292 name = "EEPDT PNs pedestal rms " + Numbers::sEE(ism) + " G16";
00293 mer05_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
00294 mer05_[ism-1]->setAxisTitle("rms", 1);
00295 }
00296
00297 #ifdef COMMON_NOISE_ANALYSIS
00298 if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00299 if ( mes01_[ism-1] ) dqmStore_->removeElement( mes01_[ism-1]->getName() );
00300 name = "EEPT pedestal 3sum G01 " + Numbers::sEE(ism);
00301 mes01_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
00302 mes01_[ism-1]->setAxisTitle("ix", 1);
00303 if ( ism >= 1 && ism <= 9 ) mes01_[ism-1]->setAxisTitle("101-ix", 1);
00304 mes01_[ism-1]->setAxisTitle("iy", 2);
00305 }
00306 if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00307 if ( mes02_[ism-1] ) dqmStore_->removeElement( mes02_[ism-1]->getName() );
00308 name = "EEPT pedestal 3sum G06 " + Numbers::sEE(ism);
00309 mes02_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
00310 mes02_[ism-1]->setAxisTitle("ix", 1);
00311 if ( ism >= 1 && ism <= 9 ) mes02_[ism-1]->setAxisTitle("101-ix", 1);
00312 mes02_[ism-1]->setAxisTitle("iy", 2);
00313 }
00314 if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00315 if ( mes03_[ism-1] ) dqmStore_->removeElement( mes03_[ism-1]->getName() );
00316 name = "EEPT pedestal 3sum G12 " + Numbers::sEE(ism);
00317 mes03_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
00318 mes03_[ism-1]->setAxisTitle("ix", 1);
00319 if ( ism >= 1 && ism <= 9 ) mes03_[ism-1]->setAxisTitle("101-ix", 1);
00320 mes03_[ism-1]->setAxisTitle("iy", 2);
00321 }
00322
00323 if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00324 if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
00325 name = "EEPT pedestal 5sum G01 " + Numbers::sEE(ism);
00326 met01_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
00327 met01_[ism-1]->setAxisTitle("ix", 1);
00328 if ( ism >= 1 && ism <= 9 ) met01_[ism-1]->setAxisTitle("101-ix", 1);
00329 met01_[ism-1]->setAxisTitle("iy", 2);
00330 }
00331 if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00332 if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
00333 name = "EEPT pedestal 5sum G06 " + Numbers::sEE(ism);
00334 met02_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
00335 met02_[ism-1]->setAxisTitle("ix", 1);
00336 if ( ism >= 1 && ism <= 9 ) met02_[ism-1]->setAxisTitle("101-ix", 1);
00337 met02_[ism-1]->setAxisTitle("iy", 2);
00338 }
00339 if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00340 if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
00341 name = "EEPT pedestal 5sum G12 " + Numbers::sEE(ism);
00342 met03_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
00343 met03_[ism-1]->setAxisTitle("ix", 1);
00344 if ( ism >= 1 && ism <= 9 ) met03_[ism-1]->setAxisTitle("101-ix", 1);
00345 met03_[ism-1]->setAxisTitle("iy", 2);
00346 }
00347 #endif
00348
00349 }
00350
00351 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00352
00353 int ism = superModules_[i];
00354
00355 if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
00356 if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
00357 if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
00358
00359 if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
00360 if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
00361
00362 for ( int ix = 1; ix <= 50; ix++ ) {
00363 for ( int iy = 1; iy <= 50; iy++ ) {
00364
00365 if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 6. );
00366 if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 6. );
00367 if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 6. );
00368
00369 int jx = ix + Numbers::ix0EE(ism);
00370 int jy = iy + Numbers::iy0EE(ism);
00371
00372 if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
00373
00374 if ( Numbers::validEE(ism, jx, jy) ) {
00375 if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 2. );
00376 if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 2. );
00377 if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2. );
00378 }
00379
00380 }
00381 }
00382
00383 for ( int i = 1; i <= 10; i++ ) {
00384
00385 if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 6. );
00386 if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 6. );
00387
00388
00389 if ( (ism >= 3 && ism <= 4) || (ism >= 7 && ism <= 9) ) continue;
00390 if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) ) continue;
00391
00392 if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
00393 if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
00394
00395 }
00396
00397 if ( mep01_[ism-1] ) mep01_[ism-1]->Reset();
00398 if ( mep02_[ism-1] ) mep02_[ism-1]->Reset();
00399 if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
00400
00401 if ( mer01_[ism-1] ) mer01_[ism-1]->Reset();
00402 if ( mer02_[ism-1] ) mer02_[ism-1]->Reset();
00403 if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
00404
00405 if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
00406 if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();
00407
00408 #ifdef COMMON_NOISE_ANALYSIS
00409 if ( mes01_[ism-1] ) mes01_[ism-1]->Reset();
00410 if ( mes02_[ism-1] ) mes02_[ism-1]->Reset();
00411 if ( mes03_[ism-1] ) mes03_[ism-1]->Reset();
00412
00413 if ( met01_[ism-1] ) met01_[ism-1]->Reset();
00414 if ( met02_[ism-1] ) met02_[ism-1]->Reset();
00415 if ( met03_[ism-1] ) met03_[ism-1]->Reset();
00416
00417 for ( int ix = 1; ix <= 50; ix++ ) {
00418 for ( int iy = 1; iy <= 50; iy++ ) {
00419
00420 if ( mes01_[ism-1] ) mes01_[ism-1]->setBinContent( ix, iy, -999. );
00421 if ( mes02_[ism-1] ) mes02_[ism-1]->setBinContent( ix, iy, -999. );
00422 if ( mes03_[ism-1] ) mes03_[ism-1]->setBinContent( ix, iy, -999. );
00423
00424 if ( met01_[ism-1] ) met01_[ism-1]->setBinContent( ix, iy, -999. );
00425 if ( met02_[ism-1] ) met02_[ism-1]->setBinContent( ix, iy, -999. );
00426 if ( met03_[ism-1] ) met03_[ism-1]->setBinContent( ix, iy, -999. );
00427
00428 }
00429 }
00430 #endif
00431
00432 }
00433
00434 }
00435
00436 void EEPedestalClient::cleanup(void) {
00437
00438 if ( ! enableCleanup_ ) return;
00439
00440 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00441
00442 int ism = superModules_[i];
00443
00444 if ( cloneME_ ) {
00445 if ( h01_[ism-1] ) delete h01_[ism-1];
00446 if ( h02_[ism-1] ) delete h02_[ism-1];
00447 if ( h03_[ism-1] ) delete h03_[ism-1];
00448
00449 if ( j01_[ism-1] ) delete j01_[ism-1];
00450 if ( j02_[ism-1] ) delete j02_[ism-1];
00451 if ( j03_[ism-1] ) delete j03_[ism-1];
00452
00453 if ( k01_[ism-1] ) delete k01_[ism-1];
00454 if ( k02_[ism-1] ) delete k02_[ism-1];
00455 if ( k03_[ism-1] ) delete k03_[ism-1];
00456
00457 if ( i01_[ism-1] ) delete i01_[ism-1];
00458 if ( i02_[ism-1] ) delete i02_[ism-1];
00459 }
00460
00461 h01_[ism-1] = 0;
00462 h02_[ism-1] = 0;
00463 h03_[ism-1] = 0;
00464
00465 j01_[ism-1] = 0;
00466 j02_[ism-1] = 0;
00467 j03_[ism-1] = 0;
00468
00469 k01_[ism-1] = 0;
00470 k02_[ism-1] = 0;
00471 k03_[ism-1] = 0;
00472
00473 i01_[ism-1] = 0;
00474 i02_[ism-1] = 0;
00475
00476 }
00477
00478 dqmStore_->setCurrentFolder( prefixME_ + "/EEPedestalClient" );
00479
00480 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00481
00482 int ism = superModules_[i];
00483
00484 if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
00485 meg01_[ism-1] = 0;
00486 if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
00487 meg02_[ism-1] = 0;
00488 if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
00489 meg03_[ism-1] = 0;
00490
00491 if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
00492 meg04_[ism-1] = 0;
00493 if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
00494 meg05_[ism-1] = 0;
00495
00496 if ( mep01_[ism-1] ) dqmStore_->removeElement( mep01_[ism-1]->getName() );
00497 mep01_[ism-1] = 0;
00498 if ( mep02_[ism-1] ) dqmStore_->removeElement( mep02_[ism-1]->getName() );
00499 mep02_[ism-1] = 0;
00500 if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
00501 mep03_[ism-1] = 0;
00502
00503 if ( mer01_[ism-1] ) dqmStore_->removeElement( mer01_[ism-1]->getName() );
00504 mer01_[ism-1] = 0;
00505 if ( mer02_[ism-1] ) dqmStore_->removeElement( mer02_[ism-1]->getName() );
00506 mer02_[ism-1] = 0;
00507 if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
00508 mer03_[ism-1] = 0;
00509
00510 if ( mer04_[ism-1] ) dqmStore_->removeElement( mer04_[ism-1]->getName() );
00511 mer04_[ism-1] = 0;
00512 if ( mer05_[ism-1] ) dqmStore_->removeElement( mer05_[ism-1]->getName() );
00513 mer05_[ism-1] = 0;
00514
00515 #ifdef COMMON_NOISE_ANALYSIS
00516 if ( mes01_[ism-1] ) dqmStore_->removeElement( mes01_[ism-1]->getName() );
00517 mes01_[ism-1] = 0;
00518 if ( mes02_[ism-1] ) dqmStore_->removeElement( mes02_[ism-1]->getName() );
00519 mes02_[ism-1] = 0;
00520 if ( mes03_[ism-1] ) dqmStore_->removeElement( mes03_[ism-1]->getName() );
00521 mes03_[ism-1] = 0;
00522
00523 if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
00524 met01_[ism-1] = 0;
00525 if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
00526 met02_[ism-1] = 0;
00527 if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
00528 met03_[ism-1] = 0;
00529 #endif
00530
00531 }
00532
00533 }
00534
00535 #ifdef WITH_ECAL_COND_DB
00536 bool EEPedestalClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
00537
00538 status = true;
00539
00540 EcalLogicID ecid;
00541
00542 MonPedestalsDat p;
00543 std::map<EcalLogicID, MonPedestalsDat> dataset1;
00544
00545 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00546
00547 int ism = superModules_[i];
00548
00549 if ( verbose_ ) {
00550 std::cout << " " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
00551 std::cout << std::endl;
00552 if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00553 UtilsClient::printBadChannels(meg01_[ism-1], h01_[ism-1]);
00554 }
00555 if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00556 UtilsClient::printBadChannels(meg02_[ism-1], h02_[ism-1]);
00557 }
00558 if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00559 UtilsClient::printBadChannels(meg03_[ism-1], h03_[ism-1]);
00560 }
00561 }
00562
00563 for ( int ix = 1; ix <= 50; ix++ ) {
00564 for ( int iy = 1; iy <= 50; iy++ ) {
00565
00566 int jx = ix + Numbers::ix0EE(ism);
00567 int jy = iy + Numbers::iy0EE(ism);
00568
00569 if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
00570
00571 if ( ! Numbers::validEE(ism, jx, jy) ) continue;
00572
00573 bool update01;
00574 bool update02;
00575 bool update03;
00576
00577 float num01, num02, num03;
00578 float mean01, mean02, mean03;
00579 float rms01, rms02, rms03;
00580
00581 update01 = UtilsClient::getBinStatistics(h01_[ism-1], ix, iy, num01, mean01, rms01);
00582 update02 = UtilsClient::getBinStatistics(h02_[ism-1], ix, iy, num02, mean02, rms02);
00583 update03 = UtilsClient::getBinStatistics(h03_[ism-1], ix, iy, num03, mean03, rms03);
00584
00585 if ( update01 || update02 || update03 ) {
00586
00587 if ( Numbers::icEE(ism, jx, jy) == 1 ) {
00588
00589 if ( verbose_ ) {
00590 std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
00591 std::cout << "G01 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num01 << " " << mean01 << " " << rms01 << std::endl;
00592 std::cout << "G06 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num02 << " " << mean02 << " " << rms02 << std::endl;
00593 std::cout << "G12 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num03 << " " << mean03 << " " << rms03 << std::endl;
00594 std::cout << std::endl;
00595 }
00596
00597 }
00598
00599 p.setPedMeanG1(mean01);
00600 p.setPedRMSG1(rms01);
00601
00602 p.setPedMeanG6(mean02);
00603 p.setPedRMSG6(rms02);
00604
00605 p.setPedMeanG12(mean03);
00606 p.setPedRMSG12(rms03);
00607
00608 if ( UtilsClient::getBinStatus(meg01_[ism-1], ix, iy) &&
00609 UtilsClient::getBinStatus(meg02_[ism-1], ix, iy) &&
00610 UtilsClient::getBinStatus(meg03_[ism-1], ix, iy) ) {
00611 p.setTaskStatus(true);
00612 } else {
00613 p.setTaskStatus(false);
00614 }
00615
00616 status = status && UtilsClient::getBinQuality(meg01_[ism-1], ix, iy) &&
00617 UtilsClient::getBinQuality(meg02_[ism-1], ix, iy) &&
00618 UtilsClient::getBinQuality(meg03_[ism-1], ix, iy);
00619
00620 int ic = Numbers::indexEE(ism, jx, jy);
00621
00622 if ( ic == -1 ) continue;
00623
00624 if ( econn ) {
00625 ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
00626 dataset1[ecid] = p;
00627 }
00628
00629 }
00630
00631 }
00632 }
00633
00634 }
00635
00636 if ( econn ) {
00637 try {
00638 if ( verbose_ ) std::cout << "Inserting MonPedestalsDat ..." << std::endl;
00639 if ( dataset1.size() != 0 ) econn->insertDataArraySet(&dataset1, moniov);
00640 if ( verbose_ ) std::cout << "done." << std::endl;
00641 } catch (std::runtime_error &e) {
00642 std::cerr << e.what() << std::endl;
00643 }
00644 }
00645
00646 if ( verbose_ ) std::cout << std::endl;
00647
00648 MonPNPedDat pn;
00649 std::map<EcalLogicID, MonPNPedDat> dataset2;
00650
00651 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00652
00653 int ism = superModules_[i];
00654
00655 if ( verbose_ ) {
00656 std::cout << " " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
00657 std::cout << std::endl;
00658 if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
00659 UtilsClient::printBadChannels(meg04_[ism-1], i01_[ism-1]);
00660 }
00661 if (find(MGPAGainsPN_.begin(), MGPAGains_.end(), 16) != MGPAGains_.end() ) {
00662 UtilsClient::printBadChannels(meg05_[ism-1], i02_[ism-1]);
00663 }
00664 }
00665
00666 for ( int i = 1; i <= 10; i++ ) {
00667
00668 bool update01;
00669 bool update02;
00670
00671 float num01, num02;
00672 float mean01, mean02;
00673 float rms01, rms02;
00674
00675 update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
00676 update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
00677
00678 if ( update01 || update02 ) {
00679
00680 if ( i == 1 ) {
00681
00682 if ( verbose_ ) {
00683 std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
00684 std::cout << "PNs (" << i << ") G01 " << num01 << " " << mean01 << " " << rms01 << std::endl;
00685 std::cout << "PNs (" << i << ") G16 " << num01 << " " << mean01 << " " << rms01 << std::endl;
00686 std::cout << std::endl;
00687 }
00688
00689 }
00690
00691 pn.setPedMeanG1(mean01);
00692 pn.setPedRMSG1(rms01);
00693
00694 pn.setPedMeanG16(mean02);
00695 pn.setPedRMSG16(rms02);
00696
00697 if ( UtilsClient::getBinStatus(meg04_[ism-1], i, 1) &&
00698 UtilsClient::getBinStatus(meg05_[ism-1], i, 1) ) {
00699 pn.setTaskStatus(true);
00700 } else {
00701 pn.setTaskStatus(false);
00702 }
00703
00704 status = status && UtilsClient::getBinQuality(meg04_[ism-1], i, 1) &&
00705 UtilsClient::getBinQuality(meg05_[ism-1], i, 1);
00706
00707 if ( econn ) {
00708 ecid = LogicID::getEcalLogicID("EE_LM_PN", Numbers::iSM(ism, EcalEndcap), i-1);
00709 dataset2[ecid] = pn;
00710 }
00711
00712 }
00713
00714 }
00715
00716 }
00717
00718 if ( econn ) {
00719 try {
00720 if ( verbose_ ) std::cout << "Inserting MonPNPedDat ..." << std::endl;
00721 if ( dataset2.size() != 0 ) econn->insertDataArraySet(&dataset2, moniov);
00722 if ( verbose_ ) std::cout << "done." << std::endl;
00723 } catch (std::runtime_error &e) {
00724 std::cerr << e.what() << std::endl;
00725 }
00726 }
00727
00728 return true;
00729
00730 }
00731 #endif
00732
00733 void EEPedestalClient::analyze(void) {
00734
00735 ievt_++;
00736 jevt_++;
00737 if ( ievt_ % 10 == 0 ) {
00738 if ( debug_ ) std::cout << "EEPedestalClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
00739 }
00740
00741 uint32_t bits01 = 0;
00742 bits01 |= 1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR;
00743 bits01 |= 1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_RMS_ERROR;
00744
00745 uint32_t bits02 = 0;
00746 bits02 |= 1 << EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_MEAN_ERROR;
00747 bits02 |= 1 << EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_RMS_ERROR;
00748
00749 uint32_t bits03 = 0;
00750 bits03 |= 1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR;
00751 bits03 |= 1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_RMS_ERROR;
00752
00753 MonitorElement* me;
00754
00755 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00756
00757 int ism = superModules_[i];
00758
00759 if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00760 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/Gain01/EEPT pedestal " + Numbers::sEE(ism) + " G01" );
00761 h01_[ism-1] = UtilsClient::getHisto( me, cloneME_, h01_[ism-1] );
00762 }
00763
00764 if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00765 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/Gain06/EEPT pedestal " + Numbers::sEE(ism) + " G06" );
00766 h02_[ism-1] = UtilsClient::getHisto( me, cloneME_, h02_[ism-1] );
00767 }
00768
00769 if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00770 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/Gain12/EEPT pedestal " + Numbers::sEE(ism) + " G12" );
00771 h03_[ism-1] = UtilsClient::getHisto( me, cloneME_, h03_[ism-1] );
00772 }
00773
00774 #ifdef COMMON_NOISE_ANALYSIS
00775 if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00776 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/Gain01/EEPT pedestal 3sum " + Numbers::sEE(ism) + " G01" );
00777 j01_[ism-1] = UtilsClient::getHisto( me, cloneME_, j01_[ism-1] );
00778 }
00779
00780 if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00781 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/Gain06/EEPT pedestal 3sum " + Numbers::sEE(ism) + " G06" );
00782 j02_[ism-1] = UtilsClient::getHisto( me, cloneME_, j02_[ism-1] );
00783 }
00784
00785 if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00786 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/Gain12/EEPT pedestal 3sum " + Numbers::sEE(ism) + " G12" );
00787 j03_[ism-1] = UtilsClient::getHisto( me, cloneME_, j03_[ism-1] );
00788 }
00789
00790 if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00791 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/Gain01/EEPT pedestal 5sum " + Numbers::sEE(ism) + " G01" );
00792 k01_[ism-1] = UtilsClient::getHisto( me, cloneME_, k01_[ism-1] );
00793 }
00794
00795 if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00796 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/Gain06/EEPT pedestal 5sum " + Numbers::sEE(ism) + " G06" );
00797 k02_[ism-1] = UtilsClient::getHisto( me, cloneME_, k02_[ism-1] );
00798 }
00799
00800 if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00801 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/Gain12/EEPT pedestal 5sum " + Numbers::sEE(ism) + " G12" );
00802 k03_[ism-1] = UtilsClient::getHisto( me, cloneME_, k03_[ism-1] );
00803 }
00804 #endif
00805
00806 if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
00807 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/PN/Gain01/EEPDT PNs pedestal " + Numbers::sEE(ism) + " G01" );
00808 i01_[ism-1] = UtilsClient::getHisto( me, cloneME_, i01_[ism-1] );
00809 }
00810
00811 if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
00812 me = dqmStore_->get( prefixME_ + "/EEPedestalTask/PN/Gain16/EEPDT PNs pedestal " + Numbers::sEE(ism) + " G16" );
00813 i02_[ism-1] = UtilsClient::getHisto( me, cloneME_, i02_[ism-1] );
00814 }
00815
00816 if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
00817 if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
00818 if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
00819
00820 if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
00821 if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
00822
00823 if ( mep01_[ism-1] ) mep01_[ism-1]->Reset();
00824 if ( mep02_[ism-1] ) mep02_[ism-1]->Reset();
00825 if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
00826
00827 if ( mer01_[ism-1] ) mer01_[ism-1]->Reset();
00828 if ( mer02_[ism-1] ) mer02_[ism-1]->Reset();
00829 if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
00830
00831 if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
00832 if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();
00833
00834 #ifdef COMMON_NOISE_ANALYSIS
00835 if ( mes01_[ism-1] ) mes01_[ism-1]->Reset();
00836 if ( mes02_[ism-1] ) mes02_[ism-1]->Reset();
00837 if ( mes03_[ism-1] ) mes03_[ism-1]->Reset();
00838
00839 if ( met01_[ism-1] ) met01_[ism-1]->Reset();
00840 if ( met02_[ism-1] ) met02_[ism-1]->Reset();
00841 if ( met03_[ism-1] ) met03_[ism-1]->Reset();
00842 #endif
00843
00844 for ( int ix = 1; ix <= 50; ix++ ) {
00845 for ( int iy = 1; iy <= 50; iy++ ) {
00846
00847 if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent(ix, iy, 6.);
00848 if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent(ix, iy, 6.);
00849 if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ix, iy, 6.);
00850
00851 int jx = ix + Numbers::ix0EE(ism);
00852 int jy = iy + Numbers::iy0EE(ism);
00853
00854 if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
00855
00856 bool innerCrystals = std::abs(jx-50) >= 5 && std::abs(jx-50) <= 10 && std::abs(jy-50) >= 5 && std::abs(jy-50) <= 10;
00857
00858 if ( Numbers::validEE(ism, jx, jy) ) {
00859 if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent(ix, iy, 2.);
00860 if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent(ix, iy, 2.);
00861 if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ix, iy, 2.);
00862 }
00863
00864 bool update01;
00865 bool update02;
00866 bool update03;
00867
00868 float num01, num02, num03;
00869 float mean01, mean02, mean03;
00870 float rms01, rms02, rms03;
00871
00872 update01 = UtilsClient::getBinStatistics(h01_[ism-1], ix, iy, num01, mean01, rms01);
00873 update02 = UtilsClient::getBinStatistics(h02_[ism-1], ix, iy, num02, mean02, rms02);
00874 update03 = UtilsClient::getBinStatistics(h03_[ism-1], ix, iy, num03, mean03, rms03);
00875
00876 if ( update01 ) {
00877
00878 float val;
00879
00880 val = 1.;
00881 if ( std::abs(mean01 - expectedMean_[0]) > discrepancyMean_[0] )
00882 val = 0.;
00883 if ( (!innerCrystals && rms01 > RMSThreshold_[0]) ||
00884 (innerCrystals && rms01 > RMSThresholdInner_[0]) )
00885 val = 0.;
00886 if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent(ix, iy, val);
00887
00888 if ( mep01_[ism-1] ) mep01_[ism-1]->Fill(mean01);
00889 if ( mer01_[ism-1] ) mer01_[ism-1]->Fill(rms01);
00890
00891 }
00892
00893 if ( update02 ) {
00894
00895 float val;
00896
00897 val = 1.;
00898 if ( std::abs(mean02 - expectedMean_[1]) > discrepancyMean_[1] )
00899 val = 0.;
00900 if ( (!innerCrystals && rms02 > RMSThreshold_[1]) ||
00901 (innerCrystals && rms02 > RMSThresholdInner_[1]) )
00902 val = 0.;
00903 if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent(ix, iy, val);
00904
00905 if ( mep02_[ism-1] ) mep02_[ism-1]->Fill(mean02);
00906 if ( mer02_[ism-1] ) mer02_[ism-1]->Fill(rms02);
00907
00908 }
00909
00910 if ( update03 ) {
00911
00912 float val;
00913
00914 val = 1.;
00915 if ( std::abs(mean03 - expectedMean_[2]) > discrepancyMean_[2] )
00916 val = 0.;
00917 if ( (!innerCrystals && rms03 > RMSThreshold_[2]) ||
00918 (innerCrystals && rms03 > RMSThresholdInner_[2]) )
00919 val = 0.;
00920
00921 if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ix, iy, val);
00922
00923 if ( mep03_[ism-1] ) mep03_[ism-1]->Fill(mean03);
00924 if ( mer03_[ism-1] ) mer03_[ism-1]->Fill(rms03);
00925
00926 }
00927
00928 if ( Masks::maskChannel(ism, ix, iy, bits01, EcalEndcap) ) UtilsClient::maskBinContent( meg01_[ism-1], ix, iy );
00929 if ( Masks::maskChannel(ism, ix, iy, bits02, EcalEndcap) ) UtilsClient::maskBinContent( meg02_[ism-1], ix, iy );
00930 if ( Masks::maskChannel(ism, ix, iy, bits03, EcalEndcap) ) UtilsClient::maskBinContent( meg03_[ism-1], ix, iy );
00931
00932 }
00933 }
00934
00935
00936
00937 for ( int i = 1; i <= 10; i++ ) {
00938
00939 if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 6. );
00940 if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 6. );
00941
00942
00943 if ( (ism >= 3 && ism <= 4) || (ism >= 7 && ism <= 9) ) continue;
00944 if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) ) continue;
00945
00946 if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
00947 if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
00948
00949 bool update01;
00950 bool update02;
00951
00952 float num01, num02;
00953 float mean01, mean02;
00954 float rms01, rms02;
00955
00956 update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
00957 update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
00958
00959
00960 if ( mer04_[ism-1] ) mer04_[ism-1]->Fill(rms01);
00961 if ( mer05_[ism-1] ) mer05_[ism-1]->Fill(rms02);
00962
00963 if ( update01 ) {
00964
00965 float val;
00966
00967 val = 1.;
00968 if ( mean01 < (expectedMeanPn_[0] - discrepancyMeanPn_[0])
00969 || (expectedMeanPn_[0] + discrepancyMeanPn_[0]) < mean01)
00970 val = 0.;
00971 if ( rms01 > RMSThresholdPn_[0])
00972 val = 0.;
00973
00974 if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent(i, 1, val);
00975
00976 }
00977
00978 if ( update02 ) {
00979
00980 float val;
00981
00982 val = 1.;
00983 if ( mean02 < (expectedMeanPn_[1] - discrepancyMeanPn_[1])
00984 || (expectedMeanPn_[1] + discrepancyMeanPn_[1]) < mean02)
00985 val = 0.;
00986 if ( rms02 > RMSThresholdPn_[1])
00987 val = 0.;
00988
00989 if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent(i, 1, val);
00990 }
00991
00992 if ( Masks::maskPn(ism, i, bits01, EcalEndcap) ) UtilsClient::maskBinContent( meg04_[ism-1], i, 1 );
00993 if ( Masks::maskPn(ism, i, bits03, EcalEndcap) ) UtilsClient::maskBinContent( meg05_[ism-1], i, 1 );
00994
00995 }
00996
00997 #ifdef COMMON_NOISE_ANALYSIS
00998 for ( int ix = 1; ix <= 50; ix++ ) {
00999 for ( int iy = 1; iy <= 50; iy++ ) {
01000
01001 float x3val01;
01002 float x3val02;
01003 float x3val03;
01004
01005 float y3val01;
01006 float y3val02;
01007 float y3val03;
01008
01009 float z3val01;
01010 float z3val02;
01011 float z3val03;
01012
01013 float x5val01;
01014 float x5val02;
01015 float x5val03;
01016
01017 float y5val01;
01018 float y5val02;
01019 float y5val03;
01020
01021 float z5val01;
01022 float z5val02;
01023 float z5val03;
01024
01025 if ( mes01_[ism-1] ) mes01_[ism-1]->setBinContent(ix, iy, -999.);
01026 if ( mes02_[ism-1] ) mes02_[ism-1]->setBinContent(ix, iy, -999.);
01027 if ( mes03_[ism-1] ) mes03_[ism-1]->setBinContent(ix, iy, -999.);
01028
01029 if ( met01_[ism-1] ) met01_[ism-1]->setBinContent(ix, iy, -999.);
01030 if ( met02_[ism-1] ) met02_[ism-1]->setBinContent(ix, iy, -999.);
01031 if ( met03_[ism-1] ) met03_[ism-1]->setBinContent(ix, iy, -999.);
01032
01033 int jx = ix + Numbers::ix0EE(ism);
01034 int jy = iy + Numbers::iy0EE(ism);
01035
01036 if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
01037
01038 if ( ! Numbers::validEE(ism, jx, jy) ) continue;
01039
01040 if ( ix >= 2 && ix <= 49 && iy >= 2 && iy <= 49 ) {
01041
01042 x3val01 = 0.;
01043 x3val02 = 0.;
01044 x3val03 = 0.;
01045 for ( int i = -1; i <= +1; i++ ) {
01046 for ( int j = -1; j <= +1; j++ ) {
01047
01048 if ( h01_[ism-1] ) x3val01 = x3val01 + h01_[ism-1]->GetBinError(ix+i, iy+j) *
01049 h01_[ism-1]->GetBinError(ix+i, iy+j);
01050
01051 if ( h02_[ism-1] ) x3val02 = x3val02 + h02_[ism-1]->GetBinError(ix+i, iy+j) *
01052 h02_[ism-1]->GetBinError(ix+i, iy+j);
01053
01054 if ( h03_[ism-1] ) x3val03 = x3val03 + h03_[ism-1]->GetBinError(ix+i, iy+j) *
01055 h03_[ism-1]->GetBinError(ix+i, iy+j);
01056
01057 }
01058 }
01059 x3val01 = x3val01 / (9.*9.);
01060 x3val02 = x3val02 / (9.*9.);
01061 x3val03 = x3val03 / (9.*9.);
01062
01063 y3val01 = 0.;
01064 if ( j01_[ism-1] ) y3val01 = j01_[ism-1]->GetBinError(ix, iy) *
01065 j01_[ism-1]->GetBinError(ix, iy);
01066
01067 y3val02 = 0.;
01068 if ( j02_[ism-1] ) y3val02 = j02_[ism-1]->GetBinError(ix, iy) *
01069 j02_[ism-1]->GetBinError(ix, iy);
01070
01071 y3val03 = 0.;
01072 if ( j03_[ism-1] ) y3val03 = j03_[ism-1]->GetBinError(ix, iy) *
01073 j03_[ism-1]->GetBinError(ix, iy);
01074
01075 z3val01 = -999.;
01076 if ( x3val01 != 0 && y3val01 != 0 ) z3val01 = sqrt(std::abs(x3val01 - y3val01));
01077 if ( (x3val01 - y3val01) < 0 ) z3val01 = -z3val01;
01078
01079 if ( mes01_[ism-1] ) mes01_[ism-1]->setBinContent(ix, iy, z3val01);
01080
01081 z3val02 = -999.;
01082 if ( x3val02 != 0 && y3val02 != 0 ) z3val02 = sqrt(std::abs(x3val02 - y3val02));
01083 if ( (x3val02 - y3val02) < 0 ) z3val02 = -z3val02;
01084
01085 if ( mes02_[ism-1] ) mes02_[ism-1]->setBinContent(ix, iy, z3val02);
01086
01087 z3val03 = -999.;
01088 if ( x3val03 != 0 && y3val03 != 0 ) z3val03 = sqrt(std::abs(x3val03 - y3val03));
01089 if ( (x3val03 - y3val03) < 0 ) z3val03 = -z3val03;
01090
01091 if ( mes03_[ism-1] ) mes03_[ism-1]->setBinContent(ix, iy, z3val03);
01092
01093 }
01094
01095 if ( ix >= 3 && ix <= 48 && iy >= 3 && iy <= 48 ) {
01096
01097 x5val01 = 0.;
01098 x5val02 = 0.;
01099 x5val03 = 0.;
01100 for ( int i = -2; i <= +2; i++ ) {
01101 for ( int j = -2; j <= +2; j++ ) {
01102
01103 if ( h01_[ism-1] ) x5val01 = x5val01 + h01_[ism-1]->GetBinError(ix+i, iy+j) *
01104 h01_[ism-1]->GetBinError(ix+i, iy+j);
01105
01106 if ( h02_[ism-1] ) x5val02 = x5val02 + h02_[ism-1]->GetBinError(ix+i, iy+j) *
01107 h02_[ism-1]->GetBinError(ix+i, iy+j);
01108
01109 if ( h03_[ism-1] ) x5val03 = x5val03 + h03_[ism-1]->GetBinError(ix+i, iy+j) *
01110 h03_[ism-1]->GetBinError(ix+i, iy+j);
01111
01112 }
01113 }
01114 x5val01 = x5val01 / (25.*25.);
01115 x5val02 = x5val02 / (25.*25.);
01116 x5val03 = x5val03 / (25.*25.);
01117
01118 y5val01 = 0.;
01119 if ( k01_[ism-1] ) y5val01 = k01_[ism-1]->GetBinError(ix, iy) *
01120 k01_[ism-1]->GetBinError(ix, iy);
01121
01122 y5val02 = 0.;
01123 if ( k02_[ism-1] ) y5val02 = k02_[ism-1]->GetBinError(ix, iy) *
01124 k02_[ism-1]->GetBinError(ix, iy);
01125
01126 y5val03 = 0.;
01127 if ( k03_[ism-1] ) y5val03 = k03_[ism-1]->GetBinError(ix, iy) *
01128 k03_[ism-1]->GetBinError(ix, iy);
01129
01130 z5val01 = -999.;
01131 if ( x5val01 != 0 && y5val01 != 0 ) z5val01 = sqrt(std::abs(x5val01 - y5val01));
01132 if ( (x5val01 - y5val01) < 0 ) z5val01 = -z5val01;
01133
01134 if ( met01_[ism-1] ) met01_[ism-1]->setBinContent(ix, iy, z5val01);
01135
01136 z5val02 = -999.;
01137 if ( x5val02 != 0 && y5val02 != 0 ) z5val02 = sqrt(std::abs(x5val02 - y5val02));
01138 if ( (x5val02 - y5val02) < 0 ) z5val02 = -z5val02;
01139
01140 if ( met02_[ism-1] ) met02_[ism-1]->setBinContent(ix, iy, z5val02);
01141
01142 z5val03 = -999.;
01143 if ( x5val03 != 0 && y5val03 != 0 ) z5val03 = sqrt(std::abs(x5val03 - y5val03));
01144 if ( (x5val03 - y5val03) < 0 ) z5val03 = -z5val03;
01145
01146 if ( met03_[ism-1] ) met03_[ism-1]->setBinContent(ix, iy, z5val03);
01147
01148 }
01149
01150 }
01151 }
01152 #endif
01153
01154 }
01155
01156 }
01157