CMS 3D CMS Logo

EBBeamCaloClient Class Reference

#include <DQM/EcalBarrelMonitorClient/interface/EBBeamCaloClient.h>

Inheritance diagram for EBBeamCaloClient:

EBClient

List of all members.

Public Member Functions

template<class T>
void AdjustRange (T obj)
void analyze (void)
 Analyze.
void beginJob (DQMStore *dqmStore)
 BeginJob.
void beginRun (void)
 BeginRun.
void cleanup (void)
 Cleanup.
 EBBeamCaloClient (const edm::ParameterSet &ps)
 Constructor.
void endJob (void)
 EndJob.
void endRun (void)
 EndRun.
int getEvtPerJob ()
 Get Functions.
int getEvtPerRun ()
 Returns the number of processed events in this Run.
void htmlOutput (int run, std::string &htmlDir, std::string &htmlName)
 HtmlOutput.
void setup (void)
 Setup.
void softReset (bool flag)
 SoftReset.
bool writeDb (EcalCondDBInterface *econn, RunIOV *runiov, MonRunIOV *moniov, bool &status, bool flag)
 WriteDB.
virtual ~EBBeamCaloClient ()
 Destructor.

Private Attributes

float aveEne1_
float aveEne3x3_
std::vector< intcheckedSteps_
bool cloneME_
bool debug_
DQMStoredqmStore_
float E1Th_
float E3x3Th_
bool enableCleanup_
TH1F * hBAllNeededCry_
TH2F * hBBeamCentered_
TH1F * hBcryDone_
TH2F * hBCryOnBeam_
TH1F * hbDesync_
TH1F * hbE1MaxCry_
TProfile * hBE1vsCry_
TH1F * hBE3x3_
TH1F * hBE3x3Moving_
TProfile * hBE3x3vsCry_
TH1F * hBEne1_
TH1F * hBEntriesvsCry_
TH1F * hBGains_ [cryInArray_]
TH2F * hBMaxEneCry_
TH1F * hBNumReadCry_
TProfile * hBpulse_ [cryInArray_]
TH1F * hBReadCryErrors_
TH1F * hbTBmoving_
int ievt_
int jevt_
MonitorElementmeEBBCaloRedGreen_
MonitorElementmeEBBCaloRedGreenReadCry_
MonitorElementmeEBBCaloRedGreenSteps_
int minEvtNum_
TProfile * pBCriInBeamEvents_
std::string prefixME_
float prescaling_
float ReadCryErrThr_
float RMSEne3x3_
std::vector< intsuperModules_
bool verbose_

Static Private Attributes

static const int cryInArray_ = 9


Detailed Description

Definition at line 32 of file EBBeamCaloClient.h.


Constructor & Destructor Documentation

EBBeamCaloClient::EBBeamCaloClient ( const edm::ParameterSet ps  ) 

Constructor.

Definition at line 36 of file EBBeamCaloClient.cc.

References aveEne1_, aveEne3x3_, checkedSteps_, cloneME_, cryInArray_, debug_, E1Th_, E3x3Th_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), hBAllNeededCry_, hBBeamCentered_, hBcryDone_, hBCryOnBeam_, hbDesync_, hbE1MaxCry_, hBE1vsCry_, hBE3x3_, hBE3x3Moving_, hBE3x3vsCry_, hBEne1_, hBEntriesvsCry_, hBGains_, hBMaxEneCry_, hBNumReadCry_, hBpulse_, hBReadCryErrors_, hbTBmoving_, i, meEBBCaloRedGreen_, meEBBCaloRedGreenReadCry_, meEBBCaloRedGreenSteps_, minEvtNum_, pBCriInBeamEvents_, prefixME_, prescaling_, ReadCryErrThr_, RMSEne3x3_, superModules_, and verbose_.

00036                                                          {
00037 
00038   // cloneME switch
00039   cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
00040 
00041   // verbose switch
00042   verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
00043 
00044   // debug switch
00045   debug_ = ps.getUntrackedParameter<bool>("debug", false);
00046 
00047   // prefixME path
00048   prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
00049 
00050   // enableCleanup_ switch
00051   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00052 
00053   // vector of selected Super Modules (Defaults to all 36).
00054   superModules_.reserve(36);
00055   for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
00056   superModules_ = ps.getUntrackedParameter<vector<int> >("superModules", superModules_);
00057 
00058   checkedSteps_.reserve(86);
00059   // there should be not more than a eta row in an autoscan
00060   minEvtNum_ = 1800;//
00061   //FIX ME, this should be configurable and change with the beam energy
00062   aveEne1_    = 1850;  E1Th_   = 900;
00063   aveEne3x3_  = 2600;  E3x3Th_ = 2600;
00064   RMSEne3x3_  = 800;
00065 
00066   ReadCryErrThr_ = 0.01;// 1%
00067   //FIX ME, this should follow the prescaling in the monitoring
00068   prescaling_ = 20;
00069 
00071   for(int u=0;u<cryInArray_;u++) {
00072     hBGains_[u] = 0;
00073     hBpulse_[u] = 0;
00074     //hBGainsMoving_[u] = 0;
00075   }
00076   hBEne1_ = 0;
00077   //hBEne1Moving_ = 0;
00078   hBAllNeededCry_ = 0;
00079   hBNumReadCry_ = 0;
00080   hBE3x3_ = 0;
00081   hBE3x3Moving_ = 0;
00082   hBCryOnBeam_ = 0;
00083   hBMaxEneCry_ = 0;
00084   hBReadCryErrors_ = 0;
00085   hBE1vsCry_ = 0;
00086   hBE3x3vsCry_ = 0;
00087   hBEntriesvsCry_ = 0;
00088   hBcryDone_ = 0;
00089   hBBeamCentered_ = 0;
00090   hbTBmoving_ = 0;
00091   hbE1MaxCry_ = 0;
00092   hbDesync_ = 0;
00093   pBCriInBeamEvents_ = 0;
00094 
00095   meEBBCaloRedGreen_ = 0;
00096   meEBBCaloRedGreenReadCry_ = 0;
00097   meEBBCaloRedGreenSteps_ = 0;
00098 }

