Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-30 04:13:31

0001 #ifndef BeamConditionsMonitor_H
0002 #define BeamConditionsMonitor_H
0003 
0004 /** \class BeamConditionsMonitor
0005  * *
0006  *  \author  Geng-yuan Jeng/UC Riverside
0007  *           Francisco Yumiceva/FNAL
0008  *   
0009  */
0010 // C++
0011 #include <string>
0012 // CMS
0013 #include "FWCore/Framework/interface/Frameworkfwd.h"
0014 #include "FWCore/Framework/interface/EDAnalyzer.h"
0015 #include "FWCore/Framework/interface/Event.h"
0016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018 #include "DQMServices/Core/interface/MonitorElement.h"
0019 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0020 #include "CondFormats/BeamSpotObjects/interface/BeamSpotObjects.h"
0021 
0022 //
0023 // class declaration
0024 //
0025 class BeamSpotObjectsRcd;
0026 class BeamConditionsMonitor : public edm::EDAnalyzer {
0027 public:
0028   BeamConditionsMonitor(const edm::ParameterSet&);
0029   ~BeamConditionsMonitor() override;
0030 
0031   typedef dqm::legacy::MonitorElement MonitorElement;
0032   typedef dqm::legacy::DQMStore DQMStore;
0033 
0034 protected:
0035   // BeginJob
0036   void beginJob() override;
0037 
0038   // BeginRun
0039   void beginRun(const edm::Run& r, const edm::EventSetup& c) override;
0040 
0041   // Fake Analyze
0042   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0043 
0044   void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override;
0045 
0046   // DQM Client Diagnostic
0047   void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
0048 
0049   // EndRun
0050   void endRun(const edm::Run& r, const edm::EventSetup& c) override;
0051 
0052   // Endjob
0053   void endJob() override;
0054 
0055 private:
0056   edm::ParameterSet parameters_;
0057   std::string monitorName_;
0058   edm::InputTag bsSrc_;  // beam spot
0059   edm::ESGetToken<BeamSpotObjects, BeamSpotObjectsRcd> beamSpotToken_;
0060   bool debug_;
0061 
0062   DQMStore* dbe_;
0063 
0064   int countEvt_;   //counter
0065   int countLumi_;  //counter
0066 
0067   // ----------member data ---------------------------
0068   BeamSpotObjects condBeamSpot;
0069 
0070   // MonitorElements
0071   MonitorElement* h_x0_lumi;
0072   MonitorElement* h_y0_lumi;
0073 };
0074 
0075 #endif