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