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