CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Friends
EcalBarrelMonitorClient Class Reference

#include <EcalBarrelMonitorClient.h>

Inheritance diagram for EcalBarrelMonitorClient:
edm::EDAnalyzer edm::EDConsumerBase EcalBarrelMonitorDbClient EcalBarrelMonitorXdaqClient

Public Member Functions

void analyze (void)
 Analyze. More...
 
void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob (void)
 BeginJob. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &c)
 BeginLumiBlock. More...
 
void beginRun (void)
 BeginRun. More...
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void beginRunDb (void)
 BeginRunDB. More...
 
void cleanup (void)
 Cleanup. More...
 
 EcalBarrelMonitorClient (const edm::ParameterSet &ps)
 Constructor. More...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &c)
 EndLumiBlock. More...
 
void endRun (void)
 EndRun. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
void endRunDb (void)
 EndRunDB. More...
 
const char * getRunType (void)
 
void reset (void)
 Reset. More...
 
void setup (void)
 Setup. More...
 
void softReset (bool flag)
 SoftReset. More...
 
void writeDb (void)
 WriteDB. More...
 
virtual ~EcalBarrelMonitorClient ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool begin_run_
 
std::vector< EBClient * > clients_
 
std::vector< std::string > clientsNames_
 
std::multimap< EBClient *, int > clientsRuns_
 
std::map< std::string, int > clientsStatus_
 
bool cloneME_
 
time_t current_time_
 
std::string dbHostName_
 
int dbHostPort_
 
std::string dbName_
 
std::string dbPassword_
 
std::string dbTagName_
 
time_t dbUpdateTime_
 
std::string dbUserName_
 
bool debug_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
std::vector< std::string > enabledClients_
 
bool end_run_
 
int evt_
 
int evtType_
 
bool forced_status_
 
bool forced_update_
 
TH1F * h_
 
int ievt_
 
std::string inputFile_
 
int jevt_
 
int last_run_
 
time_t last_time_reset_
 
time_t last_time_update_
 
std::string location_
 
bool mergeRuns_
 
std::string prefixME_
 
int prescaleFactor_
 
bool produceReports_
 
std::string resetFile_
 
int run_
 
int runType_
 
std::vector< std::string > runTypes_
 
std::string status_
 
int subrun_
 
EBSummaryClientsummaryClient_
 
std::vector< int > superModules_
 
time_t updateTime_
 
bool verbose_
 

Friends

class EcalBarrelMonitorXdaqClient
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 36 of file EcalBarrelMonitorClient.h.

Constructor & Destructor Documentation

EcalBarrelMonitorClient::EcalBarrelMonitorClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 60 of file EcalBarrelMonitorClient.cc.

References EcalDCCHeaderBlock::BEAMH2, EcalDCCHeaderBlock::BEAMH4, EcalDCCHeaderBlock::CALIB_LOCAL, clients_, clientsNames_, clientsRuns_, clientsStatus_, cloneME_, EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, gather_cfg::cout, dbHostName_, dbHostPort_, dbName_, dbPassword_, dbTagName_, dbUpdateTime_, dbUserName_, debug_, enableCleanup_, enabledClients_, spr::find(), edm::ParameterSet::getUntrackedParameter(), EcalDCCHeaderBlock::HALO_GLOBAL, EcalDCCHeaderBlock::HALO_LOCAL, i, inputFile_, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_STD, EcalDCCHeaderBlock::LED_GAP, EcalDCCHeaderBlock::LED_STD, location_, mergeRuns_, EcalDCCHeaderBlock::MTCC, EcalDCCHeaderBlock::PEDESTAL_GAP, EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN, EcalDCCHeaderBlock::PEDESTAL_STD, EcalDCCHeaderBlock::PHYSICS_GLOBAL, EcalDCCHeaderBlock::PHYSICS_LOCAL, prefixME_, prescaleFactor_, produceReports_, resetFile_, runTypes_, EBSummaryClient::setFriends(), AlCaHLTBitMon_QueryRunRegistry::string, summaryClient_, superModules_, EcalDCCHeaderBlock::TESTPULSE_GAP, EcalDCCHeaderBlock::TESTPULSE_MGPA, updateTime_, and verbose_.

