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  * \author G. Della Ricca
5  * \author F. Cossutti
6  * \author E. Di Marco
7  *
8 */
9 
10 #include <memory>
11 #include <iostream>
12 #include <fstream>
13 #include <math.h>
14 
16 
19 
21 
23 
25 
26  // cloneME switch
27  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
28 
29  // verbose switch
30  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
31 
32  // debug switch
33  debug_ = ps.getUntrackedParameter<bool>("debug", false);
34 
35  // prefixME path
36  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
37 
38  // enableCleanup_ switch
39  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
40 
41  // vector of selected Super Modules (Defaults to all 36).
42  superModules_.reserve(36);
43  for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
44  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
45 
46  h01_[0] = 0;
47  h01_[1] = 0;
48  h01_[2] = 0;
49 
50  h02_[0] = 0;
51  h02ProjEta_[0] = 0;
52  h02ProjPhi_[0] = 0;
53  h02_[1] = 0;
54  h02ProjEta_[1] = 0;
55  h02ProjPhi_[1] = 0;
56 
57  h03_ = 0;
58  h03ProjEta_ = 0;
59  h03ProjPhi_ = 0;
60 
61  h04_ = 0;
62  h04ProjEta_ = 0;
63  h04ProjPhi_ = 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 << "EBClusterClient: beginJob" << std::endl;
84 
85  ievt_ = 0;
86  jevt_ = 0;
87 
88 }
89 
91 
92  if ( debug_ ) std::cout << "EBClusterClient: beginRun" << std::endl;
93 
94  jevt_ = 0;
95 
96  this->setup();
97 
98 }
99 
101 
102  if ( debug_ ) std::cout << "EBClusterClient: endJob, ievt = " << ievt_ << std::endl;
103 
104  this->cleanup();
105 
106 }
107 
109 
110  if ( debug_ ) std::cout << "EBClusterClient: endRun, jevt = " << jevt_ << std::endl;
111 
112  this->cleanup();
113 
114 }
115 
117 
118  dqmStore_->setCurrentFolder( prefixME_ + "/EBClusterClient" );
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  if ( h02_[0] ) delete h02_[0];
132  if ( h02ProjEta_[0] ) delete h02ProjEta_[0];
133  if ( h02ProjPhi_[0] ) delete h02ProjPhi_[0];
134  if ( h02_[1] ) delete h02_[1];
135  if ( h02ProjEta_[1] ) delete h02ProjEta_[1];
136  if ( h02ProjPhi_[1] ) delete h02ProjPhi_[1];
137 
138  if ( h03_ ) delete h03_;
139  if ( h03ProjEta_ ) delete h03ProjEta_;
140  if ( h03ProjPhi_ ) delete h03ProjPhi_;
141  if ( h04_ ) delete h04_;
142  if ( h04ProjEta_ ) delete h04ProjEta_;
143  if ( h04ProjPhi_ ) delete h04ProjPhi_;
144 
145  if ( i01_[0] ) delete i01_[0];
146  if ( i01_[1] ) delete i01_[1];
147  if ( i01_[2] ) delete i01_[2];
148 
149  if ( s01_[0] ) delete s01_[0];
150  if ( s01_[1] ) delete s01_[1];
151  if ( s01_[2] ) delete s01_[2];
152 
153  }
154 
155  h01_[0] = 0;
156  h01_[1] = 0;
157  h01_[2] = 0;
158 
159  h02_[0] = 0;
160  h02ProjEta_[0] = 0;
161  h02ProjPhi_[0] = 0;
162  h02_[1] = 0;
163  h02ProjEta_[1] = 0;
164  h02ProjPhi_[1] = 0;
165 
166  h03_ = 0;
167  h03ProjEta_ = 0;
168  h03ProjPhi_ = 0;
169  h04_ = 0;
170  h04ProjEta_ = 0;
171  h04ProjPhi_ = 0;
172 
173  i01_[0] = 0;
174  i01_[1] = 0;
175  i01_[2] = 0;
176 
177  s01_[0] = 0;
178  s01_[1] = 0;
179  s01_[2] = 0;
180 
181 }
182 
183 #ifdef WITH_ECAL_COND_DB
184 bool EBClusterClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
185 
186  status = true;
187 
188  return true;
189 
190 }
191 #endif
192 
194 
195  ievt_++;
196  jevt_++;
197  if ( ievt_ % 10 == 0 ) {
198  if ( debug_ ) std::cout << "EBClusterClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
199  }
200 
201  MonitorElement* me;
202 
203  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC energy" );
204  h01_[0] = UtilsClient::getHisto( me, cloneME_, h01_[0] );
205 
206  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC size" );
207  h01_[1] = UtilsClient::getHisto( me, cloneME_, h01_[1] );
208 
209  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC number" );
210  h01_[2] = UtilsClient::getHisto( me, cloneME_, h01_[2] );
211 
212  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC energy map" );
213  h02_[0] = UtilsClient::getHisto( me, cloneME_, h02_[0] );
214 
215  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC ET map" );
216  h02_[1] = UtilsClient::getHisto( me, cloneME_, h02_[1] );
217 
218  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC number map" );
220 
221  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC size map" );
223 
224  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC energy projection eta" );
226 
227  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC energy projection phi" );
229 
230  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC ET projection eta" );
232 
233  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC ET projection phi" );
235 
236  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC number projection eta" );
238 
239  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC number projection phi" );
241 
242  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC size projection eta" );
244 
245  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT BC size projection phi" );
247 
248  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT SC energy" );
249  i01_[0] = UtilsClient::getHisto( me, cloneME_, i01_[0] );
250 
251  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT SC size" );
252  i01_[1] = UtilsClient::getHisto( me, cloneME_, i01_[1] );
253 
254  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT SC number" );
255  i01_[2] = UtilsClient::getHisto( me, cloneME_, i01_[2] );
256 
257  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT s1s9" );
258  s01_[0] = UtilsClient::getHisto( me, cloneME_, s01_[0] );
259 
260  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT s9s25" );
261  s01_[1] = UtilsClient::getHisto( me, cloneME_, s01_[1] );
262 
263  me = dqmStore_->get( prefixME_ + "/EBClusterTask/EBCLT dicluster invariant mass Pi0" );
264  s01_[2] = UtilsClient::getHisto( me, cloneME_, s01_[2] );
265 
266 }
267 
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:89
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:1623
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:584
TProfile * h02ProjEta_[2]