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

#include <EBCosmicClient.h>

Inheritance diagram for EBCosmicClient:
EBClient

Public Member Functions

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

Private Attributes

bool cloneME_
 
bool debug_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
TProfile2D * h01_ [36]
 
TH1F * h02_ [36]
 
TH1F * h03_ [36]
 
int ievt_
 
int jevt_
 
MonitorElementmeh01_ [36]
 
MonitorElementmeh02_ [36]
 
MonitorElementmeh03_ [36]
 
std::string prefixME_
 
std::vector< int > superModules_
 
bool verbose_
 

Friends

class EBSummaryClient
 

Detailed Description

Definition at line 31 of file EBCosmicClient.h.

Constructor & Destructor Documentation

EBCosmicClient::EBCosmicClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 31 of file EBCosmicClient.cc.

References cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), h01_, h02_, h03_, i, ecalpyutils::ism(), meh01_, meh02_, meh03_, 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 
55  int ism = superModules_[i];
56 
57  h01_[ism-1] = 0;
58  h02_[ism-1] = 0;
59  h03_[ism-1] = 0;
60 
61  meh01_[ism-1] = 0;
62  meh02_[ism-1] = 0;
63  meh03_[ism-1] = 0;
64 
65  }
66 
67 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
TH1F * h03_[36]
std::vector< int > superModules_
MonitorElement * meh03_[36]
TProfile2D * h01_[36]
std::string prefixME_
TH1F * h02_[36]
MonitorElement * meh01_[36]
MonitorElement * meh02_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
EBCosmicClient::~EBCosmicClient ( )
virtual

Destructor.

Definition at line 69 of file EBCosmicClient.cc.

69  {
70 
71 }

Member Function Documentation

void EBCosmicClient::analyze ( void  )
virtual

Analyze.

Implements EBClient.

Definition at line 150 of file EBCosmicClient.cc.

References cloneME_, gather_cfg::cout, debug_, dqmStore_, DQMStore::get(), h01_, h02_, h03_, i, ievt_, ecalpyutils::ism(), jevt_, meh01_, meh02_, meh03_, prefixME_, Numbers::sEB(), and superModules_.

150  {
151 
152  ievt_++;
153  jevt_++;
154  if ( ievt_ % 10 == 0 ) {
155  if ( debug_ ) std::cout << "EBCosmicClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
156  }
157 
158  MonitorElement* me;
159 
160  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
161 
162  int ism = superModules_[i];
163 
164  me = dqmStore_->get( prefixME_ + "/EBCosmicTask/Sel/EBCT energy sel " + Numbers::sEB(ism) );
165  h01_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h01_[ism-1] );
166  meh01_[ism-1] = me;
167 
168  me = dqmStore_->get( prefixME_ + "/EBCosmicTask/Spectrum/EBCT 1x1 energy spectrum " + Numbers::sEB(ism) );
169  h02_[ism-1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h02_[ism-1] );
170  meh02_[ism-1] = me;
171 
172  me = dqmStore_->get( prefixME_ + "/EBCosmicTask/Spectrum/EBCT 3x3 energy spectrum " + Numbers::sEB(ism) );
173  h03_[ism-1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h03_[ism-1] );
174  meh03_[ism-1] = me;
175 
176  }
177 
178 }
int i
Definition: DBlmapReader.cc:9
DQMStore * dqmStore_
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
TH1F * h03_[36]
std::vector< int > superModules_
MonitorElement * meh03_[36]
TProfile2D * h01_[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
std::string prefixME_
TH1F * h02_[36]
MonitorElement * meh01_[36]
MonitorElement * meh02_[36]
tuple cout
Definition: gather_cfg.py:121
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void EBCosmicClient::beginJob ( void  )
virtual

BeginJob.

Implements EBClient.

Definition at line 73 of file EBCosmicClient.cc.

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

73  {
74 
76 
77  if ( debug_ ) std::cout << "EBCosmicClient: beginJob" << std::endl;
78 
79  ievt_ = 0;
80  jevt_ = 0;
81 
82 }
DQMStore * dqmStore_
tuple cout
Definition: gather_cfg.py:121
void EBCosmicClient::beginRun ( void  )
virtual

BeginRun.

Implements EBClient.

Definition at line 84 of file EBCosmicClient.cc.

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

84  {
85 
86  if ( debug_ ) std::cout << "EBCosmicClient: beginRun" << std::endl;
87 
88  jevt_ = 0;
89 
90  this->setup();
91 
92 }
void setup(void)
Setup.
tuple cout
Definition: gather_cfg.py:121
void EBCosmicClient::cleanup ( void  )
virtual

Cleanup.

Implements EBClient.

Definition at line 114 of file EBCosmicClient.cc.

References cloneME_, enableCleanup_, h01_, h02_, h03_, i, ecalpyutils::ism(), meh01_, meh02_, meh03_, and superModules_.

Referenced by endJob(), and endRun().

114  {
115 
116  if ( ! enableCleanup_ ) return;
117 
118  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
119 
120  int ism = superModules_[i];
121 
122  if ( cloneME_ ) {
123  if ( h01_[ism-1] ) delete h01_[ism-1];
124  if ( h02_[ism-1] ) delete h02_[ism-1];
125  if ( h03_[ism-1] ) delete h03_[ism-1];
126  }
127 
128  h01_[ism-1] = 0;
129  h02_[ism-1] = 0;
130  h03_[ism-1] = 0;
131 
132  meh01_[ism-1] = 0;
133  meh02_[ism-1] = 0;
134  meh03_[ism-1] = 0;
135 
136  }
137 
138 }
int i
Definition: DBlmapReader.cc:9
TH1F * h03_[36]
std::vector< int > superModules_
MonitorElement * meh03_[36]
TProfile2D * h01_[36]
TH1F * h02_[36]
MonitorElement * meh01_[36]
MonitorElement * meh02_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void EBCosmicClient::endJob ( void  )
virtual

