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 33 of file EEOccupancyClient.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 33 of file EEOccupancyClient.cc.

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

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

81  {
82 
83 }

Member Function Documentation

void EEOccupancyClient::analyze ( void  )
virtual

Analyze.

Implements EEClient.

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

284  {
285 
286  ievt_++;
287  jevt_++;
288  if ( ievt_ % 10 == 0 ) {
289  if ( debug_ ) std::cout << "EEOccupancyClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
290  }
291 
292  MonitorElement* me;
293 
294  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
295 
296  int ism = superModules_[i];
297 
298  me = dqmStore_->get( prefixME_ + "/EEOccupancyTask/EEOT digi occupancy " + Numbers::sEE(ism) );
299  i01_[ism-1] = UtilsClient::getHisto( me, cloneME_, i01_[ism-1] );
300 
301  me = dqmStore_->get( prefixME_ + "/EEOccupancyTask/EEOT rec hit energy " + Numbers::sEE(ism) );
302  i02_[ism-1] = UtilsClient::getHisto( me, cloneME_, i02_[ism-1] );
303 
304  }
305 
306  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE -" );
307  h01_[0][0] = UtilsClient::getHisto( me, cloneME_, h01_[0][0] );
308 
309  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE - projection eta" );
311 
312  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE - projection phi" );
314 
315  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE +" );
316  h01_[1][0] = UtilsClient::getHisto( me, cloneME_, h01_[1][0] );
317 
318  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE + projection eta" );
320 
321  me = dqmStore_->get( "/EEOccupancyTask/EEOT digi occupancy EE + projection phi" );
323 
324  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE -" );
325  h01_[0][1] = UtilsClient::getHisto( me, cloneME_, h01_[0][1] );
326 
327  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE - projection eta" );
329 
330  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE - projection phi" );
332 
333  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE +" );
334  h01_[1][1] = UtilsClient::getHisto( me, cloneME_, h01_[1][1] );
335 
336  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE + projection eta" );
338 
339  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit occupancy EE + projection phi" );
341 
342  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE -" );
343  h01_[0][2] = UtilsClient::getHisto( me, cloneME_, h01_[0][2] );
344 
345  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE - projection eta" );
347 
348  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE - projection phi" );
350 
351  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE +" );
352  h01_[1][2] = UtilsClient::getHisto( me, cloneME_, h01_[1][2] );
353 
354  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE + projection eta" );
356 
357  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi occupancy EE + projection phi" );
359 
360  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE -" );
361  h02_[0][0] = UtilsClient::getHisto( me, cloneME_, h02_[0][0] );
362 
363  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE - projection eta" );
365 
366  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE - projection phi" );
368 
369  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE +" );
370  h02_[1][0] = UtilsClient::getHisto( me, cloneME_, h02_[1][0] );
371 
372  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE + projection eta" );
374 
375  me = dqmStore_->get( "/EEOccupancyTask/EEOT rec hit thr occupancy EE + projection phi" );
377 
378  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE -" );
379  h02_[0][1] = UtilsClient::getHisto( me, cloneME_, h02_[0][1] );
380 
381  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE - projection eta" );
383 
384  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE - projection phi" );
386 
387  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE +" );
388  h02_[1][1] = UtilsClient::getHisto( me, cloneME_, h02_[1][1] );
389 
390  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE + projection eta" );
392 
393  me = dqmStore_->get( "/EEOccupancyTask/EEOT TP digi thr occupancy EE + projection phi" );
395 
396 }
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:226
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:91
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:1468
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 85 of file EEOccupancyClient.cc.

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

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

BeginRun.

Implements EEClient.

Definition at line 96 of file EEOccupancyClient.cc.

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

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

Cleanup.

Implements EEClient.

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

