CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Friends
EBStatusFlagsClient Class Reference

#include <EBStatusFlagsClient.h>

Inheritance diagram for EBStatusFlagsClient:
EBClient

Public Member Functions

void analyze (void)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginRun (void)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
 EBStatusFlagsClient (const edm::ParameterSet &ps)
 Constructor. More...
 
void endJob (void)
 EndJob. More...
 
void endRun (void)
 EndRun. More...
 
int getEvtPerJob ()
 Get Functions. More...
 
int getEvtPerRun ()
 Returns the number of processed events in this Run. More...
 
void setup (void)
 Setup. More...
 
virtual ~EBStatusFlagsClient ()
 Destructor. More...
 
- Public Member Functions inherited from EBClient
virtual ~EBClient (void)
 

Private Attributes

bool cloneME_
 
bool debug_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
TH2F * h01_ [36]
 
TH1F * h02_ [36]
 
TH2F * h03_ [36]
 
int ievt_
 
int jevt_
 
MonitorElementmeh01_ [36]
 
MonitorElementmeh02_ [36]
 
MonitorElementmeh03_ [36]
 
std::string prefixME_
 
std::vector< int > superModules_
 
bool verbose_
 

Friends

class EBSummaryClient
 

Detailed Description

Definition at line 30 of file EBStatusFlagsClient.h.

Constructor & Destructor Documentation

EBStatusFlagsClient::EBStatusFlagsClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 30 of file EBStatusFlagsClient.cc.

References cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), h01_, h02_, h03_, i, ecalpyutils::ism(), meh01_, meh02_, meh03_, prefixME_, AlCaHLTBitMon_QueryRunRegistry::string, superModules_, and verbose_.

30  {
31 
32  // cloneME switch
33  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
34 
35  // verbose switch
36  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
37 
38  // debug switch
39  debug_ = ps.getUntrackedParameter<bool>("debug", false);
40 
41  // prefixME path
42  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
43 
44  // enableCleanup_ switch
45  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
46 
47  // vector of selected Super Modules (Defaults to all 36).
48  superModules_.reserve(36);
49  for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
50  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
51 
52  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
53 
54  int ism = superModules_[i];
55 
56  h01_[ism-1] = 0;
57 
58  meh01_[ism-1] = 0;
59 
60  h02_[ism-1] = 0;
61 
62  meh02_[ism-1] = 0;
63 
64  h03_[ism-1] = 0;
65 
66  meh03_[ism-1] = 0;
67 
68  }
69 
70 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< int > superModules_
MonitorElement * meh03_[36]
MonitorElement * meh01_[36]
MonitorElement * meh02_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
EBStatusFlagsClient::~EBStatusFlagsClient ( )
virtual

Destructor.

Definition at line 72 of file EBStatusFlagsClient.cc.

72  {
73 
74 }

Member Function Documentation

void EBStatusFlagsClient::analyze ( void  )
virtual

Analyze.

Implements EBClient.

Definition at line 173 of file EBStatusFlagsClient.cc.

References cloneME_, gather_cfg::cout, debug_, dqmStore_, EcalBarrel, DQMStore::get(), UtilsClient::getHisto(), h01_, h02_, h03_, i, ievt_, jevt_, Masks::maskChannel(), Masks::maskPn(), meh01_, meh02_, meh03_, prefixME_, Numbers::sEB(), MonitorElement::setBinError(), EcalDQMStatusHelper::STATUS_FLAG_ERROR, and superModules_.

