CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EEClusterClient.cc
Go to the documentation of this file.
1 /*
2  * \file EEClusterClient.cc
3  *
4  * $Date: 2011/09/02 13:55:02 $
5  * $Revision: 1.66 $
6  * \author G. Della Ricca
7  * \author E. Di Marco
8  *
9 */
10 
11 #include <memory>
12 #include <iostream>
13 #include <fstream>
14 
16 
19 
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 18).
43  superModules_.reserve(18);
44  for ( unsigned int i = 1; i <= 18; 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  for(int iEE=0;iEE<2;iEE++) {
52  for(int i=0;i<3;++i) {
53  h04_[i][iEE] = 0;
54  h02ProjEta_[i][iEE] = 0;
55  h02ProjPhi_[i][iEE] = 0;
56  }
57  }
58 
59  h03_[0] = 0;
60  h03ProjEta_[0] = 0;
61  h03ProjPhi_[0] = 0;
62 
63  h03_[1] = 0;
64  h03ProjEta_[1] = 0;
65  h03ProjPhi_[1] = 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 << "EEClusterClient: beginJob" << std::endl;
86 
87  ievt_ = 0;
88  jevt_ = 0;
89 
90 }
91 
93 
94  if ( debug_ ) std::cout << "EEClusterClient: beginRun" << std::endl;
95 
96  jevt_ = 0;
97 
98  this->setup();
99 
100 }
101 
103 
104  if ( debug_ ) std::cout << "EEClusterClient: endJob, ievt = " << ievt_ << std::endl;
105 
106  this->cleanup();
107 
108 }
109 
111 
112  if ( debug_ ) std::cout << "EEClusterClient: endRun, jevt = " << jevt_ << std::endl;
113 
114  this->cleanup();
115 
116 }
117 
119 
120  dqmStore_->setCurrentFolder( prefixME_ + "/EEClusterClient" );
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  for(int iEE=0;iEE<2;iEE++) {
134  for(int i=0;i<3;++i) {
135  if(h04_[i][iEE]) delete h04_[i][iEE];
136  if(h02ProjEta_[i][iEE]) delete h02ProjEta_[i][iEE];
137  if(h02ProjPhi_[i][iEE]) delete h02ProjPhi_[i][iEE];
138  }
139  }
140 
141  if(h03_[0]) delete h03_[0];
142  if(h03ProjEta_[0]) delete h03ProjEta_[0];
143  if(h03ProjPhi_[0]) delete h03ProjPhi_[0];
144 
145  if(h03_[1]) delete h03_[1];
146  if(h03ProjEta_[1]) delete h03ProjEta_[1];
147  if(h03ProjPhi_[1]) delete h03ProjPhi_[1];
148 
149  if(i01_[0]) delete i01_[0];
150  if(i01_[1]) delete i01_[1];
151  if(i01_[2]) delete i01_[2];
152 
153  if(s01_[0]) delete s01_[0];
154  if(s01_[1]) delete s01_[1];
155  if(s01_[2]) delete s01_[2];
156 
157  }
158 
159  h01_[0] = 0;
160  h01_[1] = 0;
161  h01_[2] = 0;
162 
163  for(int iEE=0;iEE<2;iEE++) {
164  for(int i=0;i<3;++i) {
165  h04_[i][iEE] = 0;
166  h02ProjEta_[i][iEE] = 0;
167  h02ProjPhi_[i][iEE] = 0;
168  }
169  }
170 
171  h03_[0] = 0;
172  h03ProjEta_[0] = 0;
173  h03ProjPhi_[0] = 0;
174 
175  h03_[1] = 0;
176  h03ProjEta_[1] = 0;
177  h03ProjPhi_[1] = 0;
178 
179  i01_[0] = 0;
180  i01_[1] = 0;
181  i01_[2] = 0;
182 
183  s01_[0] = 0;
184  s01_[1] = 0;
185  s01_[2] = 0;
186 
187 }
188 
189 #ifdef WITH_ECAL_COND_DB
190 bool EEClusterClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
191 
192  status = true;
193 
194  return true;
195 
196 }
197 #endif
198 
200 
201  ievt_++;
202  jevt_++;
203  if ( ievt_ % 10 == 0 ) {
204  if ( debug_ ) std::cout << "EEClusterClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
205  }
206 
207  MonitorElement* me;
208 
209  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy" );
210  h01_[0] = UtilsClient::getHisto( me, cloneME_, h01_[0] );
211 
212  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size" );
213  h01_[1] = UtilsClient::getHisto( me, cloneME_, h01_[1] );
214 
215  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number" );
216  h01_[2] = UtilsClient::getHisto( me, cloneME_, h01_[2] );
217 
218  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy map EE -" );
219  h04_[0][0] = UtilsClient::getHisto( me, cloneME_, h04_[0][0] );
220 
221  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number map EE -" );
222  h03_[0] = UtilsClient::getHisto( me, cloneME_, h03_[0] );
223 
224  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET map EE -" );
225  h04_[1][0] = UtilsClient::getHisto( me, cloneME_, h04_[1][0] );
226 
227  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size map EE -" );
228  h04_[2][0] = UtilsClient::getHisto( me, cloneME_, h04_[2][0] );
229 
230  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy projection eta EE -" );
232 
233  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy projection phi EE -" );
235 
236  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number projection eta EE -" );
238 
239  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number projection phi EE -" );
241 
242  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET projection eta EE -" );
244 
245  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET projection phi EE -" );
247 
248  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size projection eta EE -" );
250 
251  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size projection phi EE -" );
253 
254  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy map EE +" );
255  h04_[0][1] = UtilsClient::getHisto( me, cloneME_, h04_[0][1] );
256 
257  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number map EE +" );
258  h03_[1] = UtilsClient::getHisto( me, cloneME_, h03_[1] );
259 
260  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET map EE +" );
261  h04_[1][1] = UtilsClient::getHisto( me, cloneME_, h04_[1][1] );
262 
263  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size map EE +" );
264  h04_[2][1] = UtilsClient::getHisto( me, cloneME_, h04_[2][1] );
265 
266  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy projection eta EE +" );
268 
269  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy projection phi EE +" );
271 
272  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number projection eta EE +" );
274 
275  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number projection phi EE +" );
277 
278  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET projection eta EE +" );
280 
281  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET projection phi EE +" );
283 
284  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size projection eta EE +" );
286 
287  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size projection phi EE +" );
289 
290  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT SC energy" );
291  i01_[0] = UtilsClient::getHisto( me, cloneME_, i01_[0] );
292 
293  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT SC size" );
294  i01_[1] = UtilsClient::getHisto( me, cloneME_, i01_[1] );
295 
296  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT SC number" );
297  i01_[2] = UtilsClient::getHisto( me, cloneME_, i01_[2] );
298 
299  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT s1s9" );
300  s01_[0] = UtilsClient::getHisto( me, cloneME_, s01_[0] );
301 
302  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT s9s25" );
303  s01_[1] = UtilsClient::getHisto( me, cloneME_, s01_[1] );
304 
305  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT dicluster invariant mass Pi0" );
306  s01_[2] = UtilsClient::getHisto( me, cloneME_, s01_[2] );
307 
308 }
309 
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< int > superModules_
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:91
Some &quot;id&quot; conversions.
void beginRun(void)
BeginRun.
TProfile * h02ProjPhi_[3][2]
virtual ~EEClusterClient()
Destructor.
void setup(void)
Setup.
void beginJob(void)
BeginJob.
TProfile * h02ProjEta_[3][2]
TProfile2D * h04_[3][2]
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
Ecal Monitor Utils for Client.
void analyze(void)
Analyze.
EEClusterClient(const edm::ParameterSet &ps)
Constructor.
TH1F * h03ProjPhi_[2]
TH1F * h03ProjEta_[2]
DQMStore * dqmStore_
void cleanup(void)
Cleanup.
void endJob(void)
EndJob.
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
Definition: RunIOV.h:13
void endRun(void)
EndRun.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
std::string prefixME_