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: 2010/03/27 20:07:56 $
5  * $Revision: 1.74 $
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 
20 
22 
24 
26 
27  // cloneME switch
28  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
29 
30  // verbose switch
31  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
32 
33  // debug switch
34  debug_ = ps.getUntrackedParameter<bool>("debug", false);
35 
36  // prefixME path
37  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
38 
39  // enableCleanup_ switch
40  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
41 
42  // vector of selected Super Modules (Defaults to all 36).
43  superModules_.reserve(36);
44  for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
45  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
46 
47  h01_[0] = 0;
48  h01_[1] = 0;
49  h01_[2] = 0;
50 
51  h02_[0] = 0;
52  h02ProjEta_[0] = 0;
53  h02ProjPhi_[0] = 0;
54  h02_[1] = 0;
55  h02ProjEta_[1] = 0;
56  h02ProjPhi_[1] = 0;
57 
58  h03_ = 0;
59  h03ProjEta_ = 0;
60  h03ProjPhi_ = 0;
61 
62  h04_ = 0;
63  h04ProjEta_ = 0;
64  h04ProjPhi_ = 0;
65 
66  i01_[0] = 0;
67  i01_[1] = 0;
68  i01_[2] = 0;
69 
70  s01_[0] = 0;
71  s01_[1] = 0;
72  s01_[2] = 0;
73 
74 }
75 
77 
78 }
79 
81 
83 
84  if ( debug_ ) std::cout << "EBClusterClient: beginJob" << std::endl;
85 
86  ievt_ = 0;
87  jevt_ = 0;
88 
89 }
90 
92 
93  if ( debug_ ) std::cout << "EBClusterClient: beginRun" << std::endl;
94 
95  jevt_ = 0;
96 
97  this->setup();
98 
99 }
100 
102 
103  if ( debug_ ) std::cout << "EBClusterClient: endJob, ievt = " << ievt_ << std::endl;
104 
105  this->cleanup();
106 
107 }
108 
110 
111  if ( debug_ ) std::cout << "EBClusterClient: endRun, jevt = " << jevt_ << std::endl;
112 
113  this->cleanup();
114 
115 }
116 
118 
119  dqmStore_->setCurrentFolder( prefixME_ + "/EBClusterClient" );
120 
121 }
122 
124 
125  if ( ! enableCleanup_ ) return;
126 
127  if ( cloneME_ ) {
128  if ( h01_[0] ) delete h01_[0];
129  if ( h01_[1] ) delete h01_[1];
130  if ( h01_[2] ) delete h01_[2];
131 
132  if ( h02_[0] ) delete h02_[0];
133  if ( h02ProjEta_[0] ) delete h02ProjEta_[0];
134  if ( h02ProjPhi_[0] ) delete h02ProjPhi_[0];
135  if ( h02_[1] ) delete h02_[1];
136  if ( h02ProjEta_[1] ) delete h02ProjEta_[1];
137  if ( h02ProjPhi_[1] ) delete h02ProjPhi_[1];
138 
139  if ( h03_ ) delete h03_;
140  if ( h03ProjEta_ ) delete h03ProjEta_;
141  if ( h03ProjPhi_ ) delete h03ProjPhi_;
142  if ( h04_ ) delete h04_;
143  if ( h04ProjEta_ ) delete h04ProjEta_;
144  if ( h04ProjPhi_ ) delete h04ProjPhi_;
145 
146  if ( i01_[0] ) delete i01_[0];
147  if ( i01_[1] ) delete i01_[1];
148  if ( i01_[2] ) delete i01_[2];
149 
150  if ( s01_[0] ) delete s01_[0];
151  if ( s01_[1] ) delete s01_[1];
152  if ( s01_[2] ) delete s01_[2];
153 
154  }
155 
156  h01_[0] = 0;
157  h01_[1] = 0;
158  h01_[2] = 0;
159 
160  h02_[0] = 0;
161  h02ProjEta_[0] = 0;
162  h02ProjPhi_[0] = 0;
163  h02_[1] = 0;
164  h02ProjEta_[1] = 0;
165  h02ProjPhi_[1] = 0;
166 
167  h03_ = 0;
168  h03ProjEta_ = 0;
169  h03ProjPhi_ = 0;
170  h04_ = 0;
171  h04ProjEta_ = 0;
172  h04ProjPhi_ = 0;
173 
174  i01_[0] = 0;
175  i01_[1] = 0;
176  i01_[2] = 0;
177 
178  s01_[0] = 0;
179  s01_[1] = 0;
180  s01_[2] = 0;
181 
182 }
183 
184 #ifdef WITH_ECAL_COND_DB
185 bool EBClusterClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
186 
187  status = true;
188 
189  return true;
190 
191 }
192 #endif
193 
195 
196  ievt_++;
197  jevt_++;
198  if ( ievt_ % 10 == 0 ) {
199  if ( debug_ ) std::cout << "EBClusterClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
200  }
201 
202  char histo[200];
203 
204  MonitorElement* me;
205 
206  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC energy").c_str());
207  me = dqmStore_->get(histo);
208  h01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h01_[0] );
209 
210  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC size").c_str());
211  me = dqmStore_->get(histo);
212  h01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h01_[1] );
213 
214  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC number").c_str());
215  me = dqmStore_->get(histo);
216  h01_[2] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h01_[2] );
217 
218  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC energy map").c_str());
219  me = dqmStore_->get(histo);
220  h02_[0] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h02_[0] );
221 
222  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC ET map").c_str());
223  me = dqmStore_->get(histo);
224  h02_[1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h02_[1] );
225 
226  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC number map").c_str());
227  me = dqmStore_->get(histo);
228  h03_ = UtilsClient::getHisto<TH2F*>( me, cloneME_, h03_ );
229 
230  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC size map").c_str());
231  me = dqmStore_->get(histo);
232  h04_ = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h04_ );
233 
234  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC energy projection eta").c_str());
235  me = dqmStore_->get(histo);
236  h02ProjEta_[0] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjEta_[0] );
237 
238  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC energy projection phi").c_str());
239  me = dqmStore_->get(histo);
240  h02ProjPhi_[0] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjPhi_[0] );
241 
242  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC ET projection eta").c_str());
243  me = dqmStore_->get(histo);
244  h02ProjEta_[1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjEta_[1] );
245 
246  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC ET projection phi").c_str());
247  me = dqmStore_->get(histo);
248  h02ProjPhi_[1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjPhi_[1] );
249 
250  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC number projection eta").c_str());
251  me = dqmStore_->get(histo);
252  h03ProjEta_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, h03ProjEta_ );
253 
254  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC number projection phi").c_str());
255  me = dqmStore_->get(histo);
256  h03ProjPhi_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, h03ProjPhi_ );
257 
258  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC size projection eta").c_str());
259  me = dqmStore_->get(histo);
260  h04ProjEta_ = UtilsClient::getHisto<TProfile*>( me, cloneME_, h04ProjEta_ );
261 
262  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT BC size projection phi").c_str());
263  me = dqmStore_->get(histo);
264  h04ProjPhi_ = UtilsClient::getHisto<TProfile*>( me, cloneME_, h04ProjPhi_ );
265 
266  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT SC energy").c_str());
267  me = dqmStore_->get(histo);
268  i01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, i01_[0] );
269 
270  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT SC size").c_str());
271  me = dqmStore_->get(histo);
272  i01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, i01_[1] );
273 
274  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT SC number").c_str());
275  me = dqmStore_->get(histo);
276  i01_[2] = UtilsClient::getHisto<TH1F*>( me, cloneME_, i01_[2] );
277 
278  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT s1s9").c_str());
279  me = dqmStore_->get(histo);
280  s01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, s01_[0] );
281 
282  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT s9s25").c_str());
283  me = dqmStore_->get(histo);
284  s01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, s01_[1] );
285 
286  sprintf(histo, (prefixME_ + "/EBClusterTask/EBCLT dicluster invariant mass Pi0").c_str());
287  me = dqmStore_->get(histo);
288  s01_[2] = UtilsClient::getHisto<TH1F*>( me, cloneME_, s01_[2] );
289 
290 }
291 
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
TProfile * h04ProjPhi_
void endRun(void)
EndRun.
void beginRun(void)
BeginRun.
void setup(void)
Setup.
tuple histo
Definition: trackerHits.py:12
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:1270
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:41
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:237
TProfile * h02ProjEta_[2]