173  {
174 
175  ievt_++;
176  jevt_++;
177  if ( ievt_ % 10 == 0 ) {
178  if ( debug_ ) std::cout << "EBStatusFlagsClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
179  }
180 
181  uint32_t bits01 = 0;
183 
184  MonitorElement* me;
185 
186  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
187 
188  int ism = superModules_[i];
189 
190  me = dqmStore_->get( prefixME_ + "/EBStatusFlagsTask/FEStatus/EBSFT front-end status " + Numbers::sEB(ism) );
191  h01_[ism-1] = UtilsClient::getHisto( me, cloneME_, h01_[ism-1] );
192  meh01_[ism-1] = me;
193 
194  me = dqmStore_->get( prefixME_ + "/EBStatusFlagsTask/FEStatus/EBSFT front-end status bits " + Numbers::sEB(ism) );
195  h02_[ism-1] = UtilsClient::getHisto( me, cloneME_, h02_[ism-1] );
196  meh02_[ism-1] = me;
197 
198  me = dqmStore_->get( prefixME_ + "/EBStatusFlagsTask/FEStatus/EBSFT MEM front-end status " + Numbers::sEB(ism) );
199  h03_[ism-1] = UtilsClient::getHisto( me, cloneME_, h01_[ism-1] );
200  meh03_[ism-1] = me;
201 
202  for ( int ie = 1; ie <= 85; ie++ ) {
203  for ( int ip = 1; ip <= 20; ip++ ) {
204  if ( Masks::maskChannel(ism, ie, ip, bits01, EcalBarrel) ) {
205  int iet = (ie-1)/5 + 1;
206  int ipt = (ip-1)/5 + 1;
207  if ( meh01_[ism-1] ) meh01_[ism-1]->setBinError( iet, ipt, 0.01 );
208  }
209  }
210  }
211 
212  for ( int i = 1; i <= 10; i++ ) {
213  if ( Masks::maskPn(ism, i, bits01, EcalBarrel) ) {
214  int it = (i-1)/5 + 1;
215  if ( meh03_[ism-1] ) meh03_[ism-1]->setBinError( it, 1, 0.01 );
216  }
217  }
218 
219  }
220 
221 }
int i
Definition: DBlmapReader.cc:9
static bool maskChannel(int ism, int i1, int i2, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:57
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:89
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
std::vector< int > superModules_
static bool maskPn(int ism, int i1, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:109
static const int STATUS_FLAG_ERROR
MonitorElement * meh03_[36]
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * meh01_[36]
MonitorElement * meh02_[36]
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
tuple cout
Definition: gather_cfg.py:121
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void EBStatusFlagsClient::beginJob ( void  )
virtual

BeginJob.

Implements EBClient.

Definition at line 76 of file EBStatusFlagsClient.cc.

References gather_cfg::cout, debug_, dqmStore_, ievt_, jevt_, and cppFunctionSkipper::operator.

76  {
77 
79 
80  if ( debug_ ) std::cout << "EBStatusFlagsClient: beginJob" << std::endl;
81 
82  ievt_ = 0;
83  jevt_ = 0;
84 
85 }
tuple cout
Definition: gather_cfg.py:121
void EBStatusFlagsClient::beginRun ( void  )
virtual

BeginRun.

Implements EBClient.

Definition at line 87 of file EBStatusFlagsClient.cc.

References gather_cfg::cout, debug_, jevt_, and setup().

87  {
88 
89  if ( debug_ ) std::cout << "EBStatusFlagsClient: beginRun" << std::endl;
90 
91  jevt_ = 0;
92 
93  this->setup();
94 
95 }
void setup(void)
Setup.
tuple cout
Definition: gather_cfg.py:121
void EBStatusFlagsClient::cleanup ( void  )
virtual

Cleanup.

Implements EBClient.

Definition at line 119 of file EBStatusFlagsClient.cc.

References cloneME_, dqmStore_, enableCleanup_, h01_, h02_, h03_, i, ecalpyutils::ism(), meh01_, meh02_, meh03_, prefixME_, DQMStore::setCurrentFolder(), and superModules_.

Referenced by endJob(), and endRun().

119  {
120 
121  if ( ! enableCleanup_ ) return;
122 
123  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
124 
125  int ism = superModules_[i];
126 
127  if ( cloneME_ ) {
128  if ( h01_[ism-1] ) delete h01_[ism-1];
129  if ( h02_[ism-1] ) delete h02_[ism-1];
130  if ( h03_[ism-1] ) delete h03_[ism-1];
131  }
132 
133  h01_[ism-1] = 0;
134  h02_[ism-1] = 0;
135  h03_[ism-1] = 0;
136 
137  meh01_[ism-1] = 0;
138  meh02_[ism-1] = 0;
139  meh03_[ism-1] = 0;
140 
141  }
142 
143  dqmStore_->setCurrentFolder( prefixME_ + "/EBStatusFlagsClient" );
144 
145 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > superModules_
MonitorElement * meh03_[36]
MonitorElement * meh01_[36]
MonitorElement * meh02_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void EBStatusFlagsClient::endJob ( void  )
virtual

EndJob.

Implements EBClient.

Definition at line 97 of file EBStatusFlagsClient.cc.

References cleanup(), gather_cfg::cout, debug_, and ievt_.

97  {
98 
99  if ( debug_ ) std::cout << "EBStatusFlagsClient: endJob, ievt = " << ievt_ << std::endl;
100 
101  this->cleanup();
102 
103 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
void EBStatusFlagsClient::endRun ( void  )
virtual

EndRun.

Implements EBClient.

Definition at line 105 of file EBStatusFlagsClient.cc.

References cleanup(), gather_cfg::cout, debug_, and jevt_.

105  {
106 
107  if ( debug_ ) std::cout << "EBStatusFlagsClient: endRun, jevt = " << jevt_ << std::endl;
108 
109  this->cleanup();
110 
111 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
int EBStatusFlagsClient::getEvtPerJob ( void  )
inlinevirtual

Get Functions.

Implements EBClient.

Definition at line 69 of file EBStatusFlagsClient.h.

References ievt_.

69 { return ievt_; }
int EBStatusFlagsClient::getEvtPerRun ( void  )
inlinevirtual

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 70 of file EBStatusFlagsClient.h.

References jevt_.

70 { return jevt_; }
void EBStatusFlagsClient::setup ( void  )
virtual

Setup.

Implements EBClient.

Definition at line 113 of file EBStatusFlagsClient.cc.

References dqmStore_, prefixME_, and DQMStore::setCurrentFolder().

Referenced by beginRun().

113  {
114 
115  dqmStore_->setCurrentFolder( prefixME_ + "/EBStatusFlagsClient" );
116 
117 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584

Friends And Related Function Documentation

friend class EBSummaryClient
friend

Definition at line 32 of file EBStatusFlagsClient.h.

Member Data Documentation

bool EBStatusFlagsClient::cloneME_
private

Definition at line 77 of file EBStatusFlagsClient.h.

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

bool EBStatusFlagsClient::debug_
private

Definition at line 80 of file EBStatusFlagsClient.h.

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

DQMStore* EBStatusFlagsClient::dqmStore_
private

Definition at line 88 of file EBStatusFlagsClient.h.

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

bool EBStatusFlagsClient::enableCleanup_
private

Definition at line 84 of file EBStatusFlagsClient.h.

Referenced by cleanup(), and EBStatusFlagsClient().

TH2F* EBStatusFlagsClient::h01_[36]
private

Definition at line 92 of file EBStatusFlagsClient.h.

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

TH1F* EBStatusFlagsClient::h02_[36]
private

Definition at line 96 of file EBStatusFlagsClient.h.

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

TH2F* EBStatusFlagsClient::h03_[36]
private

Definition at line 100 of file EBStatusFlagsClient.h.

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

int EBStatusFlagsClient::ievt_
private

Definition at line 74 of file EBStatusFlagsClient.h.

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

int EBStatusFlagsClient::jevt_
private

Definition at line 75 of file EBStatusFlagsClient.h.

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

MonitorElement* EBStatusFlagsClient::meh01_[36]
private
MonitorElement* EBStatusFlagsClient::meh02_[36]
private

Definition at line 94 of file EBStatusFlagsClient.h.

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

MonitorElement* EBStatusFlagsClient::meh03_[36]
private

Definition at line 98 of file EBStatusFlagsClient.h.

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

std::string EBStatusFlagsClient::prefixME_
private

Definition at line 82 of file EBStatusFlagsClient.h.

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

std::vector<int> EBStatusFlagsClient::superModules_
private

Definition at line 86 of file EBStatusFlagsClient.h.

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

bool EBStatusFlagsClient::verbose_
private

Definition at line 79 of file EBStatusFlagsClient.h.

Referenced by EBStatusFlagsClient().