File indexing completed on 2024-04-06 12:06:50
0001 #ifndef BeamConditionsMonitor_H
0002 #define BeamConditionsMonitor_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <string>
0012
0013 #include "FWCore/Framework/interface/Frameworkfwd.h"
0014 #include "FWCore/Framework/interface/one/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
0024
0025 class BeamSpotObjectsRcd;
0026 class BeamConditionsMonitor
0027 : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
0028 public:
0029 BeamConditionsMonitor(const edm::ParameterSet&);
0030 ~BeamConditionsMonitor() override;
0031
0032 typedef dqm::legacy::MonitorElement MonitorElement;
0033 typedef dqm::legacy::DQMStore DQMStore;
0034
0035 protected:
0036
0037 void beginJob() override;
0038
0039
0040 void beginRun(const edm::Run& r, const edm::EventSetup& c) override;
0041
0042
0043 void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0044
0045 void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override;
0046
0047
0048 void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
0049
0050
0051 void endRun(const edm::Run& r, const edm::EventSetup& c) override;
0052
0053
0054 void endJob() override;
0055
0056 private:
0057 edm::ParameterSet parameters_;
0058 std::string monitorName_;
0059 edm::InputTag bsSrc_;
0060 edm::ESGetToken<BeamSpotObjects, BeamSpotObjectsRcd> beamSpotToken_;
0061 bool debug_;
0062
0063 DQMStore* dbe_;
0064
0065 int countEvt_;
0066 int countLumi_;
0067
0068
0069 BeamSpotObjects condBeamSpot;
0070
0071
0072 MonitorElement* h_x0_lumi;
0073 MonitorElement* h_y0_lumi;
0074 };
0075
0076 #endif