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

#include <EEOccupancyClient.h>

Inheritance diagram for EEOccupancyClient:
EEClient

Public Member Functions

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

Private Attributes

bool cloneME_
 
bool debug_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
TH2F * h01_ [2][3]
 
TH1F * h01ProjEta_ [2][3]
 
TH1F * h01ProjPhi_ [2][3]
 
TH2F * h02_ [2][2]
 
TH1F * h02ProjEta_ [2][2]
 
TH1F * h02ProjPhi_ [2][2]
 
TH2F * i01_ [18]
 
TProfile2D * i02_ [18]
 
int ievt_
 
int jevt_
 
std::string prefixME_
 
std::vector< int > superModules_
 
bool verbose_
 

Friends

class EESummaryClient
 

Detailed Description

Definition at line 31 of file EEOccupancyClient.h.

Constructor & Destructor Documentation

EEOccupancyClient::EEOccupancyClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 31 of file EEOccupancyClient.cc.

References cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), h01_, h01ProjEta_, h01ProjPhi_, h02_, h02ProjEta_, h02ProjPhi_, i, i01_, i02_, ecalpyutils::ism(), prefixME_, AlCaHLTBitMon_QueryRunRegistry::string, superModules_, and verbose_.

31  {
32 
33  // cloneME switch
34  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
35 
36  // verbose switch
37  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
38 
39  // debug switch
40  debug_ = ps.getUntrackedParameter<bool>("debug", false);
41 
42  // prefixME path
43  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
44 
45  // enableCleanup_ switch
46  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
47 
48  // vector of selected Super Modules (Defaults to all 18).
49  superModules_.reserve(18);
50  for ( unsigned int i = 1; i <= 18; i++ ) superModules_.push_back(i);
51  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
52 
53  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
54  int ism = superModules_[i];
55  i01_[ism-1] = 0;
56  i02_[ism-1] = 0;
57  }
58 
59  for ( int i=0; i<3; i++) {
60  h01_[0][i] = 0;
61  h01ProjEta_[0][i] = 0;
62  h01ProjPhi_[0][i] = 0;
63  h01_[1][i] = 0;
64  h01ProjEta_[1][i] = 0;
65  h01ProjPhi_[1][i] = 0;
66  }
67 
68  for ( int i=0; i<2; i++) {
69  h02_[0][i] = 0;
70  h02ProjEta_[0][i] = 0;
71  h02ProjPhi_[0][i] = 0;
72  h02_[1][i] = 0;
73  h02ProjEta_[1][i] = 0;
74  h02ProjPhi_[1][i] = 0;
75  }
76 
77 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
TProfile2D * i02_[18]
TH1F * h02ProjEta_[2][2]
TH1F * h02ProjPhi_[2][2]
TH1F * h01ProjEta_[2][3]
std::vector< int > superModules_
TH1F * h01ProjPhi_[2][3]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
EEOccupancyClient::~EEOccupancyClient ( )
virtual

Destructor.

Definition at line 79 of file EEOccupancyClient.cc.

79  {
80 
81 }

Member Function Documentation

void EEOccupancyClient::analyze ( void  )
virtual

Analyze.

Implements EEClient.

Definition at line 282 of file EEOccupancyClient.cc.

References cloneME_, gather_cfg::cout, debug_, dqmStore_, DQMStore::get(), UtilsClient::getHisto(), h01_, h01ProjEta_, h01ProjPhi_, h02_, h02ProjEta_, h02ProjPhi_, i, i01_, i02_, ievt_, jevt_, prefixME_, Numbers::sEE(), and superModules_.

