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_
 
float RMSThresholdInternal_
 
std::string subfolder_
 
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 39 of file EEPedestalOnlineClient.cc.

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

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

Destructor.

Definition at line 90 of file EEPedestalOnlineClient.cc.

90  {
91 
92 }

Member Function Documentation

void EEPedestalOnlineClient::analyze ( void  )
virtual

Analyze.

Implements EEClient.

Definition at line 323 of file EEPedestalOnlineClient.cc.

References abs, cloneME_, gather_cfg::cout, debug_, discrepancyMean_, dqmStore_, EcalEndcap, expectedMean_, MonitorElement::Fill(), DQMStore::get(), UtilsClient::getBinStatistics(), UtilsClient::getHisto(), h03_, 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_, CosmicsPD_Skims::radius, MonitorElement::Reset(), RMSThreshold_, RMSThresholdInternal_, Numbers::sEE(), MonitorElement::setBinContent(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, subfolder_, superModules_, and Numbers::validEE().

323  {
324 
325  ievt_++;
326  jevt_++;
327  if ( ievt_ % 10 == 0 ) {
328  if ( debug_ ) std::cout << "EEPedestalOnlineClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
329  }
330 
331  uint32_t bits03 = 0;
334 
335  std::string subdir(subfolder_.size() ? subfolder_ + "/" : "");
336 
337  MonitorElement* me;
338 
339  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
340 
341  int ism = superModules_[i];
342 
343  me = dqmStore_->get( prefixME_ + "/EEPedestalOnlineTask/" + subdir + "Gain12/EEPOT pedestal " + Numbers::sEE(ism) + " G12" );
344  h03_[ism-1] = UtilsClient::getHisto( me, cloneME_, h03_[ism-1] );
345 
346  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
347  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
348  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
349 
350  for ( int ix = 1; ix <= 50; ix++ ) {
351  for ( int iy = 1; iy <= 50; iy++ ) {
352 
353  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ix, iy, 6.);
354 
355  int jx = ix + Numbers::ix0EE(ism);
356  int jy = iy + Numbers::iy0EE(ism);
357 
358  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
359 
360  if ( Numbers::validEE(ism, jx, jy) ) {
361  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2. );
362  }
363 
364  // OOT pileup affects the region near beam pipe mostly. Use higher threshold for these crystals
365  float radius = std::sqrt((jx-50.)*(jx-50.)+(jy-50.)*(jy-50.));
366 
367  bool update03;
368 
369  float num03;
370  float mean03;
371  float rms03;
372 
373  update03 = UtilsClient::getBinStatistics(h03_[ism-1], ix, iy, num03, mean03, rms03);
374 
375  if ( update03 ) {
376 
377  float val;
378 
379  val = 1.;
380  if ( std::abs(mean03 - expectedMean_) > discrepancyMean_ )
381  val = 0.;
382  if ( (radius >= 20. && rms03 > RMSThreshold_) || (radius < 20. && rms03 > RMSThresholdInternal_) )
383  val = 0.;
384  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ix, iy, val);
385 
386  if ( mep03_[ism-1] ) mep03_[ism-1]->Fill(mean03);
387  if ( mer03_[ism-1] ) mer03_[ism-1]->Fill(rms03);
388 
389  }
390 
391  if ( Masks::maskChannel(ism, ix, iy, bits03, EcalEndcap) ) UtilsClient::maskBinContent( meg03_[ism-1], ix, iy );
392 
393  }
394  }
395 
396  }
397 
398 }
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:226
int i
Definition: DBlmapReader.cc:9
static bool validEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:832
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 T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:91
MonitorElement * mer03_[18]
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
#define abs(x)
Definition: mlp_lapack.h:159
MonitorElement * meg03_[18]
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:773
static void maskBinContent(const MonitorElement *me, const int ix, const int iy)
Mask the bin content.
Definition: UtilsClient.cc:231
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:812
void Fill(long long x)
MonitorElement * mep03_[18]
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
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
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 EEPedestalOnlineClient::beginJob ( void  )
virtual

BeginJob.

Implements EEClient.

Definition at line 94 of file EEPedestalOnlineClient.cc.

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

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

BeginRun.

Implements EEClient.

Definition at line 105 of file EEPedestalOnlineClient.cc.

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

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

Cleanup.

Implements EEClient.

Definition at line 193 of file EEPedestalOnlineClient.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().