60  {
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 }
std::multimap< EBClient *, int > clientsRuns_
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > clientsNames_
std::vector< std::string > enabledClients_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void setFriends(std::vector< EBClient * > clients)
Set Clients.
std::vector< EBClient * > clients_
std::map< std::string, int > clientsStatus_
std::vector< std::string > runTypes_
tuple cout
Definition: gather_cfg.py:121
EcalBarrelMonitorClient::~EcalBarrelMonitorClient ( )
virtual

Destructor.

Definition at line 563 of file EcalBarrelMonitorClient.cc.

References clients_, gather_cfg::cout, i, summaryClient_, and verbose_.

563  {
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 }
int i
Definition: DBlmapReader.cc:9
std::vector< EBClient * > clients_
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void EcalBarrelMonitorClient::analyze ( void  )

Analyze.

Definition at line 1414 of file EcalBarrelMonitorClient.cc.

References EBSummaryClient::analyze(), EcalDCCHeaderBlock::BEAMH2, EcalDCCHeaderBlock::BEAMH4, begin_run_, beginRun(), clients_, clientsRuns_, cloneME_, EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, gather_cfg::cout, current_time_, dbUpdateTime_, debug_, run_regression::done, dqmStore_, end_run_, endRun(), evt_, evtType_, forced_status_, forced_update_, DQMStore::get(), getRunType(), h_, i, ievt_, inputFile_, j, jevt_, last_run_, last_time_reset_, location_, mergeRuns_, NULL, EcalDCCHeaderBlock::PHYSICS_GLOBAL, EcalDCCHeaderBlock::PHYSICS_LOCAL, prefixME_, prescaleFactor_, reset(), resetFile_, run_, runType_, runTypes_, alignCSCRings::s, softReset(), status_, AlCaHLTBitMon_QueryRunRegistry::string, summaryClient_, cond::rpcobgas::time, create_public_pileup_plots::transform, update, MonitorElement::valueString(), verbose_, and writeDb().

Referenced by analyze(), endJob(), endLuminosityBlock(), and endRun().

1414  {
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 }
std::multimap< EBClient *, int > clientsRuns_
int i
Definition: DBlmapReader.cc:9
#define NULL
Definition: scimark2.h:8
void softReset(bool flag)
SoftReset.
int j
Definition: DBlmapReader.cc:9
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
std::vector< EBClient * > clients_
std::string valueString(void) const
std::vector< std::string > runTypes_
#define update(a, b)
tuple cout
Definition: gather_cfg.py:121
void analyze(void)
Analyze.
void EcalBarrelMonitorClient::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 1718 of file EcalBarrelMonitorClient.cc.

References analyze(), edm::EventID::event(), evt_, edm::EventBase::id(), jevt_, prescaleFactor_, edm::EventID::run(), and run_.

1718  {
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 }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
edm::EventID id() const
Definition: EventBase.h:56
void EcalBarrelMonitorClient::beginJob ( void  )
virtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 575 of file EcalBarrelMonitorClient.cc.

References begin_run_, EBSummaryClient::beginJob(), clients_, gather_cfg::cout, current_time_, debug_, dqmStore_, end_run_, evt_, evtType_, forced_status_, forced_update_, h_, i, ievt_, inputFile_, jevt_, last_run_, last_time_reset_, last_time_update_, NULL, DQMStore::open(), cppFunctionSkipper::operator, run_, runType_, status_, subrun_, summaryClient_, and cond::rpcobgas::time.

575  {
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 }
int i
Definition: DBlmapReader.cc:9
#define NULL
Definition: scimark2.h:8
void beginJob(void)
BeginJob.
std::vector< EBClient * > clients_
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
tuple cout
Definition: gather_cfg.py:121
void EcalBarrelMonitorClient::beginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
)
virtual

BeginLumiBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 877 of file EcalBarrelMonitorClient.cc.

References gather_cfg::cout, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), edm::LuminosityBlockID::run(), and verbose_.

877  {
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 }
LuminosityBlockID id() const
RunNumber_t run() const
LuminosityBlockNumber_t luminosityBlock() const
tuple cout
Definition: gather_cfg.py:121
void EcalBarrelMonitorClient::beginRun ( void  )

BeginRun.

Definition at line 624 of file EcalBarrelMonitorClient.cc.

References begin_run_, EBSummaryClient::beginRun(), beginRunDb(), clients_, clientsRuns_, gather_cfg::cout, current_time_, debug_, run_regression::done, end_run_, i, j, jevt_, last_run_, last_time_reset_, last_time_update_, NULL, run_, runType_, setup(), summaryClient_, and cond::rpcobgas::time.

Referenced by analyze(), and endLuminosityBlock().

