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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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
 
- 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::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 34 of file EcalBarrelMonitorClient.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 58 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_.

58  {
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 }
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(const 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 561 of file EcalBarrelMonitorClient.cc.

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

561  {
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 }
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 1412 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_lumi_plots::transform, update, MonitorElement::valueString(), verbose_, and writeDb().

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

1412  {
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 }
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:1623
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 1716 of file EcalBarrelMonitorClient.cc.

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

1716  {
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 }
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 573 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.

573  {
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 }
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:2632
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 875 of file EcalBarrelMonitorClient.cc.

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

875  {
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 }
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 622 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().

622  {
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 }
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 656 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_.

656  {
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 }
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:43
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:809
void Fill(long long x)
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
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
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:47
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:1000
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:584
void EcalBarrelMonitorClient::beginRunDb ( void  )

BeginRunDB.

Definition at line 955 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().

955  {
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 }
void setRunTypeDef(const RunTypeDef &runTypeDef)
Definition: RunTag.cc:70
int i
Definition: DBlmapReader.cc:9
void insertRunIOV(RunIOV *iov)
Definition: RunTag.h:13
RunIOV fetchRunIOV(RunTag *tag, run_t run)
void setToCurrentGMTime()
Definition: Tm.cc:177
void setLocationDef(const LocationDef &locDef)
Definition: RunTag.cc:53
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:13
void EcalBarrelMonitorClient::cleanup ( void  )

Cleanup.

Definition at line 943 of file EcalBarrelMonitorClient.cc.

References cloneME_, enableCleanup_, and h_.

Referenced by endJob(), and endRun().

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

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 722 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_.

722  {
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 }
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 885 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_.

885  {
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 }
LuminosityBlockID id() const
bool containsAnyMonitorable(const std::string &path) const
Definition: DQMStore.cc:1613
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:648
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 763 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().

763  {
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 }
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 822 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_.

822  {
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 }
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:43
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
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:1623
tuple cout
Definition: gather_cfg.py:121
void EcalBarrelMonitorClient::endRunDb ( void  )

EndRunDB.

Definition at line 1319 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().

1319  {
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 }
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:29
const char* EcalBarrelMonitorClient::getRunType ( void  )
inline

Definition at line 91 of file EcalBarrelMonitorClient.h.

References runType_, and runTypes_.

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

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

Reset.

Definition at line 935 of file EcalBarrelMonitorClient.cc.

Referenced by analyze().

935  {
936 
937 }
void EcalBarrelMonitorClient::setup ( void  )

Setup.

Definition at line 939 of file EcalBarrelMonitorClient.cc.

Referenced by beginRun().

939  {
940 
941 }
void EcalBarrelMonitorClient::softReset ( bool  flag)

SoftReset.

Definition at line 1727 of file EcalBarrelMonitorClient.cc.

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

Referenced by analyze(), and endRun().

1727  {
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 }
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 softReset(MonitorElement *me)
Definition: DQMStore.cc:2934
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
void EcalBarrelMonitorClient::writeDb ( void  )

WriteDB.

Definition at line 1108 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().

1108  {
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 }
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_
void setMonRunOutcomeDef(const MonRunOutcomeDef &outcomeDef)
Definition: MonRunDat.h:24
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(const MonVersionDef &ver)
Definition: MonRunTag.cc:49
void setTaskOutcome(int outcome)
Definition: MonRunDat.h:33
std::vector< EBClient * > clients_
std::map< std::string, int > clientsStatus_
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:29
Definition: Tm.h:13

Friends And Related Function Documentation

friend class EcalBarrelMonitorXdaqClient
friend

Definition at line 36 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 144 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient(), and writeDb().

bool EcalBarrelMonitorClient::cloneME_
private

Definition at line 98 of file EcalBarrelMonitorClient.h.

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

time_t EcalBarrelMonitorClient::current_time_
private

Definition at line 128 of file EcalBarrelMonitorClient.h.

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

std::string EcalBarrelMonitorClient::dbHostName_
private

Definition at line 110 of file EcalBarrelMonitorClient.h.

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

int EcalBarrelMonitorClient::dbHostPort_
private

Definition at line 111 of file EcalBarrelMonitorClient.h.

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

std::string EcalBarrelMonitorClient::dbName_
private

Definition at line 109 of file EcalBarrelMonitorClient.h.

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

std::string EcalBarrelMonitorClient::dbPassword_
private

Definition at line 113 of file EcalBarrelMonitorClient.h.

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

std::string EcalBarrelMonitorClient::dbTagName_
private

Definition at line 115 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient(), and writeDb().

time_t EcalBarrelMonitorClient::dbUpdateTime_
private

Definition at line 134 of file EcalBarrelMonitorClient.h.

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

std::string EcalBarrelMonitorClient::dbUserName_
private

Definition at line 112 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 105 of file EcalBarrelMonitorClient.h.

Referenced by cleanup(), and EcalBarrelMonitorClient().

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

Definition at line 138 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient(), and endLuminosityBlock().

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

Definition at line 162 of file EcalBarrelMonitorClient.h.

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

int EcalBarrelMonitorClient::evtType_
private

Definition at line 157 of file EcalBarrelMonitorClient.h.

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

bool EcalBarrelMonitorClient::forced_status_
private

Definition at line 167 of file EcalBarrelMonitorClient.h.

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

bool EcalBarrelMonitorClient::forced_update_
private

Definition at line 169 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 107 of file EcalBarrelMonitorClient.h.

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

int EcalBarrelMonitorClient::jevt_
private

Definition at line 96 of file EcalBarrelMonitorClient.h.

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

int EcalBarrelMonitorClient::last_run_
private

Definition at line 171 of file EcalBarrelMonitorClient.h.

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

time_t EcalBarrelMonitorClient::last_time_reset_
private

Definition at line 131 of file EcalBarrelMonitorClient.h.

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

time_t EcalBarrelMonitorClient::last_time_update_
private

Definition at line 130 of file EcalBarrelMonitorClient.h.

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

std::string EcalBarrelMonitorClient::location_
private

Definition at line 154 of file EcalBarrelMonitorClient.h.

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

bool EcalBarrelMonitorClient::mergeRuns_
private

Definition at line 119 of file EcalBarrelMonitorClient.h.

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

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

Definition at line 103 of file EcalBarrelMonitorClient.h.

Referenced by analyze(), and EcalBarrelMonitorClient().

bool EcalBarrelMonitorClient::produceReports_
private

Definition at line 152 of file EcalBarrelMonitorClient.h.

Referenced by beginRun(), and EcalBarrelMonitorClient().

std::string EcalBarrelMonitorClient::resetFile_
private

Definition at line 117 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 159 of file EcalBarrelMonitorClient.h.

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

int EcalBarrelMonitorClient::subrun_
private

Definition at line 126 of file EcalBarrelMonitorClient.h.

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

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

Definition at line 136 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient().

time_t EcalBarrelMonitorClient::updateTime_
private

Definition at line 133 of file EcalBarrelMonitorClient.h.

Referenced by EcalBarrelMonitorClient(), and endLuminosityBlock().

bool EcalBarrelMonitorClient::verbose_
private