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::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_, 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  // enableCleanup_ switch
54  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
55 
56  // vector of selected Super Modules (Defaults to all 18).
57  superModules_.reserve(18);
58  for ( unsigned int i = 1; i <= 18; 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_ = 4.0;
85 
86 }
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 88 of file EEPedestalOnlineClient.cc.

88  {
89 
90 }

Member Function Documentation

void EEPedestalOnlineClient::analyze ( void  )
virtual

Analyze.

Implements EEClient.

Definition at line 315 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(), superModules_, and Numbers::validEE().

315  {
316 
317  ievt_++;
318  jevt_++;
319  if ( ievt_ % 10 == 0 ) {
320  if ( debug_ ) std::cout << "EEPedestalOnlineClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
321  }
322 
323  uint32_t bits03 = 0;
326 
327  MonitorElement* me;
328 
329  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
330 
331  int ism = superModules_[i];
332 
333  me = dqmStore_->get( prefixME_ + "/EEPedestalOnlineTask/Gain12/EEPOT pedestal " + Numbers::sEE(ism) + " G12" );
334  h03_[ism-1] = UtilsClient::getHisto( me, cloneME_, h03_[ism-1] );
335 
336  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
337  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
338  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
339 
340  for ( int ix = 1; ix <= 50; ix++ ) {
341  for ( int iy = 1; iy <= 50; iy++ ) {
342 
343  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ix, iy, 6.);
344 
345  int jx = ix + Numbers::ix0EE(ism);
346  int jy = iy + Numbers::iy0EE(ism);
347 
348  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
349 
350  if ( Numbers::validEE(ism, jx, jy) ) {
351  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2. );
352  }
353 
354  // OOT pileup affects the region near beam pipe mostly. Use higher threshold for these crystals
355  float radius = std::sqrt((jx-50.)*(jx-50.)+(jy-50.)*(jy-50.));
356 
357  bool update03;
358 
359  float num03;
360  float mean03;
361  float rms03;
362 
363  update03 = UtilsClient::getBinStatistics(h03_[ism-1], ix, iy, num03, mean03, rms03);
364 
365  if ( update03 ) {
366 
367  float val;
368 
369  val = 1.;
370  if ( std::abs(mean03 - expectedMean_) > discrepancyMean_ )
371  val = 0.;
372  if ( (radius >= 20. && rms03 > RMSThreshold_) || (radius < 20. && rms03 > RMSThresholdInternal_) )
373  val = 0.;
374  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ix, iy, val);
375 
376  if ( mep03_[ism-1] ) mep03_[ism-1]->Fill(mean03);
377  if ( mer03_[ism-1] ) mer03_[ism-1]->Fill(rms03);
378 
379  }
380 
381  if ( Masks::maskChannel(ism, ix, iy, bits03, EcalEndcap) ) UtilsClient::maskBinContent( meg03_[ism-1], ix, iy );
382 
383  }
384  }
385 
386  }
387 
388 }
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:987
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 std::string sEE(const int ism)
Definition: Numbers.cc:205
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
#define abs(x)
Definition: mlp_lapack.h:159
MonitorElement * meg03_[18]
static void maskBinContent(const MonitorElement *me, const int ix, const int iy)
Mask the bin content.
Definition: UtilsClient.cc:231
void Fill(long long x)
MonitorElement * mep03_[18]
T sqrt(T t)
Definition: SSEVec.h:28
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1265
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
static int ix0EE(const int ism)
Definition: Numbers.cc:952
tuple cout
Definition: gather_cfg.py:41
static bool validEE(const int ism, const int ix, const int iy)
Definition: Numbers.cc:1005
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 92 of file EEPedestalOnlineClient.cc.

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

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

BeginRun.

Implements EEClient.

Definition at line 103 of file EEPedestalOnlineClient.cc.

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

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

Cleanup.

Implements EEClient.

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

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

EndJob.

Implements EEClient.

Definition at line 113 of file EEPedestalOnlineClient.cc.

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

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

EndRun.

Implements EEClient.

Definition at line 121 of file EEPedestalOnlineClient.cc.

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

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

References DQMStore::book1D(), DQMStore::book2D(), dqmStore_, edm::getName(), 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(), superModules_, and Numbers::validEE().

Referenced by beginRun().

129  {
130 
131  std::string name;
132 
133  dqmStore_->setCurrentFolder( prefixME_ + "/EEPedestalOnlineClient" );
134 
135  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
136 
137  int ism = superModules_[i];
138 
139  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
140  name = "EEPOT pedestal quality G12 " + Numbers::sEE(ism);
141  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.);
142  meg03_[ism-1]->setAxisTitle("ix", 1);
143  if ( ism >= 1 && ism <= 9 ) meg03_[ism-1]->setAxisTitle("101-ix", 1);
144  meg03_[ism-1]->setAxisTitle("iy", 2);
145 
146  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
147  name = "EEPOT pedestal mean G12 " + Numbers::sEE(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 = "EEPOT pedestal rms G12 " + Numbers::sEE(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 ix = 1; ix <= 50; ix++ ) {
165  for ( int iy = 1; iy <= 50; iy++ ) {
166 
167  meg03_[ism-1]->setBinContent( ix, iy, 6. );
168 
169  int jx = ix + Numbers::ix0EE(ism);
170  int jy = iy + Numbers::iy0EE(ism);
171 
172  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
173 
174  if ( Numbers::validEE(ism, jx, jy) ) {
175  meg03_[ism-1]->setBinContent( ix, iy, 2. );
176  }
177 
178  }
179  }
180 
181  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
182  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
183 
184  }
185 
186 }
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:514
static int iy0EE(const int ism)
Definition: Numbers.cc:987
MonitorElement * mer03_[18]
static std::string sEE(const int ism)
Definition: Numbers.cc:205
MonitorElement * meg03_[18]
MonitorElement * mep03_[18]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2353
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
static int ix0EE(const int ism)
Definition: Numbers.cc:952
static bool validEE(const int ism, const int ix, const int iy)
Definition: Numbers.cc:1005
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:642
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:232

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().

float EEPedestalOnlineClient::RMSThresholdInternal_
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().