CMS 3D CMS Logo

HcalMonitorClient.h

Go to the documentation of this file.
00001 #ifndef HcalMonitorClient_H
00002 #define HcalMonitorClient_H
00003 
00004 
00005 #include "FWCore/Framework/interface/EDAnalyzer.h"
00006 #include "FWCore/Framework/interface/Event.h"
00007 #include "FWCore/Framework/interface/Run.h"
00008 #include "FWCore/Framework/interface/LuminosityBlock.h"
00009 #include "FWCore/Framework/interface/MakerMacros.h"
00010 #include "FWCore/Utilities/interface/CPUTimer.h" 
00011 
00012 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00014 
00015 #include "DQMServices/Core/interface/DQMStore.h"
00016 #include "DQMServices/Core/interface/MonitorElement.h"
00017 #include "DQMServices/Core/interface/DQMOldReceiver.h"
00018 
00019 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
00020 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
00021           
00022 #include <DQM/HcalMonitorClient/interface/HcalClientUtils.h>
00023 #include <DQM/HcalMonitorClient/interface/HcalSummaryClient.h>
00024 #include <DQM/HcalMonitorClient/interface/HcalDataFormatClient.h>
00025 #include <DQM/HcalMonitorClient/interface/HcalDigiClient.h>
00026 #include <DQM/HcalMonitorClient/interface/HcalRecHitClient.h>
00027 #include <DQM/HcalMonitorClient/interface/HcalPedestalClient.h>
00028 #include <DQM/HcalMonitorClient/interface/HcalLEDClient.h>
00029 #include <DQM/HcalMonitorClient/interface/HcalLaserClient.h>
00030 #include <DQM/HcalMonitorClient/interface/HcalHotCellClient.h>
00031 #include <DQM/HcalMonitorClient/interface/HcalDeadCellClient.h>
00032 #include <DQM/HcalMonitorClient/interface/HcalTrigPrimClient.h>
00033 #include <DQM/HcalMonitorClient/interface/HcalCaloTowerClient.h>
00034 #include <DQM/HcalMonitorClient/interface/HcalBeamClient.h>
00035 
00036 //#include <DQM/HcalMonitorModule/interface/HcalMonitorSelector.h>
00037 
00038 #include <DQM/HcalMonitorClient/interface/HcalDQMDbInterface.h>
00039 
00040 #include "TROOT.h"
00041 #include "TTree.h"
00042 #include "TGaxis.h"
00043 
00044 #include <memory>
00045 #include <iostream>
00046 #include <fstream>
00047 #include <vector>
00048 #include <string>
00049 #include <sys/time.h>
00050 
00051 using namespace std;
00052 
00053 class HcalMonitorClient : public EDAnalyzer{
00054   
00055 public:
00056   
00058   HcalMonitorClient();
00059   HcalMonitorClient(const ParameterSet& ps);
00060   
00062   ~HcalMonitorClient();
00063   
00064   // Initialize
00065   void initialize(const ParameterSet& ps);
00066   void offlineSetup();
00067 
00069   void analyze(void);
00070   void analyze(const Event& evt, const EventSetup& es);
00071   
00073   void beginJob(const EventSetup& c);
00075   void beginRun(const Run& r, const edm::EventSetup & c);
00077   void beginLuminosityBlock(const edm::LuminosityBlock & l, const edm::EventSetup & c);
00078 
00080   void endJob(void);
00082   void endRun(const edm::Run & r, const edm::EventSetup & c);
00084   void endLuminosityBlock(const edm::LuminosityBlock & l, const edm::EventSetup & c);
00085   
00087   void htmlOutput(void);
00088 
00090   void report(bool update);
00091 
00093   void errorSummary();
00094 
00096   void createTests(void);
00097 
00099   void resetAllME(void);
00100 
00101   //Offline output functions
00102   void loadHistograms(TFile* infile, const char* fname);
00103   void dumpHistograms(int& runNum, vector<TH1F*> &hist1d, vector<TH2F*> &hist2d);
00104 
00106   bool prescale();
00107   
00108  private:
00109   void removeAllME(void);
00110   /********************************************************/
00111   //  The following member variables can be specified in  //
00112   //  the configuration input file for the process.       //
00113   /********************************************************/
00114 
00118   int prescaleEvt_;    
00119   int prescaleLS_;     
00120   int prescaleTime_;   
00121   int prescaleUpdate_; 
00122 
00125   std::string monitorName_;
00126 
00128   int debug_ ;
00129   
00130   // Timing diagnostic switch
00131   bool showTiming_; // controls whether to show timing diagnostic info 
00132   edm::CPUTimer cpu_timer; //  
00133 
00135     //int nevt_; // counts number of events actually analyzed by HcalMonitorClient
00136   int nlumisecs_;
00137   bool saved_;
00138 
00139   struct{
00140     timeval startTV,updateTV;
00141     double startTime;
00142     double elapsedTime; 
00143     double updateTime;
00144   } psTime_;    
00145   
00147   DQMStore* dbe_;  
00148   DQMOldReceiver* mui_;
00149   
00150   // environment variables
00151   int irun_,ilumisec_,ievent_,itime_;
00152   int maxlumisec_, minlumisec_;
00153 
00154   time_t mytime_;
00155 
00156   bool actonLS_ ;
00157   std::string rootFolder_;
00158 
00159   int ievt_; // counts number of events read by client (and analyzed by tasks)
00160   int resetUpdate_;
00161   int resetEvents_;
00162   int resetTime_;
00163   int lastResetTime_;
00164   int resetLS_;
00165   
00166   bool runningStandalone_;
00167   bool enableExit_;
00168   bool enableMonitorDaemon_;
00169 
00170   string inputFile_;
00171   string baseHtmlDir_;
00172 
00173   HcalSummaryClient*         summary_client_;
00174   HcalDataFormatClient*      dataformat_client_;
00175   HcalDigiClient*            digi_client_;
00176   HcalRecHitClient*          rechit_client_;
00177   HcalPedestalClient*        pedestal_client_;
00178   HcalLEDClient*             led_client_;
00179   HcalLaserClient*           laser_client_;
00180   HcalHotCellClient*         hot_client_;
00181   HcalDeadCellClient*        dead_client_;
00182   HcalTrigPrimClient*        tp_client_;
00183   HcalCaloTowerClient*       ct_client_;
00184   HcalBeamClient*            beam_client_;
00185   HcalHotCellDbInterface*    dqm_db_;
00186 
00187 
00188 };
00189 
00190 #endif

Generated on Tue Jun 9 17:32:54 2009 for CMSSW by  doxygen 1.5.4