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

#include <EBOccupancyClient.h>

Inheritance diagram for EBOccupancyClient:
EBClient

Public Member Functions

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

Private Attributes

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

Friends

class EBSummaryClient
 

Detailed Description

Definition at line 33 of file EBOccupancyClient.h.

Constructor & Destructor Documentation

EBOccupancyClient::EBOccupancyClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 33 of file EBOccupancyClient.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 36).
51  superModules_.reserve(36);
52  for ( unsigned int i = 1; i <= 36; 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_[i] = 0;
63  h01ProjEta_[i] = 0;
64  h01ProjPhi_[i] = 0;
65  }
66 
67  for ( int i=0; i<2; i++) {
68  h02_[i] = 0;
69  h02ProjEta_[i] = 0;
70  h02ProjPhi_[i] = 0;
71  }
72 
73 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< int > superModules_
TProfile2D * i02_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
EBOccupancyClient::~EBOccupancyClient ( )
virtual

Destructor.

Definition at line 75 of file EBOccupancyClient.cc.

75  {
76 
77 }

Member Function Documentation

void EBOccupancyClient::analyze ( void  )
virtual

Analyze.

Implements EBClient.

Definition at line 257 of file EBOccupancyClient.cc.

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

257  {
258 
259  ievt_++;
260  jevt_++;
261  if ( ievt_ % 10 == 0 ) {
262  if ( debug_ ) std::cout << "EBOccupancyClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
263  }
264 
265  MonitorElement* me;
266 
267  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
268 
269  int ism = superModules_[i];
270 
271  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT digi occupancy " + Numbers::sEB(ism) );
272  i01_[ism-1] = UtilsClient::getHisto<TH2F*>( me, cloneME_, i01_[ism-1] );
273 
274  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit energy " + Numbers::sEB(ism) );
275  i02_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, i02_[ism-1] );
276 
277  }
278 
279  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT digi occupancy" );
280  h01_[0] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[0] );
281 
282  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT digi occupancy projection eta" );
283  h01ProjEta_[0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjEta_[0] );
284 
285  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT digi occupancy projection phi" );
286  h01ProjPhi_[0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[0] );
287 
288  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit occupancy" );
289  h01_[1] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[1] );
290 
291  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit occupancy projection eta" );
292  h01ProjEta_[1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjEta_[1] );
293 
294  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit occupancy projection phi" );
295  h01ProjPhi_[1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[1] );
296 
297  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi occupancy" );
298  h01_[2] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[2] );
299 
300  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi occupancy projection eta" );
301  h01ProjEta_[2] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjEta_[2] );
302 
303  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi occupancy projection phi" );
304  h01ProjPhi_[2] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[2] );
305 
306  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit thr occupancy" );
307  h02_[0] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h02_[0] );
308 
309  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit thr occupancy projection eta" );
310  h02ProjEta_[0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjEta_[0] );
311 
312  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit thr occupancy projection phi" );
313  h02ProjPhi_[0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjPhi_[0] );
314 
315  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi thr occupancy" );
316  h02_[1] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h02_[1] );
317 
318  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi thr occupancy projection eta" );
319  h02ProjEta_[1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjEta_[1] );
320 
321  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi thr occupancy projection phi" );
322  h02ProjPhi_[1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjPhi_[1] );
323 
324 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > superModules_
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
TProfile2D * i02_[36]
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
tuple cout
Definition: gather_cfg.py:121
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void EBOccupancyClient::beginJob ( void  )
virtual

BeginJob.

Implements EBClient.

Definition at line 79 of file EBOccupancyClient.cc.

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

79  {
80 
82 
83  if ( debug_ ) std::cout << "EBOccupancyClient: beginJob" << std::endl;
84 
85  ievt_ = 0;
86  jevt_ = 0;
87 
88 }
tuple cout
Definition: gather_cfg.py:121
void EBOccupancyClient::beginRun ( void  )
virtual

BeginRun.

Implements EBClient.

Definition at line 90 of file EBOccupancyClient.cc.

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

90  {
91 
92  if ( debug_ ) std::cout << "EBOccupancyClient: beginRun" << std::endl;
93 
94  jevt_ = 0;
95 
96  this->setup();
97 
98 }
void setup(void)
Setup.
tuple cout
Definition: gather_cfg.py:121
void EBOccupancyClient::cleanup ( void  )
virtual

Cleanup.

Implements EBClient.

Definition at line 122 of file EBOccupancyClient.cc.

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

Referenced by endJob(), and endRun().

