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 "TCanvas.h"
00018 #include "TStyle.h"
00019
00020 #include "DQMServices/Core/interface/DQMStore.h"
00021
00022 #include "OnlineDB/EcalCondDB/interface/MonPedestalsDat.h"
00023 #include "OnlineDB/EcalCondDB/interface/MonPNPedDat.h"
00024 #include "OnlineDB/EcalCondDB/interface/RunCrystalErrorsDat.h"
00025 #include "OnlineDB/EcalCondDB/interface/RunTTErrorsDat.h"
00026 #include "OnlineDB/EcalCondDB/interface/RunPNErrorsDat.h"
00027
00028 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
00029
00030 #include "CondTools/Ecal/interface/EcalErrorDictionary.h"
00031
00032 #include "DQM/EcalCommon/interface/EcalErrorMask.h"
00033 #include "DQM/EcalCommon/interface/UtilsClient.h"
00034 #include "DQM/EcalCommon/interface/LogicID.h"
00035 #include "DQM/EcalCommon/interface/Numbers.h"
00036
00037 #include <DQM/EcalBarrelMonitorClient/interface/EBPedestalClient.h>
00038
00039 using namespace cms;
00040 using namespace edm;
00041 using namespace std;
00042
00043 EBPedestalClient::EBPedestalClient(const 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<string>("prefixME", "");
00056
00057
00058 enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00059
00060
00061 superModules_.reserve(36);
00062 for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
00063 superModules_ = ps.getUntrackedParameter<vector<int> >("superModules", superModules_);
00064
00065 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00066
00067 int ism = superModules_[i];
00068
00069 h01_[ism-1] = 0;
00070 h02_[ism-1] = 0;
00071 h03_[ism-1] = 0;
00072
00073 j01_[ism-1] = 0;
00074 j02_[ism-1] = 0;
00075 j03_[ism-1] = 0;
00076
00077 k01_[ism-1] = 0;
00078 k02_[ism-1] = 0;
00079 k03_[ism-1] = 0;
00080
00081 i01_[ism-1] = 0;
00082 i02_[ism-1] = 0;
00083
00084 }
00085
00086 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00087
00088 int ism = superModules_[i];
00089
00090 meg01_[ism-1] = 0;
00091 meg02_[ism-1] = 0;
00092 meg03_[ism-1] = 0;
00093
00094 meg04_[ism-1] = 0;
00095 meg05_[ism-1] = 0;
00096
00097 mep01_[ism-1] = 0;
00098 mep02_[ism-1] = 0;
00099 mep03_[ism-1] = 0;
00100
00101 mer01_[ism-1] = 0;
00102 mer02_[ism-1] = 0;
00103 mer03_[ism-1] = 0;
00104
00105 mer04_[ism-1] = 0;
00106 mer05_[ism-1] = 0;
00107
00108 mes01_[ism-1] = 0;
00109 mes02_[ism-1] = 0;
00110 mes03_[ism-1] = 0;
00111
00112 met01_[ism-1] = 0;
00113 met02_[ism-1] = 0;
00114 met03_[ism-1] = 0;
00115
00116 }
00117
00118 expectedMean_[0] = 200.0;
00119 expectedMean_[1] = 200.0;
00120 expectedMean_[2] = 200.0;
00121
00122 discrepancyMean_[0] = 25.0;
00123 discrepancyMean_[1] = 25.0;
00124 discrepancyMean_[2] = 25.0;
00125
00126 RMSThreshold_[0] = 1.0;
00127 RMSThreshold_[1] = 1.2;
00128 RMSThreshold_[2] = 2.0;
00129
00130 expectedMeanPn_[0] = 750.0;
00131 expectedMeanPn_[1] = 750.0;
00132
00133 discrepancyMeanPn_[0] = 100.0;
00134 discrepancyMeanPn_[1] = 100.0;
00135
00136 RMSThresholdPn_[0] = 1.0;
00137 RMSThresholdPn_[1] = 3.0;
00138
00139 }
00140
00141 EBPedestalClient::~EBPedestalClient() {
00142
00143 }
00144
00145 void EBPedestalClient::beginJob(DQMStore* dqmStore) {
00146
00147 dqmStore_ = dqmStore;
00148
00149 if ( debug_ ) cout << "EBPedestalClient: beginJob" << endl;
00150
00151 ievt_ = 0;
00152 jevt_ = 0;
00153
00154 }
00155
00156 void EBPedestalClient::beginRun(void) {
00157
00158 if ( debug_ ) cout << "EBPedestalClient: beginRun" << endl;
00159
00160 jevt_ = 0;
00161
00162 this->setup();
00163
00164 }
00165
00166 void EBPedestalClient::endJob(void) {
00167
00168 if ( debug_ ) cout << "EBPedestalClient: endJob, ievt = " << ievt_ << endl;
00169
00170 this->cleanup();
00171
00172 }
00173
00174 void EBPedestalClient::endRun(void) {
00175
00176 if ( debug_ ) cout << "EBPedestalClient: endRun, jevt = " << jevt_ << endl;
00177
00178 this->cleanup();
00179
00180 }
00181
00182 void EBPedestalClient::setup(void) {
00183
00184 char histo[200];
00185
00186 dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalClient" );
00187
00188 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00189
00190 int ism = superModules_[i];
00191
00192 if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
00193 sprintf(histo, "EBPT pedestal quality G01 %s", Numbers::sEB(ism).c_str());
00194 meg01_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00195 meg01_[ism-1]->setAxisTitle("ieta", 1);
00196 meg01_[ism-1]->setAxisTitle("iphi", 2);
00197 if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
00198 sprintf(histo, "EBPT pedestal quality G06 %s", Numbers::sEB(ism).c_str());
00199 meg02_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00200 meg02_[ism-1]->setAxisTitle("ieta", 1);
00201 meg02_[ism-1]->setAxisTitle("iphi", 2);
00202 if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
00203 sprintf(histo, "EBPT pedestal quality G12 %s", Numbers::sEB(ism).c_str());
00204 meg03_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00205 meg03_[ism-1]->setAxisTitle("ieta", 1);
00206 meg03_[ism-1]->setAxisTitle("iphi", 2);
00207
00208 if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
00209 sprintf(histo, "EBPT pedestal quality PNs G01 %s", Numbers::sEB(ism).c_str());
00210 meg04_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00211 meg04_[ism-1]->setAxisTitle("pseudo-strip", 1);
00212 meg04_[ism-1]->setAxisTitle("channel", 2);
00213 if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
00214 sprintf(histo, "EBPT pedestal quality PNs G16 %s", Numbers::sEB(ism).c_str());
00215 meg05_[ism-1] = dqmStore_->book2D(histo, histo, 10, 0., 10., 1, 0., 5.);
00216 meg05_[ism-1]->setAxisTitle("pseudo-strip", 1);
00217 meg05_[ism-1]->setAxisTitle("channel", 2);
00218
00219 if ( mep01_[ism-1] ) dqmStore_->removeElement( mep01_[ism-1]->getName() );
00220 sprintf(histo, "EBPT pedestal mean G01 %s", Numbers::sEB(ism).c_str());
00221 mep01_[ism-1] = dqmStore_->book1D(histo, histo, 100, 150., 250.);
00222 mep01_[ism-1]->setAxisTitle("mean", 1);
00223 if ( mep02_[ism-1] ) dqmStore_->removeElement( mep02_[ism-1]->getName() );
00224 sprintf(histo, "EBPT pedestal mean G06 %s", Numbers::sEB(ism).c_str());
00225 mep02_[ism-1] = dqmStore_->book1D(histo, histo, 100, 150., 250.);
00226 mep02_[ism-1]->setAxisTitle("mean", 1);
00227 if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
00228 sprintf(histo, "EBPT pedestal mean G12 %s", Numbers::sEB(ism).c_str());
00229 mep03_[ism-1] = dqmStore_->book1D(histo, histo, 100, 150., 250.);
00230 mep03_[ism-1]->setAxisTitle("mean", 1);
00231
00232 if ( mer01_[ism-1] ) dqmStore_->removeElement( mer01_[ism-1]->getName() );
00233 sprintf(histo, "EBPT pedestal rms G01 %s", Numbers::sEB(ism).c_str());
00234 mer01_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00235 mer01_[ism-1]->setAxisTitle("rms", 1);
00236 if ( mer02_[ism-1] ) dqmStore_->removeElement( mer02_[ism-1]->getName() );
00237 sprintf(histo, "EBPT pedestal rms G06 %s", Numbers::sEB(ism).c_str());
00238 mer02_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00239 mer02_[ism-1]->setAxisTitle("rms", 1);
00240 if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
00241 sprintf(histo, "EBPT pedestal rms G12 %s", Numbers::sEB(ism).c_str());
00242 mer03_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00243 mer03_[ism-1]->setAxisTitle("rms", 1);
00244
00245 if ( mer04_[ism-1] ) dqmStore_->removeElement( mer04_[ism-1]->getName() );
00246 sprintf(histo, "EBPDT PNs pedestal rms %s G01", Numbers::sEB(ism).c_str());
00247 mer04_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00248 mer04_[ism-1]->setAxisTitle("rms", 1);
00249 if ( mer05_[ism-1] ) dqmStore_->removeElement( mer05_[ism-1]->getName() );
00250 sprintf(histo, "EBPDT PNs pedestal rms %s G16", Numbers::sEB(ism).c_str());
00251 mer05_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
00252 mer05_[ism-1]->setAxisTitle("rms", 1);
00253
00254 if ( mes01_[ism-1] ) dqmStore_->removeElement( mes01_[ism-1]->getName() );
00255 sprintf(histo, "EBPT pedestal 3sum G01 %s", Numbers::sEB(ism).c_str());
00256 mes01_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00257 mes01_[ism-1]->setAxisTitle("ieta", 1);
00258 mes01_[ism-1]->setAxisTitle("iphi", 2);
00259 if ( mes02_[ism-1] ) dqmStore_->removeElement( mes02_[ism-1]->getName() );
00260 sprintf(histo, "EBPT pedestal 3sum G06 %s", Numbers::sEB(ism).c_str());
00261 mes02_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00262 mes02_[ism-1]->setAxisTitle("ieta", 1);
00263 mes02_[ism-1]->setAxisTitle("iphi", 2);
00264 if ( mes03_[ism-1] ) dqmStore_->removeElement( mes03_[ism-1]->getName() );
00265 sprintf(histo, "EBPT pedestal 3sum G12 %s", Numbers::sEB(ism).c_str());
00266 mes03_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00267 mes03_[ism-1]->setAxisTitle("ieta", 1);
00268 mes03_[ism-1]->setAxisTitle("iphi", 2);
00269
00270 if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
00271 sprintf(histo, "EBPT pedestal 5sum G01 %s", Numbers::sEB(ism).c_str());
00272 met01_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00273 met01_[ism-1]->setAxisTitle("ieta", 1);
00274 met01_[ism-1]->setAxisTitle("iphi", 2);
00275 if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
00276 sprintf(histo, "EBPT pedestal 5sum G06 %s", Numbers::sEB(ism).c_str());
00277 met02_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00278 met02_[ism-1]->setAxisTitle("ieta", 1);
00279 met02_[ism-1]->setAxisTitle("iphi", 2);
00280 if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
00281 sprintf(histo, "EBPT pedestal 5sum G12 %s", Numbers::sEB(ism).c_str());
00282 met03_[ism-1] = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00283 met03_[ism-1]->setAxisTitle("ieta", 1);
00284 met03_[ism-1]->setAxisTitle("iphi", 2);
00285
00286 }
00287
00288 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00289
00290 int ism = superModules_[i];
00291
00292 if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
00293 if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
00294 if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
00295
00296 if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
00297 if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
00298
00299 for ( int ie = 1; ie <= 85; ie++ ) {
00300 for ( int ip = 1; ip <= 20; ip++ ) {
00301
00302 if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ie, ip, 2. );
00303 if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ie, ip, 2. );
00304 if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ie, ip, 2. );
00305
00306 }
00307 }
00308
00309 for ( int i = 1; i <= 10; i++ ) {
00310
00311 if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
00312 if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
00313
00314 }
00315
00316 if ( mep01_[ism-1] ) mep01_[ism-1]->Reset();
00317 if ( mep02_[ism-1] ) mep02_[ism-1]->Reset();
00318 if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
00319
00320 if ( mer01_[ism-1] ) mer01_[ism-1]->Reset();
00321 if ( mer02_[ism-1] ) mer02_[ism-1]->Reset();
00322 if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
00323
00324 if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
00325 if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();
00326
00327 if ( mes01_[ism-1] ) mes01_[ism-1]->Reset();
00328 if ( mes02_[ism-1] ) mes02_[ism-1]->Reset();
00329 if ( mes03_[ism-1] ) mes03_[ism-1]->Reset();
00330
00331 if ( met01_[ism-1] ) met01_[ism-1]->Reset();
00332 if ( met02_[ism-1] ) met02_[ism-1]->Reset();
00333 if ( met03_[ism-1] ) met03_[ism-1]->Reset();
00334
00335 for ( int ie = 1; ie <= 85; ie++ ) {
00336 for ( int ip = 1; ip <= 20; ip++ ) {
00337
00338 if ( mes01_[ism-1] ) mes01_[ism-1]->setBinContent( ie, ip, -999. );
00339 if ( mes02_[ism-1] ) mes02_[ism-1]->setBinContent( ie, ip, -999. );
00340 if ( mes03_[ism-1] ) mes03_[ism-1]->setBinContent( ie, ip, -999. );
00341
00342 if ( met01_[ism-1] ) met01_[ism-1]->setBinContent( ie, ip, -999. );
00343 if ( met02_[ism-1] ) met02_[ism-1]->setBinContent( ie, ip, -999. );
00344 if ( met03_[ism-1] ) met03_[ism-1]->setBinContent( ie, ip, -999. );
00345
00346 }
00347 }
00348
00349 }
00350
00351 }
00352
00353 void EBPedestalClient::cleanup(void) {
00354
00355 if ( ! enableCleanup_ ) return;
00356
00357 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00358
00359 int ism = superModules_[i];
00360
00361 if ( cloneME_ ) {
00362 if ( h01_[ism-1] ) delete h01_[ism-1];
00363 if ( h02_[ism-1] ) delete h02_[ism-1];
00364 if ( h03_[ism-1] ) delete h03_[ism-1];
00365
00366 if ( j01_[ism-1] ) delete j01_[ism-1];
00367 if ( j02_[ism-1] ) delete j02_[ism-1];
00368 if ( j03_[ism-1] ) delete j03_[ism-1];
00369
00370 if ( k01_[ism-1] ) delete k01_[ism-1];
00371 if ( k02_[ism-1] ) delete k02_[ism-1];
00372 if ( k03_[ism-1] ) delete k03_[ism-1];
00373
00374 if ( i01_[ism-1] ) delete i01_[ism-1];
00375 if ( i02_[ism-1] ) delete i02_[ism-1];
00376 }
00377
00378 h01_[ism-1] = 0;
00379 h02_[ism-1] = 0;
00380 h03_[ism-1] = 0;
00381
00382 j01_[ism-1] = 0;
00383 j02_[ism-1] = 0;
00384 j03_[ism-1] = 0;
00385
00386 k01_[ism-1] = 0;
00387 k02_[ism-1] = 0;
00388 k03_[ism-1] = 0;
00389
00390 i01_[ism-1] = 0;
00391 i02_[ism-1] = 0;
00392
00393 }
00394
00395 dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalClient" );
00396
00397 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00398
00399 int ism = superModules_[i];
00400
00401 if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
00402 meg01_[ism-1] = 0;
00403 if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
00404 meg02_[ism-1] = 0;
00405 if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
00406 meg03_[ism-1] = 0;
00407
00408 if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
00409 meg04_[ism-1] = 0;
00410 if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
00411 meg05_[ism-1] = 0;
00412
00413 if ( mep01_[ism-1] ) dqmStore_->removeElement( mep01_[ism-1]->getName() );
00414 mep01_[ism-1] = 0;
00415 if ( mep02_[ism-1] ) dqmStore_->removeElement( mep02_[ism-1]->getName() );
00416 mep02_[ism-1] = 0;
00417 if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
00418 mep03_[ism-1] = 0;
00419
00420 if ( mer01_[ism-1] ) dqmStore_->removeElement( mer01_[ism-1]->getName() );
00421 mer01_[ism-1] = 0;
00422 if ( mer02_[ism-1] ) dqmStore_->removeElement( mer02_[ism-1]->getName() );
00423 mer02_[ism-1] = 0;
00424 if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
00425 mer03_[ism-1] = 0;
00426
00427 if ( mer04_[ism-1] ) dqmStore_->removeElement( mer04_[ism-1]->getName() );
00428 mer04_[ism-1] = 0;
00429 if ( mer05_[ism-1] ) dqmStore_->removeElement( mer05_[ism-1]->getName() );
00430 mer05_[ism-1] = 0;
00431
00432 if ( mes01_[ism-1] ) dqmStore_->removeElement( mes01_[ism-1]->getName() );
00433 mes01_[ism-1] = 0;
00434 if ( mes02_[ism-1] ) dqmStore_->removeElement( mes02_[ism-1]->getName() );
00435 mes02_[ism-1] = 0;
00436 if ( mes03_[ism-1] ) dqmStore_->removeElement( mes03_[ism-1]->getName() );
00437 mes03_[ism-1] = 0;
00438
00439 if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
00440 met01_[ism-1] = 0;
00441 if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
00442 met02_[ism-1] = 0;
00443 if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
00444 met03_[ism-1] = 0;
00445
00446 }
00447
00448 }
00449
00450 bool EBPedestalClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status, bool flag) {
00451
00452 status = true;
00453
00454 if ( ! flag ) return false;
00455
00456 EcalLogicID ecid;
00457
00458 MonPedestalsDat p;
00459 map<EcalLogicID, MonPedestalsDat> dataset1;
00460
00461 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00462
00463 int ism = superModules_[i];
00464
00465 if ( verbose_ ) {
00466 cout << " " << Numbers::sEB(ism) << " (ism=" << ism << ")" << endl;
00467 cout << endl;
00468 UtilsClient::printBadChannels(meg01_[ism-1], h01_[ism-1]);
00469 UtilsClient::printBadChannels(meg02_[ism-1], h02_[ism-1]);
00470 UtilsClient::printBadChannels(meg03_[ism-1], h03_[ism-1]);
00471 }
00472
00473 for ( int ie = 1; ie <= 85; ie++ ) {
00474 for ( int ip = 1; ip <= 20; ip++ ) {
00475
00476 bool update01;
00477 bool update02;
00478 bool update03;
00479
00480 float num01, num02, num03;
00481 float mean01, mean02, mean03;
00482 float rms01, rms02, rms03;
00483
00484 update01 = UtilsClient::getBinStatistics(h01_[ism-1], ie, ip, num01, mean01, rms01);
00485 update02 = UtilsClient::getBinStatistics(h02_[ism-1], ie, ip, num02, mean02, rms02);
00486 update03 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num03, mean03, rms03);
00487
00488 if ( update01 || update02 || update03 ) {
00489
00490 if ( Numbers::icEB(ism, ie, ip) == 1 ) {
00491
00492 if ( verbose_ ) {
00493 cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << endl;
00494 cout << "G01 (" << ie << "," << ip << ") " << num01 << " " << mean01 << " " << rms01 << endl;
00495 cout << "G06 (" << ie << "," << ip << ") " << num02 << " " << mean02 << " " << rms02 << endl;
00496 cout << "G12 (" << ie << "," << ip << ") " << num03 << " " << mean03 << " " << rms03 << endl;
00497 cout << endl;
00498 }
00499
00500 }
00501
00502 p.setPedMeanG1(mean01);
00503 p.setPedRMSG1(rms01);
00504
00505 p.setPedMeanG6(mean02);
00506 p.setPedRMSG6(rms02);
00507
00508 p.setPedMeanG12(mean03);
00509 p.setPedRMSG12(rms03);
00510
00511 if ( UtilsClient::getBinStatus(meg01_[ism-1], ie, ip) &&
00512 UtilsClient::getBinStatus(meg02_[ism-1], ie, ip) &&
00513 UtilsClient::getBinStatus(meg03_[ism-1], ie, ip) ) {
00514 p.setTaskStatus(true);
00515 } else {
00516 p.setTaskStatus(false);
00517 }
00518
00519 status = status && UtilsClient::getBinQuality(meg01_[ism-1], ie, ip) &&
00520 UtilsClient::getBinQuality(meg02_[ism-1], ie, ip) &&
00521 UtilsClient::getBinQuality(meg03_[ism-1], ie, ip);
00522
00523 int ic = Numbers::indexEB(ism, ie, ip);
00524
00525 if ( econn ) {
00526 ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
00527 dataset1[ecid] = p;
00528 }
00529
00530 }
00531
00532 }
00533 }
00534
00535 }
00536
00537 if ( econn ) {
00538 try {
00539 if ( verbose_ ) cout << "Inserting MonPedestalsDat ..." << endl;
00540 if ( dataset1.size() != 0 ) econn->insertDataArraySet(&dataset1, moniov);
00541 if ( verbose_ ) cout << "done." << endl;
00542 } catch (runtime_error &e) {
00543 cerr << e.what() << endl;
00544 }
00545 }
00546
00547 if ( verbose_ ) cout << endl;
00548
00549 MonPNPedDat pn;
00550 map<EcalLogicID, MonPNPedDat> dataset2;
00551
00552 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00553
00554 int ism = superModules_[i];
00555
00556 if ( verbose_ ) {
00557 cout << " " << Numbers::sEB(ism) << " (ism=" << ism << ")" << endl;
00558 cout << endl;
00559 UtilsClient::printBadChannels(meg04_[ism-1], i01_[ism-1]);
00560 UtilsClient::printBadChannels(meg05_[ism-1], i02_[ism-1]);
00561 }
00562
00563 for ( int i = 1; i <= 10; i++ ) {
00564
00565 bool update01;
00566 bool update02;
00567
00568 float num01, num02;
00569 float mean01, mean02;
00570 float rms01, rms02;
00571
00572 update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
00573 update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
00574
00575 if ( update01 || update02 ) {
00576
00577 if ( i == 1 ) {
00578
00579 if ( verbose_ ) {
00580 cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << endl;
00581 cout << "PNs (" << i << ") G01 " << num01 << " " << mean01 << " " << rms01 << endl;
00582 cout << "PNs (" << i << ") G16 " << num01 << " " << mean01 << " " << rms01 << endl;
00583 cout << endl;
00584 }
00585
00586 }
00587
00588 pn.setPedMeanG1(mean01);
00589 pn.setPedRMSG1(rms01);
00590
00591 pn.setPedMeanG16(mean02);
00592 pn.setPedRMSG16(rms02);
00593
00594 if ( UtilsClient::getBinStatus(meg04_[ism-1], i, 1) &&
00595 UtilsClient::getBinStatus(meg05_[ism-1], i, 1) ) {
00596 pn.setTaskStatus(true);
00597 } else {
00598 pn.setTaskStatus(false);
00599 }
00600
00601 status = status && UtilsClient::getBinQuality(meg04_[ism-1], i, 1) &&
00602 UtilsClient::getBinQuality(meg05_[ism-1], i, 1);
00603
00604 if ( econn ) {
00605 ecid = LogicID::getEcalLogicID("EB_LM_PN", Numbers::iSM(ism, EcalBarrel), i-1);
00606 dataset2[ecid] = pn;
00607 }
00608
00609 }
00610
00611 }
00612
00613 }
00614
00615 if ( econn ) {
00616 try {
00617 if ( verbose_ ) cout << "Inserting MonPNPedDat ..." << endl;
00618 if ( dataset2.size() != 0 ) econn->insertDataArraySet(&dataset2, moniov);
00619 if ( verbose_ ) cout << "done." << endl;
00620 } catch (runtime_error &e) {
00621 cerr << e.what() << endl;
00622 }
00623 }
00624
00625 return true;
00626
00627 }
00628
00629 void EBPedestalClient::analyze(void) {
00630
00631 ievt_++;
00632 jevt_++;
00633 if ( ievt_ % 10 == 0 ) {
00634 if ( debug_ ) cout << "EBPedestalClient: ievt/jevt = " << ievt_ << "/" << jevt_ << endl;
00635 }
00636
00637 uint64_t bits01 = 0;
00638 bits01 |= EcalErrorDictionary::getMask("PEDESTAL_LOW_GAIN_MEAN_WARNING");
00639 bits01 |= EcalErrorDictionary::getMask("PEDESTAL_LOW_GAIN_RMS_WARNING");
00640 bits01 |= EcalErrorDictionary::getMask("PEDESTAL_LOW_GAIN_MEAN_ERROR");
00641 bits01 |= EcalErrorDictionary::getMask("PEDESTAL_LOW_GAIN_RMS_ERROR");
00642
00643 uint64_t bits02 = 0;
00644 bits02 |= EcalErrorDictionary::getMask("PEDESTAL_MIDDLE_GAIN_MEAN_WARNING");
00645 bits02 |= EcalErrorDictionary::getMask("PEDESTAL_MIDDLE_GAIN_RMS_WARNING");
00646 bits02 |= EcalErrorDictionary::getMask("PEDESTAL_MIDDLE_GAIN_MEAN_ERROR");
00647 bits02 |= EcalErrorDictionary::getMask("PEDESTAL_MIDDLE_GAIN_RMS_ERROR");
00648
00649 uint64_t bits03 = 0;
00650 bits03 |= EcalErrorDictionary::getMask("PEDESTAL_HIGH_GAIN_MEAN_WARNING");
00651 bits03 |= EcalErrorDictionary::getMask("PEDESTAL_HIGH_GAIN_RMS_WARNING");
00652 bits03 |= EcalErrorDictionary::getMask("PEDESTAL_HIGH_GAIN_MEAN_ERROR");
00653 bits03 |= EcalErrorDictionary::getMask("PEDESTAL_HIGH_GAIN_RMS_ERROR");
00654
00655 map<EcalLogicID, RunCrystalErrorsDat> mask1;
00656 map<EcalLogicID, RunPNErrorsDat> mask2;
00657 map<EcalLogicID, RunTTErrorsDat> mask3;
00658
00659 EcalErrorMask::fetchDataSet(&mask1);
00660 EcalErrorMask::fetchDataSet(&mask2);
00661 EcalErrorMask::fetchDataSet(&mask3);
00662
00663 char histo[200];
00664
00665 MonitorElement* me;
00666
00667 for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00668
00669 int ism = superModules_[i];
00670
00671 sprintf(histo, (prefixME_ + "/EBPedestalTask/Gain01/EBPT pedestal %s G01").c_str(), Numbers::sEB(ism).c_str());
00672 me = dqmStore_->get(histo);
00673 h01_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h01_[ism-1] );
00674
00675 sprintf(histo, (prefixME_ + "/EBPedestalTask/Gain06/EBPT pedestal %s G06").c_str(), Numbers::sEB(ism).c_str());
00676 me = dqmStore_->get(histo);
00677 h02_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h02_[ism-1] );
00678
00679 sprintf(histo, (prefixME_ + "/EBPedestalTask/Gain12/EBPT pedestal %s G12").c_str(), Numbers::sEB(ism).c_str());
00680 me = dqmStore_->get(histo);
00681 h03_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h03_[ism-1] );
00682
00683 sprintf(histo, (prefixME_ + "/EBPedestalTask/Gain01/EBPT pedestal 3sum %s G01").c_str(), Numbers::sEB(ism).c_str());
00684 me = dqmStore_->get(histo);
00685 j01_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, j01_[ism-1] );
00686
00687 sprintf(histo, (prefixME_ + "/EBPedestalTask/Gain06/EBPT pedestal 3sum %s G06").c_str(), Numbers::sEB(ism).c_str());
00688 me = dqmStore_->get(histo);
00689 j02_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, j02_[ism-1] );
00690
00691 sprintf(histo, (prefixME_ + "/EBPedestalTask/Gain12/EBPT pedestal 3sum %s G12").c_str(), Numbers::sEB(ism).c_str());
00692 me = dqmStore_->get(histo);
00693 j03_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, j03_[ism-1] );
00694
00695 sprintf(histo, (prefixME_ + "/EBPedestalTask/Gain01/EBPT pedestal 5sum %s G01").c_str(), Numbers::sEB(ism).c_str());
00696 me = dqmStore_->get(histo);
00697 k01_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, k01_[ism-1] );
00698
00699 sprintf(histo, (prefixME_ + "/EBPedestalTask/Gain06/EBPT pedestal 5sum %s G06").c_str(), Numbers::sEB(ism).c_str());
00700 me = dqmStore_->get(histo);
00701 k02_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, k02_[ism-1] );
00702
00703 sprintf(histo, (prefixME_ + "/EBPedestalTask/Gain12/EBPT pedestal 5sum %s G12").c_str(), Numbers::sEB(ism).c_str());
00704 me = dqmStore_->get(histo);
00705 k03_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, k03_[ism-1] );
00706
00707 sprintf(histo, (prefixME_ + "/EBPedestalTask/PN/Gain01/EBPDT PNs pedestal %s G01").c_str(), Numbers::sEB(ism).c_str());
00708 me = dqmStore_->get(histo);
00709 i01_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i01_[ism-1] );
00710
00711 sprintf(histo, (prefixME_ + "/EBPedestalTask/PN/Gain16/EBPDT PNs pedestal %s G16").c_str(), Numbers::sEB(ism).c_str());
00712 me = dqmStore_->get(histo);
00713 i02_[ism-1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, i02_[ism-1] );
00714
00715 if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
00716 if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
00717 if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
00718
00719 if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
00720 if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
00721
00722 if ( mep01_[ism-1] ) mep01_[ism-1]->Reset();
00723 if ( mep02_[ism-1] ) mep02_[ism-1]->Reset();
00724 if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
00725
00726 if ( mer01_[ism-1] ) mer01_[ism-1]->Reset();
00727 if ( mer02_[ism-1] ) mer02_[ism-1]->Reset();
00728 if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
00729
00730 if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
00731 if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();
00732
00733 if ( mes01_[ism-1] ) mes01_[ism-1]->Reset();
00734 if ( mes02_[ism-1] ) mes02_[ism-1]->Reset();
00735 if ( mes03_[ism-1] ) mes03_[ism-1]->Reset();
00736
00737 if ( met01_[ism-1] ) met01_[ism-1]->Reset();
00738 if ( met02_[ism-1] ) met02_[ism-1]->Reset();
00739 if ( met03_[ism-1] ) met03_[ism-1]->Reset();
00740
00741 for ( int ie = 1; ie <= 85; ie++ ) {
00742 for ( int ip = 1; ip <= 20; ip++ ) {
00743
00744 if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent(ie, ip, 2.);
00745 if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent(ie, ip, 2.);
00746 if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, 2.);
00747
00748 bool update01;
00749 bool update02;
00750 bool update03;
00751
00752 float num01, num02, num03;
00753 float mean01, mean02, mean03;
00754 float rms01, rms02, rms03;
00755
00756 update01 = UtilsClient::getBinStatistics(h01_[ism-1], ie, ip, num01, mean01, rms01);
00757 update02 = UtilsClient::getBinStatistics(h02_[ism-1], ie, ip, num02, mean02, rms02);
00758 update03 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num03, mean03, rms03);
00759
00760 if ( update01 ) {
00761
00762 float val;
00763
00764 val = 1.;
00765 if ( fabs(mean01 - expectedMean_[0]) > discrepancyMean_[0] )
00766 val = 0.;
00767 if ( rms01 > RMSThreshold_[0] )
00768 val = 0.;
00769 if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent(ie, ip, val);
00770
00771 if ( mep01_[ism-1] ) mep01_[ism-1]->Fill(mean01);
00772 if ( mer01_[ism-1] ) mer01_[ism-1]->Fill(rms01);
00773
00774 }
00775
00776 if ( update02 ) {
00777
00778 float val;
00779
00780 val = 1.;
00781 if ( fabs(mean02 - expectedMean_[1]) > discrepancyMean_[1] )
00782 val = 0.;
00783 if ( rms02 > RMSThreshold_[1] )
00784 val = 0.;
00785 if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent(ie, ip, val);
00786
00787 if ( mep02_[ism-1] ) mep02_[ism-1]->Fill(mean02);
00788 if ( mer02_[ism-1] ) mer02_[ism-1]->Fill(rms02);
00789
00790 }
00791
00792 if ( update03 ) {
00793
00794 float val;
00795
00796 val = 1.;
00797 if ( fabs(mean03 - expectedMean_[2]) > discrepancyMean_[2] )
00798 val = 0.;
00799 if ( rms03 > RMSThreshold_[2] )
00800 val = 0.;
00801 if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, val);
00802
00803 if ( mep03_[ism-1] ) mep03_[ism-1]->Fill(mean03);
00804 if ( mer03_[ism-1] ) mer03_[ism-1]->Fill(rms03);
00805
00806 }
00807
00808
00809
00810 if ( mask1.size() != 0 ) {
00811 map<EcalLogicID, RunCrystalErrorsDat>::const_iterator m;
00812 for (m = mask1.begin(); m != mask1.end(); m++) {
00813
00814 EcalLogicID ecid = m->first;
00815
00816 int ic = Numbers::indexEB(ism, ie, ip);
00817
00818 if ( ecid.getLogicID() == LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic).getLogicID() ) {
00819 if ( (m->second).getErrorBits() & bits01 ) {
00820 UtilsClient::maskBinContent( meg01_[ism-1], ie, ip );
00821 }
00822 if ( (m->second).getErrorBits() & bits02 ) {
00823 UtilsClient::maskBinContent( meg02_[ism-1], ie, ip );
00824 }
00825 if ( (m->second).getErrorBits() & bits03 ) {
00826 UtilsClient::maskBinContent( meg03_[ism-1], ie, ip );
00827 }
00828 }
00829
00830 }
00831 }
00832
00833
00834
00835 if ( mask3.size() != 0 ) {
00836 map<EcalLogicID, RunTTErrorsDat>::const_iterator m;
00837 for (m = mask3.begin(); m != mask3.end(); m++) {
00838
00839 EcalLogicID ecid = m->first;
00840
00841 int itt = Numbers::iTT(ism, EcalBarrel, ie, ip);
00842
00843 if ( ecid.getLogicID() == LogicID::getEcalLogicID("EB_trigger_tower", Numbers::iSM(ism, EcalBarrel), itt).getLogicID() ) {
00844 if ( (m->second).getErrorBits() & bits01 ) {
00845 UtilsClient::maskBinContent( meg01_[ism-1], ie, ip );
00846 }
00847 if ( (m->second).getErrorBits() & bits02 ) {
00848 UtilsClient::maskBinContent( meg02_[ism-1], ie, ip );
00849 }
00850 if ( (m->second).getErrorBits() & bits03 ) {
00851 UtilsClient::maskBinContent( meg03_[ism-1], ie, ip );
00852 }
00853 }
00854
00855 }
00856 }
00857
00858 }
00859 }
00860
00861
00862
00863 for ( int i = 1; i <= 10; i++ ) {
00864
00865 if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
00866 if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
00867
00868 bool update01;
00869 bool update02;
00870
00871 float num01, num02;
00872 float mean01, mean02;
00873 float rms01, rms02;
00874
00875 update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
00876 update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
00877
00878
00879 if ( mer04_[ism-1] ) mer04_[ism-1]->Fill(rms01);
00880 if ( mer05_[ism-1] ) mer05_[ism-1]->Fill(rms02);
00881
00882
00883 if ( update01 ) {
00884
00885 float val;
00886
00887 val = 1.;
00888 if ( mean01 < (expectedMeanPn_[0] - discrepancyMeanPn_[0])
00889 || (expectedMeanPn_[0] + discrepancyMeanPn_[0]) < mean01)
00890 val = 0.;
00891 if ( rms01 > RMSThresholdPn_[0])
00892 val = 0.;
00893
00894 if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent(i, 1, val);
00895 }
00896
00897 if ( update02 ) {
00898
00899 float val;
00900
00901 val = 1.;
00902 if ( mean02 < (expectedMeanPn_[1] - discrepancyMeanPn_[1])
00903 || (expectedMeanPn_[1] + discrepancyMeanPn_[1]) < mean02)
00904 val = 0.;
00905 if ( rms02 > RMSThresholdPn_[1])
00906 val = 0.;
00907
00908 if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent(i, 1, val);
00909 }
00910
00911
00912
00913
00914 if ( mask2.size() != 0 ) {
00915 map<EcalLogicID, RunPNErrorsDat>::const_iterator m;
00916 for (m = mask2.begin(); m != mask2.end(); m++) {
00917
00918 EcalLogicID ecid = m->first;
00919
00920 if ( ecid.getLogicID() == LogicID::getEcalLogicID("EB_LM_PN", Numbers::iSM(ism, EcalBarrel), i-1).getLogicID() ) {
00921 if ( (m->second).getErrorBits() & bits01 ) {
00922 UtilsClient::maskBinContent( meg04_[ism-1], i, 1 );
00923 }
00924 if ( (m->second).getErrorBits() & bits03 ) {
00925 UtilsClient::maskBinContent( meg05_[ism-1], i, 1 );
00926 }
00927 }
00928
00929 }
00930 }
00931
00932 }
00933
00934
00935 for ( int ie = 1; ie <= 85; ie++ ) {
00936 for ( int ip = 1; ip <= 20; ip++ ) {
00937
00938 float x3val01;
00939 float x3val02;
00940 float x3val03;
00941
00942 float y3val01;
00943 float y3val02;
00944 float y3val03;
00945
00946 float z3val01;
00947 float z3val02;
00948 float z3val03;
00949
00950 float x5val01;
00951 float x5val02;
00952 float x5val03;
00953
00954 float y5val01;
00955 float y5val02;
00956 float y5val03;
00957
00958 float z5val01;
00959 float z5val02;
00960 float z5val03;
00961
00962 if ( mes01_[ism-1] ) mes01_[ism-1]->setBinContent(ie, ip, -999.);
00963 if ( mes02_[ism-1] ) mes02_[ism-1]->setBinContent(ie, ip, -999.);
00964 if ( mes03_[ism-1] ) mes03_[ism-1]->setBinContent(ie, ip, -999.);
00965
00966 if ( met01_[ism-1] ) met01_[ism-1]->setBinContent(ie, ip, -999.);
00967 if ( met02_[ism-1] ) met02_[ism-1]->setBinContent(ie, ip, -999.);
00968 if ( met03_[ism-1] ) met03_[ism-1]->setBinContent(ie, ip, -999.);
00969
00970 if ( ie >= 2 && ie <= 84 && ip >= 2 && ip <= 19 ) {
00971
00972 x3val01 = 0.;
00973 x3val02 = 0.;
00974 x3val03 = 0.;
00975 for ( int i = -1; i <= +1; i++ ) {
00976 for ( int j = -1; j <= +1; j++ ) {
00977
00978 if ( h01_[ism-1] ) x3val01 = x3val01 + h01_[ism-1]->GetBinError(ie+i, ip+j) *
00979 h01_[ism-1]->GetBinError(ie+i, ip+j);
00980
00981 if ( h02_[ism-1] ) x3val02 = x3val02 + h02_[ism-1]->GetBinError(ie+i, ip+j) *
00982 h02_[ism-1]->GetBinError(ie+i, ip+j);
00983
00984 if ( h03_[ism-1] ) x3val03 = x3val03 + h03_[ism-1]->GetBinError(ie+i, ip+j) *
00985 h03_[ism-1]->GetBinError(ie+i, ip+j);
00986
00987 }
00988 }
00989 x3val01 = x3val01 / (9.*9.);
00990 x3val02 = x3val02 / (9.*9.);
00991 x3val03 = x3val03 / (9.*9.);
00992
00993 y3val01 = 0.;
00994 if ( j01_[ism-1] ) y3val01 = j01_[ism-1]->GetBinError(ie, ip) *
00995 j01_[ism-1]->GetBinError(ie, ip);
00996
00997 y3val02 = 0.;
00998 if ( j02_[ism-1] ) y3val02 = j02_[ism-1]->GetBinError(ie, ip) *
00999 j02_[ism-1]->GetBinError(ie, ip);
01000
01001 y3val03 = 0.;
01002 if ( j03_[ism-1] ) y3val03 = j03_[ism-1]->GetBinError(ie, ip) *
01003 j03_[ism-1]->GetBinError(ie, ip);
01004
01005 z3val01 = -999.;
01006 if ( x3val01 != 0 && y3val01 != 0 ) z3val01 = sqrt(fabs(x3val01 - y3val01));
01007 if ( (x3val01 - y3val01) < 0 ) z3val01 = -z3val01;
01008
01009 if ( mes01_[ism-1] ) mes01_[ism-1]->setBinContent(ie, ip, z3val01);
01010
01011 z3val02 = -999.;
01012 if ( x3val02 != 0 && y3val02 != 0 ) z3val02 = sqrt(fabs(x3val02 - y3val02));
01013 if ( (x3val02 - y3val02) < 0 ) z3val02 = -z3val02;
01014
01015 if ( mes02_[ism-1] ) mes02_[ism-1]->setBinContent(ie, ip, z3val02);
01016
01017 z3val03 = -999.;
01018 if ( x3val03 != 0 && y3val03 != 0 ) z3val03 = sqrt(fabs(x3val03 - y3val03));
01019 if ( (x3val03 - y3val03) < 0 ) z3val03 = -z3val03;
01020
01021 if ( mes03_[ism-1] ) mes03_[ism-1]->setBinContent(ie, ip, z3val03);
01022
01023 }
01024
01025 if ( ie >= 3 && ie <= 83 && ip >= 3 && ip <= 18 ) {
01026
01027 x5val01 = 0.;
01028 x5val02 = 0.;
01029 x5val03 = 0.;
01030 for ( int i = -2; i <= +2; i++ ) {
01031 for ( int j = -2; j <= +2; j++ ) {
01032
01033 if ( h01_[ism-1] ) x5val01 = x5val01 + h01_[ism-1]->GetBinError(ie+i, ip+j) *
01034 h01_[ism-1]->GetBinError(ie+i, ip+j);
01035
01036 if ( h02_[ism-1] ) x5val02 = x5val02 + h02_[ism-1]->GetBinError(ie+i, ip+j) *
01037 h02_[ism-1]->GetBinError(ie+i, ip+j);
01038
01039 if ( h03_[ism-1] ) x5val03 = x5val03 + h03_[ism-1]->GetBinError(ie+i, ip+j) *
01040 h03_[ism-1]->GetBinError(ie+i, ip+j);
01041
01042 }
01043 }
01044 x5val01 = x5val01 / (25.*25.);
01045 x5val02 = x5val02 / (25.*25.);
01046 x5val03 = x5val03 / (25.*25.);
01047
01048 y5val01 = 0.;
01049 if ( k01_[ism-1] ) y5val01 = k01_[ism-1]->GetBinError(ie, ip) *
01050 k01_[ism-1]->GetBinError(ie, ip);
01051
01052 y5val02 = 0.;
01053 if ( k02_[ism-1] ) y5val02 = k02_[ism-1]->GetBinError(ie, ip) *
01054 k02_[ism-1]->GetBinError(ie, ip);
01055
01056 y5val03 = 0.;
01057 if ( k03_[ism-1] ) y5val03 = k03_[ism-1]->GetBinError(ie, ip) *
01058 k03_[ism-1]->GetBinError(ie, ip);
01059
01060 z5val01 = -999.;
01061 if ( x5val01 != 0 && y5val01 != 0 ) z5val01 = sqrt(fabs(x5val01 - y5val01));
01062 if ( (x5val01 - y5val01) < 0 ) z5val01 = -z5val01;
01063
01064 if ( met01_[ism-1] ) met01_[ism-1]->setBinContent(ie, ip, z5val01);
01065
01066 z5val02 = -999.;
01067 if ( x5val02 != 0 && y5val02 != 0 ) z5val02 = sqrt(fabs(x5val02 - y5val02));
01068 if ( (x5val02 - y5val02) < 0 ) z5val02 = -z5val02;
01069
01070 if ( met02_[ism-1] ) met02_[ism-1]->setBinContent(ie, ip, z5val02);
01071
01072 z5val03 = -999.;
01073 if ( x5val03 != 0 && y5val03 != 0 ) z5val03 = sqrt(fabs(x5val03 - y5val03));
01074 if ( (x5val03 - y5val03) < 0 ) z5val03 = -z5val03;
01075
01076 if ( met03_[ism-1] ) met03_[ism-1]->setBinContent(ie, ip, z5val03);
01077
01078 }
01079
01080 }
01081 }
01082
01083 }
01084
01085 }
01086
01087 void EBPedestalClient::softReset(bool flag) {
01088
01089 }
01090
01091 void EBPedestalClient::htmlOutput(int run, string& htmlDir, string& htmlName) {
01092
01093 if ( verbose_ ) cout << "Preparing EBPedestalClient html output ..." << endl;
01094
01095 ofstream htmlFile;
01096
01097 htmlFile.open((htmlDir + htmlName).c_str());
01098
01099
01100 htmlFile << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << endl;
01101 htmlFile << "<html> " << endl;
01102 htmlFile << "<head> " << endl;
01103 htmlFile << " <meta content=\"text/html; charset=ISO-8859-1\" " << endl;
01104 htmlFile << " https-equiv=\"content-type\"> " << endl;
01105 htmlFile << " <title>Monitor:PedestalTask output</title> " << endl;
01106 htmlFile << "</head> " << endl;
01107 htmlFile << "<style type=\"text/css\"> td { font-weight: bold } </style>" << endl;
01108 htmlFile << "<body> " << endl;
01109
01110 htmlFile << "<a name=""top""></a>" << endl;
01111 htmlFile << "<h2>Run: " << endl;
01112 htmlFile << " <span " << endl;
01113 htmlFile << " style=\"color: rgb(0, 0, 153);\">" << run << "</span></h2>" << endl;
01114 htmlFile << "<h2>Monitoring task: <span " << endl;
01115 htmlFile << " style=\"color: rgb(0, 0, 153);\">PEDESTAL</span></h2> " << endl;
01116 htmlFile << "<hr>" << endl;
01117 htmlFile << "<table border=1><tr><td bgcolor=red>channel has problems in this task</td>" << endl;
01118 htmlFile << "<td bgcolor=lime>channel has NO problems</td>" << endl;
01119 htmlFile << "<td bgcolor=yellow>channel is missing</td></table>" << endl;
01120 htmlFile << "<br>" << endl;
01121 htmlFile << "<table border=1>" << std::endl;
01122 for ( unsigned int i=0; i<superModules_.size(); i ++ ) {
01123 htmlFile << "<td bgcolor=white><a href=""#"
01124 << Numbers::sEB(superModules_[i]) << ">"
01125 << setfill( '0' ) << setw(2) << superModules_[i] << "</a></td>";
01126 }
01127 htmlFile << std::endl << "</table>" << std::endl;
01128
01129
01130
01131 const int csize = 250;
01132
01133 const double histMax = 1.e15;
01134
01135 int pCol3[7] = { 301, 302, 303, 304, 305, 306, 307 };
01136
01137 int pCol4[10];
01138 for ( int i = 0; i < 10; i++ ) pCol4[i] = 401+i;
01139
01140 TH2C dummy( "dummy", "dummy for sm", 85, 0., 85., 20, 0., 20. );
01141 for ( int i = 0; i < 68; i++ ) {
01142 int a = 2 + ( i/4 ) * 5;
01143 int b = 2 + ( i%4 ) * 5;
01144 dummy.Fill( a, b, i+1 );
01145 }
01146 dummy.SetMarkerSize(2);
01147 dummy.SetMinimum(0.1);
01148
01149 TH2C dummy1( "dummy1", "dummy1 for sm mem", 10, 0, 10, 5, 0, 5 );
01150 for ( short i=0; i<2; i++ ) {
01151 int a = 2 + i*5;
01152 int b = 2;
01153 dummy1.Fill( a, b, i+1+68 );
01154 }
01155 dummy1.SetMarkerSize(2);
01156 dummy1.SetMinimum(0.1);
01157
01158 string imgNameQual[3], imgNameMean[3], imgNameRMS[3], imgName3Sum[3], imgName5Sum[3], imgNameMEPnQual[2], imgNameMEPnPed[2],imgNameMEPnPedRms[2], imgName, meName;
01159
01160 TCanvas* cQual = new TCanvas("cQual", "Temp", 3*csize, csize);
01161 TCanvas* cMean = new TCanvas("cMean", "Temp", csize, csize);
01162 TCanvas* cRMS = new TCanvas("cRMS", "Temp", csize, csize);
01163 TCanvas* c3Sum = new TCanvas("c3Sum", "Temp", 3*csize, csize);
01164 TCanvas* c5Sum = new TCanvas("c5Sum", "Temp", 3*csize, csize);
01165 TCanvas* cPed = new TCanvas("cPed", "Temp", csize, csize);
01166
01167 TH2F* obj2f;
01168 TH1F* obj1f;
01169 TProfile* objp;
01170
01171
01172
01173 for ( unsigned int i=0; i<superModules_.size(); i ++ ) {
01174
01175 int ism = superModules_[i];
01176
01177
01178
01179 for ( int iCanvas = 1 ; iCanvas <= 3 ; iCanvas++ ) {
01180
01181
01182
01183 imgNameQual[iCanvas-1] = "";
01184
01185 obj2f = 0;
01186 switch ( iCanvas ) {
01187 case 1:
01188 obj2f = UtilsClient::getHisto<TH2F*>( meg01_[ism-1] );
01189 break;
01190 case 2:
01191 obj2f = UtilsClient::getHisto<TH2F*>( meg02_[ism-1] );
01192 break;
01193 case 3:
01194 obj2f = UtilsClient::getHisto<TH2F*>( meg03_[ism-1] );
01195 break;
01196 default:
01197 break;
01198 }
01199
01200 if ( obj2f ) {
01201
01202 meName = obj2f->GetName();
01203
01204 replace(meName.begin(), meName.end(), ' ', '_');
01205 imgNameQual[iCanvas-1] = meName + ".png";
01206 imgName = htmlDir + imgNameQual[iCanvas-1];
01207
01208 cQual->cd();
01209 gStyle->SetOptStat(" ");
01210 gStyle->SetPalette(7, pCol3);
01211 obj2f->GetXaxis()->SetNdivisions(17);
01212 obj2f->GetYaxis()->SetNdivisions(4);
01213 cQual->SetGridx();
01214 cQual->SetGridy();
01215 obj2f->SetMinimum(-0.00000001);
01216 obj2f->SetMaximum(7.0);
01217 obj2f->Draw("col");
01218 dummy.Draw("text,same");
01219 cQual->Update();
01220 cQual->SaveAs(imgName.c_str());
01221
01222 }
01223
01224
01225
01226 imgNameMean[iCanvas-1] = "";
01227
01228 obj1f = 0;
01229 switch ( iCanvas ) {
01230 case 1:
01231 obj1f = UtilsClient::getHisto<TH1F*>( mep01_[ism-1] );
01232 break;
01233 case 2:
01234 obj1f = UtilsClient::getHisto<TH1F*>( mep02_[ism-1] );
01235 break;
01236 case 3:
01237 obj1f = UtilsClient::getHisto<TH1F*>( mep03_[ism-1] );
01238 break;
01239 default:
01240 break;
01241 }
01242
01243 if ( obj1f ) {
01244
01245 meName = obj1f->GetName();
01246
01247 replace(meName.begin(), meName.end(), ' ', '_');
01248 imgNameMean[iCanvas-1] = meName + ".png";
01249 imgName = htmlDir + imgNameMean[iCanvas-1];
01250
01251 cMean->cd();
01252 gStyle->SetOptStat("euomr");
01253 obj1f->SetStats(kTRUE);
01254 if ( obj1f->GetMaximum(histMax) > 0. ) {
01255 gPad->SetLogy(kTRUE);
01256 } else {
01257 gPad->SetLogy(kFALSE);
01258 }
01259 obj1f->Draw();
01260 cMean->Update();
01261 cMean->SaveAs(imgName.c_str());
01262 gPad->SetLogy(kFALSE);
01263
01264 }
01265
01266
01267
01268 imgNameRMS[iCanvas-1] = "";
01269
01270 obj1f = 0;
01271 switch ( iCanvas ) {
01272 case 1:
01273 obj1f = UtilsClient::getHisto<TH1F*>( mer01_[ism-1] );
01274 break;
01275 case 2:
01276 obj1f = UtilsClient::getHisto<TH1F*>( mer02_[ism-1] );
01277 break;
01278 case 3:
01279 obj1f = UtilsClient::getHisto<TH1F*>( mer03_[ism-1] );
01280 break;
01281 default:
01282 break;
01283 }
01284
01285 if ( obj1f ) {
01286
01287 meName = obj1f->GetName();
01288
01289 replace(meName.begin(), meName.end(), ' ', '_');
01290 imgNameRMS[iCanvas-1] = meName + ".png";
01291 imgName = htmlDir + imgNameRMS[iCanvas-1];
01292
01293 cRMS->cd();
01294 gStyle->SetOptStat("euomr");
01295 obj1f->SetStats(kTRUE);
01296 if ( obj1f->GetMaximum(histMax) > 0. ) {
01297 gPad->SetLogy(kTRUE);
01298 } else {
01299 gPad->SetLogy(kFALSE);
01300 }
01301 obj1f->Draw();
01302 cRMS->Update();
01303 cRMS->SaveAs(imgName.c_str());
01304 gPad->SetLogy(kFALSE);
01305
01306 }
01307
01308
01309
01310 imgName3Sum[iCanvas-1] = "";
01311
01312 obj2f = 0;
01313 switch ( iCanvas ) {
01314 case 1:
01315 obj2f = UtilsClient::getHisto<TH2F*>( mes01_[ism-1] );
01316 break;
01317 case 2:
01318 obj2f = UtilsClient::getHisto<TH2F*>( mes02_[ism-1] );
01319 break;
01320 case 3:
01321 obj2f = UtilsClient::getHisto<TH2F*>( mes03_[ism-1] );
01322 break;
01323 default:
01324 break;
01325 }
01326
01327 if ( obj2f ) {
01328
01329 meName = obj2f->GetName();
01330
01331 replace(meName.begin(), meName.end(), ' ', '_');
01332 imgName3Sum[iCanvas-1] = meName + ".png";
01333 imgName = htmlDir + imgName3Sum[iCanvas-1];
01334
01335 c3Sum->cd();
01336 gStyle->SetOptStat(" ");
01337 gStyle->SetPalette(10, pCol4);
01338 obj2f->GetXaxis()->SetNdivisions(17);
01339 obj2f->GetYaxis()->SetNdivisions(4);
01340 c3Sum->SetGridx();
01341 c3Sum->SetGridy();
01342 obj2f->SetMinimum(-0.5);
01343 obj2f->SetMaximum(+0.5);
01344 obj2f->Draw("colz");
01345 dummy.Draw("text,same");
01346 c3Sum->Update();
01347 c3Sum->SaveAs(imgName.c_str());
01348
01349 }
01350
01351
01352
01353 imgName5Sum[iCanvas-1] = "";
01354
01355 obj2f = 0;
01356 switch ( iCanvas ) {
01357 case 1:
01358 obj2f = UtilsClient::getHisto<TH2F*>( met01_[ism-1] );
01359 break;
01360 case 2:
01361 obj2f = UtilsClient::getHisto<TH2F*>( met02_[ism-1] );
01362 break;
01363 case 3:
01364 obj2f = UtilsClient::getHisto<TH2F*>( met03_[ism-1] );
01365 break;
01366 default:
01367 break;
01368 }
01369
01370 if ( obj2f ) {
01371
01372 meName = obj2f->GetName();
01373
01374 replace(meName.begin(), meName.end(), ' ', '_');
01375 imgName5Sum[iCanvas-1] = meName + ".png";
01376 imgName = htmlDir + imgName5Sum[iCanvas-1];
01377
01378 c5Sum->cd();
01379 gStyle->SetOptStat(" ");
01380 gStyle->SetPalette(10, pCol4);
01381 obj2f->GetXaxis()->SetNdivisions(17);
01382 obj2f->GetYaxis()->SetNdivisions(4);
01383 c5Sum->SetGridx();
01384 c5Sum->SetGridy();
01385 obj2f->SetMinimum(-0.5);
01386 obj2f->SetMaximum(+0.5);
01387 obj2f->Draw("colz");
01388 dummy.Draw("text,same");
01389 c5Sum->Update();
01390 c5Sum->SaveAs(imgName.c_str());
01391
01392 }
01393
01394 }
01395
01396
01397
01398 for ( int iCanvas = 1 ; iCanvas <= 2 ; iCanvas++ ) {
01399
01400
01401
01402 imgNameMEPnQual[iCanvas-1] = "";
01403
01404 obj2f = 0;
01405 switch ( iCanvas ) {
01406 case 1:
01407 obj2f = UtilsClient::getHisto<TH2F*>( meg04_[ism-1] );
01408 break;
01409 case 2:
01410 obj2f = UtilsClient::getHisto<TH2F*>( meg05_[ism-1] );
01411 break;
01412 default:
01413 break;
01414 }
01415
01416 if ( obj2f ) {
01417
01418 meName = obj2f->GetName();
01419
01420 replace(meName.begin(), meName.end(), ' ', '_');
01421 imgNameMEPnQual[iCanvas-1] = meName + ".png";
01422 imgName = htmlDir + imgNameMEPnQual[iCanvas-1];
01423
01424 cQual->cd();
01425 gStyle->SetOptStat(" ");
01426 gStyle->SetPalette(7, pCol3);
01427 obj2f->GetXaxis()->SetNdivisions(10);
01428 obj2f->GetYaxis()->SetNdivisions(5);
01429 cQual->SetGridx();
01430 cQual->SetGridy(0);
01431 obj2f->SetMinimum(-0.00000001);
01432 obj2f->SetMaximum(7.0);
01433 obj2f->Draw("col");
01434 dummy1.Draw("text,same");
01435 cQual->Update();
01436 cQual->SaveAs(imgName.c_str());
01437
01438 }
01439
01440 imgNameMEPnPed[iCanvas-1] = "";
01441
01442 objp = 0;
01443 switch ( iCanvas ) {
01444 case 1:
01445 objp = i01_[ism-1];
01446 break;
01447 case 2:
01448 objp = i02_[ism-1];
01449 break;
01450 default:
01451 break;
01452 }
01453
01454 if ( objp ) {
01455
01456 meName = objp->GetName();
01457
01458 replace(meName.begin(), meName.end(), ' ', '_');
01459 imgNameMEPnPed[iCanvas-1] = meName + ".png";
01460 imgName = htmlDir + imgNameMEPnPed[iCanvas-1];
01461
01462 cPed->cd();
01463 gStyle->SetOptStat("euo");
01464 objp->SetStats(kTRUE);
01465
01466
01467
01468
01469
01470 objp->SetMinimum(0.0);
01471 objp->Draw();
01472 cPed->Update();
01473 cPed->SaveAs(imgName.c_str());
01474 gPad->SetLogy(kFALSE);
01475
01476 }
01477
01478 imgNameMEPnPedRms[iCanvas-1] = "";
01479
01480 obj1f = 0;
01481 switch ( iCanvas ) {
01482 case 1:
01483 if ( mer04_[ism-1] ) obj1f = UtilsClient::getHisto<TH1F*>(mer04_[ism-1]);
01484 break;
01485 case 2:
01486 if ( mer05_[ism-1] ) obj1f = UtilsClient::getHisto<TH1F*>(mer05_[ism-1]);
01487 break;
01488 default:
01489 break;
01490 }
01491
01492 if ( obj1f ) {
01493
01494 meName = obj1f->GetName();
01495
01496 replace(meName.begin(), meName.end(), ' ', '_');
01497 imgNameMEPnPedRms[iCanvas-1] = meName + ".png";
01498 imgName = htmlDir + imgNameMEPnPedRms[iCanvas-1];
01499
01500 cPed->cd();
01501 gStyle->SetOptStat("euomr");
01502 obj1f->SetStats(kTRUE);
01503
01504
01505
01506
01507
01508 obj1f->Draw();
01509 cPed->Update();
01510 cPed->SaveAs(imgName.c_str());
01511 gPad->SetLogy(kFALSE);
01512
01513 }
01514
01515 }
01516
01517 if( i>0 ) htmlFile << "<a href=""#top"">Top</a>" << std::endl;
01518 htmlFile << "<hr>" << std::endl;
01519 htmlFile << "<h3><a name="""
01520 << Numbers::sEB(ism) << """></a><strong>"
01521 << Numbers::sEB(ism) << "</strong></h3>" << endl;
01522 htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01523 htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01524 htmlFile << "<tr align=\"center\">" << endl;
01525
01526 for ( int iCanvas = 1 ; iCanvas <= 3 ; iCanvas++ ) {
01527
01528 if ( imgNameQual[iCanvas-1].size() != 0 )
01529 htmlFile << "<td colspan=\"2\"><img src=\"" << imgNameQual[iCanvas-1] << "\"></td>" << endl;
01530 else
01531 htmlFile << "<td colspan=\"2\"><img src=\"" << " " << "\"></td>" << endl;
01532
01533 }
01534
01535 htmlFile << "</tr>" << endl;
01536 htmlFile << "<tr>" << endl;
01537
01538 for ( int iCanvas = 1 ; iCanvas <= 3 ; iCanvas++ ) {
01539
01540 if ( imgNameMean[iCanvas-1].size() != 0 )
01541 htmlFile << "<td><img src=\"" << imgNameMean[iCanvas-1] << "\"></td>" << endl;
01542 else
01543 htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
01544
01545 if ( imgNameRMS[iCanvas-1].size() != 0 )
01546 htmlFile << "<td><img src=\"" << imgNameRMS[iCanvas-1] << "\"></td>" << endl;
01547 else
01548 htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
01549
01550 }
01551
01552 htmlFile << "</tr>" << endl;
01553
01554 htmlFile << "<tr align=\"center\"><td colspan=\"2\">Gain 1</td><td colspan=\"2\">Gain 6</td><td colspan=\"2\">Gain 12</td></tr>" << endl;
01555 htmlFile << "</table>" << endl;
01556 htmlFile << "<br>" << endl;
01557
01558 htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01559 htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01560 htmlFile << "<tr align=\"center\">" << endl;
01561
01562 for ( int iCanvas = 1 ; iCanvas <= 3 ; iCanvas++ ) {
01563
01564 if ( imgName3Sum[iCanvas-1].size() != 0 )
01565 htmlFile << "<td><img src=\"" << imgName3Sum[iCanvas-1] << "\"></td>" << endl;
01566 else
01567 htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
01568
01569 }
01570
01571 htmlFile << "</tr>" << endl;
01572
01573 htmlFile << "</table>" << endl;
01574 htmlFile << "<br>" << endl;
01575
01576 htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01577 htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01578 htmlFile << "<tr align=\"center\">" << endl;
01579
01580 for ( int iCanvas = 1 ; iCanvas <= 3 ; iCanvas++ ) {
01581
01582 if ( imgName5Sum[iCanvas-1].size() != 0 )
01583 htmlFile << "<td><img src=\"" << imgName5Sum[iCanvas-1] << "\"></td>" << endl;
01584 else
01585 htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
01586
01587 }
01588
01589 htmlFile << "</tr>" << endl;
01590
01591 htmlFile << "<tr align=\"center\"><td>Gain 1</td><td>Gain 6</td><td>Gain 12</td></tr>" << endl;
01592 htmlFile << "</table>" << endl;
01593 htmlFile << "<br>" << endl;
01594
01595 htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01596 htmlFile << "cellpadding=\"10\"> " << endl;
01597 htmlFile << "<tr align=\"center\">" << endl;
01598
01599 for ( int iCanvas = 1 ; iCanvas <= 2 ; iCanvas++ ) {
01600
01601 if ( imgNameMEPnQual[iCanvas-1].size() != 0 )
01602 htmlFile << "<td colspan=\"2\"><img src=\"" << imgNameMEPnQual[iCanvas-1] << "\"></td>" << endl;
01603 else
01604 htmlFile << "<td colspan=\"2\"><img src=\"" << " " << "\"></td>" << endl;
01605
01606 }
01607
01608 htmlFile << "</tr>" << endl;
01609 htmlFile << "</table>" << endl;
01610 htmlFile << "<br>" << endl;
01611
01612 htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01613 htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01614 htmlFile << "<tr align=\"center\">" << endl;
01615
01616
01617 for ( int iCanvas = 1 ; iCanvas <= 2 ; iCanvas++ ) {
01618
01619 if ( imgNameMEPnPed[iCanvas-1].size() != 0 ) {
01620 htmlFile << "<td colspan=\"2\"><img src=\"" << imgNameMEPnPed[iCanvas-1] << "\"></td>" << endl;
01621
01622 if ( imgNameMEPnPedRms[iCanvas-1].size() != 0 )
01623 htmlFile << "<td colspan=\"2\"><img src=\"" << imgNameMEPnPedRms[iCanvas-1] << "\"></td>" << endl;
01624 else
01625 htmlFile << "<td colspan=\"2\"><img src=\"" << " " << "\"></td>" << endl;
01626
01627 }
01628
01629 else{
01630 htmlFile << "<td colspan=\"2\"><img src=\"" << " " << "\"></td>" << endl;
01631
01632 if ( imgNameMEPnPedRms[iCanvas-1].size() != 0 )
01633 htmlFile << "<td colspan=\"2\"><img src=\"" << imgNameMEPnPedRms[iCanvas-1] << "\"></td>" << endl;
01634 else
01635 htmlFile << "<td colspan=\"2\"><img src=\"" << " " << "\"></td>" << endl;
01636
01637 }
01638
01639 }
01640
01641
01642 htmlFile << "</tr>" << endl;
01643
01644 htmlFile << "<tr align=\"right\"><td colspan=\"2\">Gain 1</td> <td colspan=\"2\"> </td> <td colspan=\"2\">Gain 16</td></tr>" << endl;
01645 htmlFile << "</table>" << endl;
01646 htmlFile << "<br>" << endl;
01647
01648 }
01649
01650 delete cQual;
01651 delete cMean;
01652 delete cRMS;
01653 delete c3Sum;
01654 delete c5Sum;
01655 delete cPed;
01656
01657
01658 htmlFile << "</body> " << endl;
01659 htmlFile << "</html> " << endl;
01660
01661 htmlFile.close();
01662
01663 }
01664