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
27 #include <fstream>
28 
29 //
30 // class declaration
31 //
32 
33 class BeamMonitor : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
34 public:
36 
37 protected:
38  // BeginRun
39  void bookHistograms(DQMStore::IBooker& i, const edm::Run& r, const edm::EventSetup& c) override;
40 
41  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
42 
43  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override;
44 
45  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
46  // EndRun
47  void dqmEndRun(const edm::Run& r, const edm::EventSetup& c) override;
48 
49 private:
50  void FitAndFill(const edm::LuminosityBlock& lumiSeg, int&, int&, int&);
51  void RestartFitting();
52  void scrollTH1(TH1*, std::time_t);
53  bool testScroll(std::time_t&, std::time_t&);
54  void formatFitTime(char*, const std::time_t&);
55  const int dxBin_;
56  const double dxMin_;
57  const double dxMax_;
58 
59  const int vxBin_;
60  const double vxMin_;
61  const double vxMax_;
62 
63  const int phiBin_;
64  const double phiMin_;
65  const double phiMax_;
66 
67  const int dzBin_;
68  const double dzMin_;
69  const double dzMax_;
76 
77  int fitNLumi_;
82  bool debug_;
84  std::vector<std::string> jetTrigger_;
85 
86  std::unique_ptr<BeamFitter> theBeamFitter;
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 
114 
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 
181 #endif
182 
183 // Local Variables:
184 // show-trailing-whitespace: t
185 // truncate-lines: t
186 // End:
BeamMonitor::recordName_
std::string recordName_
Definition: BeamMonitor.h:71
BeamMonitor::h_vx_vy
MonitorElement * h_vx_vy
Definition: BeamMonitor.h:127
BeamMonitor::refBStime
std::time_t refBStime[2]
Definition: BeamMonitor.h:96
BeamMonitor::lastNZbin
int lastNZbin
Definition: BeamMonitor.h:178
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
BeamMonitor::phiMin_
const double phiMin_
Definition: BeamMonitor.h:64
BeamMonitor::tmpTime
std::time_t tmpTime
Definition: BeamMonitor.h:172
mps_fire.i
i
Definition: mps_fire.py:355
BeamMonitor::ftimestamp
edm::TimeValue_t ftimestamp
Definition: BeamMonitor.h:175
BeamMonitor::firstAverageFit_
int firstAverageFit_
Definition: BeamMonitor.h:110
BeamMonitor::dzMin_
const double dzMin_
Definition: BeamMonitor.h:68
BeamMonitor::monitorName_
std::string monitorName_
Definition: BeamMonitor.h:70
BeamMonitor::hs
std::vector< MonitorElement * > hs
Definition: BeamMonitor.h:147
BeamMonitor::beginLumiOfBSFit_
int beginLumiOfBSFit_
Definition: BeamMonitor.h:90
BeamMonitor::minNrVertices_
unsigned int minNrVertices_
Definition: BeamMonitor.h:104
TriggerResults.h
BeamMonitor::cutFlowTable
MonitorElement * cutFlowTable
Definition: BeamMonitor.h:168
BeamMonitor
Definition: BeamMonitor.h:33
BeamMonitor::bookHistograms
void bookHistograms(DQMStore::IBooker &i, const edm::Run &r, const edm::EventSetup &c) override
Definition: BeamMonitor.cc:207
BeamMonitor::mapPVx
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:150
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
BeamMonitor::h_PVxz
MonitorElement * h_PVxz
Definition: BeamMonitor.h:144
BeamMonitor::frun
int frun
Definition: BeamMonitor.h:177
edm::Run
Definition: Run.h:45
BeamMonitor::pvSrc_
edm::EDGetTokenT< reco::VertexCollection > pvSrc_
Definition: BeamMonitor.h:74
edm::EDGetTokenT< reco::BeamSpot >
BeamMonitor::endLumiOfPVFit_
int endLumiOfPVFit_
Definition: BeamMonitor.h:93
BeamMonitor::onlineMode_
bool onlineMode_
Definition: BeamMonitor.h:83
BeamMonitor::jetTrigger_
std::vector< std::string > jetTrigger_
Definition: BeamMonitor.h:84
BeamMonitor::dxBin_
const int dxBin_
Definition: BeamMonitor.h:55
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
DQMStore.h
BeamMonitor::nFits_
int nFits_
Definition: BeamMonitor.h:100
BeamMonitor::mapNPV
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:151
BSTrkParameters.h
BeamMonitor::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: BeamMonitor.cc:640
BeamMonitor::mapLSBSTrkSize
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:156
BeamMonitor::reportSummary
MonitorElement * reportSummary
Definition: BeamMonitor.h:165
BeamMonitor::vxBin_
const int vxBin_
Definition: BeamMonitor.h:59
BeamMonitor::fitResults
MonitorElement * fitResults
Definition: BeamMonitor.h:132
BeamMonitor::h_sigmaY0
MonitorElement * h_sigmaY0
Definition: BeamMonitor.h:137
BeamMonitor::h_nVtx
MonitorElement * h_nVtx
Definition: BeamMonitor.h:139
BeamMonitor::countEvt_
int countEvt_
Definition: BeamMonitor.h:88
BeamMonitor::minVtxWgt_
double minVtxWgt_
Definition: BeamMonitor.h:106
DQMOneEDAnalyzer.h
BeamMonitor::h_PVz
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:143
BeamMonitor::h_nTrk_lumi
MonitorElement * h_nTrk_lumi
Definition: BeamMonitor.h:122
BeamMonitor::testScroll
bool testScroll(std::time_t &, std::time_t &)
Definition: BeamMonitor.cc:1513
BeamMonitor::nextlumi_
int nextlumi_
Definition: BeamMonitor.h:95
BeamMonitor::h_y0
MonitorElement * h_y0
Definition: BeamMonitor.h:134
BeamMonitor::minVtxNdf_
double minVtxNdf_
Definition: BeamMonitor.h:105
BeamMonitor::processed_
bool processed_
Definition: BeamMonitor.h:113
BeamMonitor::h_PVyz
MonitorElement * h_PVyz
Definition: BeamMonitor.h:145
dqm::legacy::DQMStore::IBooker
dqm::implementation::IBooker IBooker
Definition: DQMStore.h:729
BeamMonitor::fitPVNLumi_
int fitPVNLumi_
Definition: BeamMonitor.h:78
BeamMonitor::pvResults
MonitorElement * pvResults
Definition: BeamMonitor.h:146
Track.h
BeamMonitor::dxMin_
const double dxMin_
Definition: BeamMonitor.h:56
TrackFwd.h
BeamMonitor::refBS
reco::BeamSpot refBS
Definition: BeamMonitor.h:118
BeamSpot.h
BeamMonitor::countGapLumi_
int countGapLumi_
Definition: BeamMonitor.h:111
BeamMonitor::mapPVz
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:150
BeamMonitor::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
Definition: BeamMonitor.cc:777
BeamMonitor::h_sigmaZ0
MonitorElement * h_sigmaZ0
Definition: BeamMonitor.h:138
reco::BeamSpot
Definition: BeamSpot.h:21
BeamMonitor::reportSummary_
Float_t reportSummary_
Definition: BeamMonitor.h:162
BeamMonitor::mapBeginBSTime
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:154
BeamMonitor::h_nVtx_lumi_all
MonitorElement * h_nVtx_lumi_all
Definition: BeamMonitor.h:124
BeamMonitor::startTime
std::time_t startTime
Definition: BeamMonitor.h:173
BeamMonitor::tracksLabel_
edm::EDGetTokenT< reco::TrackCollection > tracksLabel_
Definition: BeamMonitor.h:73
BeamMonitor::mapBeginPVTime
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:154
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
BeamMonitor::h_vy_dz
MonitorElement * h_vy_dz
Definition: BeamMonitor.h:129
BeamMonitor::h_sigmaX0
MonitorElement * h_sigmaX0
Definition: BeamMonitor.h:136
BeamMonitor::vxMin_
const double vxMin_
Definition: BeamMonitor.h:60
BeamMonitor::dzMax_
const double dzMax_
Definition: BeamMonitor.h:69
edm::ParameterSet
Definition: ParameterSet.h:36
BeamMonitor::refTime
std::time_t refTime
Definition: BeamMonitor.h:174
BeamMonitor::formatFitTime
void formatFitTime(char *, const std::time_t &)
Definition: BeamMonitor.cc:44
BeamMonitor::endLumiOfBSFit_
int endLumiOfBSFit_
Definition: BeamMonitor.h:91
Event.h
BeamMonitor::intervalInSec_
int intervalInSec_
Definition: BeamMonitor.h:81
BeamMonitor::h_nVtx_lumi
MonitorElement * h_nVtx_lumi
Definition: BeamMonitor.h:123
BeamMonitor::refPVtime
std::time_t refPVtime[2]
Definition: BeamMonitor.h:97
BeamMonitor::RestartFitting
void RestartFitting()
Definition: BeamMonitor.cc:1437
BeamMonitor::vxMax_
const double vxMax_
Definition: BeamMonitor.h:61
BeamMonitor::StartAverage_
bool StartAverage_
Definition: BeamMonitor.h:109
edm::EventSetup
Definition: EventSetup.h:57
BeamMonitor::reportSummaryContents
MonitorElement * reportSummaryContents[3]
Definition: BeamMonitor.h:166
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
BeamMonitor::h_x0
MonitorElement * h_x0
Definition: BeamMonitor.h:133
alignCSCRings.r
r
Definition: alignCSCRings.py:93
BeamMonitor::bsSrc_
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
Definition: BeamMonitor.h:72
VertexFwd.h
BeamMonitor::h_z0
MonitorElement * h_z0
Definition: BeamMonitor.h:135
BeamMonitor::mapLSCF
std::map< int, TH1F > mapLSCF
Definition: BeamMonitor.h:159
BeamMonitor::beginLumiOfPVFit_
int beginLumiOfPVFit_
Definition: BeamMonitor.h:92
BeamMonitor::deltaSigCut_
double deltaSigCut_
Definition: BeamMonitor.h:101
BeamMonitor::dzBin_
const int dzBin_
Definition: BeamMonitor.h:67
BeamMonitor::h_PVx
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:141
Frameworkfwd.h
BeamMonitor::maxZ_
double maxZ_
Definition: BeamMonitor.h:103
BeamMonitor::resetPVNLumi_
int resetPVNLumi_
Definition: BeamMonitor.h:80
BeamMonitor::debug_
bool debug_
Definition: BeamMonitor.h:82
BeamMonitor::phiBin_
const int phiBin_
Definition: BeamMonitor.h:63
BeamMonitor::preBS
reco::BeamSpot preBS
Definition: BeamMonitor.h:119
BeamMonitor::lastlumi_
int lastlumi_
Definition: BeamMonitor.h:94
BeamMonitor::h_nVtx_st
MonitorElement * h_nVtx_st
Definition: BeamMonitor.h:140
BeamMonitor::reportSummaryMap
MonitorElement * reportSummaryMap
Definition: BeamMonitor.h:167
BeamMonitor::summaryContent_
Float_t summaryContent_[3]
Definition: BeamMonitor.h:164
BeamMonitor::FitAndFill
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Definition: BeamMonitor.cc:790
BeamMonitor::fitNLumi_
int fitNLumi_
Definition: BeamMonitor.h:77
BeamMonitor::countLumi_
int countLumi_
Definition: BeamMonitor.h:89
BeamMonitor::scrollTH1
void scrollTH1(TH1 *, std::time_t)
Definition: BeamMonitor.cc:1493
BeamMonitor::dxMax_
const double dxMax_
Definition: BeamMonitor.h:57
BeamMonitor::resetHistos_
bool resetHistos_
Definition: BeamMonitor.h:108
BeamMonitor::h_PVy
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:142
BeamMonitor::mapLSPVStoreSize
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:157
BeamMonitor::h_trkPt
MonitorElement * h_trkPt
Definition: BeamMonitor.h:130
BeamFitter.h
BeamMonitor::h_trkVz
MonitorElement * h_trkVz
Definition: BeamMonitor.h:131
BeamMonitor::hltSrc_
edm::EDGetTokenT< edm::TriggerResults > hltSrc_
Definition: BeamMonitor.h:75
BeamMonitor::phiMax_
const double phiMax_
Definition: BeamMonitor.h:65
BeamMonitor::nthBSTrk_
unsigned int nthBSTrk_
Definition: BeamMonitor.h:98
ParameterSet.h
BeamMonitor::h_trk_z0
MonitorElement * h_trk_z0
Definition: BeamMonitor.h:126
BeamMonitor::h_d0_phi0
MonitorElement * h_d0_phi0
Definition: BeamMonitor.h:125
BeamMonitor::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
Definition: BeamMonitor.cc:518
BeamMonitor::min_Ntrks_
unsigned int min_Ntrks_
Definition: BeamMonitor.h:102
BeamMonitor::nFitElements_
int nFitElements_
Definition: BeamMonitor.h:99
BeamMonitor::mapBeginBSLS
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:153
edm::Event
Definition: Event.h:73
BeamMonitor::summarySum_
Float_t summarySum_
Definition: BeamMonitor.h:163
BeamMonitor::resetFitNLumi_
int resetFitNLumi_
Definition: BeamMonitor.h:79
BeamMonitor::h_vx_dz
MonitorElement * h_vx_dz
Definition: BeamMonitor.h:128
BeamMonitor::BeamMonitor
BeamMonitor(const edm::ParameterSet &)
Definition: BeamMonitor.cc:95
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:1475
BeamMonitor::theBeamFitter
std::unique_ptr< BeamFitter > theBeamFitter
Definition: BeamMonitor.h:86
BeamMonitor::mapBeginPVLS
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:153
BeamMonitor::mapPVy
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:150
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37