282  {
283 
284  ievt_++;
285  jevt_++;
286  if ( ievt_ % 10 == 0 ) {
287  if ( debug_ ) std::cout << "EEOccupancyClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
288  }
289 
290  MonitorElement* me;
291 
292  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
293 
294  int ism = superModules_[i];
295 
296  me = dqmStore_->get( prefixME_ + "/EEOccupancyTask/EEOT digi occupancy " + Numbers::sEE(ism) );
297  i01_[ism-1] = UtilsClient::getHisto( me, cloneME_, i01_[ism-1] );
298 
299  me = dqmStore_->get( prefixME_ + "/EEOccupancyTask/EEOT rec hit energy " + Numbers::sEE(ism) );
300  i02_[ism-1] = UtilsClient::getHisto( me, cloneME_, i02_[ism-1] );
301 
302  }
303 
304  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE -" );
305  h01_[0][0] = UtilsClient::getHisto( me, cloneME_, h01_[0][0] );
306 
307  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE - projection eta" );
309 
310  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE - projection phi" );
312 
313  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE +" );
314  h01_[1][0] = UtilsClient::getHisto( me, cloneME_, h01_[1][0] );
315 
316  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE + projection eta" );
318 
319  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE + projection phi" );
321 
322  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE -" );
323  h01_[0][1] = UtilsClient::getHisto( me, cloneME_, h01_[0][1] );
324 
325  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE - projection eta" );
327 
328  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE - projection phi" );
330 
331  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE +" );
332  h01_[1][1] = UtilsClient::getHisto( me, cloneME_, h01_[1][1] );
333 
334  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE + projection eta" );
336 
337  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE + projection phi" );
339 
340  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE -" );
341  h01_[0][2] = UtilsClient::getHisto( me, cloneME_, h01_[0][2] );
342 
343  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE - projection eta" );
345 
346  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE - projection phi" );
348 
349  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE +" );
350  h01_[1][2] = UtilsClient::getHisto( me, cloneME_, h01_[1][2] );
351 
352  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE + projection eta" );
354 
355  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE + projection phi" );
357 
358  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE -" );
359  h02_[0][0] = UtilsClient::getHisto( me, cloneME_, h02_[0][0] );
360 
361  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE - projection eta" );
363 
364  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE - projection phi" );
366 
367  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE +" );
368  h02_[1][0] = UtilsClient::getHisto( me, cloneME_, h02_[1][0] );
369 
370  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE + projection eta" );
372 
373  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE + projection phi" );
375 
376  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE -" );
377  h02_[0][1] = UtilsClient::getHisto( me, cloneME_, h02_[0][1] );
378 
379  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE - projection eta" );
381 
382  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE - projection phi" );
384 
385  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE +" );
386  h02_[1][1] = UtilsClient::getHisto( me, cloneME_, h02_[1][1] );
387 
388  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE + projection eta" );
390 
391  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE + projection phi" );
393 
394 }
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:223
int i
Definition: DBlmapReader.cc:9
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:89
TProfile2D * i02_[18]
TH1F * h02ProjEta_[2][2]
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
TH1F * h02ProjPhi_[2][2]
TH1F * h01ProjEta_[2][3]
std::vector< int > superModules_
TH1F * h01ProjPhi_[2][3]
tuple cout
Definition: gather_cfg.py:121
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void EEOccupancyClient::beginJob ( void  )
virtual

BeginJob.

Implements EEClient.

Definition at line 83 of file EEOccupancyClient.cc.

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

83  {
84 
86 
87  if ( debug_ ) std::cout << "EEOccupancyClient: beginJob" << std::endl;
88 
89  ievt_ = 0;
90  jevt_ = 0;
91 
92 }
tuple cout
Definition: gather_cfg.py:121
void EEOccupancyClient::beginRun ( void  )
virtual

BeginRun.

Implements EEClient.

Definition at line 94 of file EEOccupancyClient.cc.

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

94  {
95 
96  if ( debug_ ) std::cout << "EEOccupancyClient: beginRun" << std::endl;
97 
98  jevt_ = 0;
99 
100  this->setup();
101 
102 }
void setup(void)
Setup.
tuple cout
Definition: gather_cfg.py:121
void EEOccupancyClient::cleanup ( void  )
virtual

Cleanup.

Implements EEClient.

Definition at line 126 of file EEOccupancyClient.cc.

References cloneME_, enableCleanup_, h01_, h01ProjEta_, h01ProjPhi_, h02_, h02ProjEta_, h02ProjPhi_, i, i01_, i02_, ecalpyutils::ism(), and superModules_.

Referenced by endJob(), and endRun().

126  {
127 
128  if ( ! enableCleanup_ ) return;
129 
130  if ( cloneME_ ) {
131 
132  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
133  int ism = superModules_[i];
134  if ( i01_[ism-1] ) delete i01_[ism-1];
135  if ( i02_[ism-1] ) delete i02_[ism-1];
136  }
137 
138  for ( int i=0; i<3; ++i ) {
139  if ( h01_[0][i] ) delete h01_[0][i];
140  if ( h01ProjEta_[0][i] ) delete h01ProjEta_[0][i];
141  if ( h01ProjPhi_[0][i] ) delete h01ProjPhi_[0][i];
142  if ( h01_[1][i] ) delete h01_[1][i];
143  if ( h01ProjEta_[1][i] ) delete h01ProjEta_[1][i];
144  if ( h01ProjPhi_[1][i] ) delete h01ProjPhi_[1][i];
145  }
146 
147  for ( int i=0; i<2; ++i ) {
148  if ( h02_[0][i] ) delete h02_[0][i];
149  if ( h02ProjEta_[0][i] ) delete h02ProjEta_[0][i];
150  if ( h02ProjPhi_[0][i] ) delete h02ProjPhi_[0][i];
151  if ( h01_[1][i] ) delete h01_[1][i];
152  if ( h01ProjEta_[1][i] ) delete h01ProjEta_[1][i];
153  if ( h01ProjPhi_[1][i] ) delete h01ProjPhi_[1][i];
154  }
155 
156  }
157 
158  for ( int i=0; i<3; i++) {
159  h01_[0][i] = 0;
160  h01ProjEta_[0][i] = 0;
161  h01ProjPhi_[0][i] = 0;
162  h01_[1][i] = 0;
163  h01ProjEta_[1][i] = 0;
164  h01ProjPhi_[1][i] = 0;
165  }
166 
167  for ( int i=0; i<2; i++) {
168  h02_[0][i] = 0;
169  h02ProjEta_[0][i] = 0;
170  h02ProjPhi_[0][i] = 0;
171  h02_[1][i] = 0;
172  h02ProjEta_[1][i] = 0;
173  h02ProjPhi_[1][i] = 0;
174  }
175 
176 }
int i
Definition: DBlmapReader.cc:9
TProfile2D * i02_[18]
TH1F * h02ProjEta_[2][2]
TH1F * h02ProjPhi_[2][2]
TH1F * h01ProjEta_[2][3]
std::vector< int > superModules_
TH1F * h01ProjPhi_[2][3]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void EEOccupancyClient::endJob ( void  )
virtual