EBBeamCaloClient::~EBBeamCaloClient (  )  [virtual]

Destructor.

Definition at line 100 of file EBBeamCaloClient.cc.

00100                                     {
00101 
00102 }


Member Function Documentation

template<class T>
void EBBeamCaloClient::AdjustRange ( obj  )  [inline]

Definition at line 1309 of file EBBeamCaloClient.cc.

01309                                                            {
01310   if (obj->GetEntries() == 0) {return;}
01311   int first_bin = -1, last_bin=-1;
01312   for( int bin=1; bin < obj->GetNbinsX()+1; bin++ ) {
01313     if( obj->GetBinContent(bin) > 0) {
01314       if(first_bin == -1) {first_bin = bin;}
01315       last_bin = bin;
01316     }
01317   }
01318 
01319   if(first_bin < 1 || last_bin < 1) {return;}
01320   if(first_bin > 3) {first_bin -= 3;}
01321   if(last_bin < obj->GetNbinsX() ) {last_bin += 3;}
01322 
01323   obj->GetXaxis()->SetRange(first_bin, last_bin);
01324 }

void EBBeamCaloClient::analyze ( void   )  [virtual]

Analyze.

Implements EBClient.

Definition at line 336 of file EBBeamCaloClient.cc.

References aveEne1_, aveEne3x3_, cloneME_, GenMuonPlsPt100GeV_cfg::cout, cryInArray_, debug_, dqmStore_, E1Th_, E3x3Th_, lat::endl(), DQMStore::get(), MonitorElement::getBinContent(), hBAllNeededCry_, hBBeamCentered_, hBcryDone_, hBCryOnBeam_, hbDesync_, hbE1MaxCry_, hBE1vsCry_, hBE3x3_, hBE3x3vsCry_, hBEne1_, hBEntriesvsCry_, hBGains_, hBMaxEneCry_, hBNumReadCry_, hBpulse_, hBReadCryErrors_, hbTBmoving_, histo, ievt_, int, jevt_, me, meEBBCaloRedGreen_, meEBBCaloRedGreenReadCry_, meEBBCaloRedGreenSteps_, minEvtNum_, pBCriInBeamEvents_, prefixME_, prescaling_, ReadCryErrThr_, RMSEne3x3_, MonitorElement::setBinContent(), and cmsRelvalreportInput::step.

