CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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();
38 
39  protected:
40 
41  // BeginJob
42  void beginJob();
43 
44  // BeginRun
45  void beginRun(const edm::Run& r, const edm::EventSetup& c);
46 
47  void analyze(const edm::Event& e, const edm::EventSetup& c) ;
48 
49  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
50  const edm::EventSetup& context) ;
51 
52  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
53  const edm::EventSetup& c);
54  // EndRun
55  void endRun(const edm::Run& r, const edm::EventSetup& c);
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  const char * formatFitTime( 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:
142  std::map<TString, MonitorElement*> hs;
143 
144  // The histo of the primary vertex for DQM gui
145  std::map<int, std::vector<float> > mapPVx,mapPVy,mapPVz;
146  std::map<int, std::vector<int> > mapNPV;
147  //keep track of beginLuminosity block and time
148  std::map<int, int> mapBeginBSLS,mapBeginPVLS;
149  std::map<int, std::time_t> mapBeginBSTime, mapBeginPVTime;
150  //these maps are needed to keep track of size of theBSvector and pvStore
151  std::map<int, std::size_t> mapLSBSTrkSize;
152  std::map<int, size_t>mapLSPVStoreSize;
153  //to correct the cutFlot Table
154  std::map<int, TH1F> mapLSCF;
155 
156  // Summary:
157  Float_t reportSummary_;
158  Float_t summarySum_;
159  Float_t summaryContent_[3];
164  // variables for beam fit
165 
166  //
167  std::time_t tmpTime;
168  std::time_t startTime;
169  std::time_t refTime;
171  // Current run
172  int frun;
173  int lastNZbin; // last non zero bin of time histos
174 };
175 
176 #endif
177 
178 
179 // Local Variables:
180 // show-trailing-whitespace: t
181 // truncate-lines: t
182 // End:
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
Definition: BeamMonitor.cc:433
const char * formatFitTime(const std::time_t &)
Definition: BeamMonitor.cc:44
BeamMonitor(const edm::ParameterSet &)
Definition: BeamMonitor.cc:71
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:160
void analyze(const edm::Event &e, const edm::EventSetup &c)
Definition: BeamMonitor.cc:543
int endLumiOfPVFit_
Definition: BeamMonitor.h:90
int resetFitNLumi_
Definition: BeamMonitor.h:75
MonitorElement * h_nVtx
Definition: BeamMonitor.h:134
double minVtxWgt_
Definition: BeamMonitor.h:103
MonitorElement * cutFlowTable
Definition: BeamMonitor.h:163
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:138
bool testScroll(std::time_t &, std::time_t &)
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:145
MonitorElement * h_PVxz
Definition: BeamMonitor.h:139
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:170
MonitorElement * h_sigmaZ0
Definition: BeamMonitor.h:133
MonitorElement * h_nTrk_lumi
Definition: BeamMonitor.h:119
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:151
MonitorElement * fitResults
Definition: BeamMonitor.h:127
std::vector< std::string > jetTrigger_
Definition: BeamMonitor.h:80
int fitPVNLumi_
Definition: BeamMonitor.h:74
MonitorElement * h_sigmaY0
Definition: BeamMonitor.h:132
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:145
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:149
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:146
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:149
MonitorElement * h_y0
Definition: BeamMonitor.h:129
int intervalInSec_
Definition: BeamMonitor.h:77
void beginJob()
Definition: BeamMonitor.cc:126
int countGapLumi_
Definition: BeamMonitor.h:108
edm::EDGetTokenT< reco::TrackCollection > tracksLabel_
Definition: BeamMonitor.h:69
MonitorElement * h_vy_dz
Definition: BeamMonitor.h:124
Float_t reportSummary_
Definition: BeamMonitor.h:157
MonitorElement * h_PVyz
Definition: BeamMonitor.h:140
void beginRun(const edm::Run &r, const edm::EventSetup &c)
Definition: BeamMonitor.cc:412
std::time_t refTime
Definition: BeamMonitor.h:169
MonitorElement * pvResults
Definition: BeamMonitor.h:141
int endLumiOfBSFit_
Definition: BeamMonitor.h:88
virtual void endJob()
Definition: EDAnalyzer.h:73
std::time_t refPVtime[2]
Definition: BeamMonitor.h:94
void RestartFitting()
reco::BeamSpot refBS
Definition: BeamMonitor.h:115
unsigned long long TimeValue_t
Definition: Timestamp.h:28
std::map< int, TH1F > mapLSCF
Definition: BeamMonitor.h:154
DQMStore * dbe_
Definition: BeamMonitor.h:82
double maxZ_
Definition: BeamMonitor.h:100
std::time_t startTime
Definition: BeamMonitor.h:168
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Definition: BeamMonitor.cc:693
Float_t summaryContent_[3]
Definition: BeamMonitor.h:159
MonitorElement * h_sigmaX0
Definition: BeamMonitor.h:131
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:135
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:137
int beginLumiOfPVFit_
Definition: BeamMonitor.h:89
MonitorElement * reportSummaryContents[3]
Definition: BeamMonitor.h:161
MonitorElement * h_x0
Definition: BeamMonitor.h:128
MonitorElement * h_trk_z0
Definition: BeamMonitor.h:121
int resetPVNLumi_
Definition: BeamMonitor.h:76
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:148
Float_t summarySum_
Definition: BeamMonitor.h:158
edm::ParameterSet parameters_
Definition: BeamMonitor.h:66
MonitorElement * h_trkPt
Definition: BeamMonitor.h:125
MonitorElement * h_vx_dz
Definition: BeamMonitor.h:123
MonitorElement * h_z0
Definition: BeamMonitor.h:130
unsigned int nthBSTrk_
Definition: BeamMonitor.h:95
unsigned int min_Ntrks_
Definition: BeamMonitor.h:99
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
Definition: BeamMonitor.cc:681
bool resetHistos_
Definition: BeamMonitor.h:105
double deltaSigCut_
Definition: BeamMonitor.h:98
std::time_t tmpTime
Definition: BeamMonitor.h:167
int firstAverageFit_
Definition: BeamMonitor.h:107
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:83
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:136
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:148
int beginLumiOfBSFit_
Definition: BeamMonitor.h:87
MonitorElement * h_trkVz
Definition: BeamMonitor.h:126
void endRun(const edm::Run &r, const edm::EventSetup &c)
std::string monitorName_
Definition: BeamMonitor.h:67
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:145
MonitorElement * h_d0_phi0
Definition: BeamMonitor.h:120
Definition: Run.h:41
MonitorElement * h_vx_vy
Definition: BeamMonitor.h:122
int countLumi_
Definition: BeamMonitor.h:86
void scrollTH1(TH1 *, std::time_t)
MonitorElement * reportSummaryMap
Definition: BeamMonitor.h:162
bool onlineMode_
Definition: BeamMonitor.h:79
std::map< TString, MonitorElement * > hs
Definition: BeamMonitor.h:142
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:152