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

#include <EEPedestalOnlineClient.h>

Inheritance diagram for EEPedestalOnlineClient:
EEClient

Public Member Functions

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

Private Attributes

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

Friends

class EESummaryClient
 

Detailed Description

Definition at line 33 of file EEPedestalOnlineClient.h.

Constructor & Destructor Documentation

EEPedestalOnlineClient::EEPedestalOnlineClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 38 of file EEPedestalOnlineClient.cc.

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

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

Destructor.

Definition at line 86 of file EEPedestalOnlineClient.cc.

86  {
87 
88 }

Member Function Documentation

void EEPedestalOnlineClient::analyze ( void  )
virtual

Analyze.

Implements EEClient.

Definition at line 313 of file EEPedestalOnlineClient.cc.

References abs, cloneME_, gather_cfg::cout, debug_, discrepancyMean_, dqmStore_, EcalEndcap, expectedMean_, MonitorElement::Fill(), DQMStore::get(), UtilsClient::getBinStatistics(), h03_, trackerHits::histo, i, ievt_, Numbers::ix0EE(), Numbers::iy0EE(), 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_, Numbers::sEE(), MonitorElement::setBinContent(), superModules_, and Numbers::validEE().

313  {
314 
315  ievt_++;
316  jevt_++;
317  if ( ievt_ % 10 == 0 ) {
318  if ( debug_ ) std::cout << "EEPedestalOnlineClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
319  }
320 
321  uint32_t bits03 = 0;
324 
325  char histo[200];
326 
327  MonitorElement* me;
328 
329  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
330 
331  int ism = superModules_[i];
332 
333  sprintf(histo, (prefixME_ + "/EEPedestalOnlineTask/Gain12/EEPOT pedestal %s G12").c_str(), Numbers::sEE(ism).c_str());
334  me = dqmStore_->get(histo);
335  h03_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h03_[ism-1] );
336 
337  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
338  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
339  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
340 
341  for ( int ix = 1; ix <= 50; ix++ ) {
342  for ( int iy = 1; iy <= 50; iy++ ) {
343 
344  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ix, iy, 6.);
345 
346  int jx = ix + Numbers::ix0EE(ism);
347  int jy = iy + Numbers::iy0EE(ism);
348 
349  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
350 
351  if ( Numbers::validEE(ism, jx, jy) ) {
352  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2. );
353  }
354 
355  bool update03;
356 
357  float num03;
358  float mean03;
359  float rms03;
360 
361  update03 = UtilsClient::getBinStatistics(h03_[ism-1], ix, iy, num03, mean03, rms03);
362 
363  if ( update03 ) {
364 
365  float val;
366 
367  val = 1.;
368  if ( std::abs(mean03 - expectedMean_) > discrepancyMean_ )
369  val = 0.;
370  if ( rms03 > RMSThreshold_ )
371  val = 0.;
372  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ix, iy, val);
373 
374  if ( mep03_[ism-1] ) mep03_[ism-1]->Fill(mean03);
375  if ( mer03_[ism-1] ) mer03_[ism-1]->Fill(rms03);
376 
377  }
378 
379  if ( Masks::maskChannel(ism, ix, iy, bits03, EcalEndcap) ) UtilsClient::maskBinContent( meg03_[ism-1], ix, iy );
380 
381  }
382  }
383 
384  }
385 
386 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< int > superModules_
static bool maskChannel(int ism, int i1, int i2, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:60
static int iy0EE(const int ism)
Definition: Numbers.cc:964
static void maskBinContent(const MonitorElement *me, const int ix, const int iy)
Mask the bin content.
Definition: UtilsClient.h:189
MonitorElement * mer03_[18]
static std::string sEE(const int ism)
Definition: Numbers.cc:199
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
#define abs(x)
Definition: mlp_lapack.h:159
MonitorElement * meg03_[18]
tuple histo
Definition: trackerHits.py:12
void Fill(long long x)
MonitorElement * mep03_[18]
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
static const int PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR
static int ix0EE(const int ism)
Definition: Numbers.cc:946
tuple cout
Definition: gather_cfg.py:41
static bool validEE(const int ism, const int ix, const int iy)
Definition: Numbers.cc:982
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:47
void Reset(void)
reset ME (ie. contents, errors, etc)
static bool getBinStatistics(const T *histo, const int ix, const int iy, float &num, float &mean, float &rms)
Returns true if the bin contains good statistical data.
Definition: UtilsClient.h:133
void EEPedestalOnlineClient::beginJob ( void  )
virtual

BeginJob.

Implements EEClient.

Definition at line 90 of file EEPedestalOnlineClient.cc.

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

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

BeginRun.

Implements EEClient.

Definition at line 101 of file EEPedestalOnlineClient.cc.

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

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

Cleanup.

Implements EEClient.

Definition at line 186 of file EEPedestalOnlineClient.cc.

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

Referenced by endJob(), and endRun().

186  {
187 
188  if ( ! enableCleanup_ ) return;
189 
190  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
191 
192  int ism = superModules_[i];
193 
194  if ( cloneME_ ) {
195  if ( h03_[ism-1] ) delete h03_[ism-1];
196  }
197 
198  h03_[ism-1] = 0;
199 
200  }
201 
202  dqmStore_->setCurrentFolder( prefixME_ + "/EEPedestalOnlineClient" );
203 
204  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
205 
206  int ism = superModules_[i];
207 
208  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
209  meg03_[ism-1] = 0;
210 
211  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
212  mep03_[ism-1] = 0;
213 
214  if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
215  mer03_[ism-1] = 0;
216 
217  }
218 
219 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > superModules_
MonitorElement * mer03_[18]
MonitorElement * meg03_[18]
MonitorElement * mep03_[18]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2338
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:47
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
void EEPedestalOnlineClient::endJob ( void  )
virtual