624  {
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 }
std::multimap< EBClient *, int > clientsRuns_
int i
Definition: DBlmapReader.cc:9
#define NULL
Definition: scimark2.h:8
int j
Definition: DBlmapReader.cc:9
std::vector< EBClient * > clients_
void beginRunDb(void)
BeginRunDB.
tuple cout
Definition: gather_cfg.py:121
void beginRun(void)
BeginRun.
void EcalBarrelMonitorClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 658 of file EcalBarrelMonitorClient.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), gather_cfg::cout, dqmStore_, evt_, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), i, edm::RunBase::id(), Numbers::initGeometry(), Masks::initMasking(), jevt_, mergeVDriftHistosByStation::name, prefixME_, produceReports_, DQMStore::removeElement(), edm::RunID::run(), run_, Numbers::sEB(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

658  {
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 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
RunID const & id() const
Definition: RunBase.h:41
RunNumber_t run() const
Definition: RunID.h:44
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:659
void Fill(long long x)
void removeElement(const std::string &name)
Definition: DQMStore.cc:2577
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
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:50
tuple cout
Definition: gather_cfg.py:121
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
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void EcalBarrelMonitorClient::beginRunDb ( void  )

BeginRunDB.

Definition at line 957 of file EcalBarrelMonitorClient.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, dbHostName_, dbHostPort_, dbName_, dbPassword_, dbUserName_, alignCSCRings::e, EcalCondDBInterface::fetchRunIOV(), getRunType(), i, EcalCondDBInterface::insertRunIOV(), location_, run_, runType_, runTypes_, RunTag::setGeneralTag(), LocationDef::setLocation(), RunTag::setLocationDef(), RunTypeDef::setRunType(), RunTag::setRunTypeDef(), Tm::setToCurrentGMTime(), AlCaHLTBitMon_QueryRunRegistry::string, subrun_, and verbose_.

Referenced by beginRun().

957  {
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 }
int i
Definition: DBlmapReader.cc:9
void setLocationDef(const LocationDef locDef)
Definition: RunTag.cc:53
void insertRunIOV(RunIOV *iov)
Definition: RunTag.h:13
RunIOV fetchRunIOV(RunTag *tag, run_t run)
void setToCurrentGMTime()
Definition: Tm.cc:177
void setRunTypeDef(const RunTypeDef runTypeDef)
Definition: RunTag.cc:70
std::vector< std::string > runTypes_
void setRunType(std::string runtype)
Definition: RunTypeDef.cc:33
void setLocation(std::string loc)
Definition: LocationDef.cc:33
tuple cout
Definition: gather_cfg.py:121
void setGeneralTag(std::string tag)
Definition: RunTag.cc:36
Definition: Tm.h:14
void EcalBarrelMonitorClient::cleanup ( void  )

Cleanup.

Definition at line 945 of file EcalBarrelMonitorClient.cc.

References cloneME_, enableCleanup_, and h_.

Referenced by endJob(), and endRun().

945  {
946 
947  if ( ! enableCleanup_ ) return;
948 
949  if ( cloneME_ ) {
950  if ( h_ ) delete h_;
951  }
952 
953  h_ = 0;
954 
955 }
void EcalBarrelMonitorClient::endJob ( void  )
virtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 724 of file EcalBarrelMonitorClient.cc.

References analyze(), begin_run_, cleanup(), clients_, gather_cfg::cout, debug_, end_run_, EBSummaryClient::endJob(), endRun(), forced_status_, forced_update_, i, ievt_, summaryClient_, and verbose_.

724  {
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 }
int i
Definition: DBlmapReader.cc:9
std::vector< EBClient * > clients_
void endJob(void)
EndJob.
tuple cout
Definition: gather_cfg.py:121
void EcalBarrelMonitorClient::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
)
virtual

EndLumiBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 887 of file EcalBarrelMonitorClient.cc.

References analyze(), begin_run_, beginRun(), clientsNames_, DQMStore::containsAnyMonitorable(), gather_cfg::cout, current_time_, dir, DQMStore::dirExists(), dqmStore_, enabledClients_, end_run_, endRun(), evt_, spr::find(), forced_status_, forced_update_, edm::LuminosityBlockBase::id(), last_time_update_, edm::LuminosityBlockID::luminosityBlock(), mergeVDriftHistosByStation::name, NULL, prefixME_, edm::LuminosityBlockID::run(), run_, runType_, AlCaHLTBitMon_QueryRunRegistry::string, cond::rpcobgas::time, updateTime_, and verbose_.

887  {
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 }
LuminosityBlockID id() const
bool containsAnyMonitorable(const std::string &path) const
Definition: DQMStore.cc:1463
std::vector< std::string > clientsNames_
std::vector< std::string > enabledClients_
#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
RunNumber_t run() const
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:498
LuminosityBlockNumber_t luminosityBlock() const
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
void EcalBarrelMonitorClient::endRun ( void  )

EndRun.

Definition at line 765 of file EcalBarrelMonitorClient.cc.

References EBSummaryClient::analyze(), begin_run_, cleanup(), clients_, clientsRuns_, gather_cfg::cout, dbUpdateTime_, debug_, run_regression::done, end_run_, EBSummaryClient::endRun(), endRunDb(), evt_, evtType_, i, j, jevt_, resetFile_, run_, runType_, softReset(), status_, subrun_, summaryClient_, and writeDb().

Referenced by analyze(), endJob(), endLuminosityBlock(), and endRun().

765  {
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 }
std::multimap< EBClient *, int > clientsRuns_
int i
Definition: DBlmapReader.cc:9
void endRun(void)
EndRun.
void softReset(bool flag)
SoftReset.
int j
Definition: DBlmapReader.cc:9
std::vector< EBClient * > clients_
tuple cout
Definition: gather_cfg.py:121
void analyze(void)
Analyze.
void EcalBarrelMonitorClient::endRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 824 of file EcalBarrelMonitorClient.cc.

References analyze(), begin_run_, gather_cfg::cout, dqmStore_, end_run_, endRun(), evt_, MonitorElement::Fill(), forced_status_, forced_update_, DQMStore::get(), i, edm::RunBase::id(), mergeRuns_, prefixME_, edm::RunID::run(), run_, runType_, Numbers::sEB(), MonitorElement::setBinContent(), and verbose_.

824  {
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 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
RunID const & id() const
Definition: RunBase.h:41
RunNumber_t run() const
Definition: RunID.h:44
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
void Fill(long long x)
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
tuple cout
Definition: gather_cfg.py:121
void EcalBarrelMonitorClient::endRunDb ( void  )

EndRunDB.

Definition at line 1321 of file EcalBarrelMonitorClient.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, dataset::dataset, dbHostName_, dbHostPort_, dbName_, dbPassword_, dbUserName_, alignCSCRings::e, EcalCondDBInterface::fetchDataSet(), LogicID::getEcalLogicID(), h_, EcalCondDBInterface::insertDataSet(), nevt, RunDat::setNumEvents(), and verbose_.

Referenced by endRun().

1321  {
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 }
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov)
void setNumEvents(int num)
Definition: RunDat.h:20
tuple dataset
Definition: dataset.py:393
Definition: RunDat.h:11
tuple cout
Definition: gather_cfg.py:121
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
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
const char* EcalBarrelMonitorClient::getRunType ( void  )
inline

Definition at line 93 of file EcalBarrelMonitorClient.h.

References runType_, and runTypes_.

Referenced by analyze(), beginRunDb(), and EcalBarrelMonitorXdaqClient::defaultWebPage().

93 { return( runType_ == -1 ? "UNKNOWN" : runTypes_[runType_].c_str() ); }
std::vector< std::string > runTypes_
void EcalBarrelMonitorClient::reset ( void  )

Reset.

Definition at line 937 of file EcalBarrelMonitorClient.cc.

Referenced by analyze().

937  {
938 
939 }
void EcalBarrelMonitorClient::setup ( void  )

Setup.

Definition at line 941 of file EcalBarrelMonitorClient.cc.

Referenced by beginRun().

941  {
942 
943 }
void EcalBarrelMonitorClient::softReset ( bool  flag)

SoftReset.

Definition at line 1729 of file EcalBarrelMonitorClient.cc.

References DQMStore::disableSoftReset(), dqmStore_, DQMStore::get(), DQMStore::getAllContents(), prefixME_, and DQMStore::softReset().

Referenced by analyze(), and endRun().

1729  {
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 }
long int flag
Definition: mlp_lapack.h:47
std::vector< MonitorElement * > getAllContents(const std::string &path) const
Definition: DQMStore.cc:1677
void disableSoftReset(MonitorElement *me)
Definition: DQMStore.cc:2747
void softReset(MonitorElement *me)
Definition: DQMStore.cc:2739
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
void EcalBarrelMonitorClient::writeDb ( void  )

WriteDB.

Definition at line 1110 of file EcalBarrelMonitorClient.cc.

References dtNoiseDBValidation_cfg::cerr, clients_, clientsNames_, clientsRuns_, clientsStatus_, EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, gather_cfg::cout, dataset::dataset, dbHostName_, dbHostPort_, dbName_, dbPassword_, dbTagName_, dbUserName_, run_regression::done, alignCSCRings::e, EcalCondDBInterface::fetchMonRunIOV(), LogicID::getEcalLogicID(), h_, i, EcalCondDBInterface::insertDataSet(), EcalCondDBInterface::insertMonRunIOV(), j, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_STD, nevt, EcalDCCHeaderBlock::PEDESTAL_GAP, EcalDCCHeaderBlock::PEDESTAL_STD, EcalDCCHeaderBlock::PHYSICS_GLOBAL, EcalDCCHeaderBlock::PHYSICS_LOCAL, run_, runType_, MonRunTag::setGeneralTag(), MonVersionDef::setMonitoringVersion(), MonRunDat::setMonRunOutcomeDef(), MonRunTag::setMonVersionDef(), MonRunDat::setNumEvents(), MonRunOutcomeDef::setShortDesc(), MonRunDat::setTaskList(), MonRunDat::setTaskOutcome(), Tm::setToCurrentGMTime(), ntuplemaker::status, subrun_, summaryClient_, EcalDCCHeaderBlock::TESTPULSE_GAP, EcalDCCHeaderBlock::TESTPULSE_MGPA, and verbose_.

Referenced by analyze(), and endRun().

1110  {
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 }
std::multimap< EBClient *, int > clientsRuns_
int i
Definition: DBlmapReader.cc:9
void setTaskList(int list)
Definition: MonRunDat.h:30
void setNumEvents(int num)
Definition: MonRunDat.h:21
std::vector< std::string > clientsNames_
Definition: RunTag.h:13
void setToCurrentGMTime()
Definition: Tm.cc:177
void setGeneralTag(std::string tag)
Definition: MonRunTag.cc:33
void setShortDesc(std::string desc)
int j
Definition: DBlmapReader.cc:9
void setMonVersionDef(MonVersionDef ver)
Definition: MonRunTag.cc:49
void setTaskOutcome(int outcome)
Definition: MonRunDat.h:33
std::vector< EBClient * > clients_
std::map< std::string, int > clientsStatus_
void setMonRunOutcomeDef(MonRunOutcomeDef outcomeDef)
Definition: MonRunDat.h:24
tuple dataset
Definition: dataset.py:393
MonRunIOV fetchMonRunIOV(RunTag *runtag, MonRunTag *montag, run_t run, subrun_t monrun)
void setMonitoringVersion(std::string ver)
void insertMonRunIOV(MonRunIOV *iov)
tuple cout
Definition: gather_cfg.py:121
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
tuple status
Definition: ntuplemaker.py:245
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
Definition: Tm.h:14

Friends And Related Function Documentation

friend class EcalBarrelMonitorXdaqClient
friend

Definition at line 38 of file EcalBarrelMonitorClient.h.

Member Data Documentation

bool EcalBarrelMonitorClient::begin_run_
private
std::vector<EBClient*> EcalBarrelMonitorClient::clients_
private
std::vector<std::string> EcalBarrelMonitorClient::clientsNames_
private
std::multimap<EBClient*,int> EcalBarrelMonitorClient::clientsRuns_
private
std::map<std::string,int> EcalBarrelMonitorClient::clientsStatus_
private

Definition at line 146 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient(), and writeDb().

bool EcalBarrelMonitorClient::cloneME_
private

Definition at line 100 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), cleanup(), and EcalBarrelMonitorClient().

