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