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