00336                                    {
00337 
00338   ievt_++;
00339   jevt_++;
00340   if ( ievt_ % 10 == 0 ) {
00341     if ( debug_ ) cout << "EBBeamCaloClient: ievt/jevt = " << ievt_ << "/" << jevt_ << endl;
00342   }
00343 
00344   char histo[200];
00345 
00346   MonitorElement* me = 0;
00347 
00348   // MonitorElement* meCD;
00349   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT crystals done").c_str());
00350   //meCD = dqmStore_->get(histo);
00351   me = dqmStore_->get(histo);
00352   hBcryDone_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hBcryDone_ );
00353 
00354   //MonitorElement* meCryInBeam;
00355   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT crystal on beam").c_str());
00356   //meCryInBeam = dqmStore_->get(histo);
00357   me = dqmStore_->get(histo);
00358   hBCryOnBeam_ = UtilsClient::getHisto<TH2F*>( me, cloneME_, hBCryOnBeam_);
00359 
00360   //MonitorElement* allNeededCry;
00361   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT all needed crystals readout").c_str());
00362   //allNeededCry= dqmStore_->get(histo);
00363   me = dqmStore_->get(histo);
00364   hBAllNeededCry_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hBAllNeededCry_);
00365 
00366   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT readout crystals number").c_str());
00367   //allNeededCry= dqmStore_->get(histo);
00368   me = dqmStore_->get(histo);
00369   hBNumReadCry_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hBNumReadCry_);
00370 
00371   //MonitorElement* RecEne3x3;
00372   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT rec Ene sum 3x3").c_str());
00373   //RecEne3x3= dqmStore_->get(histo);
00374   me = dqmStore_->get(histo);
00375   hBE3x3_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hBE3x3_);
00376 
00377   //MonitorElement* ErrRedCry;
00378   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT readout crystals errors").c_str());
00379   //ErrRedCry = dqmStore_->get(histo);
00380   me = dqmStore_->get(histo);
00381   hBReadCryErrors_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hBReadCryErrors_);
00382 
00383   //  MonitorElement* RecEne1;
00384   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT rec energy cry 5").c_str());
00385   //RecEne1= dqmStore_->get(histo);
00386   me = dqmStore_->get(histo);
00387   hBEne1_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hBEne1_);
00388 
00389   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT crystal with maximum rec energy").c_str());
00390   me = dqmStore_->get(histo);
00391   hBMaxEneCry_ = UtilsClient::getHisto<TH2F*>( me, cloneME_, hBMaxEneCry_);
00392 
00393   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT average rec energy in the 3x3 array").c_str());
00394   me = dqmStore_->get(histo);
00395   hBE3x3vsCry_ = UtilsClient::getHisto<TProfile*>( me, cloneME_, hBE3x3vsCry_);
00396 
00397   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT average rec energy in the single crystal").c_str());
00398   me = dqmStore_->get(histo);
00399   hBE1vsCry_ = UtilsClient::getHisto<TProfile*>( me, cloneME_, hBE1vsCry_);
00400 
00401   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT number of entries").c_str());
00402   me = dqmStore_->get(histo);
00403   hBEntriesvsCry_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hBEntriesvsCry_);
00404 
00405   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT energy deposition in the 3x3").c_str());
00406   me = dqmStore_->get(histo);
00407   hBBeamCentered_ = UtilsClient::getHisto<TH2F*>( me, cloneME_, hBBeamCentered_);
00408 
00409   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT table is moving").c_str());
00410   me = dqmStore_->get(histo);
00411   hbTBmoving_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hbTBmoving_);
00412 
00413   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT crystal in beam vs event").c_str());
00414   me = dqmStore_->get(histo);
00415   pBCriInBeamEvents_ =  UtilsClient::getHisto<TProfile*>( me, cloneME_, pBCriInBeamEvents_);
00416 
00417   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT E1 in the max cry").c_str());
00418   me = dqmStore_->get(histo);
00419   hbE1MaxCry_ =  UtilsClient::getHisto<TH1F*>( me, cloneME_, hbE1MaxCry_);
00420 
00421   sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT Desynchronization vs step").c_str());
00422   me = dqmStore_->get(histo);
00423   hbDesync_ =  UtilsClient::getHisto<TH1F*>( me, cloneME_, hbDesync_);
00424 
00425   for(int ind = 0; ind < cryInArray_; ind ++) {
00426     sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT pulse profile in G12 cry %01d").c_str(), ind+1);
00427     me = dqmStore_->get(histo);
00428     hBpulse_[ind] = UtilsClient::getHisto<TProfile*>( me, cloneME_, hBpulse_[ind]);
00429 
00430     sprintf(histo, (prefixME_ + "/EBBeamCaloTask/EBBCT found gains cry %01d").c_str(), ind+1);
00431     me = dqmStore_->get(histo);
00432     hBGains_[ind] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hBGains_[ind]);
00433   }
00434 
00435   int DoneCry = 0;//if it stays 1 the run is not an autoscan
00436   if (hBcryDone_) {
00437     for(int cry=1 ; cry<1701 ; cry ++) {
00438       int step = (int) hBcryDone_->GetBinContent(cry);
00439       if( step>0 ) {//this crystal has been scanned or is being scanned
00440         DoneCry++;
00441         float E3x3RMS = -1, E3x3 =-1, E1=-1;
00442         if(hBE3x3vsCry_) {
00443           //E3x3RMS = hBE3x3vsCry_->GetBinError(step);
00444           //E3x3 = hBE3x3vsCry_->GetBinContent(step);
00445           E3x3RMS = hBE3x3vsCry_->GetBinError(cry);
00446           E3x3 = hBE3x3vsCry_->GetBinContent(cry);
00447         }
00448         //if( hBE1vsCry_) {E1=hBE1vsCry_->GetBinContent(step);}
00449         if( hBE1vsCry_) {E1=hBE1vsCry_->GetBinContent(cry);}
00450         bool RMS3x3  =  (  E3x3RMS < RMSEne3x3_ && E3x3RMS >= 0 );
00451         bool Mean3x3 =  ( fabs( E3x3 - aveEne3x3_ ) < E3x3Th_);
00452         bool Mean1   =  ( fabs( E1 - aveEne1_ ) < E1Th_ );
00453         int ieta = ( cry - 1)/20 + 1 ;//+1 for the bin
00454         int iphi = ( cry - 1)%20 + 1 ;//+1 for the bin
00455         //fill the RedGreen histo
00456         if(ieta >0 && iphi >0 ) {
00457           if(RMS3x3 && Mean3x3 && Mean1) {meEBBCaloRedGreen_->setBinContent(ieta,iphi,1.);}
00458           else {meEBBCaloRedGreen_->setBinContent(ieta,iphi,0.);}
00459         }
00460 
00461         float Entries = -1;
00462         //if ( hBEntriesvsCry_ ) {Entries = hBEntriesvsCry_->GetBinContent(step);}
00463         if ( hBEntriesvsCry_ ) {Entries = hBEntriesvsCry_->GetBinContent(cry);}
00464         bool Nent = ( Entries * prescaling_  > minEvtNum_ );
00465         bool readCryOk = true;
00466         if( hBReadCryErrors_ ) {
00467           int step_bin = hBReadCryErrors_->GetXaxis()->FindFixBin(step);
00468           if ( step_bin > 0 && step_bin < hBReadCryErrors_->GetNbinsX() ) {
00469             if ( hBReadCryErrors_->GetBinContent(step_bin) <= Entries*ReadCryErrThr_ ) {readCryOk = true;}
00470             else {readCryOk = false;}
00471           }
00472         }
00473 
00474         if(Nent && readCryOk ) { meEBBCaloRedGreenSteps_->setBinContent(step,1,1.);}
00475         else{ meEBBCaloRedGreenSteps_->setBinContent(step,1,0.);}
00476 
00477         if (readCryOk &&  meEBBCaloRedGreenReadCry_->getBinContent(1,1) != 0.) { meEBBCaloRedGreenReadCry_->setBinContent(1,1, 1.);}
00478         else if ( !readCryOk ) { meEBBCaloRedGreenReadCry_->setBinContent(1,1, 0.);}
00479       }// end of if (step>0)
00480     }//end of loop over cry
00481   }//end of if(hBcryDone_)
00482 
00483   if(DoneCry == 1) {//this is probably not an auotscan or it is the first crystal
00484     float nEvt = 0;
00485     if(hBE3x3_) {nEvt = hBE3x3_->GetEntries();}
00486     if(nEvt > 1*prescaling_ && hBE3x3_ && hBEne1_ && hBCryOnBeam_ && meEBBCaloRedGreen_) {//check for mean and RMS
00487       bool RMS3x3  =  ( hBE3x3_->GetRMS() < RMSEne3x3_ );
00488       bool Mean3x3 =  ( fabs( hBE3x3_->GetMean() - aveEne3x3_ ) < E3x3Th_ );
00489       bool Mean1   =  ( fabs( hBEne1_->GetMean() - aveEne1_ ) < E1Th_ );
00490       //fill the RedGreen histo
00491       int ieta=0,iphi=0;
00492       float found =0; //there should be just one bin filled but...
00493       for (int b_eta =1; b_eta<86; b_eta++) {
00494         for (int b_phi =1; b_phi<21; b_phi++) {
00495           float bc = hBCryOnBeam_->GetBinContent(b_eta,b_phi);//FIX ME check if this is the correct binning
00496           if(bc > found) { found =bc; ieta = b_eta; iphi= b_phi;}
00497         }
00498       }
00499       if(ieta >0 && iphi >0 ) {
00500         if(RMS3x3 && Mean3x3 && Mean1) {meEBBCaloRedGreen_->setBinContent(ieta,iphi,1.);}
00501         else {meEBBCaloRedGreen_->setBinContent(ieta,iphi,0.);}
00502       }
00503     }
00504     if(hBReadCryErrors_) {
00505       float nErr = hBReadCryErrors_->GetBinContent(1);// for a non autoscan just the first bin should be filled
00506       if( nErr > nEvt*ReadCryErrThr_ ) { meEBBCaloRedGreenReadCry_->setBinContent(1,1,0.);}
00507       else { meEBBCaloRedGreenReadCry_->setBinContent(1,1,1.);}
00508     }
00509   }
00510 
00511   //   // was done using me instead of histos
00512   //   if(DoneCry == 0) {//this is probably not an auotscan
00513   //     float nEvt = RecEne3x3->getEntries();
00514   //     if(nEvt > 1000*prescaling_) {//check for mean and RMS
00515   //       bool RMS3x3  =  ( RecEne3x3->getRMS() < RMSEne3x3_ );
00516   //       bool Mean3x3 =  ( (RecEne3x3->getMean() - aveEne3x3_) < E3x3Th_);
00517   //       bool Mean1   =  ( (RecEne1->getMean() < aveEne1_) < E1Th_ );
00518   //       //fill the RedGreen histo
00519   //       int ieta=0,iphi=0;
00520   //       float found =0; //there should be just one bin filled but...
00521   //       for (int b_eta =1; b_eta<86; b_eta++) {
00522   //         for (int b_phi =1; b_phi<21; b_phi++) {
00523   //           float bc = meCryInBeam->getBinContent(b_eta,b_phi);//FIX ME check if this is the correct binning
00524   //           if(bc > found) { found =bc; ieta = b_eta; iphi= b_phi;}
00525   //         }
00526   //       }
00527   //       if(ieta >0 && iphi >0 ) {
00528   //         if(RMS3x3 && Mean3x3 && Mean1) {meEBBCaloRedGreen_->setBinContent(ieta,iphi,1.);}
00529   //         else {meEBBCaloRedGreen_->setBinContent(ieta,iphi,0.);}
00530   //       }
00531   //     }
00532   //     float nErr = ErrRedCry->getBinContent(1);// for a non autoscan just the first bin should be filled
00533   //     if( nErr > nEvt*ReadCryErrThr_ ) { meEBBCaloRedGreenReadCry_->setBinContent(1,1,0.);}
00534   //     else { meEBBCaloRedGreenReadCry_->setBinContent(1,1,1.);}
00535   //   }
00536 
00537 
00538 }