EndJob.

Implements EBClient.

Definition at line 94 of file EBCosmicClient.cc.

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

94  {
95 
96  if ( debug_ ) std::cout << "EBCosmicClient: endJob, ievt = " << ievt_ << std::endl;
97 
98  this->cleanup();
99 
100 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
void EBCosmicClient::endRun ( void  )
virtual

EndRun.

Implements EBClient.

Definition at line 102 of file EBCosmicClient.cc.

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

102  {
103 
104  if ( debug_ ) std::cout << "EBCosmicClient: endRun, jevt = " << jevt_ << std::endl;
105 
106  this->cleanup();
107 
108 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
int EBCosmicClient::getEvtPerJob ( void  )
inlinevirtual

Get Functions.

Implements EBClient.

Definition at line 70 of file EBCosmicClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 71 of file EBCosmicClient.h.

References jevt_.

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

Setup.

Implements EBClient.

Definition at line 110 of file EBCosmicClient.cc.

Referenced by beginRun().

110  {
111 
112 }

Friends And Related Function Documentation

friend class EBSummaryClient
friend

Definition at line 33 of file EBCosmicClient.h.

Member Data Documentation

bool EBCosmicClient::cloneME_
private

Definition at line 78 of file EBCosmicClient.h.

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

bool EBCosmicClient::debug_
private

Definition at line 81 of file EBCosmicClient.h.

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

DQMStore* EBCosmicClient::dqmStore_
private

Definition at line 89 of file EBCosmicClient.h.

Referenced by analyze(), and beginJob().

bool EBCosmicClient::enableCleanup_
private

Definition at line 85 of file EBCosmicClient.h.

Referenced by cleanup(), and EBCosmicClient().

TProfile2D* EBCosmicClient::h01_[36]
private

Definition at line 95 of file EBCosmicClient.h.

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

TH1F* EBCosmicClient::h02_[36]
private

Definition at line 96 of file EBCosmicClient.h.

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

TH1F* EBCosmicClient::h03_[36]
private

Definition at line 97 of file EBCosmicClient.h.

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

int EBCosmicClient::ievt_
private

Definition at line 75 of file EBCosmicClient.h.

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

int EBCosmicClient::jevt_
private

Definition at line 76 of file EBCosmicClient.h.

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

MonitorElement* EBCosmicClient::meh01_[36]
private

Definition at line 91 of file EBCosmicClient.h.

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

MonitorElement* EBCosmicClient::meh02_[36]
private

Definition at line 92 of file EBCosmicClient.h.

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

MonitorElement* EBCosmicClient::meh03_[36]
private

Definition at line 93 of file EBCosmicClient.h.

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

std::string EBCosmicClient::prefixME_
private

Definition at line 83 of file EBCosmicClient.h.

Referenced by analyze(), and EBCosmicClient().

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

Definition at line 87 of file EBCosmicClient.h.

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

bool EBCosmicClient::verbose_
private

Definition at line 80 of file EBCosmicClient.h.

Referenced by EBCosmicClient().