128  {
129 
130  if ( ! enableCleanup_ ) return;
131 
132  if ( cloneME_ ) {
133 
134  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
135  int ism = superModules_[i];
136  if ( i01_[ism-1] ) delete i01_[ism-1];
137  if ( i02_[ism-1] ) delete i02_[ism-1];
138  }
139 
140  for ( int i=0; i<3; ++i ) {
141  if ( h01_[0][i] ) delete h01_[0][i];
142  if ( h01ProjEta_[0][i] ) delete h01ProjEta_[0][i];
143  if ( h01ProjPhi_[0][i] ) delete h01ProjPhi_[0][i];
144  if ( h01_[1][i] ) delete h01_[1][i];
145  if ( h01ProjEta_[1][i] ) delete h01ProjEta_[1][i];
146  if ( h01ProjPhi_[1][i] ) delete h01ProjPhi_[1][i];
147  }
148 
149  for ( int i=0; i<2; ++i ) {
150  if ( h02_[0][i] ) delete h02_[0][i];
151  if ( h02ProjEta_[0][i] ) delete h02ProjEta_[0][i];
152  if ( h02ProjPhi_[0][i] ) delete h02ProjPhi_[0][i];
153  if ( h01_[1][i] ) delete h01_[1][i];
154  if ( h01ProjEta_[1][i] ) delete h01ProjEta_[1][i];
155  if ( h01ProjPhi_[1][i] ) delete h01ProjPhi_[1][i];
156  }
157 
158  }
159 
160  for ( int i=0; i<3; i++) {
161  h01_[0][i] = 0;
162  h01ProjEta_[0][i] = 0;
163  h01ProjPhi_[0][i] = 0;
164  h01_[1][i] = 0;
165  h01ProjEta_[1][i] = 0;
166  h01ProjPhi_[1][i] = 0;
167  }
168 
169  for ( int i=0; i<2; i++) {
170  h02_[0][i] = 0;
171  h02ProjEta_[0][i] = 0;
172  h02ProjPhi_[0][i] = 0;
173  h02_[1][i] = 0;
174  h02ProjEta_[1][i] = 0;
175  h02ProjPhi_[1][i] = 0;
176  }
177 
178 }
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 106 of file EEOccupancyClient.cc.

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

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

EndRun.

Implements EEClient.

Definition at line 114 of file EEOccupancyClient.cc.

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

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

Get Functions.

Implements EEClient.

Definition at line 72 of file EEOccupancyClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EEClient.

Definition at line 73 of file EEOccupancyClient.h.

References jevt_.

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

Setup.

Implements EEClient.

Definition at line 122 of file EEOccupancyClient.cc.

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

Referenced by beginRun().

122  {
123 
124  dqmStore_->setCurrentFolder( prefixME_ + "/EEOccupancyClient" );
125 
126 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Friends And Related Function Documentation

friend class EESummaryClient
friend

Definition at line 35 of file EEOccupancyClient.h.

Member Data Documentation

bool EEOccupancyClient::cloneME_
private

Definition at line 80 of file EEOccupancyClient.h.

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

bool EEOccupancyClient::debug_
private

Definition at line 83 of file EEOccupancyClient.h.

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

DQMStore* EEOccupancyClient::dqmStore_
private

Definition at line 91 of file EEOccupancyClient.h.

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

bool EEOccupancyClient::enableCleanup_
private

Definition at line 87 of file EEOccupancyClient.h.

Referenced by cleanup(), and EEOccupancyClient().

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

Definition at line 96 of file EEOccupancyClient.h.

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

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

Definition at line 97 of file EEOccupancyClient.h.

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

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

Definition at line 98 of file EEOccupancyClient.h.

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

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

Definition at line 100 of file EEOccupancyClient.h.

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

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

Definition at line 101 of file EEOccupancyClient.h.

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

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

Definition at line 102 of file EEOccupancyClient.h.

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

TH2F* EEOccupancyClient::i01_[18]
private

Definition at line 93 of file EEOccupancyClient.h.

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

TProfile2D* EEOccupancyClient::i02_[18]
private

Definition at line 94 of file EEOccupancyClient.h.

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

int EEOccupancyClient::ievt_
private

Definition at line 77 of file EEOccupancyClient.h.

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

int EEOccupancyClient::jevt_
private

Definition at line 78 of file EEOccupancyClient.h.

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

std::string EEOccupancyClient::prefixME_
private

Definition at line 85 of file EEOccupancyClient.h.

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

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

Definition at line 89 of file EEOccupancyClient.h.

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

bool EEOccupancyClient::verbose_
private

Definition at line 82 of file EEOccupancyClient.h.

Referenced by EEOccupancyClient().