void EBBeamCaloClient::beginJob ( DQMStore dqmStore  )  [virtual]

BeginJob.

Implements EBClient.

Definition at line 104 of file EBBeamCaloClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug_, dqmStore_, lat::endl(), ievt_, and jevt_.

00104                                                   {
00105 
00106   dqmStore_ = dqmStore;
00107 
00108   if ( debug_ ) cout << "EBBeamCaloClient: beginJob" << endl;
00109 
00110   ievt_ = 0;
00111   jevt_ = 0;
00112 
00113 }

void EBBeamCaloClient::beginRun ( void   )  [virtual]

BeginRun.

Implements EBClient.

Definition at line 115 of file EBBeamCaloClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug_, lat::endl(), jevt_, and setup().

00115                                     {
00116 
00117   if ( debug_ ) cout << "EBBeamCaloClient: beginRun" << endl;
00118 
00119   jevt_ = 0;
00120 
00121   this->setup();
00122 
00123 }

void EBBeamCaloClient::cleanup ( void   )  [virtual]

Cleanup.

Implements EBClient.

Definition at line 176 of file EBBeamCaloClient.cc.

References cloneME_, cryInArray_, dqmStore_, enableCleanup_, MonitorElement::getName(), hBAllNeededCry_, hBBeamCentered_, hBcryDone_, hBCryOnBeam_, hbDesync_, hbE1MaxCry_, hBE1vsCry_, hBE3x3_, hBE3x3Moving_, hBE3x3vsCry_, hBEne1_, hBEntriesvsCry_, hBGains_, hBMaxEneCry_, hBNumReadCry_, hBpulse_, hBReadCryErrors_, hbTBmoving_, meEBBCaloRedGreen_, meEBBCaloRedGreenReadCry_, meEBBCaloRedGreenSteps_, pBCriInBeamEvents_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

