CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BeamMonitorBx.h
Go to the documentation of this file.
1 #ifndef BeamMonitorBx_H
2 #define BeamMonitorBx_H
3 
10 // C++
11 #include <string>
12 // CMS
19 #include <fstream>
20 
21 //
22 // class declaration
23 //
24 
26 public:
29 
31  ~BeamMonitorBx() override;
32 
33  typedef int BxNum;
34  typedef std::map<BxNum, reco::BeamSpot> BeamSpotMapBx;
35 
36 protected:
37  // BeginJob
38  void beginJob() override;
39 
40  // BeginRun
41  void beginRun(const edm::Run& r, const edm::EventSetup& c) override;
42 
43  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
44 
45  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override;
46 
47  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
48  // EndRun
49  void endRun(const edm::Run& r, const edm::EventSetup& c) override;
50 
51 private:
52  void FitAndFill(const edm::LuminosityBlock& lumiSeg, int&, int&, int&);
53  void BookTables(int, std::map<std::string, std::string>&, std::string);
54  void BookTrendHistos(bool, int, std::map<std::string, std::string>&, std::string, const TString&, const TString&);
55  void FillTables(int, int, std::map<std::string, std::string>&, reco::BeamSpot&, std::string);
56  void FillTrendHistos(int, int, std::map<std::string, std::string>&, reco::BeamSpot&, const TString&);
57  void weight(BeamSpotMapBx&, const BeamSpotMapBx&);
58  void weight(double& mean, double& meanError, const double& val, const double& valError);
59  void formatFitTime(char*, const std::time_t&);
60 
63  edm::InputTag bsSrc_; // beam spot
64 
65  int fitNLumi_;
67  bool debug_;
68 
71 
72  unsigned int countBx_;
73  int countEvt_; //counter
74  int countLumi_; //counter
77  int lastlumi_; // previous LS processed
78  int nextlumi_; // next LS of Fit
79  int firstlumi_; // first LS with good fit
81  std::time_t refBStime[2];
82 
84  bool processed_;
85  // ----------member data ---------------------------
86  BeamSpotMapBx fbspotMap; //for weighted beam spots of each bunch
87  std::map<std::string, std::string> varMap;
88  std::map<std::string, std::string> varMap1;
89  // MonitorElements:
90  std::map<TString, MonitorElement*> hs; // Tables
91  std::map<TString, MonitorElement*> hst; // Trending Histos
92 
93  //Test
94  // MonitorElement * h_x0;
95 
96  //
97  std::time_t tmpTime;
98  std::time_t refTime;
99  std::time_t startTime;
101 };
102 
103 #endif
edm::ParameterSet parameters_
Definition: BeamMonitorBx.h:61
void beginJob() override
void FillTrendHistos(int, int, std::map< std::string, std::string > &, reco::BeamSpot &, const TString &)
dqm::legacy::DQMStore DQMStore
Definition: BeamMonitorBx.h:28
void FillTables(int, int, std::map< std::string, std::string > &, reco::BeamSpot &, std::string)
const edm::EventSetup & c
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
BeamMonitorBx(const edm::ParameterSet &)
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
std::map< BxNum, reco::BeamSpot > BeamSpotMapBx
Definition: BeamMonitorBx.h:34
dqm::legacy::MonitorElement MonitorElement
Definition: BeamMonitorBx.h:27
std::time_t startTime
Definition: BeamMonitorBx.h:99
std::map< TString, MonitorElement * > hs
Definition: BeamMonitorBx.h:90
BeamSpotMapBx fbspotMap
Definition: BeamMonitorBx.h:86
void endRun(const edm::Run &r, const edm::EventSetup &c) override
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
unsigned int countBx_
Definition: BeamMonitorBx.h:72
edm::TimeValue_t ftimestamp
std::string monitorName_
Definition: BeamMonitorBx.h:62
BeamFitter * theBeamFitter
Definition: BeamMonitorBx.h:70
unsigned long long TimeValue_t
Definition: Timestamp.h:28
std::time_t refBStime[2]
Definition: BeamMonitorBx.h:81
edm::InputTag bsSrc_
Definition: BeamMonitorBx.h:63
void analyze(const edm::Event &e, const edm::EventSetup &c) override
std::time_t tmpTime
Definition: BeamMonitorBx.h:97
void weight(BeamSpotMapBx &, const BeamSpotMapBx &)
std::time_t refTime
Definition: BeamMonitorBx.h:98
void BookTables(int, std::map< std::string, std::string > &, std::string)
DQMStore * dbe_
Definition: BeamMonitorBx.h:69
std::map< std::string, std::string > varMap
Definition: BeamMonitorBx.h:87
void BookTrendHistos(bool, int, std::map< std::string, std::string > &, std::string, const TString &, const TString &)
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
std::map< std::string, std::string > varMap1
Definition: BeamMonitorBx.h:88
std::map< TString, MonitorElement * > hst
Definition: BeamMonitorBx.h:91
void formatFitTime(char *, const std::time_t &)
~BeamMonitorBx() override
Definition: Run.h:45