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 32 of file EBStatusFlagsClient.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 32 of file EBStatusFlagsClient.cc.

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

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

74  {
75 
76 }

Member Function Documentation

void EBStatusFlagsClient::analyze ( void  )
virtual

Analyze.

Implements EBClient.

Definition at line 175 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_.

175  {
176 
177  ievt_++;
178  jevt_++;
179  if ( ievt_ % 10 == 0 ) {
180  if ( debug_ ) std::cout << "EBStatusFlagsClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
181  }
182 
183  uint32_t bits01 = 0;
185 
186  MonitorElement* me;
187 
188  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
189 
190  int ism = superModules_[i];
191 
192  me = dqmStore_->get( prefixME_ + "/EBStatusFlagsTask/FEStatus/EBSFT front-end status " + Numbers::sEB(ism) );
193  h01_[ism-1] = UtilsClient::getHisto( me, cloneME_, h01_[ism-1] );
194  meh01_[ism-1] = me;
195 
196  me = dqmStore_->get( prefixME_ + "/EBStatusFlagsTask/FEStatus/EBSFT front-end status bits " + Numbers::sEB(ism) );
197  h02_[ism-1] = UtilsClient::getHisto( me, cloneME_, h02_[ism-1] );
198  meh02_[ism-1] = me;
199 
200  me = dqmStore_->get( prefixME_ + "/EBStatusFlagsTask/FEStatus/EBSFT MEM front-end status " + Numbers::sEB(ism) );
201  h03_[ism-1] = UtilsClient::getHisto( me, cloneME_, h01_[ism-1] );
202  meh03_[ism-1] = me;
203 
204  for ( int ie = 1; ie <= 85; ie++ ) {
205  for ( int ip = 1; ip <= 20; ip++ ) {
206  if ( Masks::maskChannel(ism, ie, ip, bits01, EcalBarrel) ) {
207  int iet = (ie-1)/5 + 1;
208  int ipt = (ip-1)/5 + 1;
209  if ( meh01_[ism-1] ) meh01_[ism-1]->setBinError( iet, ipt, 0.01 );
210  }
211  }
212  }
213 
214  for ( int i = 1; i <= 10; i++ ) {
215  if ( Masks::maskPn(ism, i, bits01, EcalBarrel) ) {
216  int it = (i-1)/5 + 1;
217  if ( meh03_[ism-1] ) meh03_[ism-1]->setBinError( it, 1, 0.01 );
218  }
219  }
220 
221  }
222 
223 }
int i
Definition: DBlmapReader.cc:9
static bool maskChannel(int ism, int i1, int i2, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:60
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:91
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
std::vector< int > superModules_
static bool maskPn(int ism, int i1, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:112
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:1468
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 78 of file EBStatusFlagsClient.cc.

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

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

BeginRun.

Implements EBClient.

Definition at line 89 of file EBStatusFlagsClient.cc.

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

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

Cleanup.

Implements EBClient.

Definition at line 121 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().

121  {
122 
123  if ( ! enableCleanup_ ) return;
124 
125  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
126 
127  int ism = superModules_[i];
128 
129  if ( cloneME_ ) {
130  if ( h01_[ism-1] ) delete h01_[ism-1];
131  if ( h02_[ism-1] ) delete h02_[ism-1];
132  if ( h03_[ism-1] ) delete h03_[ism-1];
133  }
134 
135  h01_[ism-1] = 0;
136  h02_[ism-1] = 0;
137  h03_[ism-1] = 0;
138 
139  meh01_[ism-1] = 0;
140  meh02_[ism-1] = 0;
141  meh03_[ism-1] = 0;
142 
143  }
144 
145  dqmStore_->setCurrentFolder( prefixME_ + "/EBStatusFlagsClient" );
146 
147 }
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:429
void EBStatusFlagsClient::endJob ( void  )
virtual

EndJob.

Implements EBClient.

Definition at line 99 of file EBStatusFlagsClient.cc.

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

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

EndRun.

Implements EBClient.

Definition at line 107 of file EBStatusFlagsClient.cc.

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

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

Get Functions.

Implements EBClient.

Definition at line 71 of file EBStatusFlagsClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 72 of file EBStatusFlagsClient.h.

References jevt_.

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

Setup.

Implements EBClient.

Definition at line 115 of file EBStatusFlagsClient.cc.

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

Referenced by beginRun().

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

Friends And Related Function Documentation

friend class EBSummaryClient
friend

Definition at line 34 of file EBStatusFlagsClient.h.

Member Data Documentation

bool EBStatusFlagsClient::cloneME_
private

Definition at line 79 of file EBStatusFlagsClient.h.

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

bool EBStatusFlagsClient::debug_
private

Definition at line 82 of file EBStatusFlagsClient.h.

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

DQMStore* EBStatusFlagsClient::dqmStore_
private

Definition at line 90 of file EBStatusFlagsClient.h.

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

bool EBStatusFlagsClient::enableCleanup_
private

Definition at line 86 of file EBStatusFlagsClient.h.

Referenced by cleanup(), and EBStatusFlagsClient().

TH2F* EBStatusFlagsClient::h01_[36]
private

Definition at line 94 of file EBStatusFlagsClient.h.

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

TH1F* EBStatusFlagsClient::h02_[36]
private

Definition at line 98 of file EBStatusFlagsClient.h.

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

TH2F* EBStatusFlagsClient::h03_[36]
private

Definition at line 102 of file EBStatusFlagsClient.h.

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

int EBStatusFlagsClient::ievt_
private

Definition at line 76 of file EBStatusFlagsClient.h.

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

int EBStatusFlagsClient::jevt_
private

Definition at line 77 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 96 of file EBStatusFlagsClient.h.

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

MonitorElement* EBStatusFlagsClient::meh03_[36]
private

Definition at line 100 of file EBStatusFlagsClient.h.

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

std::string EBStatusFlagsClient::prefixME_
private

Definition at line 84 of file EBStatusFlagsClient.h.

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

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

Definition at line 88 of file EBStatusFlagsClient.h.

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

bool EBStatusFlagsClient::verbose_
private

Definition at line 81 of file EBStatusFlagsClient.h.

Referenced by EBStatusFlagsClient().