Referenced by endJob(), and endRun().

00176                                    {
00177   if ( ! enableCleanup_ ) return;
00178   if ( cloneME_ ) {
00179     for(int u=0;u<cryInArray_;u++) {
00180       if(hBGains_[u]) delete hBGains_[u];
00181       if(hBpulse_[u]) delete hBpulse_[u];
00182       //if(hBGainsMoving_[u])delete hBGainsMoving_[u];
00183     }
00184     if(hBEne1_) delete hBEne1_;
00185     //    if(hBEne1Moving_) delete hBEne1Moving_;
00186     if(hBAllNeededCry_) delete hBAllNeededCry_;
00187     if(hBNumReadCry_) delete hBNumReadCry_;
00188     if(hBE3x3_) delete hBE3x3_;
00189     if(hBE3x3Moving_) delete hBE3x3Moving_;
00190     if(hBCryOnBeam_) delete hBCryOnBeam_;
00191     if(hBMaxEneCry_) delete hBMaxEneCry_;
00192     if(hBReadCryErrors_) delete hBReadCryErrors_;
00193     if(hBE1vsCry_) delete hBE1vsCry_;
00194     if(hBE3x3vsCry_) delete hBE3x3vsCry_;
00195     if(hBEntriesvsCry_) delete hBEntriesvsCry_;
00196     if(hBcryDone_) delete hBcryDone_;
00197     if(hBBeamCentered_) delete hBBeamCentered_;
00198     if(hbTBmoving_) delete hbTBmoving_;
00199     if(hbE1MaxCry_) delete hbE1MaxCry_;
00200     if(hbDesync_) delete hbDesync_;
00201     if(pBCriInBeamEvents_) delete pBCriInBeamEvents_;
00202   }
00203 
00204   for(int u=0;u<cryInArray_;u++) {
00205     hBGains_[u] = 0;
00206     hBpulse_[u] = 0;
00207     //hBGainsMoving_[u] = 0;
00208   }
00209   hBEne1_ = 0;
00210   //hBEne1Moving_ = 0;
00211   hBAllNeededCry_ = 0;
00212   hBNumReadCry_ = 0;
00213   hBE3x3_ = 0;
00214   hBE3x3Moving_ = 0;
00215   hBCryOnBeam_ = 0;
00216   hBMaxEneCry_ = 0;
00217   hBReadCryErrors_ = 0;
00218   hBE1vsCry_ = 0;
00219   hBE3x3vsCry_ = 0;
00220   hBEntriesvsCry_ = 0;
00221   hBcryDone_ = 0;
00222   hBBeamCentered_ = 0;
00223   hbTBmoving_ = 0;
00224   hbE1MaxCry_ = 0;
00225   hbDesync_ = 0;
00226   pBCriInBeamEvents_ =0;
00227 
00228   dqmStore_->setCurrentFolder( prefixME_ + "/EBBeamCaloClient" );
00229 
00230   if ( meEBBCaloRedGreen_) dqmStore_->removeElement( meEBBCaloRedGreen_->getName() );
00231   meEBBCaloRedGreen_ = 0;
00232   if ( meEBBCaloRedGreenReadCry_) dqmStore_->removeElement( meEBBCaloRedGreenReadCry_->getName() );
00233   meEBBCaloRedGreenReadCry_ = 0;
00234   if( meEBBCaloRedGreenSteps_ ) dqmStore_->removeElement (  meEBBCaloRedGreenSteps_->getName() );
00235   meEBBCaloRedGreenSteps_ = 0;
00236 }

