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
EBPedestalOnlineClient Class Reference

#include <EBPedestalOnlineClient.h>

Inheritance diagram for EBPedestalOnlineClient:
EBClient

Public Member Functions

void analyze (void)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginRun (void)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
 EBPedestalOnlineClient (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 ~EBPedestalOnlineClient ()
 Destructor. More...
 
- Public Member Functions inherited from EBClient
virtual ~EBClient (void)
 

Private Attributes

bool cloneME_
 
bool debug_
 
float discrepancyMean_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
float expectedMean_
 
TProfile2D * h03_ [36]
 
int ievt_
 
int jevt_
 
MonitorElementmeg03_ [36]
 
MonitorElementmep03_ [36]
 
MonitorElementmer03_ [36]
 
std::string prefixME_
 
float RMSThreshold_
 
float RMSThresholdHighEta_
 
std::string subfolder_
 
std::vector< int > superModules_
 
bool verbose_
 

Friends

class EBSummaryClient
 

Detailed Description

Definition at line 31 of file EBPedestalOnlineClient.h.

Constructor & Destructor Documentation

EBPedestalOnlineClient::EBPedestalOnlineClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 35 of file EBPedestalOnlineClient.cc.

References cloneME_, debug_, discrepancyMean_, enableCleanup_, expectedMean_, edm::ParameterSet::getUntrackedParameter(), h03_, i, ecalpyutils::ism(), meg03_, mep03_, mer03_, prefixME_, RMSThreshold_, RMSThresholdHighEta_, AlCaHLTBitMon_QueryRunRegistry::string, subfolder_, superModules_, and verbose_.

35  {
36 
37  // cloneME switch
38  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
39 
40  // verbose switch
41  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
42 
43  // debug switch
44  debug_ = ps.getUntrackedParameter<bool>("debug", false);
45 
46  // prefixME path
47  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
48 
49  subfolder_ = ps.getUntrackedParameter<std::string>("subfolder", "");
50 
51  // enableCleanup_ switch
52  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
53 
54  // vector of selected Super Modules (Defaults to all 36).
55  superModules_.reserve(36);
56  for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
57  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
58 
59  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
60 
61  int ism = superModules_[i];
62 
63  h03_[ism-1] = 0;
64 
65  }
66 
67  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
68 
69  int ism = superModules_[i];
70 
71  meg03_[ism-1] = 0;
72 
73  mep03_[ism-1] = 0;
74 
75  mer03_[ism-1] = 0;
76 
77  }
78 
79  expectedMean_ = 200.0;
80  discrepancyMean_ = 25.0;
81  RMSThreshold_ = 3.0;
83 
84 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * mer03_[36]
std::vector< int > superModules_
MonitorElement * meg03_[36]
MonitorElement * mep03_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
EBPedestalOnlineClient::~EBPedestalOnlineClient ( )
virtual

Destructor.

Definition at line 86 of file EBPedestalOnlineClient.cc.

86  {
87 
88 }

Member Function Documentation

void EBPedestalOnlineClient::analyze ( void  )
virtual

Analyze.

Implements EBClient.

Definition at line 300 of file EBPedestalOnlineClient.cc.

References funct::abs(), cloneME_, gather_cfg::cout, debug_, discrepancyMean_, dqmStore_, EcalBarrel, expectedMean_, MonitorElement::Fill(), DQMStore::get(), UtilsClient::getBinStatistics(), h03_, i, ievt_, jevt_, UtilsClient::maskBinContent(), Masks::maskChannel(), meg03_, mep03_, mer03_, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, prefixME_, MonitorElement::Reset(), RMSThreshold_, RMSThresholdHighEta_, Numbers::sEB(), MonitorElement::setBinContent(), AlCaHLTBitMon_QueryRunRegistry::string, subfolder_, and superModules_.

