CMS 3D CMS Logo

FakeBeamMonitor.h
Go to the documentation of this file.
1 #ifndef FakeBeamMonitor_H
2 #define FakeBeamMonitor_H
3 
11 // C++
12 #include <string>
13 #include <memory>
14 // CMS
27 #include <fstream>
28 #include "TRandom3.h"
29 
30 //
31 // class declaration
32 //
33 
34 class FakeBeamMonitor : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
35 public:
37  ~FakeBeamMonitor() override;
38 
39 protected:
40  // BeginRun
41  void bookHistograms(DQMStore::IBooker& i, 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, const edm::EventSetup& context) override;
46 
47  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
48  // EndRun
49  void dqmEndRun(const edm::Run& r, const edm::EventSetup& c) override;
50 
51 private:
52  void FitAndFill(const edm::LuminosityBlock& lumiSeg, int&, int&, int&);
53  void RestartFitting();
54  void scrollTH1(TH1*, std::time_t);
55  bool testScroll(std::time_t&, std::time_t&);
56  void formatFitTime(char*, const std::time_t&);
57 
58  const int dxBin_;
59  const double dxMin_;
60  const double dxMax_;
61 
62  const int vxBin_;
63  const double vxMin_;
64  const double vxMax_;
65 
66  const int phiBin_;
67  const double phiMin_;
68  const double phiMax_;
69 
70  const int dzBin_;
71  const double dzMin_;
72  const double dzMax_;
74  std::string recordName_; // output BeamSpotOnline Record name
76  int DBloggerReturn_; // DB logger return value
77 
78  int fitNLumi_;
83  bool debug_;
85 
86  int countEvt_; //counter
87  int countLumi_; //counter
92  int lastlumi_; // previous LS processed
93  int nextlumi_; // next LS of Fit
94  std::time_t refBStime[2];
95  std::time_t refPVtime[2];
96  unsigned int nthBSTrk_;
98  int nFits_;
99  double deltaSigCut_;
100  unsigned int min_Ntrks_;
101  double maxZ_;
102  unsigned int minNrVertices_;
103  double minVtxNdf_;
104  double minVtxWgt_;
105 
110 
112 
113  // ----------member data ---------------------------
114 
115  // std::vector<BSTrkParameters> fBSvector;
118 
119  // MonitorElements:
145  std::vector<MonitorElement*> hs;
146 
147  // The histo of the primary vertex for DQM gui
148  std::map<int, std::vector<float> > mapPVx, mapPVy, mapPVz;
149  std::map<int, std::vector<int> > mapNPV;
150  //keep track of beginLuminosity block and time
151  std::map<int, int> mapBeginBSLS, mapBeginPVLS;
152  std::map<int, std::time_t> mapBeginBSTime, mapBeginPVTime;
153  //these maps are needed to keep track of size of theBSvector and pvStore
154  std::map<int, std::size_t> mapLSBSTrkSize;
155  std::map<int, size_t> mapLSPVStoreSize;
156  //to correct the cutFlot Table
157  std::map<int, TH1F> mapLSCF;
158 
159  // Summary:
160  Float_t reportSummary_;
161  Float_t summarySum_;
162  Float_t summaryContent_[3];
167  // variables for beam fit
168 
169  //
170  std::time_t tmpTime;
171  std::time_t startTime;
172  std::time_t refTime;
174  // Current run
175  int frun;
176  int lastNZbin; // last non zero bin of time histos
177 
178  TRandom3* rndm_;
179 };
180 
181 #endif
182 
183 // Local Variables:
184 // show-trailing-whitespace: t
185 // truncate-lines: t
186 // End:
FakeBeamMonitor::h_z0
MonitorElement * h_z0
Definition: FakeBeamMonitor.h:133
FakeBeamMonitor::rndm_
TRandom3 * rndm_
Definition: FakeBeamMonitor.h:178
FakeBeamMonitor::refTime
std::time_t refTime
Definition: FakeBeamMonitor.h:172
FakeBeamMonitor::phiMax_
const double phiMax_
Definition: FakeBeamMonitor.h:68
FakeBeamMonitor::mapPVz
std::map< int, std::vector< float > > mapPVz
Definition: FakeBeamMonitor.h:148
FakeBeamMonitor::nFitElements_
int nFitElements_
Definition: FakeBeamMonitor.h:97
FakeBeamMonitor::reportSummaryContents
MonitorElement * reportSummaryContents[3]
Definition: FakeBeamMonitor.h:164
FakeBeamMonitor::cutFlowTable
MonitorElement * cutFlowTable
Definition: FakeBeamMonitor.h:166
FakeBeamMonitor::h_vy_dz
MonitorElement * h_vy_dz
Definition: FakeBeamMonitor.h:127
mps_fire.i
i
Definition: mps_fire.py:428
FakeBeamMonitor::mapLSCF
std::map< int, TH1F > mapLSCF
Definition: FakeBeamMonitor.h:157
FakeBeamMonitor::dxMin_
const double dxMin_
Definition: FakeBeamMonitor.h:59
FakeBeamMonitor::pvResults
MonitorElement * pvResults
Definition: FakeBeamMonitor.h:144
FakeBeamMonitor
Definition: FakeBeamMonitor.h:34
FakeBeamMonitor::FakeBeamMonitor
FakeBeamMonitor(const edm::ParameterSet &)
Definition: FakeBeamMonitor.cc:97
FakeBeamMonitor::h_PVy
MonitorElement * h_PVy[2]
Definition: FakeBeamMonitor.h:140
TriggerResults.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
FakeBeamMonitor::onlineMode_
bool onlineMode_
Definition: FakeBeamMonitor.h:84
FakeBeamMonitor::hs
std::vector< MonitorElement * > hs
Definition: FakeBeamMonitor.h:145
FakeBeamMonitor::scrollTH1
void scrollTH1(TH1 *, std::time_t)
Definition: FakeBeamMonitor.cc:1558
FakeBeamMonitor::firstAverageFit_
int firstAverageFit_
Definition: FakeBeamMonitor.h:108
FakeBeamMonitor::h_nVtx_lumi_all
MonitorElement * h_nVtx_lumi_all
Definition: FakeBeamMonitor.h:122
FakeBeamMonitor::mapLSPVStoreSize
std::map< int, size_t > mapLSPVStoreSize
Definition: FakeBeamMonitor.h:155
FakeBeamMonitor::vxMin_
const double vxMin_
Definition: FakeBeamMonitor.h:63
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
FakeBeamMonitor::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
Definition: FakeBeamMonitor.cc:511
DQMStore.h
FakeBeamMonitor::frun
int frun
Definition: FakeBeamMonitor.h:175
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
FakeBeamMonitor::minNrVertices_
unsigned int minNrVertices_
Definition: FakeBeamMonitor.h:102
FakeBeamMonitor::h_vx_vy
MonitorElement * h_vx_vy
Definition: FakeBeamMonitor.h:125
FakeBeamMonitor::h_sigmaY0
MonitorElement * h_sigmaY0
Definition: FakeBeamMonitor.h:135
FakeBeamMonitor::h_vx_dz
MonitorElement * h_vx_dz
Definition: FakeBeamMonitor.h:126
FakeBeamMonitor::h_y0
MonitorElement * h_y0
Definition: FakeBeamMonitor.h:132
FakeBeamMonitor::lastNZbin
int lastNZbin
Definition: FakeBeamMonitor.h:176
FakeBeamMonitor::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
Definition: FakeBeamMonitor.cc:779
DQMOneEDAnalyzer.h
FakeBeamMonitor::h_PVxz
MonitorElement * h_PVxz
Definition: FakeBeamMonitor.h:142
FakeBeamMonitor::dzBin_
const int dzBin_
Definition: FakeBeamMonitor.h:70
FakeBeamMonitor::fitPVNLumi_
int fitPVNLumi_
Definition: FakeBeamMonitor.h:79
FakeBeamMonitor::reportSummary
MonitorElement * reportSummary
Definition: FakeBeamMonitor.h:163
FakeBeamMonitor::nthBSTrk_
unsigned int nthBSTrk_
Definition: FakeBeamMonitor.h:96
FakeBeamMonitor::formatFitTime
void formatFitTime(char *, const std::time_t &)
Definition: FakeBeamMonitor.cc:44
FakeBeamMonitor::dzMin_
const double dzMin_
Definition: FakeBeamMonitor.h:71
FakeBeamMonitor::refBStime
std::time_t refBStime[2]
Definition: FakeBeamMonitor.h:94
FakeBeamMonitor::refPVtime
std::time_t refPVtime[2]
Definition: FakeBeamMonitor.h:95
FakeBeamMonitor::reportSummaryMap
MonitorElement * reportSummaryMap
Definition: FakeBeamMonitor.h:165
Track.h
TrackFwd.h
FakeBeamMonitor::nextlumi_
int nextlumi_
Definition: FakeBeamMonitor.h:93
BeamSpot.h
FakeBeamMonitor::h_trkVz
MonitorElement * h_trkVz
Definition: FakeBeamMonitor.h:129
FakeBeamMonitor::debug_
bool debug_
Definition: FakeBeamMonitor.h:83
FakeBeamMonitor::monitorName_
std::string monitorName_
Definition: FakeBeamMonitor.h:73
FakeBeamMonitor::h_PVx
MonitorElement * h_PVx[2]
Definition: FakeBeamMonitor.h:139
FakeBeamMonitor::DBloggerReturn_
int DBloggerReturn_
Definition: FakeBeamMonitor.h:76
FakeBeamMonitor::bookHistograms
void bookHistograms(DQMStore::IBooker &i, const edm::Run &r, const edm::EventSetup &c) override
Definition: FakeBeamMonitor.cc:199
FakeBeamMonitor::h_nTrk_lumi
MonitorElement * h_nTrk_lumi
Definition: FakeBeamMonitor.h:120
FakeBeamMonitor::h_sigmaZ0
MonitorElement * h_sigmaZ0
Definition: FakeBeamMonitor.h:136
reco::BeamSpot
Definition: BeamSpot.h:21
FakeBeamMonitor::refBS
reco::BeamSpot refBS
Definition: FakeBeamMonitor.h:116
FakeBeamMonitor::h_x0
MonitorElement * h_x0
Definition: FakeBeamMonitor.h:131
FakeBeamMonitor::fitResults
MonitorElement * fitResults
Definition: FakeBeamMonitor.h:130
FakeBeamMonitor::deltaSigCut_
double deltaSigCut_
Definition: FakeBeamMonitor.h:99
FakeBeamMonitor::resetHistos_
bool resetHistos_
Definition: FakeBeamMonitor.h:106
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
FakeBeamMonitor::countGapLumi_
int countGapLumi_
Definition: FakeBeamMonitor.h:109
FakeBeamMonitor::mapBeginPVTime
std::map< int, std::time_t > mapBeginPVTime
Definition: FakeBeamMonitor.h:152
FakeBeamMonitor::h_nVtx
MonitorElement * h_nVtx
Definition: FakeBeamMonitor.h:137
FakeBeamMonitor::testScroll
bool testScroll(std::time_t &, std::time_t &)
Definition: FakeBeamMonitor.cc:1578
FakeBeamMonitor::mapBeginBSTime
std::map< int, std::time_t > mapBeginBSTime
Definition: FakeBeamMonitor.h:152
edm::ParameterSet
Definition: ParameterSet.h:47
FakeBeamMonitor::mapBeginBSLS
std::map< int, int > mapBeginBSLS
Definition: FakeBeamMonitor.h:151
FakeBeamMonitor::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: FakeBeamMonitor.cc:640
Event.h
FakeBeamMonitor::resetFitNLumi_
int resetFitNLumi_
Definition: FakeBeamMonitor.h:80
FakeBeamMonitor::summarySum_
Float_t summarySum_
Definition: FakeBeamMonitor.h:161
FakeBeamMonitor::summaryContent_
Float_t summaryContent_[3]
Definition: FakeBeamMonitor.h:162
FakeBeamMonitor::phiBin_
const int phiBin_
Definition: FakeBeamMonitor.h:66
FakeBeamMonitor::beginLumiOfBSFit_
int beginLumiOfBSFit_
Definition: FakeBeamMonitor.h:88
FakeBeamMonitor::countEvt_
int countEvt_
Definition: FakeBeamMonitor.h:86
FakeBeamMonitor::reportSummary_
Float_t reportSummary_
Definition: FakeBeamMonitor.h:160
FakeBeamMonitor::h_d0_phi0
MonitorElement * h_d0_phi0
Definition: FakeBeamMonitor.h:123
edm::Service< cond::service::OnlineDBOutputService >
FakeBeamMonitor::min_Ntrks_
unsigned int min_Ntrks_
Definition: FakeBeamMonitor.h:100
FakeBeamMonitor::processed_
bool processed_
Definition: FakeBeamMonitor.h:111
FakeBeamMonitor::h_trk_z0
MonitorElement * h_trk_z0
Definition: FakeBeamMonitor.h:124
FakeBeamMonitor::vxMax_
const double vxMax_
Definition: FakeBeamMonitor.h:64
FakeBeamMonitor::dzMax_
const double dzMax_
Definition: FakeBeamMonitor.h:72
FakeBeamMonitor::h_PVz
MonitorElement * h_PVz[2]
Definition: FakeBeamMonitor.h:141
FakeBeamMonitor::FitAndFill
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Definition: FakeBeamMonitor.cc:798
FakeBeamMonitor::vxBin_
const int vxBin_
Definition: FakeBeamMonitor.h:62
FakeBeamMonitor::dxMax_
const double dxMax_
Definition: FakeBeamMonitor.h:60
FakeBeamMonitor::mapPVx
std::map< int, std::vector< float > > mapPVx
Definition: FakeBeamMonitor.h:148
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
FakeBeamMonitor::phiMin_
const double phiMin_
Definition: FakeBeamMonitor.h:67
FakeBeamMonitor::dqmEndRun
void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override
Definition: FakeBeamMonitor.cc:1540
FakeBeamMonitor::countLumi_
int countLumi_
Definition: FakeBeamMonitor.h:87
FakeBeamMonitor::h_sigmaX0
MonitorElement * h_sigmaX0
Definition: FakeBeamMonitor.h:134
FakeBeamMonitor::StartAverage_
bool StartAverage_
Definition: FakeBeamMonitor.h:107
FakeBeamMonitor::ftimestamp
edm::TimeValue_t ftimestamp
Definition: FakeBeamMonitor.h:173
alignCSCRings.r
r
Definition: alignCSCRings.py:93
FakeBeamMonitor::recordName_
std::string recordName_
Definition: FakeBeamMonitor.h:74
FakeBeamMonitor::dxBin_
const int dxBin_
Definition: FakeBeamMonitor.h:58
VertexFwd.h
FakeBeamMonitor::minVtxNdf_
double minVtxNdf_
Definition: FakeBeamMonitor.h:103
FakeBeamMonitor::mapLSBSTrkSize
std::map< int, std::size_t > mapLSBSTrkSize
Definition: FakeBeamMonitor.h:154
FakeBeamMonitor::preBS
reco::BeamSpot preBS
Definition: FakeBeamMonitor.h:117
FakeBeamMonitor::h_nVtx_st
MonitorElement * h_nVtx_st
Definition: FakeBeamMonitor.h:138
FakeBeamMonitor::h_PVyz
MonitorElement * h_PVyz
Definition: FakeBeamMonitor.h:143
OnlineDBOutputService.h
FakeBeamMonitor::mapBeginPVLS
std::map< int, int > mapBeginPVLS
Definition: FakeBeamMonitor.h:151
Frameworkfwd.h
FakeBeamMonitor::~FakeBeamMonitor
~FakeBeamMonitor() override
Definition: FakeBeamMonitor.cc:95
FakeBeamMonitor::h_nVtx_lumi
MonitorElement * h_nVtx_lumi
Definition: FakeBeamMonitor.h:121
FakeBeamMonitor::mapNPV
std::map< int, std::vector< int > > mapNPV
Definition: FakeBeamMonitor.h:149
FakeBeamMonitor::minVtxWgt_
double minVtxWgt_
Definition: FakeBeamMonitor.h:104
FakeBeamMonitor::nFits_
int nFits_
Definition: FakeBeamMonitor.h:98
FakeBeamMonitor::mapPVy
std::map< int, std::vector< float > > mapPVy
Definition: FakeBeamMonitor.h:148
FakeBeamMonitor::maxZ_
double maxZ_
Definition: FakeBeamMonitor.h:101
FakeBeamMonitor::lastlumi_
int lastlumi_
Definition: FakeBeamMonitor.h:92
dqm::implementation::IBooker
Definition: DQMStore.h:43
FakeBeamMonitor::h_trkPt
MonitorElement * h_trkPt
Definition: FakeBeamMonitor.h:128
FakeBeamMonitor::endLumiOfBSFit_
int endLumiOfBSFit_
Definition: FakeBeamMonitor.h:89
FakeBeamMonitor::onlineDbService_
edm::Service< cond::service::OnlineDBOutputService > onlineDbService_
Definition: FakeBeamMonitor.h:75
ParameterSet.h
FakeBeamMonitor::tmpTime
std::time_t tmpTime
Definition: FakeBeamMonitor.h:170
edm::Event
Definition: Event.h:73
FakeBeamMonitor::intervalInSec_
int intervalInSec_
Definition: FakeBeamMonitor.h:82
FakeBeamMonitor::resetPVNLumi_
int resetPVNLumi_
Definition: FakeBeamMonitor.h:81
FakeBeamMonitor::endLumiOfPVFit_
int endLumiOfPVFit_
Definition: FakeBeamMonitor.h:91
FakeBeamMonitor::RestartFitting
void RestartFitting()
Definition: FakeBeamMonitor.cc:1502
FakeBeamMonitor::beginLumiOfPVFit_
int beginLumiOfPVFit_
Definition: FakeBeamMonitor.h:90
edm::TimeValue_t
unsigned long long TimeValue_t
Definition: Timestamp.h:28
FakeBeamMonitor::startTime
std::time_t startTime
Definition: FakeBeamMonitor.h:171
FakeBeamMonitor::fitNLumi_
int fitNLumi_
Definition: FakeBeamMonitor.h:78
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37