122  {
123 
124  if ( ! enableCleanup_ ) return;
125 
126  if ( cloneME_ ) {
127 
128  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
129  int ism = superModules_[i];
130  if ( i01_[ism-1] ) delete i01_[ism-1];
131  if ( i02_[ism-1] ) delete i02_[ism-1];
132  }
133 
134  for ( int i=0; i<3; ++i ) {
135  if ( h01_[i] ) delete h01_[i];
136  if ( h01ProjEta_[i] ) delete h01ProjEta_[i];
137  if ( h01ProjPhi_[i] ) delete h01ProjPhi_[i];
138  }
139 
140  for ( int i=0; i<2; ++i ) {
141  if ( h02_[i] ) delete h02_[i];
142  if ( h02ProjEta_[i] ) delete h02ProjEta_[i];
143  if ( h02ProjPhi_[i] ) delete h02ProjPhi_[i];
144  }
145 
146  }
147 
148  for ( int i=0; i<3; ++i ) {
149  h01_[i] = 0;
150  h01ProjEta_[i] = 0;
151  h01ProjPhi_[i] = 0;
152  }
153 
154  for ( int i=0; i<2; ++i ) {
155  h02_[i] = 0;
156  h02ProjEta_[i] = 0;
157  h02ProjPhi_[i] = 0;
158  }
159 
160 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > superModules_
TProfile2D * i02_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void EBOccupancyClient::endJob ( void  )
virtual

EndJob.

Implements EBClient.

Definition at line 100 of file EBOccupancyClient.cc.

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

100  {
101 
102  if ( debug_ ) std::cout << "EBOccupancyClient: endJob, ievt = " << ievt_ << std::endl;
103 
104  this->cleanup();
105 
106 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
void EBOccupancyClient::endRun ( void  )
virtual

EndRun.

Implements EBClient.

Definition at line 108 of file EBOccupancyClient.cc.

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

108  {
109 
110  if ( debug_ ) std::cout << "EBOccupancyClient: endRun, jevt = " << jevt_ << std::endl;
111 
112  this->cleanup();
113 
114 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
int EBOccupancyClient::getEvtPerJob ( void  )
inlinevirtual

Get Functions.

Implements EBClient.

Definition at line 72 of file EBOccupancyClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 73 of file EBOccupancyClient.h.

References jevt_.

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

Setup.

Implements EBClient.

Definition at line 116 of file EBOccupancyClient.cc.

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

Referenced by beginRun().

116  {
117 
118  dqmStore_->setCurrentFolder( prefixME_ + "/EBOccupancyClient" );
119 
120 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Friends And Related Function Documentation

friend class EBSummaryClient
friend

Definition at line 35 of file EBOccupancyClient.h.

Member Data Documentation

bool EBOccupancyClient::cloneME_
private

Definition at line 80 of file EBOccupancyClient.h.

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

bool EBOccupancyClient::debug_
private

Definition at line 83 of file EBOccupancyClient.h.

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

DQMStore* EBOccupancyClient::dqmStore_
private

Definition at line 91 of file EBOccupancyClient.h.

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

bool EBOccupancyClient::enableCleanup_
private

Definition at line 87 of file EBOccupancyClient.h.

Referenced by cleanup(), and EBOccupancyClient().

TH2F* EBOccupancyClient::h01_[3]
private

Definition at line 96 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h01ProjEta_[3]
private

Definition at line 97 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h01ProjPhi_[3]
private

Definition at line 98 of file EBOccupancyClient.h.

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

TH2F* EBOccupancyClient::h02_[2]
private

Definition at line 100 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h02ProjEta_[2]
private

Definition at line 101 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h02ProjPhi_[2]
private

Definition at line 102 of file EBOccupancyClient.h.

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

TH2F* EBOccupancyClient::i01_[36]
private

Definition at line 93 of file EBOccupancyClient.h.

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

TProfile2D* EBOccupancyClient::i02_[36]
private

Definition at line 94 of file EBOccupancyClient.h.

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

int EBOccupancyClient::ievt_
private

Definition at line 77 of file EBOccupancyClient.h.

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

int EBOccupancyClient::jevt_
private

Definition at line 78 of file EBOccupancyClient.h.

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

std::string EBOccupancyClient::prefixME_
private

Definition at line 85 of file EBOccupancyClient.h.

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

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

Definition at line 89 of file EBOccupancyClient.h.

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

bool EBOccupancyClient::verbose_
private

Definition at line 82 of file EBOccupancyClient.h.

Referenced by EBOccupancyClient().