#include <EBIntegrityClient.h>
Public Member Functions | |
void | analyze (void) |
Analyze. | |
void | beginJob (void) |
BeginJob. | |
void | beginRun (void) |
BeginRun. | |
void | cleanup (void) |
Cleanup. | |
EBIntegrityClient (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 | setup (void) |
Setup. | |
virtual | ~EBIntegrityClient () |
Destructor. | |
Private Attributes | |
bool | cloneME_ |
bool | debug_ |
DQMStore * | dqmStore_ |
bool | enableCleanup_ |
TH1F * | h00_ |
TH2F * | h01_ [36] |
TH2F * | h02_ [36] |
TH2F * | h03_ [36] |
TH2F * | h04_ [36] |
TH2F * | h05_ [36] |
TH2F * | h06_ [36] |
TH2F * | h07_ [36] |
TH2F * | h08_ [36] |
TH2F * | h09_ [36] |
TH2F * | h_ [36] |
TH2F * | hmem_ [36] |
int | ievt_ |
int | jevt_ |
MonitorElement * | meg01_ [36] |
MonitorElement * | meg02_ [36] |
std::string | prefixME_ |
std::vector< int > | superModules_ |
float | threshCry_ |
bool | verbose_ |
Static Private Attributes | |
static const int | chNum [5][5] |
Friends | |
class | EBSummaryClient |
Definition at line 33 of file EBIntegrityClient.h.
EBIntegrityClient::EBIntegrityClient | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 45 of file EBIntegrityClient.cc.
References cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), h00_, h01_, h02_, h03_, h04_, h05_, h06_, h07_, h08_, h09_, h_, hmem_, i, ecalpyutils::ism(), meg01_, meg02_, prefixME_, superModules_, threshCry_, and verbose_.
{ // cloneME switch cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true); // verbose switch verbose_ = ps.getUntrackedParameter<bool>("verbose", true); // debug switch debug_ = ps.getUntrackedParameter<bool>("debug", false); // prefixME path prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", ""); // enableCleanup_ switch enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false); // vector of selected Super Modules (Defaults to all 36). superModules_.reserve(36); for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i); superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_); h00_ = 0; for ( unsigned int i=0; i<superModules_.size(); i++ ) { int ism = superModules_[i]; h_[ism-1] = 0; hmem_[ism-1] = 0; h01_[ism-1] = 0; h02_[ism-1] = 0; h03_[ism-1] = 0; h04_[ism-1] = 0; h05_[ism-1] = 0; h06_[ism-1] = 0; h07_[ism-1] = 0; h08_[ism-1] = 0; h09_[ism-1] = 0; } for ( unsigned int i=0; i<superModules_.size(); i++ ) { int ism = superModules_[i]; // integrity summary histograms meg01_[ism-1] = 0; meg02_[ism-1] = 0; } threshCry_ = 0.01; }
EBIntegrityClient::~EBIntegrityClient | ( | ) | [virtual] |
void EBIntegrityClient::analyze | ( | void | ) | [virtual] |
Analyze.
Implements EBClient.
Definition at line 636 of file EBIntegrityClient.cc.
References EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR, EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR, EcalDQMStatusHelper::CH_ID_ERROR, cloneME_, gather_cfg::cout, debug_, dqmStore_, EcalBarrel, DQMStore::get(), getHisto(), h00_, h01_, h02_, h03_, h04_, h05_, h06_, h07_, h08_, h09_, h_, hmem_, i, ievt_, jevt_, UtilsClient::maskBinContent(), Masks::maskChannel(), Masks::maskPn(), meg01_, meg02_, prefixME_, MonitorElement::Reset(), Numbers::sEB(), MonitorElement::setBinContent(), superModules_, threshCry_, EcalDQMStatusHelper::TT_ID_ERROR, and EcalDQMStatusHelper::TT_SIZE_ERROR.
{ ievt_++; jevt_++; if ( ievt_ % 10 == 0 ) { if ( debug_ ) std::cout << "EBIntegrityClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl; } uint32_t bits01 = 0; bits01 |= 1 << EcalDQMStatusHelper::CH_ID_ERROR; bits01 |= 1 << EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR; bits01 |= 1 << EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR; bits01 |= 1 << EcalDQMStatusHelper::TT_ID_ERROR; bits01 |= 1 << EcalDQMStatusHelper::TT_SIZE_ERROR; MonitorElement* me; me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/EBIT DCC size error" ); h00_ = UtilsClient::getHisto( me, cloneME_, h00_ ); for ( unsigned int i=0; i<superModules_.size(); i++ ) { int ism = superModules_[i]; me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT digi occupancy " + Numbers::sEB(ism) ); h_[ism-1] = UtilsClient::getHisto( me, cloneME_, h_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT MEM digi occupancy " + Numbers::sEB(ism) ); hmem_[ism-1] = UtilsClient::getHisto( me, cloneME_, hmem_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/Gain/EBIT gain " + Numbers::sEB(ism) ); h01_[ism-1] = UtilsClient::getHisto( me, cloneME_, h01_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/ChId/EBIT ChId " + Numbers::sEB(ism) ); h02_[ism-1] = UtilsClient::getHisto( me, cloneME_, h02_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/GainSwitch/EBIT gain switch " + Numbers::sEB(ism) ); h03_[ism-1] = UtilsClient::getHisto( me, cloneME_, h03_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/TTId/EBIT TTId " + Numbers::sEB(ism) ); h04_[ism-1] = UtilsClient::getHisto( me, cloneME_, h04_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/TTBlockSize/EBIT TTBlockSize " + Numbers::sEB(ism) ); h05_[ism-1] = UtilsClient::getHisto( me, cloneME_, h05_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/MemChId/EBIT MemChId " + Numbers::sEB(ism) ); h06_[ism-1] = UtilsClient::getHisto( me, cloneME_, h06_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/MemGain/EBIT MemGain " + Numbers::sEB(ism) ); h07_[ism-1] = UtilsClient::getHisto( me, cloneME_, h07_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/MemTTId/EBIT MemTTId " + Numbers::sEB(ism) ); h08_[ism-1] = UtilsClient::getHisto( me, cloneME_, h08_[ism-1] ); me = dqmStore_->get( prefixME_ + "/EBIntegrityTask/MemSize/EBIT MemSize " + Numbers::sEB(ism) ); h09_[ism-1] = UtilsClient::getHisto( me, cloneME_, h09_[ism-1] ); float num00; // integrity summary histograms if ( meg01_[ism-1] ) meg01_[ism-1]->Reset(); if ( meg02_[ism-1] ) meg02_[ism-1]->Reset(); num00 = 0.; bool update0 = false; // dcc size errors if ( h00_ ) { num00 = h00_->GetBinContent(ism); update0 = true; } float num01, num02, num03, num04, num05; for ( int ie = 1; ie <= 85; ie++ ) { for ( int ip = 1; ip <= 20; ip++ ) { num01 = num02 = num03 = num04 = num05 = 0.; if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ie, ip, 2. ); bool update1 = false; bool update2 = false; float numTot = -1.; if ( h_[ism-1] ) numTot = h_[ism-1]->GetBinContent(ie, ip); if ( h01_[ism-1] ) { num01 = h01_[ism-1]->GetBinContent(ie, ip); update1 = true; } if ( h02_[ism-1] ) { num02 = h02_[ism-1]->GetBinContent(ie, ip); update1 = true; } if ( h03_[ism-1] ) { num03 = h03_[ism-1]->GetBinContent(ie, ip); update1 = true; } int iet = 1 + ((ie-1)/5); int ipt = 1 + ((ip-1)/5); if ( h04_[ism-1] ) { num04 = h04_[ism-1]->GetBinContent(iet, ipt); update2 = true; } if ( h05_[ism-1] ) { num05 = h05_[ism-1]->GetBinContent(iet, ipt); update2 = true; } if ( update0 || update1 || update2 ) { float val; val = 1.; // number of events on a channel if ( numTot > 0 ) { float errorRate1 = num00 / ( numTot + num01 + num02 + num03 ); if ( errorRate1 > threshCry_ ) val = 0.; errorRate1 = ( num01 + num02 + num03 ) / ( numTot + num01 + num02 + num03 ) / 3.; if ( errorRate1 > threshCry_ ) val = 0.; float errorRate2 = ( num04 + num05 ) / ( numTot/25. + num04 + num05 ) / 2.; if ( errorRate2 > threshCry_ ) val = 0.; } else { val = 2.; if ( num00 > 0 ) val = 0.; if ( ( num01 + num02 + num03 ) > 0 ) val = 0.; if ( ( num04 + num05 ) > 0 ) val = 0.; } // filling the summary for SM channels if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ie, ip, val ); } if ( Masks::maskChannel(ism, ie, ip, bits01, EcalBarrel) ) UtilsClient::maskBinContent( meg01_[ism-1], ie, ip ); } } // end of loop on crystals // summaries for mem channels float num06, num07, num08, num09; for ( int ie = 1; ie <= 10; ie++ ) { for ( int ip = 1; ip <= 5; ip++ ) { num06 = num07 = num08 = num09 = 0.; // initialize summary histo for mem if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ie, ip, 2. ); bool update1 = false; bool update2 = false; float numTotmem = -1.; if ( hmem_[ism-1] ) numTotmem = hmem_[ism-1]->GetBinContent(ie, ip); if ( h06_[ism-1] ) { num06 = h06_[ism-1]->GetBinContent(ie, ip); update1 = true; } if ( h07_[ism-1] ) { num07 = h07_[ism-1]->GetBinContent(ie, ip); update1 = true; } int iet = 1 + ((ie-1)/5); int ipt = 1; if ( h08_[ism-1] ) { num08 = h08_[ism-1]->GetBinContent(iet, ipt); update2 = true; } if ( h09_[ism-1] ) { num09 = h09_[ism-1]->GetBinContent(iet, ipt); update2 = true; } if ( update0 || update1 || update2 ) { float val; val = 1.; // number of events on a channel if ( numTotmem > 0 ) { float errorRate1 = ( num06 + num07 ) / ( numTotmem + num06 + num07 ) / 2.; if ( errorRate1 > threshCry_ ) val = 0.; float errorRate2 = ( num08 + num09 ) / ( numTotmem/25. + num08 + num09 ) / 2.; if ( errorRate2 > threshCry_ ) val = 0.; } else { val = 2.; if ( ( num06 + num07 ) > 0 ) val = 0.; if ( ( num08 + num09 ) > 0 ) val = 0.; } // filling summary for mem channels if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ie, ip, val ); } if ( Masks::maskPn(ism, ie, bits01, EcalBarrel) ) UtilsClient::maskBinContent( meg02_[ism-1], ie, ip ); } } // end loop on mem channels } // end loop on supermodules }
void EBIntegrityClient::beginJob | ( | void | ) | [virtual] |
BeginJob.
Implements EBClient.
Definition at line 106 of file EBIntegrityClient.cc.
References gather_cfg::cout, debug_, dqmStore_, ievt_, jevt_, and cmsCodeRules::cppFunctionSkipper::operator.
void EBIntegrityClient::beginRun | ( | void | ) | [virtual] |
void EBIntegrityClient::cleanup | ( | void | ) | [virtual] |
Cleanup.
Implements EBClient.
Definition at line 194 of file EBIntegrityClient.cc.
References cloneME_, dqmStore_, enableCleanup_, edm::getName(), h00_, h01_, h02_, h03_, h04_, h05_, h06_, h07_, h08_, h09_, h_, hmem_, i, ecalpyutils::ism(), meg01_, meg02_, prefixME_, DQMStore::removeElement(), DQMStore::setCurrentFolder(), and superModules_.
Referenced by endJob(), and endRun().
{ if ( ! enableCleanup_ ) return; if ( cloneME_ ) { if ( h00_ ) delete h00_; } h00_ = 0; for ( unsigned int i=0; i<superModules_.size(); i++ ) { int ism = superModules_[i]; if ( cloneME_ ) { if ( h_[ism-1] ) delete h_[ism-1]; if ( hmem_[ism-1] ) delete hmem_[ism-1]; if ( h01_[ism-1] ) delete h01_[ism-1]; if ( h02_[ism-1] ) delete h02_[ism-1]; if ( h03_[ism-1] ) delete h03_[ism-1]; if ( h04_[ism-1] ) delete h04_[ism-1]; if ( h05_[ism-1] ) delete h05_[ism-1]; if ( h06_[ism-1] ) delete h06_[ism-1]; if ( h07_[ism-1] ) delete h07_[ism-1]; if ( h08_[ism-1] ) delete h08_[ism-1]; if ( h09_[ism-1] ) delete h09_[ism-1]; } h_[ism-1] = 0; hmem_[ism-1] = 0; h01_[ism-1] = 0; h02_[ism-1] = 0; h03_[ism-1] = 0; h04_[ism-1] = 0; h05_[ism-1] = 0; h06_[ism-1] = 0; h07_[ism-1] = 0; h08_[ism-1] = 0; h09_[ism-1] = 0; } dqmStore_->setCurrentFolder( prefixME_ + "/EBIntegrityClient" ); for ( unsigned int i=0; i<superModules_.size(); i++ ) { int ism = superModules_[i]; if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() ); meg01_[ism-1] = 0; if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() ); meg02_[ism-1] = 0; } }
void EBIntegrityClient::endJob | ( | void | ) | [virtual] |
void EBIntegrityClient::endRun | ( | void | ) | [virtual] |
int EBIntegrityClient::getEvtPerJob | ( | void | ) | [inline, virtual] |
Get Functions.
Implements EBClient.
Definition at line 72 of file EBIntegrityClient.h.
References ievt_.
{ return ievt_; }
int EBIntegrityClient::getEvtPerRun | ( | void | ) | [inline, virtual] |
void EBIntegrityClient::setup | ( | void | ) | [virtual] |
Setup.
Implements EBClient.
Definition at line 143 of file EBIntegrityClient.cc.
References DQMStore::book2D(), dqmStore_, edm::getName(), i, ecalpyutils::ism(), meg01_, meg02_, mergeVDriftHistosByStation::name, prefixME_, DQMStore::removeElement(), MonitorElement::Reset(), Numbers::sEB(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), and superModules_.
Referenced by beginRun().
{ std::string name; dqmStore_->setCurrentFolder( prefixME_ + "/EBIntegrityClient" ); for ( unsigned int i=0; i<superModules_.size(); i++ ) { int ism = superModules_[i]; if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() ); name = "EBIT data integrity quality " + Numbers::sEB(ism); meg01_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.); meg01_[ism-1]->setAxisTitle("ieta", 1); meg01_[ism-1]->setAxisTitle("iphi", 2); if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() ); name = "EBIT data integrity quality MEM " + Numbers::sEB(ism); meg02_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 5, 0.,5.); meg02_[ism-1]->setAxisTitle("pseudo-strip", 1); meg02_[ism-1]->setAxisTitle("channel", 2); } for ( unsigned int i=0; i<superModules_.size(); i++ ) { int ism = superModules_[i]; if ( meg01_[ism-1] ) meg01_[ism-1]->Reset(); if ( meg02_[ism-1] ) meg02_[ism-1]->Reset(); for ( int ie = 1; ie <= 85; ie++ ) { for ( int ip = 1; ip <= 20; ip++ ) { if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ie, ip, 2. ); } } for ( int ie = 1; ie <= 10; ie++ ) { for ( int ip = 1; ip <= 5; ip++ ) { if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ie, ip, 2. ); } } } }
friend class EBSummaryClient [friend] |
Definition at line 35 of file EBIntegrityClient.h.
const int EBIntegrityClient::chNum [static, private] |
{ { 1, 2, 3, 4, 5}, {10, 9, 8, 7, 6}, {11, 12, 13, 14, 15}, {20, 19, 18, 17, 16}, {21, 22, 23, 24, 25} }
Definition at line 115 of file EBIntegrityClient.h.
bool EBIntegrityClient::cloneME_ [private] |
Definition at line 80 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
bool EBIntegrityClient::debug_ [private] |
Definition at line 83 of file EBIntegrityClient.h.
Referenced by analyze(), beginJob(), beginRun(), EBIntegrityClient(), endJob(), and endRun().
DQMStore* EBIntegrityClient::dqmStore_ [private] |
Definition at line 91 of file EBIntegrityClient.h.
Referenced by analyze(), beginJob(), cleanup(), and setup().
bool EBIntegrityClient::enableCleanup_ [private] |
Definition at line 87 of file EBIntegrityClient.h.
Referenced by cleanup(), and EBIntegrityClient().
TH1F* EBIntegrityClient::h00_ [private] |
Definition at line 93 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h01_[36] [private] |
Definition at line 95 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h02_[36] [private] |
Definition at line 96 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h03_[36] [private] |
Definition at line 97 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h04_[36] [private] |
Definition at line 98 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h05_[36] [private] |
Definition at line 99 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h06_[36] [private] |
Definition at line 100 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h07_[36] [private] |
Definition at line 101 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h08_[36] [private] |
Definition at line 102 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h09_[36] [private] |
Definition at line 103 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::h_[36] [private] |
Definition at line 108 of file EBIntegrityClient.h.
Referenced by EBSummaryClient::analyze(), analyze(), cleanup(), and EBIntegrityClient().
TH2F* EBIntegrityClient::hmem_[36] [private] |
Definition at line 109 of file EBIntegrityClient.h.
Referenced by EBSummaryClient::analyze(), analyze(), cleanup(), and EBIntegrityClient().
int EBIntegrityClient::ievt_ [private] |
Definition at line 77 of file EBIntegrityClient.h.
Referenced by analyze(), beginJob(), endJob(), and getEvtPerJob().
int EBIntegrityClient::jevt_ [private] |
Definition at line 78 of file EBIntegrityClient.h.
Referenced by analyze(), beginJob(), beginRun(), endRun(), and getEvtPerRun().
MonitorElement* EBIntegrityClient::meg01_[36] [private] |
Definition at line 105 of file EBIntegrityClient.h.
Referenced by EBSummaryClient::analyze(), analyze(), cleanup(), EBIntegrityClient(), and setup().
MonitorElement* EBIntegrityClient::meg02_[36] [private] |
Definition at line 106 of file EBIntegrityClient.h.
Referenced by EBSummaryClient::analyze(), analyze(), cleanup(), EBIntegrityClient(), and setup().
std::string EBIntegrityClient::prefixME_ [private] |
Definition at line 85 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), EBIntegrityClient(), and setup().
std::vector<int> EBIntegrityClient::superModules_ [private] |
Definition at line 89 of file EBIntegrityClient.h.
Referenced by analyze(), cleanup(), EBIntegrityClient(), and setup().
float EBIntegrityClient::threshCry_ [private] |
Definition at line 113 of file EBIntegrityClient.h.
Referenced by analyze(), and EBIntegrityClient().
bool EBIntegrityClient::verbose_ [private] |
Definition at line 82 of file EBIntegrityClient.h.
Referenced by EBIntegrityClient().