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