CMS 3D CMS Logo

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