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

Constructor & Destructor Documentation

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

Constructor.

Definition at line 37 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_.

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 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 321 of file EEPedestalOnlineClient.cc.

References funct::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().

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

References gather_cfg::cout, debug_, dqmStore_, ievt_, jevt_, and 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:121
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:121
void EEPedestalOnlineClient::cleanup ( void  )
virtual

Cleanup.

Implements EEClient.

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

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

Get Functions.

Implements EEClient.

Definition at line 70 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 71 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_, 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().

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

Definition at line 33 of file EEPedestalOnlineClient.h.

Member Data Documentation

bool EEPedestalOnlineClient::cloneME_
private

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

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

int EEPedestalOnlineClient::jevt_
private

Definition at line 76 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 83 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::string EEPedestalOnlineClient::subfolder_
private

Definition at line 85 of file EEPedestalOnlineClient.h.

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

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

Referenced by EEPedestalOnlineClient().