time_t EcalBarrelMonitorClient::current_time_
private

Definition at line 130 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), beginRun(), and endLuminosityBlock().

std::string EcalBarrelMonitorClient::dbHostName_
private

Definition at line 112 of file EcalBarrelMonitorClient.h.

Referenced by beginRunDb(), EcalBarrelMonitorClient(), endRunDb(), and writeDb().

int EcalBarrelMonitorClient::dbHostPort_
private

Definition at line 113 of file EcalBarrelMonitorClient.h.

Referenced by beginRunDb(), EcalBarrelMonitorClient(), endRunDb(), and writeDb().

std::string EcalBarrelMonitorClient::dbName_
private

Definition at line 111 of file EcalBarrelMonitorClient.h.

Referenced by beginRunDb(), EcalBarrelMonitorClient(), endRunDb(), and writeDb().

std::string EcalBarrelMonitorClient::dbPassword_
private

Definition at line 115 of file EcalBarrelMonitorClient.h.

Referenced by beginRunDb(), EcalBarrelMonitorClient(), endRunDb(), and writeDb().

std::string EcalBarrelMonitorClient::dbTagName_
private

Definition at line 117 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient(), and writeDb().

time_t EcalBarrelMonitorClient::dbUpdateTime_
private

Definition at line 136 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), EcalBarrelMonitorClient(), and endRun().

