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