EndJob.

Implements EEClient.

Definition at line 111 of file EEPedestalOnlineClient.cc.

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

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

EndRun.

Implements EEClient.

Definition at line 119 of file EEPedestalOnlineClient.cc.

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

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

Get Functions.

Implements EEClient.

Definition at line 72 of file EEPedestalOnlineClient.h.

References ievt_.

int EEPedestalOnlineClient::getEvtPerRun ( void  )
inlinevirtual

Returns the number of processed events in this Run.

Implements EEClient.

Definition at line 73 of file EEPedestalOnlineClient.h.

References jevt_.

void EEPedestalOnlineClient::setup ( void  )
virtual

Setup.

Implements EEClient.

Definition at line 127 of file EEPedestalOnlineClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), dqmStore_, edm::getName(), trackerHits::histo, i, ecalpyutils::ism(), Numbers::ix0EE(), Numbers::iy0EE(), meg03_, mep03_, mer03_, prefixME_, DQMStore::removeElement(), MonitorElement::Reset(), Numbers::sEE(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), superModules_, and Numbers::validEE().

Referenced by beginRun().

127  {
128 
129  char histo[200];
130 
131  dqmStore_->setCurrentFolder( prefixME_ + "/EEPedestalOnlineClient" );
132 
133  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
134 
135  int ism = superModules_[i];
136 
137  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
138  sprintf(histo, "EEPOT pedestal quality G12 %s", Numbers::sEE(ism).c_str());
139  meg03_[ism-1] = dqmStore_->book2D(histo, histo, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
140  meg03_[ism-1]->setAxisTitle("ix", 1);
141  if ( ism >= 1 && ism <= 9 ) meg03_[ism-1]->setAxisTitle("101-ix", 1);
142  meg03_[ism-1]->setAxisTitle("iy", 2);
143 
144  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
145  sprintf(histo, "EEPOT pedestal mean G12 %s", Numbers::sEE(ism).c_str());
146  mep03_[ism-1] = dqmStore_->book1D(histo, histo, 100, 150., 250.);
147  mep03_[ism-1]->setAxisTitle("mean", 1);
148 
149  if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
150  sprintf(histo, "EEPOT pedestal rms G12 %s", Numbers::sEE(ism).c_str());
151  mer03_[ism-1] = dqmStore_->book1D(histo, histo, 100, 0., 10.);
152  mer03_[ism-1]->setAxisTitle("rms", 1);
153 
154  }
155 
156  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
157 
158  int ism = superModules_[i];
159 
160  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
161 
162  for ( int ix = 1; ix <= 50; ix++ ) {
163  for ( int iy = 1; iy <= 50; iy++ ) {
164 
165  meg03_[ism-1]->setBinContent( ix, iy, 6. );
166 
167  int jx = ix + Numbers::ix0EE(ism);
168  int jy = iy + Numbers::iy0EE(ism);
169 
170  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
171 
172  if ( Numbers::validEE(ism, jx, jy) ) {
173  meg03_[ism-1]->setBinContent( ix, iy, 2. );
174  }
175 
176  }
177  }
178 
179  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
180  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
181 
182  }
183 
184 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< int > superModules_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
static int iy0EE(const int ism)
Definition: Numbers.cc:964
MonitorElement * mer03_[18]
static std::string sEE(const int ism)
Definition: Numbers.cc:199
MonitorElement * meg03_[18]
tuple histo
Definition: trackerHits.py:12
MonitorElement * mep03_[18]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2338
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
static int ix0EE(const int ism)
Definition: Numbers.cc:946
static bool validEE(const int ism, const int ix, const int iy)
Definition: Numbers.cc:982
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:647
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:47
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:237