std::string EcalBarrelMonitorClient::dbUserName_
private

Definition at line 114 of file EcalBarrelMonitorClient.h.

Referenced by beginRunDb(), EcalBarrelMonitorClient(), endRunDb(), and writeDb().

bool EcalBarrelMonitorClient::debug_
private
DQMStore* EcalBarrelMonitorClient::dqmStore_
private
bool EcalBarrelMonitorClient::enableCleanup_
private

Definition at line 107 of file EcalBarrelMonitorClient.h.

Referenced by cleanup(), and EcalBarrelMonitorClient().

std::vector<std::string> EcalBarrelMonitorClient::enabledClients_
private

Definition at line 140 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient(), and endLuminosityBlock().

bool EcalBarrelMonitorClient::end_run_
private
int EcalBarrelMonitorClient::evt_
private

Definition at line 164 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), beginRun(), endLuminosityBlock(), and endRun().

int EcalBarrelMonitorClient::evtType_
private

Definition at line 159 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), and endRun().

bool EcalBarrelMonitorClient::forced_status_
private

Definition at line 169 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), endJob(), endLuminosityBlock(), and endRun().

bool EcalBarrelMonitorClient::forced_update_
private

Definition at line 171 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), endJob(), endLuminosityBlock(), and endRun().

TH1F* EcalBarrelMonitorClient::h_
private
int EcalBarrelMonitorClient::ievt_
private
std::string EcalBarrelMonitorClient::inputFile_
private

