CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EBClusterClient.cc
Go to the documentation of this file.
1 /*
2  * \file EBClusterClient.cc
3  *
4  * $Date: 2012/04/27 13:45:58 $
5  * $Revision: 1.80 $
6  * \author G. Della Ricca
7  * \author F. Cossutti
8  * \author E. Di Marco
9  *
10 */
11 
12 #include <memory>
13 #include <iostream>
14 #include <fstream>
15 #include <math.h>
16 
18 
21 
23 
25 
27 
28  // cloneME switch
29  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
30 
31  // verbose switch
32  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
33 
34  // debug switch
35  debug_ = ps.getUntrackedParameter<bool>("debug", false);
36 
37  // prefixME path
38  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
39 
40  // enableCleanup_ switch
41  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
42 
43  // vector of selected Super Modules (Defaults to all 36).
44  superModules_.reserve(36);
45  for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
46  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
47 
48  h01_[0] = 0;
49  h01_[1] = 0;
50  h01_[2] = 0;
51 
52  h02_[0] = 0;
53  h02ProjEta_[0] = 0;
54  h02ProjPhi_[0] = 0;
55  h02_[1] = 0;
56  h02ProjEta_[1] = 0;
57  h02ProjPhi_[1] = 0;
58 
59  h03_ = 0;
60  h03ProjEta_ = 0;
61  h03ProjPhi_ = 0;
62 
63  h04_ = 0;
64  h04ProjEta_ = 0;
65  h04ProjPhi_ = 0;
66 
67  i01_[0] = 0;
68  i01_[1] = 0;
69  i01_[2] = 0;
70 
71  s01_[0] = 0;
72  s01_[1] = 0;
73  s01_[2] = 0;
74 
75 }
76 
78 
79 }
80 
82 
84 
85  if ( debug_ ) std::cout << "EBClusterClient: beginJob" << std::endl;
86 
87  ievt_ = 0;
88  jevt_ = 0;
89 
90 }
91 
93 
94  if ( debug_ ) std::cout << "EBClusterClient: beginRun" << std::endl;
95 
96  jevt_ = 0;
97 
98  this->setup();
99 
100 }
101 
103 
104  if ( debug_ ) std::cout << "EBClusterClient: endJob, ievt = " << ievt_ << std::endl;
105 
106  this->cleanup();
107 
108 }
109 
111 
112  if ( debug_ ) std::cout << "EBClusterClient: endRun, jevt = " << jevt_ << std::endl;
113 
114  this->cleanup();
115 
116 }
117 
119 
120  dqmStore_->setCurrentFolder( prefixME_ + "/EBClusterClient" );
121 
122 }
123 
125 
126  if ( ! enableCleanup_ ) return;
127 
128  if ( cloneME_ ) {
129  if ( h01_[0] ) delete h01_[0];
130  if ( h01_[1] ) delete h01_[1];
131  if ( h01_[2] ) delete h01_[2];
132 
133  if ( h02_[0] ) delete h02_[0];
134  if ( h02ProjEta_[0] ) delete h02ProjEta_[0];
135  if ( h02ProjPhi_[0] ) delete h02ProjPhi_[0];
136  if ( h02_[1] ) delete h02_[1];
137  if ( h02ProjEta_[1] ) delete h02ProjEta_[1];
138  if ( h02ProjPhi_[1] ) delete h02ProjPhi_[1];
139 
140  if ( h03_ ) delete h03_;
141  if ( h03ProjEta_ ) delete h03ProjEta_;
142  if ( h03ProjPhi_ ) delete h03ProjPhi_;
143  if ( h04_ ) delete h04_;
144  if ( h04ProjEta_ ) delete h04ProjEta_;
145  if ( h04ProjPhi_ ) delete h04ProjPhi_;
146 
147  if ( i01_[0] ) delete i01_[0];
148  if ( i01_[1] ) delete i01_[1];
149  if ( i01_[2] ) delete i01_[2];
150 
151  if ( s01_[0] ) delete s01_[0];
152  if ( s01_[1] ) delete s01_[1];
153  if ( s01_[2] ) delete s01_[2];
154 
155  }
156 
157  h01_[0] = 0;
158  h01_[1] = 0;
159  h01_[2] = 0;
160 
161  h02_[0] = 0;
162  h02ProjEta_[0] = 0;
163  h02ProjPhi_[0] = 0;
164  h02_[1] = 0;
165  h02ProjEta_[1] = 0;
166  h02ProjPhi_[1] = 0;
167 
168  h03_ = 0;
169  h03ProjEta_ = 0;
170  h03ProjPhi_ = 0;
171  h04_ = 0;
172  h04ProjEta_ = 0;
173  h04ProjPhi_ = 0;
174 
175  i01_[0] = 0;
176  i01_[1] = 0;
177  i01_[2] = 0;
178 
179  s01_[0] = 0;
180  s01_[1] = 0;
181  s01_[2] = 0;
182 
183 }
184 
185 #ifdef WITH_ECAL_COND_DB
186 bool EBClusterClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
187 
188  status = true;
189 
190  return true;
191 
192 }
193 #endif
194 
196 
197  ievt_++;
198  jevt_++;
199  if ( ievt_ % 10 == 0 ) {
200  if ( debug_ ) std::cout << "EBClusterClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
201  }
202 
203  MonitorElement* me;
204 
205  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC energy" );
206  h01_[0] = UtilsClient::getHisto( me, cloneME_, h01_[0] );
207 
208  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC size" );
209  h01_[1] = UtilsClient::getHisto( me, cloneME_, h01_[1] );
210 
211  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC number" );
212  h01_[2] = UtilsClient::getHisto( me, cloneME_, h01_[2] );
213 
214  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC energy map" );
215  h02_[0] = UtilsClient::getHisto( me, cloneME_, h02_[0] );
216 
217  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC ET map" );
218  h02_[1] = UtilsClient::getHisto( me, cloneME_, h02_[1] );
219 
220  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC number map" );
222 
223  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC size map" );
225 
226  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC energy projection eta" );
228 
229  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC energy projection phi" );
231 
232  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC ET projection eta" );
234 
235  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC ET projection phi" );
237 
238  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC number projection eta" );
240 
241  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC number projection phi" );
243 
244  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC size projection eta" );
246 
247  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC size projection phi" );
249 
250  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT SC energy" );
251  i01_[0] = UtilsClient::getHisto( me, cloneME_, i01_[0] );
252 
253  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT SC size" );
254  i01_[1] = UtilsClient::getHisto( me, cloneME_, i01_[1] );
255 
256  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT SC number" );
257  i01_[2] = UtilsClient::getHisto( me, cloneME_, i01_[2] );
258 
259  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT s1s9" );
260  s01_[0] = UtilsClient::getHisto( me, cloneME_, s01_[0] );
261 
262  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT s9s25" );
263  s01_[1] = UtilsClient::getHisto( me, cloneME_, s01_[1] );
264 
265  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT dicluster invariant mass Pi0" );
266  s01_[2] = UtilsClient::getHisto( me, cloneME_, s01_[2] );
267 
268 }
269 
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
TProfile * h04ProjPhi_
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:91
void endRun(void)
EndRun.
void beginRun(void)
BeginRun.
void setup(void)
Setup.
std::vector< int > superModules_
EBClusterClient(const edm::ParameterSet &ps)
Constructor.
void analyze(void)
Analyze.
virtual ~EBClusterClient()
Destructor.
std::string prefixME_
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
void beginJob(void)
BeginJob.
DQMStore * dqmStore_
Ecal Monitor Utils for Client.
TProfile2D * h04_
TProfile2D * h02_[2]
TProfile * h02ProjPhi_[2]
TProfile * h04ProjEta_
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
void cleanup(void)
Cleanup.
Definition: RunIOV.h:13
void endJob(void)
EndJob.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
TProfile * h02ProjEta_[2]