CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BeamMonitor.h
Go to the documentation of this file.
1 #ifndef BeamMonitor_H
2 #define BeamMonitor_H
3 
12 // C++
13 #include <string>
14 // CMS
23 #include <fstream>
24 
25 
26 //
27 // class declaration
28 //
29 
30 class BeamMonitor : public edm::EDAnalyzer {
31  public:
32 
34  ~BeamMonitor();
35 
36  protected:
37 
38  // BeginJob
39  void beginJob();
40 
41  // BeginRun
42  void beginRun(const edm::Run& r, const edm::EventSetup& c);
43 
44  void analyze(const edm::Event& e, const edm::EventSetup& c) ;
45 
46  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
47  const edm::EventSetup& context) ;
48 
49  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
50  const edm::EventSetup& c);
51  // EndRun
52  void endRun(const edm::Run& r, const edm::EventSetup& c);
53  // Endjob
54  void endJob(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);
55 
56  private:
57 
58  void FitAndFill(const edm::LuminosityBlock& lumiSeg,int&,int&,int&);
59  void RestartFitting();
60  void scrollTH1(TH1 *, std::time_t);
61  bool testScroll(std::time_t &, std::time_t &);
62  const char * formatFitTime( const std::time_t &);
64  std::string monitorName_;
65  edm::InputTag bsSrc_; // beam spot
67  edm::InputTag pvSrc_; // primary vertex
68  edm::InputTag hltSrc_;//hlt collection
69 
70  int fitNLumi_;
75  bool debug_;
77  std::vector<std::string> jetTrigger_;
78 
81 
82  int countEvt_; //counter
83  int countLumi_; //counter
88  int lastlumi_; // previous LS processed
89  int nextlumi_; // next LS of Fit
90  std::time_t refBStime[2];
91  std::time_t refPVtime[2];
92  unsigned int nthBSTrk_;
94  int nFits_;
95  double deltaSigCut_;
96  unsigned int min_Ntrks_;
97  double maxZ_;
98  unsigned int minNrVertices_;
99  double minVtxNdf_;
100  double minVtxWgt_;
101 
106 
108 
109  // ----------member data ---------------------------
110 
111  // std::vector<BSTrkParameters> fBSvector;
114 
115  // MonitorElements:
139  std::map<TString, MonitorElement*> hs;
140 
141  // The histo of the primary vertex for DQM gui
142  std::map<int, std::vector<float> > mapPVx,mapPVy,mapPVz;
143  std::map<int, std::vector<int> > mapNPV;
144  //keep track of beginLuminosity block and time
145  std::map<int, int> mapBeginBSLS,mapBeginPVLS;
146  std::map<int, std::time_t> mapBeginBSTime, mapBeginPVTime;
147  //these maps are needed to keep track of size of theBSvector and pvStore
148  std::map<int, std::size_t> mapLSBSTrkSize;
149  std::map<int, size_t>mapLSPVStoreSize;
150  //to correct the cutFlot Table
151  std::map<int, TH1F> mapLSCF;
152 
153  // Summary:
154  Float_t reportSummary_;
155  Float_t summarySum_;
156  Float_t summaryContent_[3];
161  // variables for beam fit
162 
163  //
164  std::time_t tmpTime;
165  std::time_t startTime;
166  std::time_t refTime;
168  // Current run
169  int frun;
170  int lastNZbin; // last non zero bin of time histos
171 };
172 
173 #endif
174 
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
Definition: BeamMonitor.cc:434
const char * formatFitTime(const std::time_t &)
Definition: BeamMonitor.cc:50
BeamMonitor(const edm::ParameterSet &)
Definition: BeamMonitor.cc:77
unsigned int minNrVertices_
Definition: BeamMonitor.h:98
int nFitElements_
Definition: BeamMonitor.h:93
std::time_t refBStime[2]
Definition: BeamMonitor.h:90
MonitorElement * reportSummary
Definition: BeamMonitor.h:157
void analyze(const edm::Event &e, const edm::EventSetup &c)
Definition: BeamMonitor.cc:544
int endLumiOfPVFit_
Definition: BeamMonitor.h:87
int resetFitNLumi_
Definition: BeamMonitor.h:72
MonitorElement * h_nVtx
Definition: BeamMonitor.h:131
double minVtxWgt_
Definition: BeamMonitor.h:100
MonitorElement * cutFlowTable
Definition: BeamMonitor.h:160
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:135
bool testScroll(std::time_t &, std::time_t &)
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:142
MonitorElement * h_PVxz
Definition: BeamMonitor.h:136
double minVtxNdf_
Definition: BeamMonitor.h:99
bool processed_
Definition: BeamMonitor.h:107
edm::TimeValue_t ftimestamp
Definition: BeamMonitor.h:167
MonitorElement * h_sigmaZ0
Definition: BeamMonitor.h:130
MonitorElement * h_nTrk_lumi
Definition: BeamMonitor.h:116
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:148
MonitorElement * fitResults
Definition: BeamMonitor.h:124
std::vector< std::string > jetTrigger_
Definition: BeamMonitor.h:77
int fitPVNLumi_
Definition: BeamMonitor.h:71
MonitorElement * h_sigmaY0
Definition: BeamMonitor.h:129
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:142
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:146
edm::InputTag bsSrc_
Definition: BeamMonitor.h:65
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:143
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:146
MonitorElement * h_y0
Definition: BeamMonitor.h:126
int intervalInSec_
Definition: BeamMonitor.h:74
void beginJob()
Definition: BeamMonitor.cc:127
int countGapLumi_
Definition: BeamMonitor.h:105
MonitorElement * h_vy_dz
Definition: BeamMonitor.h:121
Float_t reportSummary_
Definition: BeamMonitor.h:154
MonitorElement * h_PVyz
Definition: BeamMonitor.h:137
void beginRun(const edm::Run &r, const edm::EventSetup &c)
Definition: BeamMonitor.cc:413
std::time_t refTime
Definition: BeamMonitor.h:166
MonitorElement * pvResults
Definition: BeamMonitor.h:138
int endLumiOfBSFit_
Definition: BeamMonitor.h:85
virtual void endJob()
Definition: EDAnalyzer.h:59
std::time_t refPVtime[2]
Definition: BeamMonitor.h:91
void RestartFitting()
reco::BeamSpot refBS
Definition: BeamMonitor.h:112
unsigned long long TimeValue_t
Definition: Timestamp.h:27
std::map< int, TH1F > mapLSCF
Definition: BeamMonitor.h:151
DQMStore * dbe_
Definition: BeamMonitor.h:79
double maxZ_
Definition: BeamMonitor.h:97
std::time_t startTime
Definition: BeamMonitor.h:165
edm::InputTag hltSrc_
Definition: BeamMonitor.h:68
edm::InputTag pvSrc_
Definition: BeamMonitor.h:67
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Definition: BeamMonitor.cc:693
Float_t summaryContent_[3]
Definition: BeamMonitor.h:156
MonitorElement * h_sigmaX0
Definition: BeamMonitor.h:128
bool StartAverage_
Definition: BeamMonitor.h:103
reco::BeamSpot preBS
Definition: BeamMonitor.h:113
MonitorElement * h_nVtx_st
Definition: BeamMonitor.h:132
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:134
int beginLumiOfPVFit_
Definition: BeamMonitor.h:86
MonitorElement * reportSummaryContents[3]
Definition: BeamMonitor.h:158
MonitorElement * h_x0
Definition: BeamMonitor.h:125
MonitorElement * h_trk_z0
Definition: BeamMonitor.h:118
int resetPVNLumi_
Definition: BeamMonitor.h:73
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:145
Float_t summarySum_
Definition: BeamMonitor.h:155
edm::ParameterSet parameters_
Definition: BeamMonitor.h:63
MonitorElement * h_trkPt
Definition: BeamMonitor.h:122
MonitorElement * h_vx_dz
Definition: BeamMonitor.h:120
MonitorElement * h_z0
Definition: BeamMonitor.h:127
unsigned int nthBSTrk_
Definition: BeamMonitor.h:92
unsigned int min_Ntrks_
Definition: BeamMonitor.h:96
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
Definition: BeamMonitor.cc:681
bool resetHistos_
Definition: BeamMonitor.h:102
double deltaSigCut_
Definition: BeamMonitor.h:95
std::time_t tmpTime
Definition: BeamMonitor.h:164
int firstAverageFit_
Definition: BeamMonitor.h:104
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:80
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:133
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:145
int beginLumiOfBSFit_
Definition: BeamMonitor.h:84
MonitorElement * h_trkVz
Definition: BeamMonitor.h:123
void endRun(const edm::Run &r, const edm::EventSetup &c)
std::string monitorName_
Definition: BeamMonitor.h:64
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:142
MonitorElement * h_d0_phi0
Definition: BeamMonitor.h:117
edm::InputTag tracksLabel_
Definition: BeamMonitor.h:66
Definition: Run.h:33
MonitorElement * h_vx_vy
Definition: BeamMonitor.h:119
int countLumi_
Definition: BeamMonitor.h:83
void scrollTH1(TH1 *, std::time_t)
MonitorElement * reportSummaryMap
Definition: BeamMonitor.h:159
bool onlineMode_
Definition: BeamMonitor.h:76
std::map< TString, MonitorElement * > hs
Definition: BeamMonitor.h:139
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:149