193  {
194 
195  if ( ! enableCleanup_ ) return;
196 
197  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
198 
199  int ism = superModules_[i];
200 
201  if ( cloneME_ ) {
202  if ( h03_[ism-1] ) delete h03_[ism-1];
203  }
204 
205  h03_[ism-1] = 0;
206 
207  }
208 
209  dqmStore_->setCurrentFolder( prefixME_ + "/EEPedestalOnlineClient" );
210 
211  if(subfolder_.size())
212  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalOnlineClient/" + subfolder_);
213 
214  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
215 
216  int ism = superModules_[i];
217 
218  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
219  meg03_[ism-1] = 0;
220 
221  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
222  mep03_[ism-1] = 0;
223 
224  if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
225  mer03_[ism-1] = 0;
226 
227  }
228 
229 }
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:2577
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void EEPedestalOnlineClient::endJob ( void  )
virtual

EndJob.

Implements EEClient.

Definition at line 115 of file EEPedestalOnlineClient.cc.

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

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

EndRun.

Implements EEClient.

Definition at line 123 of file EEPedestalOnlineClient.cc.

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

123  {
124 
125  if ( debug_ ) std::cout << "EEPedestalOnlineClient: endRun, jevt = " << jevt_ << std::endl;
126 
127  this->cleanup();
128 
129 }
tuple cout
Definition: gather_cfg.py:121
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 131 of file EEPedestalOnlineClient.cc.

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

Referenced by beginRun().

131  {
132 
134 
135  dqmStore_->setCurrentFolder( prefixME_ + "/EEPedestalOnlineClient" );
136 
137  if(subfolder_.size())
138  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalOnlineClient/" + subfolder_);
139 
140  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
141 
142  int ism = superModules_[i];
143 
144  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
145  name = "EEPOT pedestal quality G12 " + Numbers::sEE(ism);
146  meg03_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
147  meg03_[ism-1]->setAxisTitle("ix", 1);
148  if ( ism >= 1 && ism <= 9 ) meg03_[ism-1]->setAxisTitle("101-ix", 1);
149  meg03_[ism-1]->setAxisTitle("iy", 2);
150 
151  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
152  name = "EEPOT pedestal mean G12 " + Numbers::sEE(ism);
153  mep03_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
154  mep03_[ism-1]->setAxisTitle("mean", 1);
155 
156  if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
157  name = "EEPOT pedestal rms G12 " + Numbers::sEE(ism);
158  mer03_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
159  mer03_[ism-1]->setAxisTitle("rms", 1);
160 
161  }
162 
163  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
164 
165  int ism = superModules_[i];
166 
167  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
168 
169  for ( int ix = 1; ix <= 50; ix++ ) {
170  for ( int iy = 1; iy <= 50; iy++ ) {
171 
172  meg03_[ism-1]->setBinContent( ix, iy, 6. );
173 
174  int jx = ix + Numbers::ix0EE(ism);
175  int jy = iy + Numbers::iy0EE(ism);
176 
177  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
178 
179  if ( Numbers::validEE(ism, jx, jy) ) {
180  meg03_[ism-1]->setBinContent( ix, iy, 2. );
181  }
182 
183  }
184  }
185 
186  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
187  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
188 
189  }
190 
191 }
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:226
int i
Definition: DBlmapReader.cc:9
static bool validEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:832
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:722
MonitorElement * mer03_[18]
MonitorElement * meg03_[18]
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:773
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:812
MonitorElement * mep03_[18]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2577
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:850
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:434

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 106 of file EEPedestalOnlineClient.h.

Referenced by analyze(), and EEPedestalOnlineClient().

DQMStore* EEPedestalOnlineClient::dqmStore_
private

Definition at line 93 of file EEPedestalOnlineClient.h.

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

bool EEPedestalOnlineClient::enableCleanup_
private

Definition at line 89 of file EEPedestalOnlineClient.h.

Referenced by cleanup(), and EEPedestalOnlineClient().

float EEPedestalOnlineClient::expectedMean_
private

Definition at line 105 of file EEPedestalOnlineClient.h.

Referenced by analyze(), and EEPedestalOnlineClient().

TProfile2D* EEPedestalOnlineClient::h03_[18]
private

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

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

MonitorElement* EEPedestalOnlineClient::mer03_[18]
private

Definition at line 101 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 107 of file EEPedestalOnlineClient.h.

Referenced by analyze(), and EEPedestalOnlineClient().

float EEPedestalOnlineClient::RMSThresholdInternal_
private

Definition at line 107 of file EEPedestalOnlineClient.h.

Referenced by analyze(), and EEPedestalOnlineClient().

std::string EEPedestalOnlineClient::subfolder_
private

Definition at line 87 of file EEPedestalOnlineClient.h.

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

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

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