void EBBeamCaloClient::endJob ( void   )  [virtual]

EndJob.

Implements EBClient.

Definition at line 125 of file EBBeamCaloClient.cc.

References cleanup(), GenMuonPlsPt100GeV_cfg::cout, debug_, lat::endl(), and ievt_.

00125                                   {
00126 
00127   if ( debug_ ) cout << "EBBeamCaloClient: endJob, ievt = " << ievt_ << endl;
00128 
00129   this->cleanup();
00130 
00131 }

void EBBeamCaloClient::endRun ( void   )  [virtual]

EndRun.

Implements EBClient.

Definition at line 133 of file EBBeamCaloClient.cc.

References cleanup(), GenMuonPlsPt100GeV_cfg::cout, debug_, lat::endl(), and jevt_.

00133                                   {
00134 
00135   if ( debug_ ) cout << "EBBeamCaloClient: endRun, jevt = " << jevt_ << endl;
00136 
00137   this->cleanup();
00138 
00139 }

int EBBeamCaloClient::getEvtPerJob ( void   )  [inline, virtual]

Get Functions.

Implements EBClient.

Definition at line 75 of file EBBeamCaloClient.h.

References ievt_.

00075 { return ievt_; }

int EBBeamCaloClient::getEvtPerRun ( void   )  [inline, virtual]

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 76 of file EBBeamCaloClient.h.

References jevt_.

00076 { return jevt_; }

void EBBeamCaloClient::htmlOutput ( int  run,
std::string &  htmlDir,
std::string &  htmlName 
) [virtual]

HtmlOutput.

Implements EBClient.

void EBBeamCaloClient::setup ( void   )  [virtual]

Setup.

Implements EBClient.

Definition at line 141 of file EBBeamCaloClient.cc.

References DQMStore::book2D(), dqmStore_, MonitorElement::getName(), histo, meEBBCaloRedGreen_, meEBBCaloRedGreenReadCry_, meEBBCaloRedGreenSteps_, prefixME_, DQMStore::removeElement(), MonitorElement::Reset(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), and DQMStore::setCurrentFolder().

Referenced by beginRun().

00141                                  {
00142 
00143   char histo[200];
00144 
00145   dqmStore_->setCurrentFolder( prefixME_ + "/EBBeamCaloClient" );
00146 
00147   if ( meEBBCaloRedGreen_ ) dqmStore_->removeElement( meEBBCaloRedGreen_->getName() );
00148   sprintf(histo, "EBBCT quality");
00149   meEBBCaloRedGreen_ = dqmStore_->book2D(histo, histo, 85, 0., 85., 20, 0., 20.);
00150 
00151   meEBBCaloRedGreen_->Reset();
00152 
00153   for ( int ie = 1; ie <= 85; ie++ ) {
00154     for ( int ip = 1; ip <= 20; ip++ ) {
00155 
00156       meEBBCaloRedGreen_ ->setBinContent( ie, ip, 2. );
00157 
00158     }
00159   }
00160 
00161   if ( meEBBCaloRedGreenReadCry_ ) dqmStore_->removeElement( meEBBCaloRedGreenReadCry_->getName() );
00162   sprintf(histo, "EBBCT quality read crystal errors");
00163   meEBBCaloRedGreenReadCry_ = dqmStore_->book2D(histo, histo, 1, 0., 1., 1, 0., 1.);
00164   meEBBCaloRedGreenReadCry_->Reset();
00165   meEBBCaloRedGreenReadCry_ ->setBinContent( 1, 1, 2. );
00166 
00167   if( meEBBCaloRedGreenSteps_ ) dqmStore_->removeElement( meEBBCaloRedGreenSteps_->getName() );
00168   sprintf(histo, "EBBCT quality entries or read crystals errors");
00169   meEBBCaloRedGreenSteps_ = dqmStore_->book2D(histo, histo, 86, 1., 87., 1, 0., 1.);
00170   meEBBCaloRedGreenSteps_->setAxisTitle("step in the scan");
00171   meEBBCaloRedGreenSteps_->Reset();
00172   for( int bin=1; bin <87; bin++) { meEBBCaloRedGreenSteps_->setBinContent( bin, 1, 2. );}
00173 
00174 }

void EBBeamCaloClient::softReset ( bool  flag  )  [virtual]

SoftReset.

Implements EBClient.

Definition at line 540 of file EBBeamCaloClient.cc.

00540                                           {
00541 
00542 }

bool EBBeamCaloClient::writeDb ( EcalCondDBInterface econn,
RunIOV runiov,
MonRunIOV moniov,
bool status,
bool  flag 
) [virtual]

