CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalBarrelMonitorClient.cc
Go to the documentation of this file.
1 /*
2  * \file EcalBarrelMonitorClient.cc
3  *
4  * $Date: 2012/06/28 12:14:27 $
5  * $Revision: 1.508 $
6  * \author G. Della Ricca
7  * \author F. Cossutti
8  *
9 */
10 
11 #include <memory>
12 #include <iostream>
13 #include <iomanip>
14 #include <fstream>
15 #include <algorithm>
16 #include <unistd.h>
17 
24 
26 
28 
30 
32 
33 #ifdef WITH_ECAL_COND_DB
39 #endif
40 
42 
45 
47 
59 
61 
62  // verbose switch
63 
64  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
65 
66  if ( verbose_ ) {
67  std::cout << std::endl;
68  std::cout << " *** Ecal Barrel Generic Monitor Client ***" << std::endl;
69  std::cout << std::endl;
70  }
71 
72  // DQM ROOT input file
73 
74  inputFile_ = ps.getUntrackedParameter<std::string>("inputFile", "");
75 
76  if ( verbose_ ) {
77  if ( inputFile_.size() != 0 ) {
78  std::cout << " Reading DQM data from inputFile '" << inputFile_ << "'" << std::endl;
79  }
80  }
81 
82  // Ecal Cond DB
83 
84  dbName_ = ps.getUntrackedParameter<std::string>("dbName", "");
85  dbHostName_ = ps.getUntrackedParameter<std::string>("dbHostName", "");
86  dbHostPort_ = ps.getUntrackedParameter<int>("dbHostPort", 1521);
87  dbUserName_ = ps.getUntrackedParameter<std::string>("dbUserName", "");
88  dbPassword_ = ps.getUntrackedParameter<std::string>("dbPassword", "");
89 
90  dbTagName_ = ps.getUntrackedParameter<std::string>("dbTagName", "CMSSW");
91 
92  if ( verbose_ ) {
93  if ( dbName_.size() != 0 ) {
94  std::cout << " Ecal Cond DB: " << std::endl;
95  std::cout << " dbName = '" << dbName_ << "'" << std::endl;
96  std::cout << " dbUserName = '" << dbUserName_ << "'" << std::endl;
97  if ( dbHostName_.size() != 0 ) {
98  std::cout << " dbHostName = '" << dbHostName_ << "'" << std::endl;
99  std::cout << " dbHostPort = '" << dbHostPort_ << "'" << std::endl;
100  }
101  std::cout << " dbTagName = '" << dbTagName_ << "'" << std::endl;
102 #ifndef WITH_ECAL_COND_DB
103  std::cout << std::endl;
104  std::cout << "WARNING: DB access is NOT available" << std::endl;
105  std::cout << std::endl;
106 #endif
107  } else {
108  std::cout << " Ecal Cond DB is OFF" << std::endl;
109  }
110  }
111 
112  // mergeRuns switch
113 
114  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
115 
116  if ( verbose_ ) {
117  if ( mergeRuns_ ) {
118  std::cout << " mergeRuns switch is ON" << std::endl;
119  } else {
120  std::cout << " mergeRuns switch is OFF" << std::endl;
121  }
122  }
123 
124  // resetFile
125 
126  resetFile_ = ps.getUntrackedParameter<std::string>("resetFile", "");
127 
128  if ( verbose_ ) {
129  if ( resetFile_.size() != 0 ) {
130  std::cout << " resetFile is '" << resetFile_ << "'" << std::endl;
131  }
132  }
133 
134  // updateTime
135 
136  updateTime_ = ps.getUntrackedParameter<int>("updateTime", 0);
137 
138  if ( verbose_ ) {
139  std::cout << " updateTime is " << updateTime_ << " minute(s)" << std::endl;
140  }
141 
142  // dbUpdateTime
143 
144  dbUpdateTime_ = ps.getUntrackedParameter<int>("dbUpdateTime", 0);
145 
146  if ( verbose_ ) {
147  std::cout << " dbUpdateTime is " << dbUpdateTime_ << " minute(s)" << std::endl;
148  }
149 
150  // location
151 
152  location_ = ps.getUntrackedParameter<std::string>("location", "H4");
153 
154  if ( verbose_ ) {
155  std::cout << " location is '" << location_ << "'" << std::endl;
156  }
157 
158  // cloneME switch
159 
160  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
161 
162  if ( verbose_ ) {
163  if ( cloneME_ ) {
164  std::cout << " cloneME switch is ON" << std::endl;
165  } else {
166  std::cout << " cloneME switch is OFF" << std::endl;
167  }
168  }
169 
170  // debug switch
171 
172  debug_ = ps.getUntrackedParameter<bool>("debug", false);
173 
174  if ( verbose_ ) {
175  if ( debug_ ) {
176  std::cout << " debug switch is ON" << std::endl;
177  } else {
178  std::cout << " debug switch is OFF" << std::endl;
179  }
180  }
181 
182  // prescaleFactor
183 
184  prescaleFactor_ = ps.getUntrackedParameter<int>("prescaleFactor", 1);
185 
186  if ( verbose_ ) {
187  std::cout << " prescaleFactor is " << prescaleFactor_ << std::endl;
188  }
189 
190  // prefixME path
191 
192  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
193 
194  if ( verbose_ ) {
195  std::cout << " prefixME path is '" << prefixME_ << "'" << std::endl;
196  }
197 
198  produceReports_ = ps.getUntrackedParameter<bool>("produceReports", true);
199 
200  if (produceReports_){
201  std::cout << " producing reportSummaries" << std::endl;
202  }
203 
204  // enableCleanup switch
205 
206  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
207 
208  if ( verbose_ ) {
209  if ( enableCleanup_ ) {
210  std::cout << " enableCleanup switch is ON" << std::endl;
211  } else {
212  std::cout << " enableCleanup switch is OFF" << std::endl;
213  }
214  }
215 
216  // vector of selected Super Modules (Defaults to all 36).
217 
218  superModules_.reserve(36);
219  for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
220 
221  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
222 
223  if ( verbose_ ) {
224  std::cout << " Selected SMs:" << std::endl;
225  for ( unsigned int i = 0; i < superModules_.size(); i++ ) {
226  std::cout << " " << std::setw(2) << std::setfill('0') << superModules_[i];
227  }
228  std::cout << std::endl;
229  }
230 
231  // vector of enabled Clients (defaults)
232 
233  enabledClients_.push_back("Integrity");
234  enabledClients_.push_back("StatusFlags");
235  enabledClients_.push_back("PedestalOnline");
236  enabledClients_.push_back("Summary");
237 
238  enabledClients_ = ps.getUntrackedParameter<std::vector<std::string> >("enabledClients", enabledClients_);
239 
240  if ( verbose_ ) {
241  std::cout << " Enabled Clients:" << std::endl;
242  for ( unsigned int i = 0; i < enabledClients_.size(); i++ ) {
243  std::cout << " " << enabledClients_[i];
244  }
245  std::cout << std::endl;
246  }
247 
248  // set runTypes (use resize() on purpose!)
249 
250  runTypes_.resize(30);
251  for ( unsigned int i = 0; i < runTypes_.size(); i++ ) runTypes_[i] = "UNKNOWN";
252 
262 
269 
274 
276 
277  // clients' constructors
278 
279  clients_.reserve(12);
280  clientsNames_.reserve(12);
281 
282  if ( find(enabledClients_.begin(), enabledClients_.end(), "Integrity" ) != enabledClients_.end() ) {
283 
284  clients_.push_back( new EBIntegrityClient(ps) );
285  clientsNames_.push_back( "Integrity" );
286 
287  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
288  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
289  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
290  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN ));
291  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
292  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
293  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
294  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
295 
296  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
297  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
298  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
299  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
300  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
301  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
302  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
303 
304  }
305 
306  if ( find(enabledClients_.begin(), enabledClients_.end(), "StatusFlags" ) != enabledClients_.end() ) {
307 
308  clients_.push_back( new EBStatusFlagsClient(ps) );
309  clientsNames_.push_back( "StatusFlags" );
310 
311  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
312  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
313  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
314  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN ));
315  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
316  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
317  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
318  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
319 
320  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
321  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
322  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
323  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
324  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
325  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
326  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
327 
328  }
329 
330  if ( find(enabledClients_.begin(), enabledClients_.end(), "Occupancy" ) != enabledClients_.end() ) {
331 
332  clients_.push_back( new EBOccupancyClient(ps) );
333  clientsNames_.push_back( "Occupancy" );
334 
335  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
336  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
337  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
338  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN ));
339  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
340  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
341  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
342  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
343 
344  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
345  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
346  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
347  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
348  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
349  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
350  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
351 
352  }
353 
354  if ( find(enabledClients_.begin(), enabledClients_.end(), "Cosmic" ) != enabledClients_.end() ) {
355 
356  clients_.push_back( new EBCosmicClient(ps) );
357  clientsNames_.push_back( "Cosmic" );
358 
359  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
360  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
361  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
362  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
363  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
364 
365  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
366  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
367  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
368  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
369  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
370  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
371  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
372 
373  }
374 
375  if ( find(enabledClients_.begin(), enabledClients_.end(), "Laser" ) != enabledClients_.end() ) {
376 
377  clients_.push_back( new EBLaserClient(ps) );
378  clientsNames_.push_back( "Laser" );
379 
380  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
381  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
382  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
383  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
384  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
385  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
386  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
387 
388  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
389  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
390  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
391  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
392  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
393  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
394  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
395 
396  }
397 
398  if ( find(enabledClients_.begin(), enabledClients_.end(), "Pedestal" ) != enabledClients_.end() ) {
399 
400  clients_.push_back( new EBPedestalClient(ps) );
401  clientsNames_.push_back( "Pedestal" );
402 
403  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
404  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
405  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
406  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
407  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
408  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
409  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
410 
411  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
412  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
413  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
414  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
415  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
416  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
417  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
418 
419  }
420 
421  if ( find(enabledClients_.begin(), enabledClients_.end(), "PedestalOnline" ) != enabledClients_.end() ) {
422 
423  clients_.push_back( new EBPedestalOnlineClient(ps) );
424  clientsNames_.push_back( "PedestalOnline" );
425 
426  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
427  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
428  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
429  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
430  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
431  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
432  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
433 
434  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
435  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
436  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
437  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
438  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
439  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
440  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
441 
442  }
443 
444  if ( find(enabledClients_.begin(), enabledClients_.end(), "TestPulse" ) != enabledClients_.end() ) {
445 
446  clients_.push_back( new EBTestPulseClient(ps) );
447  clientsNames_.push_back( "TestPulse" );
448 
449  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
450  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
451  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
452  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
453  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
454  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
455  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
456 
457  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
458  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
459  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
460  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
461  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
462  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
463  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
464 
465  }
466 
467  if ( find(enabledClients_.begin(), enabledClients_.end(), "TriggerTower" ) != enabledClients_.end() ) {
468 
469  clients_.push_back( new EBTriggerTowerClient(ps) );
470  clientsNames_.push_back( "TriggerTower" );
471 
472  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
473  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
474  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
475  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
476  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
477  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
478  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
479 
480  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
481  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
482  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
483  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
484  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
485  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
486  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
487 
488  }
489 
490  if ( find(enabledClients_.begin(), enabledClients_.end(), "Cluster" ) != enabledClients_.end() ) {
491 
492  clients_.push_back( new EBClusterClient(ps) );
493  clientsNames_.push_back( "Cluster" );
494 
495  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
496  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
497  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
498  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
499  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
500  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
501  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
502 
503  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
504  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
505  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
506  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
507  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
508  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
509  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
510 
511  }
512 
513  if ( find(enabledClients_.begin(), enabledClients_.end(), "Timing" ) != enabledClients_.end() ) {
514 
515  clients_.push_back( new EBTimingClient(ps) );
516  clientsNames_.push_back( "Timing" );
517 
518  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMIC ));
519  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_STD ));
520  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_STD ));
521  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_MGPA ));
522  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH4 ));
523  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::BEAMH2 ));
524  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::MTCC ));
525 
526  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_GLOBAL ));
527  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_GLOBAL ));
528  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::COSMICS_LOCAL ));
529  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PHYSICS_LOCAL ));
530  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::LASER_GAP ));
531  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::TESTPULSE_GAP ));
532  clientsRuns_.insert(std::pair<EBClient*,int>( clients_.back(), EcalDCCHeaderBlock::PEDESTAL_GAP ));
533 
534  }
535 
536  // define status bits
537 
538  clientsStatus_.insert(std::pair<std::string,int>( "Integrity", 0 ));
539  clientsStatus_.insert(std::pair<std::string,int>( "Cosmic", 1 ));
540  clientsStatus_.insert(std::pair<std::string,int>( "Laser", 2 ));
541  clientsStatus_.insert(std::pair<std::string,int>( "Pedestal", 3 ));
542  clientsStatus_.insert(std::pair<std::string,int>( "PedestalOnline", 4 ));
543  clientsStatus_.insert(std::pair<std::string,int>( "TestPulse", 5 ));
544  clientsStatus_.insert(std::pair<std::string,int>( "TriggerTower", 8 ));
545  clientsStatus_.insert(std::pair<std::string,int>( "Cluster", 9 ));
546  clientsStatus_.insert(std::pair<std::string,int>( "Timing", 10 ));
547  clientsStatus_.insert(std::pair<std::string,int>( "Led", 11 ));
548  clientsStatus_.insert(std::pair<std::string,int>( "StatusFlags", 12 ));
549  clientsStatus_.insert(std::pair<std::string,int>( "Occupancy", 13 ));
550 
551  if ( find(enabledClients_.begin(), enabledClients_.end(), "Summary" ) != enabledClients_.end() ) {
552 
554 
555  }
556 
558 
559  if ( verbose_ ) std::cout << std::endl;
560 
561 }
562 
564 
565  if ( verbose_ ) std::cout << "Exit ..." << std::endl;
566 
567  for ( unsigned int i=0; i<clients_.size(); i++ ) {
568  delete clients_[i];
569  }
570 
571  if ( summaryClient_ ) delete summaryClient_;
572 
573 }
574 
576 
577  begin_run_ = false;
578  end_run_ = false;
579 
580  forced_status_ = false;
581  forced_update_ = false;
582 
583  h_ = 0;
584 
585  status_ = "unknown";
586 
587  run_ = -1;
588  evt_ = -1;
589 
590  runType_ = -1;
591  evtType_ = -1;
592 
593  last_run_ = -1;
594 
595  subrun_ = -1;
596 
597  if ( debug_ ) std::cout << "EcalBarrelMonitorClient: beginJob" << std::endl;
598 
599  ievt_ = 0;
600  jevt_ = 0;
601 
605 
606  // get hold of back-end interface
607 
609 
610  if ( inputFile_.size() != 0 ) {
611  if ( dqmStore_ ) {
613  }
614  }
615 
616  for ( unsigned int i=0; i<clients_.size(); i++ ) {
617  clients_[i]->beginJob();
618  }
619 
621 
622 }
623 
625 
626  begin_run_ = true;
627  end_run_ = false;
628 
629  last_run_ = run_;
630 
631  if ( debug_ ) std::cout << "EcalBarrelMonitorClient: beginRun" << std::endl;
632 
633  jevt_ = 0;
634 
638 
639  this->setup();
640 
641  this->beginRunDb();
642 
643  for ( int i=0; i<int(clients_.size()); i++ ) {
644  clients_[i]->cleanup();
645  bool done = false;
646  for ( std::multimap<EBClient*,int>::iterator j = clientsRuns_.lower_bound(clients_[i]); j != clientsRuns_.upper_bound(clients_[i]); j++ ) {
647  if ( runType_ != -1 && runType_ == (*j).second && !done ) {
648  done = true;
649  clients_[i]->beginRun();
650  }
651  }
652  }
653 
655 
656 }
657 
659 
661 
662  if ( verbose_ ) std::cout << std::endl;
663 
665 
666  if ( verbose_ ) {
667  std::cout << std::endl;
668  std::cout << "Standard beginRun() for run " << r.id().run() << std::endl;
669  std::cout << std::endl;
670  }
671 
672  run_ = r.id().run();
673  evt_ = 0;
674 
675  jevt_ = 0;
676 
677  // summary for DQM GUI
678 
679  if(produceReports_){
680 
681  MonitorElement* me;
682 
683  dqmStore_->setCurrentFolder( prefixME_ + "/EventInfo" );
684 
685  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummary");
686  if ( me ) {
688  }
689  me = dqmStore_->bookFloat("reportSummary");
690  me->Fill(-1.0);
691 
692  dqmStore_->setCurrentFolder( prefixME_ + "/EventInfo/reportSummaryContents" );
693 
694  std::string name;
695  for (int i = 0; i < 36; i++) {
696  name = "EcalBarrel_" + Numbers::sEB(i+1);
697  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryContents/" + name);
698  if ( me ) {
700  }
701  me = dqmStore_->bookFloat(name);
702  me->Fill(-1.0);
703  }
704 
705  dqmStore_->setCurrentFolder( prefixME_ + "/EventInfo" );
706 
707  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryMap");
708  if ( me ) {
710  }
711 
712  me = dqmStore_->book2D("reportSummaryMap","EcalBarrel Report Summary Map", 72, 0., 72., 34, 0., 34);
713  for ( int iettx = 0; iettx < 34; iettx++ ) {
714  for ( int ipttx = 0; ipttx < 72; ipttx++ ) {
715  me->setBinContent( ipttx+1, iettx+1, -1.0 );
716  }
717  }
718  me->setAxisTitle("jphi", 1);
719  me->setAxisTitle("jeta", 2);
720 
721  }
722 }
723 
725 
726  if ( ! end_run_ ) {
727 
728  if ( verbose_ ) {
729  std::cout << std::endl;
730  std::cout << "Checking last event at endJob() ... " << std::endl;
731  std::cout << std::endl;
732  }
733 
734  forced_update_ = true;
735  this->analyze();
736 
737  if ( begin_run_ && ! end_run_ ) {
738 
739  if ( verbose_ ) {
740  std::cout << std::endl;
741  std::cout << "Forcing endRun() ... " << std::endl;
742  std::cout << std::endl;
743  }
744 
745  forced_status_ = true;
746  this->analyze();
747  this->endRun();
748 
749  }
750 
751  }
752 
753  if ( debug_ ) std::cout << "EcalBarrelMonitorClient: endJob, ievt = " << ievt_ << std::endl;
754 
755  this->cleanup();
756 
757  for ( unsigned int i=0; i<clients_.size(); i++ ) {
758  clients_[i]->endJob();
759  }
760 
762 
763 }
764 
766 
767  begin_run_ = false;
768  end_run_ = true;
769 
770  if ( debug_ ) std::cout << "EcalBarrelMonitorClient: endRun, jevt = " << jevt_ << std::endl;
771 
772  if ( subrun_ != -1 ) {
773 
774  this->writeDb();
775 
776  this->endRunDb();
777 
778  }
779 
780  if ( resetFile_.size() != 0 || dbUpdateTime_ > 0 ) {
781 
782  this->softReset(false);
783 
784  for ( int i=0; i<int(clients_.size()); i++ ) {
785  bool done = false;
786  for ( std::multimap<EBClient*,int>::iterator j = clientsRuns_.lower_bound(clients_[i]); j != clientsRuns_.upper_bound(clients_[i]); j++ ) {
787  if ( runType_ != -1 && runType_ == (*j).second && !done ) {
788  done = true;
789  clients_[i]->analyze();
790  }
791  }
792  }
793 
795 
796  }
797 
798  for ( int i=0; i<int(clients_.size()); i++ ) {
799  bool done = false;
800  for ( std::multimap<EBClient*,int>::iterator j = clientsRuns_.lower_bound(clients_[i]); j != clientsRuns_.upper_bound(clients_[i]); j++ ) {
801  if ( runType_ != -1 && runType_ == (*j).second && !done ) {
802  done = true;
803  clients_[i]->endRun();
804  }
805  }
806  }
807 
809 
810  this->cleanup();
811 
812  status_ = "unknown";
813 
814  run_ = -1;
815  evt_ = -1;
816 
817  runType_ = -1;
818  evtType_ = -1;
819 
820  subrun_ = -1;
821 
822 }
823 
825 
826  if ( verbose_ ) {
827  std::cout << std::endl;
828  std::cout << "Standard endRun() for run " << r.id().run() << std::endl;
829  std::cout << std::endl;
830  }
831 
832  this->analyze();
833 
834  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
835 
836  forced_update_ = true;
837  this->analyze();
838 
839  if ( ! mergeRuns_ ) {
840 
841  if ( begin_run_ && ! end_run_ ) {
842 
843  forced_status_ = false;
844  this->endRun();
845 
846  }
847 
848  }
849 
850  }
851 
852  // summary for DQM GUI
853 
854  if ( run_ != -1 && evt_ != -1 && runType_ == -1 ) {
855 
856  MonitorElement* me;
857 
858  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummary");
859  if ( me ) me->Fill(-1.0);
860 
861  for (int i = 0; i < 36; i++) {
862  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryContents/EcalBarrel_" + Numbers::sEB(i+1));
863  if ( me ) me->Fill(-1.0);
864  }
865 
866  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryMap");
867  for ( int iettx = 0; iettx < 34; iettx++ ) {
868  for ( int ipttx = 0; ipttx < 72; ipttx++ ) {
869  if ( me ) me->setBinContent( ipttx+1, iettx+1, -1.0 );
870  }
871  }
872 
873  }
874 
875 }
876 
878 
879  if ( verbose_ ) {
880  std::cout << std::endl;
881  std::cout << "Standard beginLuminosityBlock() for luminosity block " << l.id().luminosityBlock() << " of run " << l.id().run() << std::endl;
882  std::cout << std::endl;
883  }
884 
885 }
886 
888 
890 
891  if ( verbose_ ) {
892  std::cout << std::endl;
893  std::cout << "Standard endLuminosityBlock() for luminosity block " << l.id().luminosityBlock() << " of run " << l.id().run() << std::endl;
894  std::cout << std::endl;
895  }
896 
897  if ( updateTime_ > 0 ) {
898  if ( (current_time_ - last_time_update_) < 60 * updateTime_ ) {
899  return;
900  }
902  }
903 
904  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
905 
906  forced_update_ = true;
907  this->analyze();
908 
909  }
910 
911  for(unsigned iC(0); iC < enabledClients_.size(); iC++){
912  std::string& name(enabledClients_[iC]);
913 
914  if(name == "Cluster" || name == "Cosmic" || name == "Occupancy" || name == "StatusFlags" || name == "Trend") continue;
915 
916  if(!dqmStore_->dirExists(prefixME_ + "/EB" + name + "Client")){
917  std::vector<std::string>::iterator itr(std::find(clientsNames_.begin(), clientsNames_.end(), name));
918  if(itr == clientsNames_.end()) continue; // something seriously wrong, but ignore
919 
920  std::cout << "EB" << name << "Client is missing plots; resetting now" << std::endl;
921 
922  EBClient* client(clients_[itr - clientsNames_.begin()]);
923 
924  client->cleanup();
925  client->setup();
926  }
927  }
928 
929 }
930 
932 
933 }
934 
936 
937 }
938 
940 
941  if ( ! enableCleanup_ ) return;
942 
943  if ( cloneME_ ) {
944  if ( h_ ) delete h_;
945  }
946 
947  h_ = 0;
948 
949 }
950 
952 
953  subrun_ = 0;
954 
955 #ifdef WITH_ECAL_COND_DB
956  EcalCondDBInterface* econn;
957 
958  econn = 0;
959 
960  if ( dbName_.size() != 0 ) {
961  try {
962  if ( verbose_ ) std::cout << "Opening DB connection with TNS_ADMIN ..." << std::endl;
964  if ( verbose_ ) std::cout << "done." << std::endl;
965  } catch (std::runtime_error &e) {
966  std::cerr << e.what() << std::endl;
967  if ( dbHostName_.size() != 0 ) {
968  try {
969  if ( verbose_ ) std::cout << "Opening DB connection without TNS_ADMIN ..." << std::endl;
971  if ( verbose_ ) std::cout << "done." << std::endl;
972  } catch (std::runtime_error &e) {
973  std::cerr << e.what() << std::endl;
974  }
975  }
976  }
977  }
978 
979  // create the objects necessary to identify a dataset
980 
981  LocationDef locdef;
982 
983  locdef.setLocation(location_);
984 
985  RunTypeDef rundef;
986 
987  rundef.setRunType( this->getRunType() );
988 
989  RunTag runtag;
990 
991  runtag.setLocationDef(locdef);
992  runtag.setRunTypeDef(rundef);
993 
994  runtag.setGeneralTag( this->getRunType() );
995 
996  // fetch the RunIOV from the DB
997 
998  bool foundRunIOV = false;
999 
1000  if ( econn ) {
1001  try {
1002  if ( verbose_ ) std::cout << "Fetching RunIOV ..." << std::endl;
1003 // runiov_ = econn->fetchRunIOV(&runtag, run_);
1004  runiov_ = econn->fetchRunIOV(location_, run_);
1005  if ( verbose_ ) std::cout << "done." << std::endl;
1006  foundRunIOV = true;
1007  } catch (std::runtime_error &e) {
1008  std::cerr << e.what() << std::endl;
1009  foundRunIOV = false;
1010  }
1011  }
1012 
1013  // begin - setup the RunIOV (on behalf of the DAQ)
1014 
1015  if ( ! foundRunIOV ) {
1016 
1017  Tm startRun;
1018 
1019  startRun.setToCurrentGMTime();
1020 
1021  runiov_.setRunNumber(run_);
1022  runiov_.setRunStart(startRun);
1023  runiov_.setRunTag(runtag);
1024 
1025  if ( econn ) {
1026  try {
1027  if ( verbose_ ) std::cout << "Inserting RunIOV ..." << std::endl;
1028  econn->insertRunIOV(&runiov_);
1029 // runiov_ = econn->fetchRunIOV(&runtag, run_);
1030  runiov_ = econn->fetchRunIOV(location_, run_);
1031  if ( verbose_ ) std::cout << "done." << std::endl;
1032  } catch (std::runtime_error &e) {
1033  std::cerr << e.what() << std::endl;
1034  try {
1035  if ( verbose_ ) std::cout << "Fetching RunIOV (again) ..." << std::endl;
1036 // runiov_ = econn->fetchRunIOV(&runtag, run_);
1037  runiov_ = econn->fetchRunIOV(location_, run_);
1038  if ( verbose_ ) std::cout << "done." << std::endl;
1039  foundRunIOV = true;
1040  } catch (std::runtime_error &e) {
1041  std::cerr << e.what() << std::endl;
1042  foundRunIOV = false;
1043  }
1044  }
1045  }
1046 
1047  }
1048 
1049  // end - setup the RunIOV (on behalf of the DAQ)
1050 
1051  if ( verbose_ ) {
1052  std::cout << std::endl;
1053  std::cout << "=============RunIOV:" << std::endl;
1054  std::cout << "Run Number: " << runiov_.getRunNumber() << std::endl;
1055  std::cout << "Run Start: " << runiov_.getRunStart().str() << std::endl;
1056  std::cout << "Run End: " << runiov_.getRunEnd().str() << std::endl;
1057  std::cout << "====================" << std::endl;
1058  std::cout << std::endl;
1059  std::cout << "=============RunTag:" << std::endl;
1060  std::cout << "GeneralTag: " << runiov_.getRunTag().getGeneralTag() << std::endl;
1061  std::cout << "Location: " << runiov_.getRunTag().getLocationDef().getLocation() << std::endl;
1062  std::cout << "Run Type: " << runiov_.getRunTag().getRunTypeDef().getRunType() << std::endl;
1063  std::cout << "====================" << std::endl;
1064  std::cout << std::endl;
1065  }
1066 
1067  std::string rt = runiov_.getRunTag().getRunTypeDef().getRunType();
1068  if ( strcmp(rt.c_str(), "UNKNOWN") == 0 ) {
1069  runType_ = -1;
1070  } else {
1071  for ( unsigned int i = 0; i < runTypes_.size(); i++ ) {
1072  if ( strcmp(rt.c_str(), runTypes_[i].c_str()) == 0 ) {
1073  if ( runType_ != int(i) ) {
1074  if ( verbose_ ) {
1075  std::cout << std::endl;
1076  std::cout << "Fixing Run Type to: " << runTypes_[i] << std::endl;
1077  std::cout << std::endl;
1078  }
1079  runType_ = i;
1080  }
1081  break;
1082  }
1083  }
1084  }
1085 
1086  if ( verbose_ ) std::cout << std::endl;
1087 
1088  if ( econn ) {
1089  try {
1090  if ( verbose_ ) std::cout << "Closing DB connection ..." << std::endl;
1091  delete econn;
1092  econn = 0;
1093  if ( verbose_ ) std::cout << "done." << std::endl;
1094  } catch (std::runtime_error &e) {
1095  std::cerr << e.what() << std::endl;
1096  }
1097  }
1098 #endif
1099 
1100  if ( verbose_ ) std::cout << std::endl;
1101 
1102 }
1103 
1105 
1106  subrun_++;
1107 
1108 #ifdef WITH_ECAL_COND_DB
1109  EcalCondDBInterface* econn;
1110 
1111  econn = 0;
1112 
1113  if ( dbName_.size() != 0 ) {
1114  try {
1115  if ( verbose_ ) std::cout << "Opening DB connection with TNS_ADMIN ..." << std::endl;
1117  if ( verbose_ ) std::cout << "done." << std::endl;
1118  } catch (std::runtime_error &e) {
1119  std::cerr << e.what() << std::endl;
1120  if ( dbHostName_.size() != 0 ) {
1121  try {
1122  if ( verbose_ ) std::cout << "Opening DB connection without TNS_ADMIN ..." << std::endl;
1124  if ( verbose_ ) std::cout << "done." << std::endl;
1125  } catch (std::runtime_error &e) {
1126  std::cerr << e.what() << std::endl;
1127  }
1128  }
1129  }
1130  }
1131 
1132  MonVersionDef monverdef;
1133 
1134  monverdef.setMonitoringVersion("test01");
1135 
1136  MonRunTag montag;
1137 
1138  montag.setMonVersionDef(monverdef);
1139  montag.setGeneralTag(dbTagName_);
1140 
1141  Tm startSubRun;
1142 
1143  startSubRun.setToCurrentGMTime();
1144 
1145  // fetch the MonIOV from the DB
1146 
1147  bool foundMonIOV = false;
1148 
1149  if ( econn ) {
1150  try {
1151  if ( verbose_ ) std::cout << "Fetching MonIOV ..." << std::endl;
1152  RunTag runtag = runiov_.getRunTag();
1153  moniov_ = econn->fetchMonRunIOV(&runtag, &montag, run_, subrun_);
1154  if ( verbose_ ) std::cout << "done." << std::endl;
1155  foundMonIOV = true;
1156  } catch (std::runtime_error &e) {
1157  std::cerr << e.what() << std::endl;
1158  foundMonIOV = false;
1159  }
1160  }
1161 
1162  // begin - setup the MonIOV
1163 
1164  if ( !foundMonIOV ) {
1165 
1166  moniov_.setRunIOV(runiov_);
1167  moniov_.setSubRunNumber(subrun_);
1168 
1169  if ( subrun_ > 1 ) {
1170  moniov_.setSubRunStart(startSubRun);
1171  } else {
1172  moniov_.setSubRunStart(runiov_.getRunStart());
1173  }
1174 
1175  moniov_.setMonRunTag(montag);
1176 
1177  if ( econn ) {
1178  try {
1179  if ( verbose_ ) std::cout << "Inserting MonIOV ..." << std::endl;
1180  econn->insertMonRunIOV(&moniov_);
1181  RunTag runtag = runiov_.getRunTag();
1182  moniov_ = econn->fetchMonRunIOV(&runtag, &montag, run_, subrun_);
1183  if ( verbose_ ) std::cout << "done." << std::endl;
1184  } catch (std::runtime_error &e) {
1185  std::cerr << e.what() << std::endl;
1186  try {
1187  if ( verbose_ ) std::cout << "Fetching MonIOV (again) ..." << std::endl;
1188  RunTag runtag = runiov_.getRunTag();
1189  moniov_ = econn->fetchMonRunIOV(&runtag, &montag, run_, subrun_);
1190  if ( verbose_ ) std::cout << "done." << std::endl;
1191  foundMonIOV = true;
1192  } catch (std::runtime_error &e) {
1193  std::cerr << e.what() << std::endl;
1194  foundMonIOV = false;
1195  }
1196  }
1197  }
1198 
1199  }
1200 
1201  // end - setup the MonIOV
1202 
1203  if ( verbose_ ) {
1204  std::cout << std::endl;
1205  std::cout << "==========MonRunIOV:" << std::endl;
1206  std::cout << "SubRun Number: " << moniov_.getSubRunNumber() << std::endl;
1207  std::cout << "SubRun Start: " << moniov_.getSubRunStart().str() << std::endl;
1208  std::cout << "SubRun End: " << moniov_.getSubRunEnd().str() << std::endl;
1209  std::cout << "====================" << std::endl;
1210  std::cout << std::endl;
1211  std::cout << "==========MonRunTag:" << std::endl;
1212  std::cout << "GeneralTag: " << moniov_.getMonRunTag().getGeneralTag() << std::endl;
1213  std::cout << "Monitoring Ver: " << moniov_.getMonRunTag().getMonVersionDef().getMonitoringVersion() << std::endl;
1214  std::cout << "====================" << std::endl;
1215  std::cout << std::endl;
1216  }
1217 
1218  int taskl = 0x0;
1219  int tasko = 0x0;
1220 
1221  for ( int i=0; i<int(clients_.size()); i++ ) {
1222  bool done = false;
1223  for ( std::multimap<EBClient*,int>::iterator j = clientsRuns_.lower_bound(clients_[i]); j != clientsRuns_.upper_bound(clients_[i]); j++ ) {
1224  if ( h_ && runType_ != -1 && runType_ == (*j).second && !done ) {
1226  if ( strcmp(clientsNames_[i].c_str(), "Laser") == 0 && runType_ != EcalDCCHeaderBlock::LASER_STD && runType_ != EcalDCCHeaderBlock::LASER_GAP && h_->GetBinContent(2+EcalDCCHeaderBlock::LASER_STD) == 0 && h_->GetBinContent(2+EcalDCCHeaderBlock::LASER_GAP) == 0 ) continue;
1227  if ( strcmp(clientsNames_[i].c_str(), "Pedestal") == 0 && runType_ != EcalDCCHeaderBlock::PEDESTAL_STD && runType_ != EcalDCCHeaderBlock::PEDESTAL_GAP && h_->GetBinContent(2+EcalDCCHeaderBlock::PEDESTAL_STD) == 0 && h_->GetBinContent(2+EcalDCCHeaderBlock::PEDESTAL_GAP) == 0 ) continue;
1228  if ( strcmp(clientsNames_[i].c_str(), "TestPulse") == 0 && runType_ != EcalDCCHeaderBlock::TESTPULSE_MGPA && runType_ != EcalDCCHeaderBlock::TESTPULSE_GAP && h_->GetBinContent(2+EcalDCCHeaderBlock::TESTPULSE_MGPA) == 0 && h_->GetBinContent(2+EcalDCCHeaderBlock::TESTPULSE_GAP) == 0 ) continue;
1229  done = true;
1230  if ( verbose_ ) {
1231  if ( econn ) {
1232  std::cout << " Writing " << clientsNames_[i] << " results to DB " << std::endl;
1233  std::cout << std::endl;
1234  }
1235  }
1236  bool status;
1237  if ( clients_[i]->writeDb(econn, &runiov_, &moniov_, status) ) {
1238  taskl |= 0x1 << clientsStatus_[clientsNames_[i]];
1239  if ( status ) {
1240  tasko |= 0x1 << clientsStatus_[clientsNames_[i]];
1241  }
1242  } else {
1243  tasko |= 0x1 << clientsStatus_[clientsNames_[i]];
1244  }
1245  }
1246  }
1247  if ( ((taskl >> clientsStatus_[clientsNames_[i]]) & 0x1) ) {
1248  if ( verbose_ ) {
1249  std::cout << " Task output for " << clientsNames_[i] << " = "
1250  << ((tasko >> clientsStatus_[clientsNames_[i]]) & 0x1) << std::endl;
1251  std::cout << std::endl;
1252  }
1253  }
1254  }
1255 
1256  bool status;
1257  if ( summaryClient_ ) summaryClient_->writeDb(econn, &runiov_, &moniov_, status);
1258 
1259  EcalLogicID ecid;
1260  MonRunDat md;
1261  std::map<EcalLogicID, MonRunDat> dataset;
1262 
1263  MonRunOutcomeDef monRunOutcomeDef;
1264 
1265  monRunOutcomeDef.setShortDesc("success");
1266 
1267  float nevt = -1.;
1268 
1269  if ( h_ ) nevt = h_->GetSumOfWeights();
1270 
1271  md.setNumEvents(int(nevt));
1272  md.setMonRunOutcomeDef(monRunOutcomeDef);
1273 
1274 // string fileName = "";
1275 // md.setRootfileName(fileName);
1276 
1277  md.setTaskList(taskl);
1278  md.setTaskOutcome(tasko);
1279 
1280  if ( econn ) {
1281  try {
1282  ecid = LogicID::getEcalLogicID("EB");
1283  dataset[ecid] = md;
1284  } catch (std::runtime_error &e) {
1285  std::cerr << e.what() << std::endl;
1286  }
1287  }
1288 
1289  if ( econn ) {
1290  try {
1291  if ( verbose_ ) std::cout << "Inserting MonRunDat ..." << std::endl;
1292  econn->insertDataSet(&dataset, &moniov_);
1293  if ( verbose_ ) std::cout << "done." << std::endl;
1294  } catch (std::runtime_error &e) {
1295  std::cerr << e.what() << std::endl;
1296  }
1297  }
1298 
1299  if ( econn ) {
1300  try {
1301  if ( verbose_ ) std::cout << "Closing DB connection ..." << std::endl;
1302  delete econn;
1303  econn = 0;
1304  if ( verbose_ ) std::cout << "done." << std::endl;
1305  } catch (std::runtime_error &e) {
1306  std::cerr << e.what() << std::endl;
1307  }
1308  }
1309 #endif
1310 
1311  if ( verbose_ ) std::cout << std::endl;
1312 
1313 }
1314 
1316 
1317 #ifdef WITH_ECAL_COND_DB
1318  EcalCondDBInterface* econn;
1319 
1320  econn = 0;
1321 
1322  if ( dbName_.size() != 0 ) {
1323  try {
1324  if ( verbose_ ) std::cout << "Opening DB connection with TNS_ADMIN ..." << std::endl;
1326  if ( verbose_ ) std::cout << "done." << std::endl;
1327  } catch (std::runtime_error &e) {
1328  std::cerr << e.what() << std::endl;
1329  if ( dbHostName_.size() != 0 ) {
1330  try {
1331  if ( verbose_ ) std::cout << "Opening DB connection without TNS_ADMIN ..." << std::endl;
1333  if ( verbose_ ) std::cout << "done." << std::endl;
1334  } catch (std::runtime_error &e) {
1335  std::cerr << e.what() << std::endl;
1336  }
1337  }
1338  }
1339  }
1340 
1341  EcalLogicID ecid;
1342  RunDat rd;
1343  std::map<EcalLogicID, RunDat> dataset;
1344 
1345  float nevt = -1.;
1346 
1347  if ( h_ ) nevt = h_->GetSumOfWeights();
1348 
1349  rd.setNumEvents(int(nevt));
1350 
1351  // fetch the RunDat from the DB
1352 
1353  bool foundRunDat = false;
1354 
1355  if ( econn ) {
1356  try {
1357  if ( verbose_ ) std::cout << "Fetching RunDat ..." << std::endl;
1358  econn->fetchDataSet(&dataset, &runiov_);
1359  if ( verbose_ ) std::cout << "done." << std::endl;
1360  foundRunDat = true;
1361  } catch (std::runtime_error &e) {
1362  std::cerr << e.what() << std::endl;
1363  foundRunDat = false;
1364  }
1365  }
1366 
1367  // begin - setup the RunDat (on behalf of the DAQ)
1368 
1369  if ( ! foundRunDat ) {
1370 
1371  if ( econn ) {
1372  try {
1373  ecid = LogicID::getEcalLogicID("EB");
1374  dataset[ecid] = rd;
1375  } catch (std::runtime_error &e) {
1376  std::cerr << e.what() << std::endl;
1377  }
1378  }
1379 
1380  if ( econn ) {
1381  try {
1382  if ( verbose_ ) std::cout << "Inserting RunDat ..." << std::endl;
1383  econn->insertDataSet(&dataset, &runiov_);
1384  if ( verbose_ ) std::cout << "done." << std::endl;
1385  } catch (std::runtime_error &e) {
1386  std::cerr << e.what() << std::endl;
1387  }
1388  }
1389 
1390  }
1391 
1392  // end - setup the RunDat (on behalf of the DAQ)
1393 
1394  if ( econn ) {
1395  try {
1396  if ( verbose_ ) std::cout << "Closing DB connection ..." << std::endl;
1397  delete econn;
1398  econn = 0;
1399  if ( verbose_ ) std::cout << "done." << std::endl;
1400  } catch (std::runtime_error &e) {
1401  std::cerr << e.what() << std::endl;
1402  }
1403  }
1404 #endif
1405 
1406 }
1407 
1409 
1410  current_time_ = time(NULL);
1411 
1412  ievt_++;
1413  jevt_++;
1414 
1415  if ( debug_ ) std::cout << "EcalBarrelMonitorClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
1416 
1417  MonitorElement* me;
1418  std::string s;
1419 
1420  me = dqmStore_->get(prefixME_ + "/EcalInfo/STATUS");
1421  if ( me ) {
1422  status_ = "unknown";
1423  s = me->valueString();
1424  if ( strcmp(s.c_str(), "i=0") == 0 ) status_ = "begin-of-run";
1425  if ( strcmp(s.c_str(), "i=1") == 0 ) status_ = "running";
1426  if ( strcmp(s.c_str(), "i=2") == 0 ) status_ = "end-of-run";
1427  if ( debug_ ) std::cout << "Found '" << prefixME_ << "/EcalInfo/STATUS'" << std::endl;
1428  }
1429 
1430  if ( inputFile_.size() != 0 ) {
1431  if ( ievt_ == 1 ) {
1432  if ( verbose_ ) {
1433  std::cout << std::endl;
1434  std::cout << " Reading DQM from file, forcing 'begin-of-run'" << std::endl;
1435  std::cout << std::endl;
1436  }
1437  status_ = "begin-of-run";
1438  }
1439  }
1440 
1441  int ecal_run = -1;
1442  me = dqmStore_->get(prefixME_ + "/EcalInfo/RUN");
1443  if ( me ) {
1444  s = me->valueString();
1445  sscanf(s.c_str(), "i=%d", &ecal_run);
1446  if ( debug_ ) std::cout << "Found '" << prefixME_ << "/EcalInfo/RUN'" << std::endl;
1447  }
1448 
1449  int ecal_evt = -1;
1450  me = dqmStore_->get(prefixME_ + "/EcalInfo/EVT");
1451  if ( me ) {
1452  s = me->valueString();
1453  sscanf(s.c_str(), "i=%d", &ecal_evt);
1454  if ( debug_ ) std::cout << "Found '" << prefixME_ << "/EcalInfo/EVT'" << std::endl;
1455  }
1456 
1457  me = dqmStore_->get(prefixME_ + "/EcalInfo/EVTTYPE");
1458  h_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, h_ );
1459 
1460  me = dqmStore_->get(prefixME_ + "/EcalInfo/RUNTYPE");
1461  if ( me ) {
1462  s = me->valueString();
1463  sscanf(s.c_str(), "i=%d", &evtType_);
1464  if ( runType_ == -1 ) runType_ = evtType_;
1465  if ( debug_ ) std::cout << "Found '" << prefixME_ << "/EcalInfo/RUNTYPE'" << std::endl;
1466  }
1467 
1468  // if the run number from the Event is less than zero,
1469  // use the run number from the ECAL DCC header
1470  if ( run_ <= 0 ) run_ = ecal_run;
1471 
1472  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1473  if ( ! mergeRuns_ && run_ != last_run_ ) forced_update_ = true;
1474  }
1475 
1476  bool update = ( forced_update_ ) ||
1477  ( prescaleFactor_ != 1 ) ||
1478  ( jevt_ < 10 ) ||
1479  ( jevt_ < 100 && jevt_ % 10 == 0 ) ||
1480  ( jevt_ < 1000 && jevt_ % 100 == 0 ) ||
1481  ( jevt_ % 1000 == 0 );
1482 
1483  if ( update || strcmp(status_.c_str(), "begin-of-run") == 0 || strcmp(status_.c_str(), "end-of-run") == 0 ) {
1484 
1485  if ( verbose_ ) {
1486  std::cout << " RUN status = \"" << status_ << "\"" << std::endl;
1487  std::cout << " CMS run/event number = " << run_ << "/" << evt_ << std::endl;
1488  std::cout << " EB run/event number = " << ecal_run << "/" << ecal_evt << std::endl;
1489  std::cout << " EB location = " << location_ << std::endl;
1490  std::cout << " EB run/event type = " << this->getRunType() << "/" << ( evtType_ == -1 ? "UNKNOWN" : runTypes_[evtType_] ) << std::flush;
1491 
1492  if ( h_ ) {
1493  if ( h_->GetSumOfWeights() != 0 ) {
1494  std::cout << " ( " << std::flush;
1495  for ( unsigned int i = 0; i < runTypes_.size(); i++ ) {
1496  if ( strcmp(runTypes_[i].c_str(), "UNKNOWN") != 0 && h_->GetBinContent(2+i) != 0 ) {
1497  std::string s = runTypes_[i];
1498  transform( s.begin(), s.end(), s.begin(), (int(*)(int))tolower );
1499  std::cout << s << " ";
1500  }
1501  }
1502  std::cout << ")" << std::flush;
1503  }
1504  }
1505  std::cout << std::endl;
1506  }
1507 
1508  }
1509 
1510  if ( strcmp(status_.c_str(), "begin-of-run") == 0 ) {
1511 
1512  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1513 
1514  if ( ! begin_run_ ) {
1515 
1516  forced_status_ = false;
1517  this->beginRun();
1518 
1519  }
1520 
1521  }
1522 
1523  }
1524 
1525  if ( strcmp(status_.c_str(), "begin-of-run") == 0 || strcmp(status_.c_str(), "running") == 0 || strcmp(status_.c_str(), "end-of-run") == 0 ) {
1526 
1527  if ( begin_run_ && ! end_run_ ) {
1528 
1529  bool update = ( forced_update_ ) ||
1530  ( prescaleFactor_ != 1 ) ||
1531  ( jevt_ < 3 ) ||
1532  ( jevt_ < 1000 && jevt_ % 100 == 0 ) ||
1533  ( jevt_ < 10000 && jevt_ % 1000 == 0 ) ||
1534  ( jevt_ % 10000 == 0 );
1535 
1536  if ( update || strcmp(status_.c_str(), "begin-of-run") == 0 || strcmp(status_.c_str(), "end-of-run") == 0 ) {
1537 
1538  for ( int i=0; i<int(clients_.size()); i++ ) {
1539  bool done = false;
1540  for ( std::multimap<EBClient*,int>::iterator j = clientsRuns_.lower_bound(clients_[i]); j != clientsRuns_.upper_bound(clients_[i]); j++ ) {
1541  if ( runType_ != -1 && runType_ == (*j).second && !done ) {
1542  done = true;
1543  clients_[i]->analyze();
1544  }
1545  }
1546  }
1547 
1549 
1550  }
1551 
1552  forced_update_ = false;
1553 
1554  bool reset = false;
1555 
1556  if ( resetFile_.size() != 0 ) {
1557  if ( access(resetFile_.c_str(), W_OK) == 0 ) {
1558  if ( unlink(resetFile_.c_str()) == 0 ) {
1559  reset |= true;
1560  }
1561  }
1562  }
1563 
1564  if ( dbUpdateTime_ > 0 ) {
1565  reset |= (current_time_ - last_time_reset_) > 60 * dbUpdateTime_;
1566  }
1567 
1568  if ( reset ) {
1576  this->softReset(true);
1578  }
1579 
1580  }
1581 
1582  }
1583 
1584  if ( strcmp(status_.c_str(), "end-of-run") == 0 ) {
1585 
1586  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1587 
1588  if ( begin_run_ && ! end_run_ ) {
1589 
1590  forced_status_ = false;
1591  this->endRun();
1592 
1593  }
1594 
1595  }
1596 
1597  }
1598 
1599  // BEGIN: run-time fixes for missing state transitions
1600 
1601  // run number transition
1602 
1603  if ( strcmp(status_.c_str(), "running") == 0 ) {
1604 
1605  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1606 
1607  if ( ! mergeRuns_ ) {
1608 
1609  int new_run_ = run_;
1610  int old_run_ = last_run_;
1611 
1612  if ( new_run_ != old_run_ ) {
1613 
1614  if ( begin_run_ && ! end_run_ ) {
1615 
1616  if ( verbose_ ) {
1617  std::cout << std::endl;
1618  std::cout << " Old run has finished, issuing endRun() ... " << std::endl;
1619  std::cout << std::endl;
1620  }
1621 
1622  // end old_run_
1623  run_ = old_run_;
1624 
1625  forced_status_ = false;
1626  this->endRun();
1627 
1628  }
1629 
1630  if ( ! begin_run_ ) {
1631 
1632  if ( verbose_ ) {
1633  std::cout << std::endl;
1634  std::cout << " New run has started, issuing beginRun() ... " << std::endl;
1635  std::cout << std::endl;
1636  }
1637 
1638  // start new_run_
1639  run_ = new_run_;
1640 
1641  forced_status_ = false;
1642  this->beginRun();
1643 
1644  }
1645 
1646  }
1647 
1648  }
1649 
1650  }
1651 
1652  }
1653 
1654  // 'running' state without a previous 'begin-of-run' state
1655 
1656  if ( strcmp(status_.c_str(), "running") == 0 ) {
1657 
1658  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1659 
1660  if ( ! forced_status_ ) {
1661 
1662  if ( ! begin_run_ ) {
1663 
1664  if ( verbose_ ) {
1665  std::cout << std::endl;
1666  std::cout << "Forcing beginRun() ... NOW !" << std::endl;
1667  std::cout << std::endl;
1668  }
1669 
1670  forced_status_ = true;
1671  this->beginRun();
1672 
1673  }
1674 
1675  }
1676 
1677  }
1678 
1679  }
1680 
1681  // 'end-of-run' state without a previous 'begin-of-run' or 'running' state
1682 
1683  if ( strcmp(status_.c_str(), "end-of-run") == 0 ) {
1684 
1685  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1686 
1687  if ( ! forced_status_ ) {
1688 
1689  if ( ! begin_run_ ) {
1690 
1691  if ( verbose_ ) {
1692  std::cout << std::endl;
1693  std::cout << "Forcing beginRun() ... NOW !" << std::endl;
1694  std::cout << std::endl;
1695  }
1696 
1697  forced_status_ = true;
1698  this->beginRun();
1699 
1700  }
1701 
1702  }
1703 
1704  }
1705 
1706  }
1707 
1708  // END: run-time fixes for missing state transitions
1709 
1710 }
1711 
1713 
1714  run_ = e.id().run();
1715  evt_ = e.id().event();
1716 
1717  if ( prescaleFactor_ > 0 ) {
1718  if ( jevt_ % prescaleFactor_ == 0 ) this->analyze();
1719  }
1720 
1721 }
1722 
1724 
1725  std::vector<MonitorElement*> mes = dqmStore_->getAllContents(prefixME_);
1726  std::vector<MonitorElement*>::const_iterator meitr;
1727  for ( meitr=mes.begin(); meitr!=mes.end(); meitr++ ) {
1728  if ( !strncmp((*meitr)->getName().c_str(), "EB", 2)
1729  && strncmp((*meitr)->getName().c_str(), "EBTrend", 7)
1730  && strncmp((*meitr)->getName().c_str(), "by lumi", 7) ) {
1731  if ( flag ) {
1732  dqmStore_->softReset(*meitr);
1733  } else {
1734  dqmStore_->disableSoftReset(*meitr);
1735  }
1736  }
1737  }
1738 
1739  MonitorElement* me = dqmStore_->get(prefixME_ + "/EcalInfo/EVTTYPE");
1740  if ( me ) {
1741  if ( flag ) {
1742  dqmStore_->softReset(me);
1743  } else {
1745  }
1746  }
1747 
1748 }
1749 
RunNumber_t run() const
Definition: EventID.h:42
LuminosityBlockID id() const
std::multimap< EBClient *, int > clientsRuns_
Cache logicID vector from database.
EventNumber_t event() const
Definition: EventID.h:44
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
void setTaskList(int list)
Definition: MonRunDat.h:30
void setNumEvents(int num)
Definition: MonRunDat.h:21
void setBinContent(int binx, double content)
set content of bin (1-D)
long int flag
Definition: mlp_lapack.h:47
void setLocationDef(const LocationDef locDef)
Definition: RunTag.cc:53
std::vector< std::string > clientsNames_
RunID const & id() const
Definition: RunBase.h:41
void insertRunIOV(RunIOV *iov)
RunNumber_t run() const
Definition: RunID.h:44
std::vector< std::string > enabledClients_
Some &quot;id&quot; conversions.
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
Definition: RunTag.h:13
void beginLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c)
BeginLumiBlock.
void endRun(void)
EndRun.
RunIOV fetchRunIOV(RunTag *tag, run_t run)
#define NULL
Definition: scimark2.h:8
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void setToCurrentGMTime()
Definition: Tm.cc:177
void setGeneralTag(std::string tag)
Definition: MonRunTag.cc:33
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void setShortDesc(std::string desc)
std::vector< MonitorElement * > getAllContents(const std::string &path) const
Definition: DQMStore.cc:1672
void Fill(long long x)
void disableSoftReset(MonitorElement *me)
Definition: DQMStore.cc:2742
void beginJob(void)
BeginJob.
void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c)
EndLumiBlock.
void softReset(bool flag)
SoftReset.
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov)
void setRunTypeDef(const RunTypeDef runTypeDef)
Definition: RunTag.cc:70
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
void setFriends(std::vector< EBClient * > clients)
Set Clients.
channel masking
void setNumEvents(int num)
Definition: RunDat.h:20
RunNumber_t run() const
int j
Definition: DBlmapReader.cc:9
EcalBarrelMonitorClient(const edm::ParameterSet &ps)
Constructor.
void softReset(MonitorElement *me)
Definition: DQMStore.cc:2734
void setMonVersionDef(MonVersionDef ver)
Definition: MonRunTag.cc:49
void setTaskOutcome(int outcome)
Definition: MonRunDat.h:33
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
static void initMasking(const edm::EventSetup &setup, bool verbose=false)
Definition: Masks.cc:34
std::vector< EBClient * > clients_
std::map< std::string, int > clientsStatus_
std::string valueString(void) const
virtual ~EcalBarrelMonitorClient()
Destructor.
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:493
Ecal Monitor Utils for Client.
void setMonRunOutcomeDef(MonRunOutcomeDef outcomeDef)
Definition: MonRunDat.h:24
std::vector< std::string > runTypes_
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:50
void setRunType(std::string runtype)
Definition: RunTypeDef.cc:33
void beginRunDb(void)
BeginRunDB.
tuple dataset
Definition: dataset.py:393
LuminosityBlockNumber_t luminosityBlock() const
MonRunIOV fetchMonRunIOV(RunTag *runtag, MonRunTag *montag, run_t run, subrun_t monrun)
Definition: RunDat.h:11
void setMonitoringVersion(std::string ver)
edm::EventID id() const
Definition: EventBase.h:56
void endJob(void)
EndJob.
void insertMonRunIOV(MonRunIOV *iov)
#define update(a, b)
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2432
void setLocation(std::string loc)
Definition: LocationDef.cc:33
tuple cout
Definition: gather_cfg.py:121
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
tuple status
Definition: ntuplemaker.py:245
void setGeneralTag(std::string tag)
Definition: RunTag.cc:36
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
static EcalLogicID getEcalLogicID(const char *name, const int id1=EcalLogicID::NULLID, const int id2=EcalLogicID::NULLID, const int id3=EcalLogicID::NULLID)
Definition: LogicID.h:31
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: Tm.h:14
void analyze(void)
Analyze.
void beginRun(void)
BeginRun.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
Definition: Run.h:33