Definition at line 109 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), and EcalBarrelMonitorClient().

int EcalBarrelMonitorClient::jevt_
private

Definition at line 98 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), beginRun(), and endRun().

int EcalBarrelMonitorClient::last_run_
private

Definition at line 173 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), and beginRun().

time_t EcalBarrelMonitorClient::last_time_reset_
private

Definition at line 133 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), and beginRun().

time_t EcalBarrelMonitorClient::last_time_update_
private

Definition at line 132 of file EcalBarrelMonitorClient.h.

Referenced by beginJob(), beginRun(), and endLuminosityBlock().

std::string EcalBarrelMonitorClient::location_
private

Definition at line 156 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginRunDb(), and EcalBarrelMonitorClient().

bool EcalBarrelMonitorClient::mergeRuns_
private

Definition at line 121 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), EcalBarrelMonitorClient(), and endRun().

std::string EcalBarrelMonitorClient::prefixME_
private
int EcalBarrelMonitorClient::prescaleFactor_
private

Definition at line 105 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), and EcalBarrelMonitorClient().

bool EcalBarrelMonitorClient::produceReports_
private

Definition at line 154 of file EcalBarrelMonitorClient.h.

Referenced by beginRun(), and EcalBarrelMonitorClient().

std::string EcalBarrelMonitorClient::resetFile_
private

Definition at line 119 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), EcalBarrelMonitorClient(), and endRun().

int EcalBarrelMonitorClient::run_
private
int EcalBarrelMonitorClient::runType_
private
std::vector<std::string> EcalBarrelMonitorClient::runTypes_
private
std::string EcalBarrelMonitorClient::status_
private

Definition at line 161 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), beginJob(), and endRun().

int EcalBarrelMonitorClient::subrun_
private

Definition at line 128 of file EcalBarrelMonitorClient.h.

Referenced by beginJob(), beginRunDb(), endRun(), and writeDb().

EBSummaryClient* EcalBarrelMonitorClient::summaryClient_
private
std::vector<int> EcalBarrelMonitorClient::superModules_
private

Definition at line 138 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient().

time_t EcalBarrelMonitorClient::updateTime_
private

Definition at line 135 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient(), and endLuminosityBlock().

bool EcalBarrelMonitorClient::verbose_
private