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: 2013/04/02 09:07:29 $
5  * $Revision: 1.508.2.1 $
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 
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(begin_run_ && !end_run_){
898  unsigned iC(0);
899  for(; iC < enabledClients_.size(); iC++){
901 
902  if(name == "Cluster" || name == "Cosmic" || name == "Occupancy" || name == "StatusFlags" || name == "Trend") continue;
903 
904  std::string dir(prefixME_ + "/EB" + name + "Client");
906  std::vector<std::string>::iterator itr(std::find(clientsNames_.begin(), clientsNames_.end(), name));
907  if(itr == clientsNames_.end()) continue; // something seriously wrong, but ignore
908  std::cout << "EB" << name << "Client is missing plots; resetting now" << std::endl;
909 
910  break;
911  }
912  }
913  if(iC != enabledClients_.size()){
914  forced_status_ = false;
915  endRun();
916  beginRun();
917  run_ = l.id().run();
918  evt_ = 0;
919  }
920  }
921 
922  if ( updateTime_ > 0 ) {
923  if ( (current_time_ - last_time_update_) < 60 * updateTime_ ) {
924  return;
925  }
927  }
928 
929  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
930 
931  forced_update_ = true;
932  this->analyze();
933 
934  }
935 }
936 
938 
939 }
940 
942 
943 }
944 
946 
947  if ( ! enableCleanup_ ) return;
948 
949  if ( cloneME_ ) {
950  if ( h_ ) delete h_;
951  }
952 
953  h_ = 0;
954 
955 }
956 
958 
959  subrun_ = 0;
960 
961 #ifdef WITH_ECAL_COND_DB
962  EcalCondDBInterface* econn;
963 
964  econn = 0;
965 
966  if ( dbName_.size() != 0 ) {
967  try {
968  if ( verbose_ ) std::cout << "Opening DB connection with TNS_ADMIN ..." << std::endl;
970  if ( verbose_ ) std::cout << "done." << std::endl;
971  } catch (std::runtime_error &e) {
972  std::cerr << e.what() << std::endl;
973  if ( dbHostName_.size() != 0 ) {
974  try {
975  if ( verbose_ ) std::cout << "Opening DB connection without TNS_ADMIN ..." << std::endl;
977  if ( verbose_ ) std::cout << "done." << std::endl;
978  } catch (std::runtime_error &e) {
979  std::cerr << e.what() << std::endl;
980  }
981  }
982  }
983  }
984 
985  // create the objects necessary to identify a dataset
986 
987  LocationDef locdef;
988 
989  locdef.setLocation(location_);
990 
991  RunTypeDef rundef;
992 
993  rundef.setRunType( this->getRunType() );
994 
995  RunTag runtag;
996 
997  runtag.setLocationDef(locdef);
998  runtag.setRunTypeDef(rundef);
999 
1000  runtag.setGeneralTag( this->getRunType() );
1001 
1002  // fetch the RunIOV from the DB
1003 
1004  bool foundRunIOV = false;
1005 
1006  if ( econn ) {
1007  try {
1008  if ( verbose_ ) std::cout << "Fetching RunIOV ..." << std::endl;
1009 // runiov_ = econn->fetchRunIOV(&runtag, run_);
1010  runiov_ = econn->fetchRunIOV(location_, run_);
1011  if ( verbose_ ) std::cout << "done." << std::endl;
1012  foundRunIOV = true;
1013  } catch (std::runtime_error &e) {
1014  std::cerr << e.what() << std::endl;
1015  foundRunIOV = false;
1016  }
1017  }
1018 
1019  // begin - setup the RunIOV (on behalf of the DAQ)
1020 
1021  if ( ! foundRunIOV ) {
1022 
1023  Tm startRun;
1024 
1025  startRun.setToCurrentGMTime();
1026 
1027  runiov_.setRunNumber(run_);
1028  runiov_.setRunStart(startRun);
1029  runiov_.setRunTag(runtag);
1030 
1031  if ( econn ) {
1032  try {
1033  if ( verbose_ ) std::cout << "Inserting RunIOV ..." << std::endl;
1034  econn->insertRunIOV(&runiov_);
1035 // runiov_ = econn->fetchRunIOV(&runtag, run_);
1036  runiov_ = econn->fetchRunIOV(location_, run_);
1037  if ( verbose_ ) std::cout << "done." << std::endl;
1038  } catch (std::runtime_error &e) {
1039  std::cerr << e.what() << std::endl;
1040  try {
1041  if ( verbose_ ) std::cout << "Fetching RunIOV (again) ..." << std::endl;
1042 // runiov_ = econn->fetchRunIOV(&runtag, run_);
1043  runiov_ = econn->fetchRunIOV(location_, run_);
1044  if ( verbose_ ) std::cout << "done." << std::endl;
1045  foundRunIOV = true;
1046  } catch (std::runtime_error &e) {
1047  std::cerr << e.what() << std::endl;
1048  foundRunIOV = false;
1049  }
1050  }
1051  }
1052 
1053  }
1054 
1055  // end - setup the RunIOV (on behalf of the DAQ)
1056 
1057  if ( verbose_ ) {
1058  std::cout << std::endl;
1059  std::cout << "=============RunIOV:" << std::endl;
1060  std::cout << "Run Number: " << runiov_.getRunNumber() << std::endl;
1061  std::cout << "Run Start: " << runiov_.getRunStart().str() << std::endl;
1062  std::cout << "Run End: " << runiov_.getRunEnd().str() << std::endl;
1063  std::cout << "====================" << std::endl;
1064  std::cout << std::endl;
1065  std::cout << "=============RunTag:" << std::endl;
1066  std::cout << "GeneralTag: " << runiov_.getRunTag().getGeneralTag() << std::endl;
1067  std::cout << "Location: " << runiov_.getRunTag().getLocationDef().getLocation() << std::endl;
1068  std::cout << "Run Type: " << runiov_.getRunTag().getRunTypeDef().getRunType() << std::endl;
1069  std::cout << "====================" << std::endl;
1070  std::cout << std::endl;
1071  }
1072 
1073  std::string rt = runiov_.getRunTag().getRunTypeDef().getRunType();
1074  if ( strcmp(rt.c_str(), "UNKNOWN") == 0 ) {
1075  runType_ = -1;
1076  } else {
1077  for ( unsigned int i = 0; i < runTypes_.size(); i++ ) {
1078  if ( strcmp(rt.c_str(), runTypes_[i].c_str()) == 0 ) {
1079  if ( runType_ != int(i) ) {
1080  if ( verbose_ ) {
1081  std::cout << std::endl;
1082  std::cout << "Fixing Run Type to: " << runTypes_[i] << std::endl;
1083  std::cout << std::endl;
1084  }
1085  runType_ = i;
1086  }
1087  break;
1088  }
1089  }
1090  }
1091 
1092  if ( verbose_ ) std::cout << std::endl;
1093 
1094  if ( econn ) {
1095  try {
1096  if ( verbose_ ) std::cout << "Closing DB connection ..." << std::endl;
1097  delete econn;
1098  econn = 0;
1099  if ( verbose_ ) std::cout << "done." << std::endl;
1100  } catch (std::runtime_error &e) {
1101  std::cerr << e.what() << std::endl;
1102  }
1103  }
1104 #endif
1105 
1106  if ( verbose_ ) std::cout << std::endl;
1107 
1108 }
1109 
1111 
1112  subrun_++;
1113 
1114 #ifdef WITH_ECAL_COND_DB
1115  EcalCondDBInterface* econn;
1116 
1117  econn = 0;
1118 
1119  if ( dbName_.size() != 0 ) {
1120  try {
1121  if ( verbose_ ) std::cout << "Opening DB connection with TNS_ADMIN ..." << std::endl;
1123  if ( verbose_ ) std::cout << "done." << std::endl;
1124  } catch (std::runtime_error &e) {
1125  std::cerr << e.what() << std::endl;
1126  if ( dbHostName_.size() != 0 ) {
1127  try {
1128  if ( verbose_ ) std::cout << "Opening DB connection without TNS_ADMIN ..." << std::endl;
1130  if ( verbose_ ) std::cout << "done." << std::endl;
1131  } catch (std::runtime_error &e) {
1132  std::cerr << e.what() << std::endl;
1133  }
1134  }
1135  }
1136  }
1137 
1138  MonVersionDef monverdef;
1139 
1140  monverdef.setMonitoringVersion("test01");
1141 
1142  MonRunTag montag;
1143 
1144  montag.setMonVersionDef(monverdef);
1145  montag.setGeneralTag(dbTagName_);
1146 
1147  Tm startSubRun;
1148 
1149  startSubRun.setToCurrentGMTime();
1150 
1151  // fetch the MonIOV from the DB
1152 
1153  bool foundMonIOV = false;
1154 
1155  if ( econn ) {
1156  try {
1157  if ( verbose_ ) std::cout << "Fetching MonIOV ..." << std::endl;
1158  RunTag runtag = runiov_.getRunTag();
1159  moniov_ = econn->fetchMonRunIOV(&runtag, &montag, run_, subrun_);
1160  if ( verbose_ ) std::cout << "done." << std::endl;
1161  foundMonIOV = true;
1162  } catch (std::runtime_error &e) {
1163  std::cerr << e.what() << std::endl;
1164  foundMonIOV = false;
1165  }
1166  }
1167 
1168  // begin - setup the MonIOV
1169 
1170  if ( !foundMonIOV ) {
1171 
1172  moniov_.setRunIOV(runiov_);
1173  moniov_.setSubRunNumber(subrun_);
1174 
1175  if ( subrun_ > 1 ) {
1176  moniov_.setSubRunStart(startSubRun);
1177  } else {
1178  moniov_.setSubRunStart(runiov_.getRunStart());
1179  }
1180 
1181  moniov_.setMonRunTag(montag);
1182 
1183  if ( econn ) {
1184  try {
1185  if ( verbose_ ) std::cout << "Inserting MonIOV ..." << std::endl;
1186  econn->insertMonRunIOV(&moniov_);
1187  RunTag runtag = runiov_.getRunTag();
1188  moniov_ = econn->fetchMonRunIOV(&runtag, &montag, run_, subrun_);
1189  if ( verbose_ ) std::cout << "done." << std::endl;
1190  } catch (std::runtime_error &e) {
1191  std::cerr << e.what() << std::endl;
1192  try {
1193  if ( verbose_ ) std::cout << "Fetching MonIOV (again) ..." << std::endl;
1194  RunTag runtag = runiov_.getRunTag();
1195  moniov_ = econn->fetchMonRunIOV(&runtag, &montag, run_, subrun_);
1196  if ( verbose_ ) std::cout << "done." << std::endl;
1197  foundMonIOV = true;
1198  } catch (std::runtime_error &e) {
1199  std::cerr << e.what() << std::endl;
1200  foundMonIOV = false;
1201  }
1202  }
1203  }
1204 
1205  }
1206 
1207  // end - setup the MonIOV
1208 
1209  if ( verbose_ ) {
1210  std::cout << std::endl;
1211  std::cout << "==========MonRunIOV:" << std::endl;
1212  std::cout << "SubRun Number: " << moniov_.getSubRunNumber() << std::endl;
1213  std::cout << "SubRun Start: " << moniov_.getSubRunStart().str() << std::endl;
1214  std::cout << "SubRun End: " << moniov_.getSubRunEnd().str() << std::endl;
1215  std::cout << "====================" << std::endl;
1216  std::cout << std::endl;
1217  std::cout << "==========MonRunTag:" << std::endl;
1218  std::cout << "GeneralTag: " << moniov_.getMonRunTag().getGeneralTag() << std::endl;
1219  std::cout << "Monitoring Ver: " << moniov_.getMonRunTag().getMonVersionDef().getMonitoringVersion() << std::endl;
1220  std::cout << "====================" << std::endl;
1221  std::cout << std::endl;
1222  }
1223 
1224  int taskl = 0x0;
1225  int tasko = 0x0;
1226 
1227  for ( int i=0; i<int(clients_.size()); i++ ) {
1228  bool done = false;
1229  for ( std::multimap<EBClient*,int>::iterator j = clientsRuns_.lower_bound(clients_[i]); j != clientsRuns_.upper_bound(clients_[i]); j++ ) {
1230  if ( h_ && runType_ != -1 && runType_ == (*j).second && !done ) {
1232  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;
1233  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;
1234  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;
1235  done = true;
1236  if ( verbose_ ) {
1237  if ( econn ) {
1238  std::cout << " Writing " << clientsNames_[i] << " results to DB " << std::endl;
1239  std::cout << std::endl;
1240  }
1241  }
1242  bool status;
1243  if ( clients_[i]->writeDb(econn, &runiov_, &moniov_, status) ) {
1244  taskl |= 0x1 << clientsStatus_[clientsNames_[i]];
1245  if ( status ) {
1246  tasko |= 0x1 << clientsStatus_[clientsNames_[i]];
1247  }
1248  } else {
1249  tasko |= 0x1 << clientsStatus_[clientsNames_[i]];
1250  }
1251  }
1252  }
1253  if ( ((taskl >> clientsStatus_[clientsNames_[i]]) & 0x1) ) {
1254  if ( verbose_ ) {
1255  std::cout << " Task output for " << clientsNames_[i] << " = "
1256  << ((tasko >> clientsStatus_[clientsNames_[i]]) & 0x1) << std::endl;
1257  std::cout << std::endl;
1258  }
1259  }
1260  }
1261 
1262  bool status;
1263  if ( summaryClient_ ) summaryClient_->writeDb(econn, &runiov_, &moniov_, status);
1264 
1265  EcalLogicID ecid;
1266  MonRunDat md;
1267  std::map<EcalLogicID, MonRunDat> dataset;
1268 
1269  MonRunOutcomeDef monRunOutcomeDef;
1270 
1271  monRunOutcomeDef.setShortDesc("success");
1272 
1273  float nevt = -1.;
1274 
1275  if ( h_ ) nevt = h_->GetSumOfWeights();
1276 
1277  md.setNumEvents(int(nevt));
1278  md.setMonRunOutcomeDef(monRunOutcomeDef);
1279 
1280 // string fileName = "";
1281 // md.setRootfileName(fileName);
1282 
1283  md.setTaskList(taskl);
1284  md.setTaskOutcome(tasko);
1285 
1286  if ( econn ) {
1287  try {
1288  ecid = LogicID::getEcalLogicID("EB");
1289  dataset[ecid] = md;
1290  } catch (std::runtime_error &e) {
1291  std::cerr << e.what() << std::endl;
1292  }
1293  }
1294 
1295  if ( econn ) {
1296  try {
1297  if ( verbose_ ) std::cout << "Inserting MonRunDat ..." << std::endl;
1298  econn->insertDataSet(&dataset, &moniov_);
1299  if ( verbose_ ) std::cout << "done." << std::endl;
1300  } catch (std::runtime_error &e) {
1301  std::cerr << e.what() << std::endl;
1302  }
1303  }
1304 
1305  if ( econn ) {
1306  try {
1307  if ( verbose_ ) std::cout << "Closing DB connection ..." << std::endl;
1308  delete econn;
1309  econn = 0;
1310  if ( verbose_ ) std::cout << "done." << std::endl;
1311  } catch (std::runtime_error &e) {
1312  std::cerr << e.what() << std::endl;
1313  }
1314  }
1315 #endif
1316 
1317  if ( verbose_ ) std::cout << std::endl;
1318 
1319 }
1320 
1322 
1323 #ifdef WITH_ECAL_COND_DB
1324  EcalCondDBInterface* econn;
1325 
1326  econn = 0;
1327 
1328  if ( dbName_.size() != 0 ) {
1329  try {
1330  if ( verbose_ ) std::cout << "Opening DB connection with TNS_ADMIN ..." << std::endl;
1332  if ( verbose_ ) std::cout << "done." << std::endl;
1333  } catch (std::runtime_error &e) {
1334  std::cerr << e.what() << std::endl;
1335  if ( dbHostName_.size() != 0 ) {
1336  try {
1337  if ( verbose_ ) std::cout << "Opening DB connection without TNS_ADMIN ..." << std::endl;
1339  if ( verbose_ ) std::cout << "done." << std::endl;
1340  } catch (std::runtime_error &e) {
1341  std::cerr << e.what() << std::endl;
1342  }
1343  }
1344  }
1345  }
1346 
1347  EcalLogicID ecid;
1348  RunDat rd;
1349  std::map<EcalLogicID, RunDat> dataset;
1350 
1351  float nevt = -1.;
1352 
1353  if ( h_ ) nevt = h_->GetSumOfWeights();
1354 
1355  rd.setNumEvents(int(nevt));
1356 
1357  // fetch the RunDat from the DB
1358 
1359  bool foundRunDat = false;
1360 
1361  if ( econn ) {
1362  try {
1363  if ( verbose_ ) std::cout << "Fetching RunDat ..." << std::endl;
1364  econn->fetchDataSet(&dataset, &runiov_);
1365  if ( verbose_ ) std::cout << "done." << std::endl;
1366  foundRunDat = true;
1367  } catch (std::runtime_error &e) {
1368  std::cerr << e.what() << std::endl;
1369  foundRunDat = false;
1370  }
1371  }
1372 
1373  // begin - setup the RunDat (on behalf of the DAQ)
1374 
1375  if ( ! foundRunDat ) {
1376 
1377  if ( econn ) {
1378  try {
1379  ecid = LogicID::getEcalLogicID("EB");
1380  dataset[ecid] = rd;
1381  } catch (std::runtime_error &e) {
1382  std::cerr << e.what() << std::endl;
1383  }
1384  }
1385 
1386  if ( econn ) {
1387  try {
1388  if ( verbose_ ) std::cout << "Inserting RunDat ..." << std::endl;
1389  econn->insertDataSet(&dataset, &runiov_);
1390  if ( verbose_ ) std::cout << "done." << std::endl;
1391  } catch (std::runtime_error &e) {
1392  std::cerr << e.what() << std::endl;
1393  }
1394  }
1395 
1396  }
1397 
1398  // end - setup the RunDat (on behalf of the DAQ)
1399 
1400  if ( econn ) {
1401  try {
1402  if ( verbose_ ) std::cout << "Closing DB connection ..." << std::endl;
1403  delete econn;
1404  econn = 0;
1405  if ( verbose_ ) std::cout << "done." << std::endl;
1406  } catch (std::runtime_error &e) {
1407  std::cerr << e.what() << std::endl;
1408  }
1409  }
1410 #endif
1411 
1412 }
1413 
1415 
1416  current_time_ = time(NULL);
1417 
1418  ievt_++;
1419  jevt_++;
1420 
1421  if ( debug_ ) std::cout << "EcalBarrelMonitorClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
1422 
1423  MonitorElement* me;
1424  std::string s;
1425 
1426  me = dqmStore_->get(prefixME_ + "/EcalInfo/STATUS");
1427  if ( me ) {
1428  status_ = "unknown";
1429  s = me->valueString();
1430  if ( strcmp(s.c_str(), "i=0") == 0 ) status_ = "begin-of-run";
1431  if ( strcmp(s.c_str(), "i=1") == 0 ) status_ = "running";
1432  if ( strcmp(s.c_str(), "i=2") == 0 ) status_ = "end-of-run";
1433  if ( debug_ ) std::cout << "Found '" << prefixME_ << "/EcalInfo/STATUS'" << std::endl;
1434  }
1435 
1436  if ( inputFile_.size() != 0 ) {
1437  if ( ievt_ == 1 ) {
1438  if ( verbose_ ) {
1439  std::cout << std::endl;
1440  std::cout << " Reading DQM from file, forcing 'begin-of-run'" << std::endl;
1441  std::cout << std::endl;
1442  }
1443  status_ = "begin-of-run";
1444  }
1445  }
1446 
1447  int ecal_run = -1;
1448  me = dqmStore_->get(prefixME_ + "/EcalInfo/RUN");
1449  if ( me ) {
1450  s = me->valueString();
1451  sscanf(s.c_str(), "i=%d", &ecal_run);
1452  if ( debug_ ) std::cout << "Found '" << prefixME_ << "/EcalInfo/RUN'" << std::endl;
1453  }
1454 
1455  int ecal_evt = -1;
1456  me = dqmStore_->get(prefixME_ + "/EcalInfo/EVT");
1457  if ( me ) {
1458  s = me->valueString();
1459  sscanf(s.c_str(), "i=%d", &ecal_evt);
1460  if ( debug_ ) std::cout << "Found '" << prefixME_ << "/EcalInfo/EVT'" << std::endl;
1461  }
1462 
1463  me = dqmStore_->get(prefixME_ + "/EcalInfo/EVTTYPE");
1464  h_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, h_ );
1465 
1466  me = dqmStore_->get(prefixME_ + "/EcalInfo/RUNTYPE");
1467  if ( me ) {
1468  s = me->valueString();
1469  sscanf(s.c_str(), "i=%d", &evtType_);
1470  if ( runType_ == -1 ) runType_ = evtType_;
1471  if ( debug_ ) std::cout << "Found '" << prefixME_ << "/EcalInfo/RUNTYPE'" << std::endl;
1472  }
1473 
1474  // if the run number from the Event is less than zero,
1475  // use the run number from the ECAL DCC header
1476  if ( run_ <= 0 ) run_ = ecal_run;
1477 
1478  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1479  if ( ! mergeRuns_ && run_ != last_run_ ) forced_update_ = true;
1480  }
1481 
1482  bool update = ( forced_update_ ) ||
1483  ( prescaleFactor_ != 1 ) ||
1484  ( jevt_ < 10 ) ||
1485  ( jevt_ < 100 && jevt_ % 10 == 0 ) ||
1486  ( jevt_ < 1000 && jevt_ % 100 == 0 ) ||
1487  ( jevt_ % 1000 == 0 );
1488 
1489  if ( update || strcmp(status_.c_str(), "begin-of-run") == 0 || strcmp(status_.c_str(), "end-of-run") == 0 ) {
1490 
1491  if ( verbose_ ) {
1492  std::cout << " RUN status = \"" << status_ << "\"" << std::endl;
1493  std::cout << " CMS run/event number = " << run_ << "/" << evt_ << std::endl;
1494  std::cout << " EB run/event number = " << ecal_run << "/" << ecal_evt << std::endl;
1495  std::cout << " EB location = " << location_ << std::endl;
1496  std::cout << " EB run/event type = " << this->getRunType() << "/" << ( evtType_ == -1 ? "UNKNOWN" : runTypes_[evtType_] ) << std::flush;
1497 
1498  if ( h_ ) {
1499  if ( h_->GetSumOfWeights() != 0 ) {
1500  std::cout << " ( " << std::flush;
1501  for ( unsigned int i = 0; i < runTypes_.size(); i++ ) {
1502  if ( strcmp(runTypes_[i].c_str(), "UNKNOWN") != 0 && h_->GetBinContent(2+i) != 0 ) {
1503  std::string s = runTypes_[i];
1504  transform( s.begin(), s.end(), s.begin(), (int(*)(int))tolower );
1505  std::cout << s << " ";
1506  }
1507  }
1508  std::cout << ")" << std::flush;
1509  }
1510  }
1511  std::cout << std::endl;
1512  }
1513 
1514  }
1515 
1516  if ( strcmp(status_.c_str(), "begin-of-run") == 0 ) {
1517 
1518  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1519 
1520  if ( ! begin_run_ ) {
1521 
1522  forced_status_ = false;
1523  this->beginRun();
1524 
1525  }
1526 
1527  }
1528 
1529  }
1530 
1531  if ( strcmp(status_.c_str(), "begin-of-run") == 0 || strcmp(status_.c_str(), "running") == 0 || strcmp(status_.c_str(), "end-of-run") == 0 ) {
1532 
1533  if ( begin_run_ && ! end_run_ ) {
1534 
1535  bool update = ( forced_update_ ) ||
1536  ( prescaleFactor_ != 1 ) ||
1537  ( jevt_ < 3 ) ||
1538  ( jevt_ < 1000 && jevt_ % 100 == 0 ) ||
1539  ( jevt_ < 10000 && jevt_ % 1000 == 0 ) ||
1540  ( jevt_ % 10000 == 0 );
1541 
1542  if ( update || strcmp(status_.c_str(), "begin-of-run") == 0 || strcmp(status_.c_str(), "end-of-run") == 0 ) {
1543 
1544  for ( int i=0; i<int(clients_.size()); i++ ) {
1545  bool done = false;
1546  for ( std::multimap<EBClient*,int>::iterator j = clientsRuns_.lower_bound(clients_[i]); j != clientsRuns_.upper_bound(clients_[i]); j++ ) {
1547  if ( runType_ != -1 && runType_ == (*j).second && !done ) {
1548  done = true;
1549  clients_[i]->analyze();
1550  }
1551  }
1552  }
1553 
1555 
1556  }
1557 
1558  forced_update_ = false;
1559 
1560  bool reset = false;
1561 
1562  if ( resetFile_.size() != 0 ) {
1563  if ( access(resetFile_.c_str(), W_OK) == 0 ) {
1564  if ( unlink(resetFile_.c_str()) == 0 ) {
1565  reset |= true;
1566  }
1567  }
1568  }
1569 
1570  if ( dbUpdateTime_ > 0 ) {
1571  reset |= (current_time_ - last_time_reset_) > 60 * dbUpdateTime_;
1572  }
1573 
1574  if ( reset ) {
1582  this->softReset(true);
1584  }
1585 
1586  }
1587 
1588  }
1589 
1590  if ( strcmp(status_.c_str(), "end-of-run") == 0 ) {
1591 
1592  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1593 
1594  if ( begin_run_ && ! end_run_ ) {
1595 
1596  forced_status_ = false;
1597  this->endRun();
1598 
1599  }
1600 
1601  }
1602 
1603  }
1604 
1605  // BEGIN: run-time fixes for missing state transitions
1606 
1607  // run number transition
1608 
1609  if ( strcmp(status_.c_str(), "running") == 0 ) {
1610 
1611  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1612 
1613  if ( ! mergeRuns_ ) {
1614 
1615  int new_run_ = run_;
1616  int old_run_ = last_run_;
1617 
1618  if ( new_run_ != old_run_ ) {
1619 
1620  if ( begin_run_ && ! end_run_ ) {
1621 
1622  if ( verbose_ ) {
1623  std::cout << std::endl;
1624  std::cout << " Old run has finished, issuing endRun() ... " << std::endl;
1625  std::cout << std::endl;
1626  }
1627 
1628  // end old_run_
1629  run_ = old_run_;
1630 
1631  forced_status_ = false;
1632  this->endRun();
1633 
1634  }
1635 
1636  if ( ! begin_run_ ) {
1637 
1638  if ( verbose_ ) {
1639  std::cout << std::endl;
1640  std::cout << " New run has started, issuing beginRun() ... " << std::endl;
1641  std::cout << std::endl;
1642  }
1643 
1644  // start new_run_
1645  run_ = new_run_;
1646 
1647  forced_status_ = false;
1648  this->beginRun();
1649 
1650  }
1651 
1652  }
1653 
1654  }
1655 
1656  }
1657 
1658  }
1659 
1660  // 'running' state without a previous 'begin-of-run' state
1661 
1662  if ( strcmp(status_.c_str(), "running") == 0 ) {
1663 
1664  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1665 
1666  if ( ! forced_status_ ) {
1667 
1668  if ( ! begin_run_ ) {
1669 
1670  if ( verbose_ ) {
1671  std::cout << std::endl;
1672  std::cout << "Forcing beginRun() ... NOW !" << std::endl;
1673  std::cout << std::endl;
1674  }
1675 
1676  forced_status_ = true;
1677  this->beginRun();
1678 
1679  }
1680 
1681  }
1682 
1683  }
1684 
1685  }
1686 
1687  // 'end-of-run' state without a previous 'begin-of-run' or 'running' state
1688 
1689  if ( strcmp(status_.c_str(), "end-of-run") == 0 ) {
1690 
1691  if ( run_ != -1 && evt_ != -1 && runType_ != -1 ) {
1692 
1693  if ( ! forced_status_ ) {
1694 
1695  if ( ! begin_run_ ) {
1696 
1697  if ( verbose_ ) {
1698  std::cout << std::endl;
1699  std::cout << "Forcing beginRun() ... NOW !" << std::endl;
1700  std::cout << std::endl;
1701  }
1702 
1703  forced_status_ = true;
1704  this->beginRun();
1705 
1706  }
1707 
1708  }
1709 
1710  }
1711 
1712  }
1713 
1714  // END: run-time fixes for missing state transitions
1715 
1716 }
1717 
1719 
1720  run_ = e.id().run();
1721  evt_ = e.id().event();
1722 
1723  if ( prescaleFactor_ > 0 ) {
1724  if ( jevt_ % prescaleFactor_ == 0 ) this->analyze();
1725  }
1726 
1727 }
1728 
1730 
1731  std::vector<MonitorElement*> mes = dqmStore_->getAllContents(prefixME_);
1732  std::vector<MonitorElement*>::const_iterator meitr;
1733  for ( meitr=mes.begin(); meitr!=mes.end(); meitr++ ) {
1734  if ( !strncmp((*meitr)->getName().c_str(), "EB", 2)
1735  && strncmp((*meitr)->getName().c_str(), "EBTrend", 7)
1736  && strncmp((*meitr)->getName().c_str(), "by lumi", 7) ) {
1737  if ( flag ) {
1738  dqmStore_->softReset(*meitr);
1739  } else {
1740  dqmStore_->disableSoftReset(*meitr);
1741  }
1742  }
1743  }
1744 
1745  MonitorElement* me = dqmStore_->get(prefixME_ + "/EcalInfo/EVTTYPE");
1746  if ( me ) {
1747  if ( flag ) {
1748  dqmStore_->softReset(me);
1749  } else {
1751  }
1752  }
1753 
1754 }
1755 
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
bool containsAnyMonitorable(const std::string &path) const
Definition: DQMStore.cc:1463
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:659
void setShortDesc(std::string desc)
std::vector< MonitorElement * > getAllContents(const std::string &path) const
Definition: DQMStore.cc:1677
void Fill(long long x)
void disableSoftReset(MonitorElement *me)
Definition: DQMStore.cc:2747
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:2577
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:2739
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:1473
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:498
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:2437
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)
dbl *** dir
Definition: mlp_gen.cc:35
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:850
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:434
Definition: Run.h:36