CMS 3D CMS Logo

BeamMonitor.h
Go to the documentation of this file.
1 #ifndef BeamMonitor_H
2 #define BeamMonitor_H
3 
10 // C++
11 #include <string>
12 // CMS
27 #include <fstream>
28 
29 //
30 // class declaration
31 //
32 
33 class BeamMonitor : public edm::EDAnalyzer {
34  public:
35 
37  ~BeamMonitor() override;
38 
39  protected:
40 
41  // BeginJob
42  void beginJob() override;
43 
44  // BeginRun
45  void beginRun(const edm::Run& r, const edm::EventSetup& c) override;
46 
47  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
48 
49  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
50  const edm::EventSetup& context) override;
51 
52  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
53  const edm::EventSetup& c) override;
54  // EndRun
55  void endRun(const edm::Run& r, const edm::EventSetup& c) override;
56  // Endjob
57  void endJob(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);
58 
59  private:
60 
61  void FitAndFill(const edm::LuminosityBlock& lumiSeg,int&,int&,int&);
62  void RestartFitting();
63  void scrollTH1(TH1 *, std::time_t);
64  bool testScroll(std::time_t &, std::time_t &);
65  void formatFitTime(char *, const std::time_t&);
72 
73  int fitNLumi_;
78  bool debug_;
80  std::vector<std::string> jetTrigger_;
81 
84 
85  int countEvt_; //counter
86  int countLumi_; //counter
91  int lastlumi_; // previous LS processed
92  int nextlumi_; // next LS of Fit
93  std::time_t refBStime[2];
94  std::time_t refPVtime[2];
95  unsigned int nthBSTrk_;
97  int nFits_;
98  double deltaSigCut_;
99  unsigned int min_Ntrks_;
100  double maxZ_;
101  unsigned int minNrVertices_;
102  double minVtxNdf_;
103  double minVtxWgt_;
104 
109 
111 
112  // ----------member data ---------------------------
113 
114  // std::vector<BSTrkParameters> fBSvector;
117 
118  // MonitorElements:
144  std::map<TString, MonitorElement*> hs;
145 
146  // The histo of the primary vertex for DQM gui
147  std::map<int, std::vector<float> > mapPVx,mapPVy,mapPVz;
148  std::map<int, std::vector<int> > mapNPV;
149  //keep track of beginLuminosity block and time
150  std::map<int, int> mapBeginBSLS,mapBeginPVLS;
151  std::map<int, std::time_t> mapBeginBSTime, mapBeginPVTime;
152  //these maps are needed to keep track of size of theBSvector and pvStore
153  std::map<int, std::size_t> mapLSBSTrkSize;
154  std::map<int, size_t>mapLSPVStoreSize;
155  //to correct the cutFlot Table
156  std::map<int, TH1F> mapLSCF;
157 
158  // Summary:
159  Float_t reportSummary_;
160  Float_t summarySum_;
161  Float_t summaryContent_[3];
166  // variables for beam fit
167 
168  //
169  std::time_t tmpTime;
170  std::time_t startTime;
171  std::time_t refTime;
173  // Current run
174  int frun;
175  int lastNZbin; // last non zero bin of time histos
176 };
177 
178 #endif
179 
180 
181 // Local Variables:
182 // show-trailing-whitespace: t
183 // truncate-lines: t
184 // End:
void beginJob() override
Definition: BeamMonitor.cc:140
BeamMonitor(const edm::ParameterSet &)
Definition: BeamMonitor.cc:85
edm::EDGetTokenT< edm::TriggerResults > hltSrc_
Definition: BeamMonitor.h:71
unsigned int minNrVertices_
Definition: BeamMonitor.h:101
int nFitElements_
Definition: BeamMonitor.h:96
std::time_t refBStime[2]
Definition: BeamMonitor.h:93
MonitorElement * reportSummary
Definition: BeamMonitor.h:162
int endLumiOfPVFit_
Definition: BeamMonitor.h:90
int resetFitNLumi_
Definition: BeamMonitor.h:75
MonitorElement * h_nVtx
Definition: BeamMonitor.h:136
double minVtxWgt_
Definition: BeamMonitor.h:103
MonitorElement * cutFlowTable
Definition: BeamMonitor.h:165
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:140
bool testScroll(std::time_t &, std::time_t &)
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:147
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: BeamMonitor.cc:569
MonitorElement * h_PVxz
Definition: BeamMonitor.h:141
double minVtxNdf_
Definition: BeamMonitor.h:102
bool processed_
Definition: BeamMonitor.h:110
edm::EDGetTokenT< reco::VertexCollection > pvSrc_
Definition: BeamMonitor.h:70
edm::TimeValue_t ftimestamp
Definition: BeamMonitor.h:172
void endRun(const edm::Run &r, const edm::EventSetup &c) override
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
Definition: BeamMonitor.cc:707
MonitorElement * h_sigmaZ0
Definition: BeamMonitor.h:135
MonitorElement * h_nTrk_lumi
Definition: BeamMonitor.h:119
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:153
MonitorElement * fitResults
Definition: BeamMonitor.h:129
std::vector< std::string > jetTrigger_
Definition: BeamMonitor.h:80
int fitPVNLumi_
Definition: BeamMonitor.h:74
MonitorElement * h_sigmaY0
Definition: BeamMonitor.h:134
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:147
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:151
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:148
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
Definition: BeamMonitor.cc:436
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:151
MonitorElement * h_y0
Definition: BeamMonitor.h:131
int intervalInSec_
Definition: BeamMonitor.h:77
int countGapLumi_
Definition: BeamMonitor.h:108
edm::EDGetTokenT< reco::TrackCollection > tracksLabel_
Definition: BeamMonitor.h:69
MonitorElement * h_vy_dz
Definition: BeamMonitor.h:126
Float_t reportSummary_
Definition: BeamMonitor.h:159
MonitorElement * h_PVyz
Definition: BeamMonitor.h:142
std::time_t refTime
Definition: BeamMonitor.h:171
void formatFitTime(char *, const std::time_t &)
Definition: BeamMonitor.cc:45
MonitorElement * pvResults
Definition: BeamMonitor.h:143
int endLumiOfBSFit_
Definition: BeamMonitor.h:88
virtual void endJob()
Definition: EDAnalyzer.h:78
std::time_t refPVtime[2]
Definition: BeamMonitor.h:94
MonitorElement * h_nVtx_lumi
Definition: BeamMonitor.h:120
void RestartFitting()
reco::BeamSpot refBS
Definition: BeamMonitor.h:115
~BeamMonitor() override
Definition: BeamMonitor.cc:134
unsigned long long TimeValue_t
Definition: Timestamp.h:28
std::map< int, TH1F > mapLSCF
Definition: BeamMonitor.h:156
MonitorElement * h_nVtx_lumi_all
Definition: BeamMonitor.h:121
DQMStore * dbe_
Definition: BeamMonitor.h:82
double maxZ_
Definition: BeamMonitor.h:100
std::time_t startTime
Definition: BeamMonitor.h:170
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Definition: BeamMonitor.cc:719
Float_t summaryContent_[3]
Definition: BeamMonitor.h:161
MonitorElement * h_sigmaX0
Definition: BeamMonitor.h:133
bool StartAverage_
Definition: BeamMonitor.h:106
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
Definition: BeamMonitor.h:68
reco::BeamSpot preBS
Definition: BeamMonitor.h:116
MonitorElement * h_nVtx_st
Definition: BeamMonitor.h:137
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:139
int beginLumiOfPVFit_
Definition: BeamMonitor.h:89
MonitorElement * reportSummaryContents[3]
Definition: BeamMonitor.h:163
MonitorElement * h_x0
Definition: BeamMonitor.h:130
MonitorElement * h_trk_z0
Definition: BeamMonitor.h:123
int resetPVNLumi_
Definition: BeamMonitor.h:76
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:150
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
Definition: BeamMonitor.cc:458
Float_t summarySum_
Definition: BeamMonitor.h:160
edm::ParameterSet parameters_
Definition: BeamMonitor.h:66
MonitorElement * h_trkPt
Definition: BeamMonitor.h:127
MonitorElement * h_vx_dz
Definition: BeamMonitor.h:125
MonitorElement * h_z0
Definition: BeamMonitor.h:132
unsigned int nthBSTrk_
Definition: BeamMonitor.h:95
unsigned int min_Ntrks_
Definition: BeamMonitor.h:99
bool resetHistos_
Definition: BeamMonitor.h:105
double deltaSigCut_
Definition: BeamMonitor.h:98
std::time_t tmpTime
Definition: BeamMonitor.h:169
int firstAverageFit_
Definition: BeamMonitor.h:107
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:83
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:138
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:150
int beginLumiOfBSFit_
Definition: BeamMonitor.h:87
MonitorElement * h_trkVz
Definition: BeamMonitor.h:128
std::string monitorName_
Definition: BeamMonitor.h:67
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:147
MonitorElement * h_d0_phi0
Definition: BeamMonitor.h:122
Definition: Run.h:43
MonitorElement * h_vx_vy
Definition: BeamMonitor.h:124
int countLumi_
Definition: BeamMonitor.h:86
void scrollTH1(TH1 *, std::time_t)
MonitorElement * reportSummaryMap
Definition: BeamMonitor.h:164
bool onlineMode_
Definition: BeamMonitor.h:79
std::map< TString, MonitorElement * > hs
Definition: BeamMonitor.h:144
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:154