CMS 3D CMS Logo

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
20 #include <fstream>
21 
22 
23 //
24 // class declaration
25 //
26 
28  public:
30  ~BeamMonitorBx() override;
31 
32  typedef int BxNum;
33  typedef std::map<BxNum,reco::BeamSpot> BeamSpotMapBx;
34 
35  protected:
36 
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,
46  const edm::EventSetup& context) override;
47 
48  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
49  const edm::EventSetup& c) override;
50  // EndRun
51  void endRun(const edm::Run& r, const edm::EventSetup& c) override;
52 
53  private:
54 
55  void FitAndFill(const edm::LuminosityBlock& lumiSeg, int&, int&, int&);
56  void BookTables(int, std::map<std::string,std::string>&,std::string);
57  void BookTrendHistos(bool, int, std::map<std::string,std::string>&,
58  std::string, const TString&, const TString&);
59  void FillTables(int, int, std::map<std::string,std::string>&,
61  void FillTrendHistos(int, int, std::map<std::string,std::string>&,
62  reco::BeamSpot&, const TString&);
63  void weight(BeamSpotMapBx&, const BeamSpotMapBx&);
64  void weight(double& mean,double& meanError,const double& val,const double& valError);
65  void formatFitTime(char *, const std::time_t&);
66 
69  edm::InputTag bsSrc_; // beam spot
70 
71  int fitNLumi_;
73  bool debug_;
74 
77 
78  unsigned int countBx_;
79  int countEvt_; //counter
80  int countLumi_; //counter
83  int lastlumi_; // previous LS processed
84  int nextlumi_; // next LS of Fit
85  int firstlumi_; // first LS with good fit
87  std::time_t refBStime[2];
88 
90  bool processed_;
91  // ----------member data ---------------------------
92  BeamSpotMapBx fbspotMap;//for weighted beam spots of each bunch
93  std::map<std::string, std::string> varMap;
94  std::map<std::string, std::string> varMap1;
95  // MonitorElements:
96  std::map<TString, MonitorElement*> hs; // Tables
97  std::map<TString, MonitorElement*> hst; // Trending Histos
98 
99  //Test
100  // MonitorElement * h_x0;
101 
102  //
103  std::time_t tmpTime;
104  std::time_t refTime;
105  std::time_t startTime;
107 
108 };
109 
110 #endif
111 
edm::ParameterSet parameters_
Definition: BeamMonitorBx.h:67
void beginJob() override
void FillTrendHistos(int, int, std::map< std::string, std::string > &, reco::BeamSpot &, const TString &)
void FillTables(int, int, std::map< std::string, std::string > &, reco::BeamSpot &, std::string)
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::time_t startTime
std::map< TString, MonitorElement * > hs
Definition: BeamMonitorBx.h:96
BeamSpotMapBx fbspotMap
Definition: BeamMonitorBx.h:92
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:78
edm::TimeValue_t ftimestamp
std::string monitorName_
Definition: BeamMonitorBx.h:68
BeamFitter * theBeamFitter
Definition: BeamMonitorBx.h:76
unsigned long long TimeValue_t
Definition: Timestamp.h:28
std::time_t refBStime[2]
Definition: BeamMonitorBx.h:87
edm::InputTag bsSrc_
Definition: BeamMonitorBx.h:69
void analyze(const edm::Event &e, const edm::EventSetup &c) override
std::time_t tmpTime
void weight(BeamSpotMapBx &, const BeamSpotMapBx &)
std::time_t refTime
void BookTables(int, std::map< std::string, std::string > &, std::string)
DQMStore * dbe_
Definition: BeamMonitorBx.h:75
std::map< std::string, std::string > varMap
Definition: BeamMonitorBx.h:93
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:94
std::map< TString, MonitorElement * > hst
Definition: BeamMonitorBx.h:97
void formatFitTime(char *, const std::time_t &)
~BeamMonitorBx() override
Definition: Run.h:45
std::map< BxNum, reco::BeamSpot > BeamSpotMapBx
Definition: BeamMonitorBx.h:33