300  {
301 
302  ievt_++;
303  jevt_++;
304  if ( ievt_ % 10 == 0 ) {
305  if ( debug_ ) std::cout << "EBPedestalOnlineClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
306  }
307 
308  uint32_t bits03 = 0;
311 
312  std::string subdir(subfolder_.size() ? subfolder_ + "/" : "");
313 
314  MonitorElement* me;
315 
316  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
317 
318  int ism = superModules_[i];
319 
320  me = dqmStore_->get( prefixME_ + "/EBPedestalOnlineTask/" + subdir + "Gain12/EBPOT pedestal " + Numbers::sEB(ism) + " G12" );
321  h03_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h03_[ism-1] );
322  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
323  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
324  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
325 
326  for ( int ie = 1; ie <= 85; ie++ ) {
327  for ( int ip = 1; ip <= 20; ip++ ) {
328 
329  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, 2.);
330 
331  bool update03;
332 
333  float num03;
334  float mean03;
335  float rms03;
336 
337  update03 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num03, mean03, rms03);
338 
339  if ( update03 ) {
340 
341  float val;
342 
343  val = 1.;
344  if ( std::abs(mean03 - expectedMean_) > discrepancyMean_ )
345  val = 0.;
346  if ( (ie<=40 && rms03 > RMSThreshold_) || (ie>40 && rms03 > RMSThresholdHighEta_) )
347  val = 0.;
348  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, val);
349 
350  if ( mep03_[ism-1] ) mep03_[ism-1]->Fill(mean03);
351  if ( mer03_[ism-1] ) mer03_[ism-1]->Fill(rms03);
352 
353  }
354 
355  if ( Masks::maskChannel(ism, ie, ip, bits03, EcalBarrel) ) UtilsClient::maskBinContent( meg03_[ism-1], ie, ip );
356 
357  }
358  }
359 
360  }
361 
362 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
static bool maskChannel(int ism, int i1, int i2, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:57
MonitorElement * mer03_[36]
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
static void maskBinContent(const MonitorElement *me, const int ix, const int iy)
Mask the bin content.
Definition: UtilsClient.cc:231
std::vector< int > superModules_
void Fill(long long x)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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
static bool getBinStatistics(TH1 *histo, const int ix, const int iy, float &num, float &mean, float &rms, float minEntries=1.)
Returns true if the bin contains good statistical data.
Definition: UtilsClient.cc:74
static const int PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR
MonitorElement * meg03_[36]
MonitorElement * mep03_[36]
tuple cout
Definition: gather_cfg.py:121
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void Reset(void)
reset ME (ie. contents, errors, etc)
void EBPedestalOnlineClient::beginJob ( void  )
virtual

BeginJob.

Implements EBClient.

Definition at line 90 of file EBPedestalOnlineClient.cc.

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

90  {
91 
93 
94  if ( debug_ ) std::cout << "EBPedestalOnlineClient: beginJob" << std::endl;
95 
96  ievt_ = 0;
97  jevt_ = 0;
98 
99 }
tuple cout
Definition: gather_cfg.py:121
void EBPedestalOnlineClient::beginRun ( void  )
virtual

BeginRun.

Implements EBClient.

Definition at line 101 of file EBPedestalOnlineClient.cc.

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

101  {
102 
103  if ( debug_ ) std::cout << "EBPedestalOnlineClient: beginRun" << std::endl;
104 
105  jevt_ = 0;
106 
107  this->setup();
108 
109 }
tuple cout
Definition: gather_cfg.py:121
void EBPedestalOnlineClient::cleanup ( void  )
virtual

Cleanup.

Implements EBClient.

Definition at line 179 of file EBPedestalOnlineClient.cc.

References cloneME_, dqmStore_, enableCleanup_, h03_, i, ecalpyutils::ism(), meg03_, mep03_, mer03_, prefixME_, DQMStore::removeElement(), DQMStore::setCurrentFolder(), subfolder_, and superModules_.

Referenced by endJob(), and endRun().

179  {
180 
181  if ( ! enableCleanup_ ) return;
182 
183  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
184 
185  int ism = superModules_[i];
186 
187  if ( cloneME_ ) {
188  if ( h03_[ism-1] ) delete h03_[ism-1];
189  }
190 
191  h03_[ism-1] = 0;
192 
193  }
194 
195  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient" );
196 
197  if(subfolder_.size())
198  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient/" + subfolder_);
199 
200  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
201 
202  int ism = superModules_[i];
203 
204  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
205  meg03_[ism-1] = 0;
206 
207  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
208  mep03_[ism-1] = 0;
209 
210  if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
211  mer03_[ism-1] = 0;
212 
213  }
214 
215 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * mer03_[36]
std::vector< int > superModules_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * meg03_[36]
MonitorElement * mep03_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void EBPedestalOnlineClient::endJob ( void  )
virtual

EndJob.

Implements EBClient.

Definition at line 111 of file EBPedestalOnlineClient.cc.

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

111  {
112 
113  if ( debug_ ) std::cout << "EBPedestalOnlineClient: endJob, ievt = " << ievt_ << std::endl;
114 
115  this->cleanup();
116 
117 }
tuple cout
Definition: gather_cfg.py:121
void EBPedestalOnlineClient::endRun ( void  )
virtual

EndRun.

Implements EBClient.

Definition at line 119 of file EBPedestalOnlineClient.cc.

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

