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

#include <EECosmicClient.h>

Inheritance diagram for EECosmicClient:
EEClient

Public Member Functions

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

Private Attributes

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

Friends

class EESummaryClient
 

Detailed Description

Definition at line 31 of file EECosmicClient.h.

Constructor & Destructor Documentation

EECosmicClient::EECosmicClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 30 of file EECosmicClient.cc.

References cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), h01_, h02_, h03_, i, ecalpyutils::ism(), meh01_, meh02_, meh03_, prefixME_, AlCaHLTBitMon_QueryRunRegistry::string, superModules_, and verbose_.

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

Destructor.

Definition at line 68 of file EECosmicClient.cc.

68  {
69 
70 }

Member Function Documentation

void EECosmicClient::analyze ( void  )
virtual

Analyze.

Implements EEClient.

Definition at line 149 of file EECosmicClient.cc.

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

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

BeginJob.

Implements EEClient.

Definition at line 72 of file EECosmicClient.cc.

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

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

BeginRun.

Implements EEClient.

Definition at line 83 of file EECosmicClient.cc.

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

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

Cleanup.

Implements EEClient.

Definition at line 113 of file EECosmicClient.cc.

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

Referenced by endJob(), and endRun().

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

EndJob.

Implements EEClient.

Definition at line 93 of file EECosmicClient.cc.

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

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

EndRun.

Implements EEClient.

Definition at line 101 of file EECosmicClient.cc.

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

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

Get Functions.

Implements EEClient.

Definition at line 70 of file EECosmicClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EEClient.

Definition at line 71 of file EECosmicClient.h.

References jevt_.

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

Setup.

Implements EEClient.

Definition at line 109 of file EECosmicClient.cc.

Referenced by beginRun().

109  {
110 
111 }

Friends And Related Function Documentation

friend class EESummaryClient
friend

Definition at line 33 of file EECosmicClient.h.

Member Data Documentation

bool EECosmicClient::cloneME_
private

Definition at line 78 of file EECosmicClient.h.

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

bool EECosmicClient::debug_
private

Definition at line 81 of file EECosmicClient.h.

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

DQMStore* EECosmicClient::dqmStore_
private

Definition at line 89 of file EECosmicClient.h.

Referenced by analyze(), and beginJob().

bool EECosmicClient::enableCleanup_
private

Definition at line 85 of file EECosmicClient.h.

Referenced by cleanup(), and EECosmicClient().

TProfile2D* EECosmicClient::h01_[18]
private

Definition at line 95 of file EECosmicClient.h.

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

TH1F* EECosmicClient::h02_[18]
private

Definition at line 96 of file EECosmicClient.h.

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

TH1F* EECosmicClient::h03_[18]
private

Definition at line 97 of file EECosmicClient.h.

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

int EECosmicClient::ievt_
private

Definition at line 75 of file EECosmicClient.h.

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

int EECosmicClient::jevt_
private

Definition at line 76 of file EECosmicClient.h.

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

MonitorElement* EECosmicClient::meh01_[18]
private

Definition at line 91 of file EECosmicClient.h.

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

MonitorElement* EECosmicClient::meh02_[18]
private

Definition at line 92 of file EECosmicClient.h.

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

MonitorElement* EECosmicClient::meh03_[18]
private

Definition at line 93 of file EECosmicClient.h.

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

std::string EECosmicClient::prefixME_
private

Definition at line 83 of file EECosmicClient.h.

Referenced by analyze(), and EECosmicClient().

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

Definition at line 87 of file EECosmicClient.h.

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

bool EECosmicClient::verbose_
private

Definition at line 80 of file EECosmicClient.h.

Referenced by EECosmicClient().