EndJob.

Implements EEClient.

Definition at line 104 of file EEOccupancyClient.cc.

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

104  {
105 
106  if ( debug_ ) std::cout << "EEOccupancyClient: endJob, ievt = " << ievt_ << std::endl;
107 
108  this->cleanup();
109 
110 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
void EEOccupancyClient::endRun ( void  )
virtual

EndRun.

Implements EEClient.

Definition at line 112 of file EEOccupancyClient.cc.

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

112  {
113 
114  if ( debug_ ) std::cout << "EEOccupancyClient: endRun, jevt = " << jevt_ << std::endl;
115 
116  this->cleanup();
117 
118 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
int EEOccupancyClient::getEvtPerJob ( void  )
inlinevirtual

Get Functions.

Implements EEClient.

Definition at line 70 of file EEOccupancyClient.h.

References ievt_.

70 { return ievt_; }
int EEOccupancyClient::getEvtPerRun ( void  )
inlinevirtual

Returns the number of processed events in this Run.

Implements EEClient.

Definition at line 71 of file EEOccupancyClient.h.

References jevt_.

71 { return jevt_; }
void EEOccupancyClient::setup ( void  )
virtual

Setup.

Implements EEClient.

Definition at line 120 of file EEOccupancyClient.cc.

References dqmStore_, prefixME_, and DQMStore::setCurrentFolder().

Referenced by beginRun().

120  {
121 
122  dqmStore_->setCurrentFolder( prefixME_ + "/EEOccupancyClient" );
123 
124 }
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 EEOccupancyClient.h.

Member Data Documentation

bool EEOccupancyClient::cloneME_
private

Definition at line 78 of file EEOccupancyClient.h.

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

bool EEOccupancyClient::debug_
private

Definition at line 81 of file EEOccupancyClient.h.

Referenced by analyze(), beginJob(), beginRun(), EEOccupancyClient(), endJob(), and endRun().

DQMStore* EEOccupancyClient::dqmStore_
private

Definition at line 89 of file EEOccupancyClient.h.

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

bool EEOccupancyClient::enableCleanup_
private

Definition at line 85 of file EEOccupancyClient.h.

Referenced by cleanup(), and EEOccupancyClient().

TH2F* EEOccupancyClient::h01_[2][3]
private

Definition at line 94 of file EEOccupancyClient.h.

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

TH1F* EEOccupancyClient::h01ProjEta_[2][3]
private

Definition at line 95 of file EEOccupancyClient.h.

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

TH1F* EEOccupancyClient::h01ProjPhi_[2][3]
private

Definition at line 96 of file EEOccupancyClient.h.

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

TH2F* EEOccupancyClient::h02_[2][2]
private

Definition at line 98 of file EEOccupancyClient.h.

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

TH1F* EEOccupancyClient::h02ProjEta_[2][2]
private

Definition at line 99 of file EEOccupancyClient.h.

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

TH1F* EEOccupancyClient::h02ProjPhi_[2][2]
private

Definition at line 100 of file EEOccupancyClient.h.

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

TH2F* EEOccupancyClient::i01_[18]
private

Definition at line 91 of file EEOccupancyClient.h.

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

TProfile2D* EEOccupancyClient::i02_[18]
private

Definition at line 92 of file EEOccupancyClient.h.

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

int EEOccupancyClient::ievt_
private

Definition at line 75 of file EEOccupancyClient.h.

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

int EEOccupancyClient::jevt_
private

Definition at line 76 of file EEOccupancyClient.h.

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

std::string EEOccupancyClient::prefixME_
private

Definition at line 83 of file EEOccupancyClient.h.

Referenced by analyze(), EEOccupancyClient(), and setup().

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

Definition at line 87 of file EEOccupancyClient.h.

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

bool EEOccupancyClient::verbose_
private

Definition at line 80 of file EEOccupancyClient.h.

Referenced by EEOccupancyClient().