WriteDB.

Implements EBClient.

Definition at line 238 of file EBBeamCaloClient.cc.

References TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, ttbarGen_cfg::dataset, e, EcalBarrel, lat::endl(), LogicID::getEcalLogicID(), hBcryDone_, hBCryOnBeam_, hBE1vsCry_, hBMaxEneCry_, i, Numbers::icEB(), EcalCondDBInterface::insertDataArraySet(), int, Numbers::iSM(), Numbers::sEB(), MonOccupancyDat::setAvgEnergy(), MonOccupancyDat::setEventsOverHighThreshold(), MonOccupancyDat::setEventsOverLowThreshold(), cmsRelvalreportInput::step, superModules_, and verbose_.

00238                                                                                                                      {
00239 
00240   status = true;
00241 
00242   if ( ! flag ) return false;
00243 
00244   EcalLogicID ecid;
00245 
00246   MonOccupancyDat o;
00247   map<EcalLogicID, MonOccupancyDat> dataset;
00248 
00249   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00250 
00251     int ism = superModules_[i];
00252 
00253     if ( verbose_ ) {
00254       cout << " " << Numbers::sEB(ism) << " (ism=" << ism << ")" << endl;
00255       cout << endl;
00256     }
00257 
00258     const float n_min_tot = 1000.;
00259 
00260     float num01, num02;
00261     float mean01;
00262 
00263     for ( int ie = 1; ie <= 85; ie++ ) {
00264       for ( int ip = 1; ip <= 20; ip++ ) {
00265 
00266         num01 = num02 = -1.;
00267         mean01 = -1.;
00268 
00269         bool update_channel = false;
00270 
00271         if ( hBCryOnBeam_ && hBCryOnBeam_->GetEntries() >= n_min_tot ) {
00272           num01 = hBCryOnBeam_->GetBinContent(ie, ip);
00273           update_channel = true;
00274         }
00275 
00276         if ( hBMaxEneCry_ && hBMaxEneCry_->GetEntries() >= n_min_tot ) {
00277           num02 = hBMaxEneCry_->GetBinContent(ie, ip);
00278           update_channel = true;
00279         }
00280 
00281         mean01 = 0.;
00282         //int cry = ip+20*(ie-1);
00283         int ic = (ip-1) + 20*(ie-1) + 1;
00284         int step = 0;
00285         if (hBcryDone_) { step = (int) hBcryDone_->GetBinContent(ic);}
00286         if( step > 0 && step < 86) {
00287         //if(hBE3x3vsCry_) {mean01 = hBE3x3vsCry_->GetBinContent(step);}// E in the 3x3
00288         if( hBE1vsCry_ ) {mean01 = hBE1vsCry_->GetBinContent(ic);} // E1
00289         }
00290 
00291         if ( update_channel ) {
00292 
00293           if ( Numbers::icEB(ism, ie, ip) == 1 ) {
00294 
00295             if ( verbose_ ) {
00296               cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << endl;
00297               cout << "CryOnBeam (" << ie << "," << ip << ") " << num01  << endl;
00298               cout << "MaxEneCry (" << ie << "," << ip << ") " << num02  << endl;
00299               cout << "E1 ("        << ie << "," << ip << ") " << mean01 << endl;
00300               cout << endl;
00301             }
00302 
00303           }
00304 
00305           o.setEventsOverHighThreshold(int(num01));
00306           o.setEventsOverLowThreshold(int(num02));
00307 
00308           o.setAvgEnergy(mean01);
00309 
00310           if ( econn ) {
00311             ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
00312             dataset[ecid] = o;
00313           }
00314 
00315         }
00316 
00317       }
00318     }
00319 
00320   }
00321 
00322   if ( econn ) {
00323     try {
00324       if ( verbose_ ) cout << "Inserting MonOccupancyDat ..." << endl;
00325       if ( dataset.size() != 0 ) econn->insertDataArraySet(&dataset, moniov);
00326       if ( verbose_ ) cout << "done." << endl;
00327     } catch (runtime_error &e) {
00328       cerr << e.what() << endl;
00329     }
00330   }
00331 
00332   return true;
00333 
00334 }


Member Data Documentation

float EBBeamCaloClient::aveEne1_ [private]

Definition at line 151 of file EBBeamCaloClient.h.

Referenced by analyze(), and EBBeamCaloClient().

float EBBeamCaloClient::aveEne3x3_ [private]

Definition at line 153 of file EBBeamCaloClient.h.

Referenced by analyze(), and EBBeamCaloClient().

std::vector<int> EBBeamCaloClient::checkedSteps_ [private]

Definition at line 99 of file EBBeamCaloClient.h.

Referenced by EBBeamCaloClient().

bool EBBeamCaloClient::cloneME_ [private]

Definition at line 85 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

const int EBBeamCaloClient::cryInArray_ = 9 [static, private]

Definition at line 80 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

bool EBBeamCaloClient::debug_ [private]

Definition at line 88 of file EBBeamCaloClient.h.

Referenced by analyze(), beginJob(), beginRun(), EBBeamCaloClient(), endJob(), and endRun().

DQMStore* EBBeamCaloClient::dqmStore_ [private]

