CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Vx3DHLTAnalyzer.h
Go to the documentation of this file.
1 #ifndef Vx3DHLTAnalyzer_H
2 #define Vx3DHLTAnalyzer_H
3 
4 // -*- C++ -*-
5 //
6 // Package: Vx3DHLTAnalyzer
7 // Class: Vx3DHLTAnalyzer
8 //
14 //
15 // Original Author: Mauro Dinardo, 28 S-012, +41-22-767-8302,
16 // Created: Tue Feb 23 13:15:31 CET 2010
17 
18 // -*- C++ -*-
19 //
20 // Package: Vx3DHLTAnalyzer
21 // Class: Vx3DHLTAnalyzer
22 //
23 
24 
25 // system include files
26 #include <memory>
27 
28 // user include files
35 
38 
42 
43 #include <TF3.h>
44 
45 #include <iostream>
46 #include <fstream>
47 #include <vector>
48 
49 
50 // #################
51 // # Fit variables #
52 // #################
53 #define DIM 3
54 double Gauss3DFunc(const double* par);
55 typedef struct
56 {
57  double x;
58  double y;
59  double z;
60  double Covariance[DIM][DIM];
61 } VertexType;
62 std::vector<VertexType> Vertices;
64 unsigned int counterVx; // Counts the number of vertices taken into account for the fit
65 double maxTransRadius; // Max transverse radius in which the vertices must be [cm]
66 double maxLongLength; // Max longitudinal length in which the vertices must be [cm]
67 double xPos,yPos,zPos; // x,y,z approximate positions of the beam spot
68 double pi;
69 // ######################
70 // # cfg file parameter #
71 // ######################
72 double VxErrCorr; // Coefficient to compensate the under-estimation of the vertex errors
73 
74 
76  public:
77  explicit Vx3DHLTAnalyzer(const edm::ParameterSet&);
79 
80 
81  private:
82  virtual void beginJob();
83  virtual void analyze(const edm::Event&, const edm::EventSetup&);
84  virtual unsigned int HitCounter(const edm::Event& iEvent);
85  virtual char* formatTime(const time_t& t);
86  virtual int MyFit(std::vector<double>* vals);
87  virtual void reset(std::string ResetType);
88  virtual void writeToFile(std::vector<double>* vals,
89  edm::TimeValue_t BeginTimeOfFit,
90  edm::TimeValue_t EndTimeOfFit,
91  unsigned int BeginLumiOfFit,
92  unsigned int EndLumiOfFit,
93  int dataType);
94  virtual void beginLuminosityBlock(const edm::LuminosityBlock& lumiBlock,
95  const edm::EventSetup& iSetup);
96  virtual void endLuminosityBlock(const edm::LuminosityBlock& lumiBlock,
97  const edm::EventSetup& iSetup);
98  virtual void endJob();
99  virtual void beginRun();
100 
101 
102  // #######################
103  // # cfg file parameters #
104  // #######################
107  bool debugMode;
108  unsigned int nLumiReset;
110  unsigned int minNentries;
111  double xRange;
112  double xStep;
113  double yRange;
114  double yStep;
115  double zRange;
116  double zStep;
118 
119 
120  // ##############
121  // # Histograms #
122  // ##############
126 
130 
133 
137 
141 
144 
147 
150 
152 
153  // ######################
154  // # Internal variables #
155  // ######################
156  std::ofstream outputFile;
157  std::ofstream outputDebugFile;
160  unsigned int nBinsHistoricalPlot;
161  unsigned int nBinsWholeHistory;
162  unsigned int runNumber;
163  unsigned int lumiCounter;
164  unsigned int lumiCounterHisto;
165  unsigned int totalHits;
166  unsigned int maxLumiIntegration;
167  unsigned int prescaleHistory;
168  unsigned int numberGoodFits;
169  unsigned int numberFits;
170  unsigned int beginLumiOfFit;
171  unsigned int endLumiOfFit;
172  unsigned int lastLumiOfFit;
173  double minVxDoF;
175 };
176 
177 #endif
unsigned int lumiCounter
MonitorElement * dxdzlumi
MonitorElement * Vx_ZX
unsigned int totalHits
double maxLongLength
unsigned int maxLumiIntegration
virtual char * formatTime(const time_t &t)
unsigned int numberFits
edm::EDGetTokenT< reco::VertexCollection > vertexCollection
double zPos
unsigned int beginLumiOfFit
virtual int MyFit(std::vector< double > *vals)
MonitorElement * hitCountHistory
unsigned int minNentries
MonitorElement * Vx_X
edm::EDGetTokenT< SiPixelRecHitCollection > pixelHitCollection
unsigned int nLumiReset
MonitorElement * mYlumi
edm::TimeValue_t beginTimeOfFit
edm::TimeValue_t endTimeOfFit
MonitorElement * sYlumi
virtual unsigned int HitCounter(const edm::Event &iEvent)
MonitorElement * reportSummaryMap
virtual void writeToFile(std::vector< double > *vals, edm::TimeValue_t BeginTimeOfFit, edm::TimeValue_t EndTimeOfFit, unsigned int BeginLumiOfFit, unsigned int EndLumiOfFit, int dataType)
unsigned int nBinsHistoricalPlot
double maxTransRadius
MonitorElement * Vx_XY
MonitorElement * sZlumi
double Gauss3DFunc(const double *par)
bool considerVxCovariance
double xPos
virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
MonitorElement * fitResults
Vx3DHLTAnalyzer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:243
MonitorElement * Vx_ZY
std::string fileName
virtual void beginJob()
virtual void beginRun()
unsigned int endLumiOfFit
unsigned int numberGoodFits
MonitorElement * reportSummary
MonitorElement * goodVxCounter
std::ofstream outputDebugFile
MonitorElement * dydzlumi
virtual void analyze(const edm::Event &, const edm::EventSetup &)
double yPos
MonitorElement * Vx_Z
MonitorElement * mXlumi
virtual void reset(std::string ResetType)
unsigned long long TimeValue_t
Definition: Timestamp.h:28
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
MonitorElement * mZlumi
MonitorElement * sXlumi
unsigned int lastLumiOfFit
std::ofstream outputFile
#define DIM
unsigned int nBinsWholeHistory
unsigned int lumiCounterHisto
unsigned int runNumber
std::vector< VertexType > Vertices
virtual void endJob()
unsigned int counterVx
unsigned int prescaleHistory
double pi
double VxErrCorr
MonitorElement * goodVxCountHistory
MonitorElement * hitCounter
MonitorElement * Vx_Y