CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EBBeamHodoClient.cc
Go to the documentation of this file.
1 /*
2  * \file EBBeamHodoClient.cc
3  *
4  * $Date: 2011/08/30 09:33:51 $
5  * $Revision: 1.74 $
6  * \author G. Della Ricca
7  * \author G. Franzoni
8  *
9 */
10 
11 #include <memory>
12 #include <iostream>
13 #include <sstream>
14 #include <iomanip>
15 
17 
20 
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  for (int i=0; i<4; i++) {
49 
50  ho01_[i] = 0;
51  hr01_[i] = 0;
52 
53  }
54 
55  hp01_[0] = 0;
56  hp01_[1] = 0;
57 
58  hp02_ = 0;
59 
60  hs01_[0] = 0;
61  hs01_[1] = 0;
62 
63  hq01_[0] = 0;
64  hq01_[1] = 0;
65 
66  ht01_ = 0;
67 
68  hc01_[0] = 0;
69  hc01_[1] = 0;
70  hc01_[2] = 0;
71 
72  hm01_ = 0;
73 
74  he01_[0] = 0;
75  he01_[1] = 0;
76 
77  he02_[0] = 0;
78  he02_[1] = 0;
79 
80  he03_[0] = 0;
81  he03_[1] = 0;
82  he03_[2] = 0;
83 
84 }
85 
87 
88 }
89 
91 
93 
94  if ( debug_ ) std::cout << "EBBeamHodoClient: beginJob" << std::endl;
95 
96  ievt_ = 0;
97  jevt_ = 0;
98 
99 }
100 
102 
103  if ( debug_ ) std::cout << "EBBeamHodoClient: beginRun" << std::endl;
104 
105  jevt_ = 0;
106 
107  this->setup();
108 
109 }
110 
112 
113  if ( debug_ ) std::cout << "EBBeamHodoClient: endJob, ievt = " << ievt_ << std::endl;
114 
115  this->cleanup();
116 
117  if ( cloneME_ ) {
118 
119  for (int i=0; i<4; i++) {
120 
121  if ( ho01_[i] ) delete ho01_[i];
122  if ( hr01_[i] ) delete hr01_[i];
123 
124  }
125 
126  if ( hp01_[0] ) delete hp01_[0];
127  if ( hp01_[1] ) delete hp01_[1];
128 
129  if ( hp02_ ) delete hp02_;
130 
131  if ( hs01_[0] ) delete hs01_[0];
132  if ( hs01_[1] ) delete hs01_[1];
133 
134  if ( hq01_[0] ) delete hq01_[0];
135  if ( hq01_[1] ) delete hq01_[1];
136 
137  if ( ht01_ ) delete ht01_;
138 
139  if ( hc01_[0] ) delete hc01_[0];
140  if ( hc01_[1] ) delete hc01_[1];
141  if ( hc01_[2] ) delete hc01_[2];
142 
143  if ( hm01_ ) delete hm01_;
144 
145  if ( he01_[0] ) delete he01_[0];
146  if ( he01_[1] ) delete he01_[1];
147 
148  if ( he02_[0] ) delete he02_[0];
149  if ( he02_[1] ) delete he02_[1];
150 
151  if ( he03_[0] ) delete he03_[0];
152  if ( he03_[1] ) delete he03_[1];
153  if ( he03_[2] ) delete he03_[2];
154 
155  }
156 
157  for (int i=0; i<4; i++) {
158 
159  ho01_[i] = 0;
160  hr01_[i] = 0;
161 
162  }
163 
164  hp01_[0] = 0;
165  hp01_[1] = 0;
166 
167  hp02_ = 0;
168 
169  hs01_[0] = 0;
170  hs01_[1] = 0;
171 
172  hq01_[0] = 0;
173  hq01_[1] = 0;
174 
175  ht01_ = 0;
176 
177  hc01_[0] = 0;
178  hc01_[1] = 0;
179  hc01_[2] = 0;
180 
181  hm01_ = 0;
182 
183  he01_[0] = 0;
184  he01_[1] = 0;
185 
186  he02_[0] = 0;
187  he02_[1] = 0;
188 
189  he03_[0] = 0;
190  he03_[1] = 0;
191  he03_[2] = 0;
192 
193 }
194 
196 
197  if ( debug_ ) std::cout << "EBBeamHodoClient: endRun, jevt = " << jevt_ << std::endl;
198 
199  this->cleanup();
200 
201 }
202 
204 
205  dqmStore_->setCurrentFolder( prefixME_ + "/EBBeamHodoClient" );
206 
207 }
208 
210 
211  if ( ! enableCleanup_ ) return;
212 
213  dqmStore_->setCurrentFolder( prefixME_ + "/EBBeamHodoClient" );
214 
215 }
216 
217 #ifdef WITH_ECAL_COND_DB
218 bool EBBeamHodoClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
219 
220  status = true;
221 
222  return true;
223 
224 }
225 #endif
226 
228 
229  ievt_++;
230  jevt_++;
231  if ( ievt_ % 10 == 0 ) {
232  if ( debug_ ) std::cout << "EBBeamHodoClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
233  }
234 
235  int smId = 1;
236 
237  std::stringstream ss;
238 
239  MonitorElement* me;
240 
241  for (int i=0; i<4; i++) {
242 
243  ss.str("");
244  ss << prefixME_ << "/EBBeamHodoTask/EBBHT occup " << Numbers::sEB(smId) << std::setfill('0') << std::setw(2) << i+1;
245  me = dqmStore_->get(ss.str());
247 
248  ss.str("");
249  ss << prefixME_ << "/EBBeamHodoTask/EBBHT raw " << Numbers::sEB(smId) << std::setfill('0') << std::setw(2) << i+1;
250  me = dqmStore_->get(ss.str());
252 
253  }
254 
255  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT PosX rec " + Numbers::sEB(smId) );
256  hp01_[0] = UtilsClient::getHisto( me, cloneME_, hp01_[0] );
257 
258  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT PosY rec " + Numbers::sEB(smId) );
259  hp01_[1] = UtilsClient::getHisto( me, cloneME_, hp01_[1] );
260 
261  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT PosYX rec " + Numbers::sEB(smId) );
263 
264  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT SloX " + Numbers::sEB(smId) );
265  hs01_[0] = UtilsClient::getHisto( me, cloneME_, hs01_[0] );
266 
267  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT SloY " + Numbers::sEB(smId) );
268  hs01_[1] = UtilsClient::getHisto( me, cloneME_, hs01_[1] );
269 
270  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT QualX " + Numbers::sEB(smId) );
271  hq01_[0] = UtilsClient::getHisto( me, cloneME_, hq01_[0] );
272 
273  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT QualY " + Numbers::sEB(smId) );
274  hq01_[1] = UtilsClient::getHisto( me, cloneME_, hq01_[1] );
275 
276  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT TDC rec " + Numbers::sEB(smId) );
278 
279  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT Hodo-Calo X vs Cry " + Numbers::sEB(smId) );
280  hc01_[0] = UtilsClient::getHisto( me, cloneME_, hc01_[0] );
281 
282  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT Hodo-Calo Y vs Cry " + Numbers::sEB(smId) );
283  hc01_[1] = UtilsClient::getHisto( me, cloneME_, hc01_[1] );
284 
285  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT TDC-Calo vs Cry " + Numbers::sEB(smId) );
286  hc01_[2] = UtilsClient::getHisto( me, cloneME_, hc01_[2] );
287 
288  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT Missing Collections " + Numbers::sEB(smId) );
290 
291  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT prof E1 vs X " + Numbers::sEB(smId) );
292  he01_[0] = UtilsClient::getHisto( me, cloneME_, he01_[0] );
293 
294  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT prof E1 vs Y " + Numbers::sEB(smId) );
295  he01_[1] = UtilsClient::getHisto( me, cloneME_, he01_[1] );
296 
297  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT his E1 vs X " + Numbers::sEB(smId) );
298  he02_[0] = UtilsClient::getHisto( me, cloneME_, he02_[0] );
299 
300  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT his E1 vs Y " + Numbers::sEB(smId) );
301  he02_[1] = UtilsClient::getHisto( me, cloneME_, he02_[1] );
302 
303  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT PosX Hodo-Calo " + Numbers::sEB(smId) );
304  he03_[0] = UtilsClient::getHisto( me, cloneME_, he03_[0] );
305 
306  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT PosY Hodo-Calo " + Numbers::sEB(smId) );
307  he03_[1] = UtilsClient::getHisto( me, cloneME_, he03_[1] );
308 
309  me = dqmStore_->get( prefixME_ + "/EBBeamHodoTask/EBBHT TimeMax TDC-Calo " + Numbers::sEB(smId) );
310  he03_[2] = UtilsClient::getHisto( me, cloneME_, he03_[2] );
311 
312 }
313 
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
static std::string sEB(const int ism)
Definition: Numbers.cc:87
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 endRun(void)
EndRun.
DQMStore * dqmStore_
TProfile * he01_[2]
std::vector< int > superModules_
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:1265
Ecal Monitor Utils for Client.
void analyze(void)
Analyze.
virtual ~EBBeamHodoClient()
Destructor.
void beginJob(void)
BeginJob.
void beginRun(void)
BeginRun.
void endJob(void)
EndJob.
EBBeamHodoClient(const edm::ParameterSet &ps)
Constructor.
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:41
tuple status
Definition: ntuplemaker.py:245
void setup(void)
Setup.
Definition: RunIOV.h:13
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232