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  * \author G. Della Ricca
5  * \author E. Di Marco
6  *
7 */
8 
9 #include <memory>
10 #include <iostream>
11 #include <fstream>
12 
14 
17 
20 
22 
24 
25  // cloneME switch
26  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
27 
28  // verbose switch
29  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
30 
31  // debug switch
32  debug_ = ps.getUntrackedParameter<bool>("debug", false);
33 
34  // prefixME path
35  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
36 
37  // enableCleanup_ switch
38  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
39 
40  // vector of selected Super Modules (Defaults to all 18).
41  superModules_.reserve(18);
42  for ( unsigned int i = 1; i <= 18; i++ ) superModules_.push_back(i);
43  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
44 
45  h01_[0] = 0;
46  h01_[1] = 0;
47  h01_[2] = 0;
48 
49  for(int iEE=0;iEE<2;iEE++) {
50  for(int i=0;i<3;++i) {
51  h04_[i][iEE] = 0;
52  h02ProjEta_[i][iEE] = 0;
53  h02ProjPhi_[i][iEE] = 0;
54  }
55  }
56 
57  h03_[0] = 0;
58  h03ProjEta_[0] = 0;
59  h03ProjPhi_[0] = 0;
60 
61  h03_[1] = 0;
62  h03ProjEta_[1] = 0;
63  h03ProjPhi_[1] = 0;
64 
65  i01_[0] = 0;
66  i01_[1] = 0;
67  i01_[2] = 0;
68 
69  s01_[0] = 0;
70  s01_[1] = 0;
71  s01_[2] = 0;
72 
73 }
74 
76 
77 }
78 
80 
82 
83  if ( debug_ ) std::cout << "EEClusterClient: beginJob" << std::endl;
84 
85  ievt_ = 0;
86  jevt_ = 0;
87 
88 }
89 
91 
92  if ( debug_ ) std::cout << "EEClusterClient: beginRun" << std::endl;
93 
94  jevt_ = 0;
95 
96  this->setup();
97 
98 }
99 
101 
102  if ( debug_ ) std::cout << "EEClusterClient: endJob, ievt = " << ievt_ << std::endl;
103 
104  this->cleanup();
105 
106 }
107 
109 
110  if ( debug_ ) std::cout << "EEClusterClient: endRun, jevt = " << jevt_ << std::endl;
111 
112  this->cleanup();
113 
114 }
115 
117 
118  dqmStore_->setCurrentFolder( prefixME_ + "/EEClusterClient" );
119 
120 }
121 
123 
124  if ( ! enableCleanup_ ) return;
125 
126  if ( cloneME_ ) {
127  if ( h01_[0] ) delete h01_[0];
128  if ( h01_[1] ) delete h01_[1];
129  if ( h01_[2] ) delete h01_[2];
130 
131  for(int iEE=0;iEE<2;iEE++) {
132  for(int i=0;i<3;++i) {
133  if(h04_[i][iEE]) delete h04_[i][iEE];
134  if(h02ProjEta_[i][iEE]) delete h02ProjEta_[i][iEE];
135  if(h02ProjPhi_[i][iEE]) delete h02ProjPhi_[i][iEE];
136  }
137  }
138 
139  if(h03_[0]) delete h03_[0];
140  if(h03ProjEta_[0]) delete h03ProjEta_[0];
141  if(h03ProjPhi_[0]) delete h03ProjPhi_[0];
142 
143  if(h03_[1]) delete h03_[1];
144  if(h03ProjEta_[1]) delete h03ProjEta_[1];
145  if(h03ProjPhi_[1]) delete h03ProjPhi_[1];
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  for(int iEE=0;iEE<2;iEE++) {
162  for(int i=0;i<3;++i) {
163  h04_[i][iEE] = 0;
164  h02ProjEta_[i][iEE] = 0;
165  h02ProjPhi_[i][iEE] = 0;
166  }
167  }
168 
169  h03_[0] = 0;
170  h03ProjEta_[0] = 0;
171  h03ProjPhi_[0] = 0;
172 
173  h03_[1] = 0;
174  h03ProjEta_[1] = 0;
175  h03ProjPhi_[1] = 0;
176 
177  i01_[0] = 0;
178  i01_[1] = 0;
179  i01_[2] = 0;
180 
181  s01_[0] = 0;
182  s01_[1] = 0;
183  s01_[2] = 0;
184 
185 }
186 
187 #ifdef WITH_ECAL_COND_DB
188 bool EEClusterClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
189 
190  status = true;
191 
192  return true;
193 
194 }
195 #endif
196 
198 
199  ievt_++;
200  jevt_++;
201  if ( ievt_ % 10 == 0 ) {
202  if ( debug_ ) std::cout << "EEClusterClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
203  }
204 
205  MonitorElement* me;
206 
207  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy" );
208  h01_[0] = UtilsClient::getHisto( me, cloneME_, h01_[0] );
209 
210  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size" );
211  h01_[1] = UtilsClient::getHisto( me, cloneME_, h01_[1] );
212 
213  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number" );
214  h01_[2] = UtilsClient::getHisto( me, cloneME_, h01_[2] );
215 
216  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy map EE -" );
217  h04_[0][0] = UtilsClient::getHisto( me, cloneME_, h04_[0][0] );
218 
219  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number map EE -" );
220  h03_[0] = UtilsClient::getHisto( me, cloneME_, h03_[0] );
221 
222  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET map EE -" );
223  h04_[1][0] = UtilsClient::getHisto( me, cloneME_, h04_[1][0] );
224 
225  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size map EE -" );
226  h04_[2][0] = UtilsClient::getHisto( me, cloneME_, h04_[2][0] );
227 
228  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy projection eta EE -" );
230 
231  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy projection phi EE -" );
233 
234  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number projection eta EE -" );
236 
237  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number projection phi EE -" );
239 
240  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET projection eta EE -" );
242 
243  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET projection phi EE -" );
245 
246  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size projection eta EE -" );
248 
249  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size projection phi EE -" );
251 
252  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy map EE +" );
253  h04_[0][1] = UtilsClient::getHisto( me, cloneME_, h04_[0][1] );
254 
255  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number map EE +" );
256  h03_[1] = UtilsClient::getHisto( me, cloneME_, h03_[1] );
257 
258  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET map EE +" );
259  h04_[1][1] = UtilsClient::getHisto( me, cloneME_, h04_[1][1] );
260 
261  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size map EE +" );
262  h04_[2][1] = UtilsClient::getHisto( me, cloneME_, h04_[2][1] );
263 
264  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy projection eta EE +" );
266 
267  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC energy projection phi EE +" );
269 
270  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number projection eta EE +" );
272 
273  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC number projection phi EE +" );
275 
276  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET projection eta EE +" );
278 
279  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC ET projection phi EE +" );
281 
282  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size projection eta EE +" );
284 
285  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT BC size projection phi EE +" );
287 
288  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT SC energy" );
289  i01_[0] = UtilsClient::getHisto( me, cloneME_, i01_[0] );
290 
291  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT SC size" );
292  i01_[1] = UtilsClient::getHisto( me, cloneME_, i01_[1] );
293 
294  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT SC number" );
295  i01_[2] = UtilsClient::getHisto( me, cloneME_, i01_[2] );
296 
297  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT s1s9" );
298  s01_[0] = UtilsClient::getHisto( me, cloneME_, s01_[0] );
299 
300  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT s9s25" );
301  s01_[1] = UtilsClient::getHisto( me, cloneME_, s01_[1] );
302 
303  me = dqmStore_->get( prefixME_ + "/EEClusterTask/EECLT dicluster invariant mass Pi0" );
304  s01_[2] = UtilsClient::getHisto( me, cloneME_, s01_[2] );
305 
306 }
307 
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:89
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:1623
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:584
std::string prefixME_