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