119  {
120 
121  if ( debug_ ) std::cout << "EBPedestalOnlineClient: endRun, jevt = " << jevt_ << std::endl;
122 
123  this->cleanup();
124 
125 }
tuple cout
Definition: gather_cfg.py:121
int EBPedestalOnlineClient::getEvtPerJob ( void  )
inlinevirtual

Get Functions.

Implements EBClient.

Definition at line 70 of file EBPedestalOnlineClient.h.

References ievt_.

int EBPedestalOnlineClient::getEvtPerRun ( void  )
inlinevirtual

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 71 of file EBPedestalOnlineClient.h.

References jevt_.

void EBPedestalOnlineClient::setup ( void  )
virtual

Setup.

Implements EBClient.

Definition at line 127 of file EBPedestalOnlineClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), dqmStore_, i, ecalpyutils::ism(), meg03_, mep03_, mer03_, mergeVDriftHistosByStation::name, prefixME_, DQMStore::removeElement(), MonitorElement::Reset(), Numbers::sEB(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, subfolder_, and superModules_.

Referenced by beginRun().

127  {
128 
130 
131  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient" );
132 
133  if(subfolder_.size())
134  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient/" + subfolder_);
135 
136  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
137 
138  int ism = superModules_[i];
139 
140  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
141  name = "EBPOT pedestal quality G12 " + Numbers::sEB(ism);
142  meg03_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
143  meg03_[ism-1]->setAxisTitle("ieta", 1);
144  meg03_[ism-1]->setAxisTitle("iphi", 2);
145 
146  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
147  name = "EBPOT pedestal mean G12 " + Numbers::sEB(ism);
148  mep03_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
149  mep03_[ism-1]->setAxisTitle("mean", 1);
150 
151  if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
152  name = "EBPOT pedestal rms G12 " + Numbers::sEB(ism);
153  mer03_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
154  mer03_[ism-1]->setAxisTitle("rms", 1);
155 
156  }
157 
158  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
159 
160  int ism = superModules_[i];
161 
162  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
163 
164  for ( int ie = 1; ie <= 85; ie++ ) {
165  for ( int ip = 1; ip <= 20; ip++ ) {
166 
167  meg03_[ism-1]->setBinContent( ie, ip, 2. );
168 
169  }
170  }
171 
172  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
173  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
174 
175  }
176 
177 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * mer03_[36]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
std::vector< int > superModules_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * meg03_[36]
MonitorElement * mep03_[36]
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584

Friends And Related Function Documentation

friend class EBSummaryClient
friend

Definition at line 33 of file EBPedestalOnlineClient.h.

Member Data Documentation

bool EBPedestalOnlineClient::cloneME_
private

Definition at line 78 of file EBPedestalOnlineClient.h.

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

bool EBPedestalOnlineClient::debug_
private
float EBPedestalOnlineClient::discrepancyMean_
private

Definition at line 104 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

DQMStore* EBPedestalOnlineClient::dqmStore_
private

Definition at line 91 of file EBPedestalOnlineClient.h.

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

bool EBPedestalOnlineClient::enableCleanup_
private

Definition at line 87 of file EBPedestalOnlineClient.h.

Referenced by cleanup(), and EBPedestalOnlineClient().

float EBPedestalOnlineClient::expectedMean_
private

Definition at line 103 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

TProfile2D* EBPedestalOnlineClient::h03_[36]
private

Definition at line 93 of file EBPedestalOnlineClient.h.

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

int EBPedestalOnlineClient::ievt_
private

Definition at line 75 of file EBPedestalOnlineClient.h.

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

int EBPedestalOnlineClient::jevt_
private

Definition at line 76 of file EBPedestalOnlineClient.h.

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

MonitorElement* EBPedestalOnlineClient::meg03_[36]
private
MonitorElement* EBPedestalOnlineClient::mep03_[36]
private

Definition at line 97 of file EBPedestalOnlineClient.h.

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

MonitorElement* EBPedestalOnlineClient::mer03_[36]
private

Definition at line 99 of file EBPedestalOnlineClient.h.

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

std::string EBPedestalOnlineClient::prefixME_
private

Definition at line 83 of file EBPedestalOnlineClient.h.

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

float EBPedestalOnlineClient::RMSThreshold_
private

Definition at line 105 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

float EBPedestalOnlineClient::RMSThresholdHighEta_
private

Definition at line 105 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

std::string EBPedestalOnlineClient::subfolder_
private

Definition at line 85 of file EBPedestalOnlineClient.h.

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

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

Definition at line 89 of file EBPedestalOnlineClient.h.

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

bool EBPedestalOnlineClient::verbose_
private

Definition at line 80 of file EBPedestalOnlineClient.h.

Referenced by EBPedestalOnlineClient().