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 33 of file EBPedestalOnlineClient.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 37 of file EBPedestalOnlineClient.cc.

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

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

88  {
89 
90 }

Member Function Documentation

void EBPedestalOnlineClient::analyze ( void  )
virtual

Analyze.

Implements EBClient.

Definition at line 302 of file EBPedestalOnlineClient.cc.

References 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(), subfolder_, and superModules_.

302  {
303 
304  ievt_++;
305  jevt_++;
306  if ( ievt_ % 10 == 0 ) {
307  if ( debug_ ) std::cout << "EBPedestalOnlineClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
308  }
309 
310  uint32_t bits03 = 0;
313 
314  std::string subdir(subfolder_.size() ? subfolder_ + "/" : "");
315 
316  MonitorElement* me;
317 
318  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
319 
320  int ism = superModules_[i];
321 
322  me = dqmStore_->get( prefixME_ + "/EBPedestalOnlineTask/" + subdir + "Gain12/EBPOT pedestal " + Numbers::sEB(ism) + " G12" );
323  h03_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h03_[ism-1] );
324  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
325  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
326  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
327 
328  for ( int ie = 1; ie <= 85; ie++ ) {
329  for ( int ip = 1; ip <= 20; ip++ ) {
330 
331  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, 2.);
332 
333  bool update03;
334 
335  float num03;
336  float mean03;
337  float rms03;
338 
339  update03 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num03, mean03, rms03);
340 
341  if ( update03 ) {
342 
343  float val;
344 
345  val = 1.;
346  if ( std::abs(mean03 - expectedMean_) > discrepancyMean_ )
347  val = 0.;
348  if ( (ie<=40 && rms03 > RMSThreshold_) || (ie>40 && rms03 > RMSThresholdHighEta_) )
349  val = 0.;
350  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, val);
351 
352  if ( mep03_[ism-1] ) mep03_[ism-1]->Fill(mean03);
353  if ( mer03_[ism-1] ) mer03_[ism-1]->Fill(rms03);
354 
355  }
356 
357  if ( Masks::maskChannel(ism, ie, ip, bits03, EcalBarrel) ) UtilsClient::maskBinContent( meg03_[ism-1], ie, ip );
358 
359  }
360  }
361 
362  }
363 
364 }
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:60
MonitorElement * mer03_[36]
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
#define abs(x)
Definition: mlp_lapack.h:159
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)
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
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 92 of file EBPedestalOnlineClient.cc.

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

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

BeginRun.

Implements EBClient.

Definition at line 103 of file EBPedestalOnlineClient.cc.

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

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

Cleanup.

Implements EBClient.

Definition at line 181 of file EBPedestalOnlineClient.cc.

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

Referenced by endJob(), and endRun().

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

EndJob.

Implements EBClient.

Definition at line 113 of file EBPedestalOnlineClient.cc.

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

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

EndRun.

Implements EBClient.

Definition at line 121 of file EBPedestalOnlineClient.cc.

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

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

Get Functions.

Implements EBClient.

Definition at line 72 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 73 of file EBPedestalOnlineClient.h.

References jevt_.

void EBPedestalOnlineClient::setup ( void  )
virtual

Setup.

Implements EBClient.

Definition at line 129 of file EBPedestalOnlineClient.cc.

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

Referenced by beginRun().

129  {
130 
131  std::string name;
132 
133  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient" );
134 
135  if(subfolder_.size())
136  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient/" + subfolder_);
137 
138  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
139 
140  int ism = superModules_[i];
141 
142  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
143  name = "EBPOT pedestal quality G12 " + Numbers::sEB(ism);
144  meg03_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
145  meg03_[ism-1]->setAxisTitle("ieta", 1);
146  meg03_[ism-1]->setAxisTitle("iphi", 2);
147 
148  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
149  name = "EBPOT pedestal mean G12 " + Numbers::sEB(ism);
150  mep03_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
151  mep03_[ism-1]->setAxisTitle("mean", 1);
152 
153  if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
154  name = "EBPOT pedestal rms G12 " + Numbers::sEB(ism);
155  mer03_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
156  mer03_[ism-1]->setAxisTitle("rms", 1);
157 
158  }
159 
160  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
161 
162  int ism = superModules_[i];
163 
164  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
165 
166  for ( int ie = 1; ie <= 85; ie++ ) {
167  for ( int ip = 1; ip <= 20; ip++ ) {
168 
169  meg03_[ism-1]->setBinContent( ie, ip, 2. );
170 
171  }
172  }
173 
174  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
175  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
176 
177  }
178 
179 }
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:717
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
std::vector< int > superModules_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
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:845
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:429

Friends And Related Function Documentation

friend class EBSummaryClient
friend

Definition at line 35 of file EBPedestalOnlineClient.h.

Member Data Documentation

bool EBPedestalOnlineClient::cloneME_
private

Definition at line 80 of file EBPedestalOnlineClient.h.

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

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

Definition at line 106 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

DQMStore* EBPedestalOnlineClient::dqmStore_
private

Definition at line 93 of file EBPedestalOnlineClient.h.

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

bool EBPedestalOnlineClient::enableCleanup_
private

Definition at line 89 of file EBPedestalOnlineClient.h.

Referenced by cleanup(), and EBPedestalOnlineClient().

float EBPedestalOnlineClient::expectedMean_
private

Definition at line 105 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

TProfile2D* EBPedestalOnlineClient::h03_[36]
private

Definition at line 95 of file EBPedestalOnlineClient.h.

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

int EBPedestalOnlineClient::ievt_
private

Definition at line 77 of file EBPedestalOnlineClient.h.

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

int EBPedestalOnlineClient::jevt_
private

Definition at line 78 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 99 of file EBPedestalOnlineClient.h.

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

MonitorElement* EBPedestalOnlineClient::mer03_[36]
private

Definition at line 101 of file EBPedestalOnlineClient.h.

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

std::string EBPedestalOnlineClient::prefixME_
private

Definition at line 85 of file EBPedestalOnlineClient.h.

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

float EBPedestalOnlineClient::RMSThreshold_
private

Definition at line 107 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

float EBPedestalOnlineClient::RMSThresholdHighEta_
private

Definition at line 107 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

std::string EBPedestalOnlineClient::subfolder_
private

Definition at line 87 of file EBPedestalOnlineClient.h.

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

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

Definition at line 91 of file EBPedestalOnlineClient.h.

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

bool EBPedestalOnlineClient::verbose_
private

Definition at line 82 of file EBPedestalOnlineClient.h.

Referenced by EBPedestalOnlineClient().