Definition at line 96 of file EBBeamCaloClient.h.

Referenced by analyze(), beginJob(), cleanup(), and setup().

float EBBeamCaloClient::E1Th_ [private]

Definition at line 152 of file EBBeamCaloClient.h.

Referenced by analyze(), and EBBeamCaloClient().

float EBBeamCaloClient::E3x3Th_ [private]

Definition at line 154 of file EBBeamCaloClient.h.

Referenced by analyze(), and EBBeamCaloClient().

bool EBBeamCaloClient::enableCleanup_ [private]

Definition at line 92 of file EBBeamCaloClient.h.

Referenced by cleanup(), and EBBeamCaloClient().

TH1F* EBBeamCaloClient::hBAllNeededCry_ [private]

Definition at line 111 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH2F* EBBeamCaloClient::hBBeamCentered_ [private]

Definition at line 133 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH1F* EBBeamCaloClient::hBcryDone_ [private]

Definition at line 131 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), EBBeamCaloClient(), and writeDb().

TH2F* EBBeamCaloClient::hBCryOnBeam_ [private]

Definition at line 119 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), EBBeamCaloClient(), and writeDb().

TH1F* EBBeamCaloClient::hbDesync_ [private]

Definition at line 139 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH1F* EBBeamCaloClient::hbE1MaxCry_ [private]

Definition at line 137 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TProfile* EBBeamCaloClient::hBE1vsCry_ [private]

Definition at line 125 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), EBBeamCaloClient(), and writeDb().

TH1F* EBBeamCaloClient::hBE3x3_ [private]

Definition at line 115 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH1F* EBBeamCaloClient::hBE3x3Moving_ [private]

Definition at line 117 of file EBBeamCaloClient.h.

Referenced by cleanup(), and EBBeamCaloClient().

TProfile* EBBeamCaloClient::hBE3x3vsCry_ [private]

Definition at line 127 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH1F* EBBeamCaloClient::hBEne1_ [private]

Definition at line 106 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH1F* EBBeamCaloClient::hBEntriesvsCry_ [private]

Definition at line 129 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH1F* EBBeamCaloClient::hBGains_[cryInArray_] [private]

Definition at line 103 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH2F* EBBeamCaloClient::hBMaxEneCry_ [private]

Definition at line 121 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), EBBeamCaloClient(), and writeDb().

TH1F* EBBeamCaloClient::hBNumReadCry_ [private]

Definition at line 113 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TProfile* EBBeamCaloClient::hBpulse_[cryInArray_] [private]

Definition at line 104 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH1F* EBBeamCaloClient::hBReadCryErrors_ [private]

Definition at line 123 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

TH1F* EBBeamCaloClient::hbTBmoving_ [private]

Definition at line 135 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

int EBBeamCaloClient::ievt_ [private]

Definition at line 82 of file EBBeamCaloClient.h.

Referenced by analyze(), beginJob(), endJob(), and getEvtPerJob().

int EBBeamCaloClient::jevt_ [private]

Definition at line 83 of file EBBeamCaloClient.h.

Referenced by analyze(), beginJob(), beginRun(), endRun(), and getEvtPerRun().

MonitorElement* EBBeamCaloClient::meEBBCaloRedGreen_ [private]

Definition at line 143 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), EBBeamCaloClient(), and setup().

MonitorElement* EBBeamCaloClient::meEBBCaloRedGreenReadCry_ [private]

Definition at line 144 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), EBBeamCaloClient(), and setup().

MonitorElement* EBBeamCaloClient::meEBBCaloRedGreenSteps_ [private]

Definition at line 145 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), EBBeamCaloClient(), and setup().

int EBBeamCaloClient::minEvtNum_ [private]

Definition at line 149 of file EBBeamCaloClient.h.

Referenced by analyze(), and EBBeamCaloClient().

TProfile* EBBeamCaloClient::pBCriInBeamEvents_ [private]

Definition at line 141 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), and EBBeamCaloClient().

std::string EBBeamCaloClient::prefixME_ [private]

Definition at line 90 of file EBBeamCaloClient.h.

Referenced by analyze(), cleanup(), EBBeamCaloClient(), and setup().

float EBBeamCaloClient::prescaling_ [private]

Definition at line 100 of file EBBeamCaloClient.h.

Referenced by analyze(), and EBBeamCaloClient().

float EBBeamCaloClient::ReadCryErrThr_ [private]

Definition at line 156 of file EBBeamCaloClient.h.

Referenced by analyze(), and EBBeamCaloClient().

float EBBeamCaloClient::RMSEne3x3_ [private]

Definition at line 155 of file EBBeamCaloClient.h.

Referenced by analyze(), and EBBeamCaloClient().

std::vector<int> EBBeamCaloClient::superModules_ [private]

Definition at line 94 of file EBBeamCaloClient.h.

Referenced by EBBeamCaloClient(), and writeDb().

bool EBBeamCaloClient::verbose_ [private]

Definition at line 87 of file EBBeamCaloClient.h.

Referenced by EBBeamCaloClient(), and writeDb().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:17 2009 for CMSSW by  doxygen 1.5.4