CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DQM/HcalMonitorModule/interface/ZDCMonitorModule.h

Go to the documentation of this file.
00001 #ifndef ZDCMonitorModule_GUARD_H
00002 #define ZDCMonitorModule_GUARD_H
00003 
00004 /*
00005  * \file ZDCMonitorModule.h
00006  *
00007 
00008  * $Date: 2010/03/25 20:00:36 $
00009  * $Revision: 1.2 $
00010  * \author 
00011  *
00012 */
00013 
00014 #include "FWCore/Framework/interface/Frameworkfwd.h"
00015 #include "FWCore/Framework/interface/EDAnalyzer.h"
00016 #include "FWCore/Framework/interface/Event.h"
00017 #include "FWCore/Framework/interface/MakerMacros.h"
00018 #include "FWCore/Framework/interface/ESHandle.h"
00019 #include "FWCore/Framework/interface/Run.h"
00020 #include "FWCore/ServiceRegistry/interface/Service.h"
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022 
00023 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
00024 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
00025 
00026 #include "FWCore/Utilities/interface/CPUTimer.h"
00027 
00028 class MonitorElement;
00029 class DQMStore;
00030 class  HcalZDCMonitor;
00031 
00032 #include <iostream>
00033 #include <fstream>
00034 
00035 class ZDCMonitorModule : public edm::EDAnalyzer{
00036 
00037 public:
00038   
00039   // Constructor
00040   ZDCMonitorModule(const edm::ParameterSet& ps);
00041 
00042   // Destructor
00043   ~ZDCMonitorModule();
00044   
00045  protected:
00046   
00047   // Analyze
00048   void analyze(const edm::Event& e, const edm::EventSetup& c);
00049   
00050   // BeginJob
00051   void beginJob();
00052   
00053   // BeginRun
00054   void beginRun(const edm::Run& run, const edm::EventSetup& c);
00055 
00056   // Begin LumiBlock
00057   void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, 
00058                             const edm::EventSetup& c) ;
00059 
00060   // End LumiBlock
00061   void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, 
00062                           const edm::EventSetup& c);
00063 
00064   // EndJob
00065   void endJob(void);
00066   
00067   // EndRun
00068   void endRun(const edm::Run& run, const edm::EventSetup& c);
00069 
00070   // Reset
00071   void reset(void);
00072 
00074   bool prescale();
00075 /*
00076   // Check ZDC has FED data
00077   void CheckZDCStatus   (const FEDRawDataCollection& rawraw,
00078                         const HcalUnpackerReport& report,
00079                         const HcalElectronicsMap& emap,
00080                         const ZDCDigiCollection& zdcdigi
00081                         );
00082 */
00083  private:
00084   std::vector<int> fedss;
00085   /********************************************************/
00086   //  The following member variables can be specified in  //
00087   //  the configuration input file for the process.       //
00088   /********************************************************/
00089 
00093   int prescaleEvt_;    
00094   int prescaleLS_;     
00095   int prescaleTime_;   
00096   int prescaleUpdate_; 
00097 
00098   // Reset histograms every N events
00099 
00102   std::string monitorName_;
00103 
00105   int debug_;  // make debug an int in order to allow different levels of messaging
00106 
00107   // control whether or not to display time used by each module
00108   bool showTiming_; 
00109   edm::CPUTimer cpu_timer; // 
00110 
00111   // counters and flags
00112   int nevt_;
00113 
00114   struct{
00115     timeval startTV,updateTV;
00116     double elapsedTime; 
00117     double vetoTime; 
00118     double updateTime;
00119   } psTime_;    
00120 
00122   DQMStore* dbe_;  
00123   
00124   // environment variables
00125   int irun_,ievent_,itime_;
00126   unsigned int ilumisec;
00127   bool Online_;
00128   std::string rootFolder_;
00129 
00130   int ievt_;
00131   int ievt_rawdata_;
00132   int ievt_digi_;
00133   int ievt_rechit_;
00134   int ievt_pre_; // copy of counter used for prescale purposes
00135   bool fedsListed_;
00136   
00137   edm::InputTag inputLabelDigi_;
00138   edm::InputTag inputLabelRecHitZDC_;
00139 
00140   edm::InputTag FEDRawDataCollection_; // not yet in use, but we still store the tag name
00141 
00142   MonitorElement* meIEVTALL_;
00143   MonitorElement* meIEVTRAW_;
00144   MonitorElement* meIEVTDIGI_;
00145   MonitorElement* meIEVTRECHIT_;
00146 
00147   MonitorElement* meFEDS_;
00148   MonitorElement* meStatus_;
00149   MonitorElement* meTrigger_;
00150   MonitorElement* meLatency_;
00151   MonitorElement* meQuality_;
00152   
00153   HcalZDCMonitor*         zdcMon_;
00154 
00156   bool checkZDC_;
00157 
00158   edm::ESHandle<HcalDbService> conditions_;
00159   const HcalElectronicsMap*    readoutMap_;
00160 
00161   std::ofstream m_logFile;
00162 
00163   // Determine whether the ZDC in the run (using FED info)
00164   int ZDCpresent_;
00165   MonitorElement* meZDC_;
00166 
00167   // myquality_ will store status values for each det ID I find
00168   bool dump2database_;
00169   //std::map<HcalDetId, unsigned int> myquality_;
00170   //HcalChannelQuality* chanquality_;
00171 };
00172 
00173 #endif