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

Constructor & Destructor Documentation

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

Constructor.

Definition at line 31 of file EBOccupancyClient.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 36).
49  superModules_.reserve(36);
50  for ( unsigned int i = 1; i <= 36; 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_[i] = 0;
61  h01ProjEta_[i] = 0;
62  h01ProjPhi_[i] = 0;
63  }
64 
65  for ( int i=0; i<2; i++) {
66  h02_[i] = 0;
67  h02ProjEta_[i] = 0;
68  h02ProjPhi_[i] = 0;
69  }
70 
71 }
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 73 of file EBOccupancyClient.cc.

73  {
74 
75 }

Member Function Documentation

void EBOccupancyClient::analyze ( void  )
virtual

Analyze.

Implements EBClient.

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

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

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

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

BeginRun.

Implements EBClient.

Definition at line 88 of file EBOccupancyClient.cc.

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

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

Cleanup.

Implements EBClient.

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

120  {
121 
122  if ( ! enableCleanup_ ) return;
123 
124  if ( cloneME_ ) {
125 
126  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
127  int ism = superModules_[i];
128  if ( i01_[ism-1] ) delete i01_[ism-1];
129  if ( i02_[ism-1] ) delete i02_[ism-1];
130  }
131 
132  for ( int i=0; i<3; ++i ) {
133  if ( h01_[i] ) delete h01_[i];
134  if ( h01ProjEta_[i] ) delete h01ProjEta_[i];
135  if ( h01ProjPhi_[i] ) delete h01ProjPhi_[i];
136  }
137 
138  for ( int i=0; i<2; ++i ) {
139  if ( h02_[i] ) delete h02_[i];
140  if ( h02ProjEta_[i] ) delete h02ProjEta_[i];
141  if ( h02ProjPhi_[i] ) delete h02ProjPhi_[i];
142  }
143 
144  }
145 
146  for ( int i=0; i<3; ++i ) {
147  h01_[i] = 0;
148  h01ProjEta_[i] = 0;
149  h01ProjPhi_[i] = 0;
150  }
151 
152  for ( int i=0; i<2; ++i ) {
153  h02_[i] = 0;
154  h02ProjEta_[i] = 0;
155  h02ProjPhi_[i] = 0;
156  }
157 
158 }
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 98 of file EBOccupancyClient.cc.

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

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

EndRun.

Implements EBClient.

Definition at line 106 of file EBOccupancyClient.cc.

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

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

Get Functions.

Implements EBClient.

Definition at line 70 of file EBOccupancyClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 71 of file EBOccupancyClient.h.

References jevt_.

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

Setup.

Implements EBClient.

Definition at line 114 of file EBOccupancyClient.cc.

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

Referenced by beginRun().

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

Friends And Related Function Documentation

friend class EBSummaryClient
friend

Definition at line 33 of file EBOccupancyClient.h.

Member Data Documentation

bool EBOccupancyClient::cloneME_
private

Definition at line 78 of file EBOccupancyClient.h.

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

bool EBOccupancyClient::debug_
private

Definition at line 81 of file EBOccupancyClient.h.

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

DQMStore* EBOccupancyClient::dqmStore_
private

Definition at line 89 of file EBOccupancyClient.h.

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

bool EBOccupancyClient::enableCleanup_
private

Definition at line 85 of file EBOccupancyClient.h.

Referenced by cleanup(), and EBOccupancyClient().

TH2F* EBOccupancyClient::h01_[3]
private

Definition at line 94 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h01ProjEta_[3]
private

Definition at line 95 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h01ProjPhi_[3]
private

Definition at line 96 of file EBOccupancyClient.h.

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

TH2F* EBOccupancyClient::h02_[2]
private

Definition at line 98 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h02ProjEta_[2]
private

Definition at line 99 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h02ProjPhi_[2]
private

Definition at line 100 of file EBOccupancyClient.h.

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

TH2F* EBOccupancyClient::i01_[36]
private

Definition at line 91 of file EBOccupancyClient.h.

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

TProfile2D* EBOccupancyClient::i02_[36]
private

Definition at line 92 of file EBOccupancyClient.h.

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

int EBOccupancyClient::ievt_
private

Definition at line 75 of file EBOccupancyClient.h.

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

int EBOccupancyClient::jevt_
private

Definition at line 76 of file EBOccupancyClient.h.

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

std::string EBOccupancyClient::prefixME_
private

Definition at line 83 of file EBOccupancyClient.h.

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

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

Definition at line 87 of file EBOccupancyClient.h.

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

bool EBOccupancyClient::verbose_
private

Definition at line 80 of file EBOccupancyClient.h.

Referenced by EBOccupancyClient().