Friends And Related Function Documentation

friend class EESummaryClient
friend

Definition at line 35 of file EEPedestalOnlineClient.h.

Member Data Documentation

bool EEPedestalOnlineClient::cloneME_
private

Definition at line 80 of file EEPedestalOnlineClient.h.

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

bool EEPedestalOnlineClient::debug_
private
float EEPedestalOnlineClient::discrepancyMean_
private

Definition at line 104 of file EEPedestalOnlineClient.h.

Referenced by analyze(), and EEPedestalOnlineClient().

DQMStore* EEPedestalOnlineClient::dqmStore_
private

Definition at line 91 of file EEPedestalOnlineClient.h.

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

bool EEPedestalOnlineClient::enableCleanup_
private

Definition at line 87 of file EEPedestalOnlineClient.h.

Referenced by cleanup(), and EEPedestalOnlineClient().

float EEPedestalOnlineClient::expectedMean_
private

Definition at line 103 of file EEPedestalOnlineClient.h.

Referenced by analyze(), and EEPedestalOnlineClient().

TProfile2D* EEPedestalOnlineClient::h03_[18]
private

Definition at line 93 of file EEPedestalOnlineClient.h.

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

int EEPedestalOnlineClient::ievt_
private

Definition at line 77 of file EEPedestalOnlineClient.h.

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

int EEPedestalOnlineClient::jevt_
private

Definition at line 78 of file EEPedestalOnlineClient.h.

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

MonitorElement* EEPedestalOnlineClient::meg03_[18]
private
MonitorElement* EEPedestalOnlineClient::mep03_[18]
private

Definition at line 97 of file EEPedestalOnlineClient.h.

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

MonitorElement* EEPedestalOnlineClient::mer03_[18]
private

Definition at line 99 of file EEPedestalOnlineClient.h.

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

std::string EEPedestalOnlineClient::prefixME_
private

Definition at line 85 of file EEPedestalOnlineClient.h.

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

float EEPedestalOnlineClient::RMSThreshold_
private

Definition at line 105 of file EEPedestalOnlineClient.h.

Referenced by analyze(), and EEPedestalOnlineClient().

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

Definition at line 89 of file EEPedestalOnlineClient.h.

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

bool EEPedestalOnlineClient::verbose_
private

Definition at line 82 of file EEPedestalOnlineClient.h.

Referenced by EEPedestalOnlineClient().