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 #include <memory>
26 
30 
33 
37 
38 #include <TF3.h>
39 
40 #include <iostream>
41 #include <fstream>
42 #include <vector>
43 
44 
45 using namespace std;
46 using namespace reco;
47 using namespace edm;
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 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 
75 class Vx3DHLTAnalyzer : public EDAnalyzer {
76  public:
77  explicit Vx3DHLTAnalyzer (const ParameterSet&);
78  ~Vx3DHLTAnalyzer();
79 
80 
81  private:
82  virtual void beginJob ();
83  virtual void analyze (const Event&, const EventSetup&);
84  virtual unsigned int HitCounter (const Event& iEvent);
85  virtual string formatTime (const time_t& t);
86  virtual int MyFit (vector<double>* vals);
87  virtual void reset (string ResetType);
88  virtual void writeToFile (vector<double>* vals,
89  TimeValue_t BeginTimeOfFit,
90  TimeValue_t EndTimeOfFit,
91  unsigned int BeginLumiOfFit,
92  unsigned int EndLumiOfFit,
93  int dataType);
94  virtual void beginLuminosityBlock (const LuminosityBlock& lumiBlock, const EventSetup& iSetup);
95  virtual void endLuminosityBlock (const LuminosityBlock& lumiBlock, const EventSetup& iSetup);
96  virtual void endJob ();
97  virtual void beginRun (const Run& iRun, const EventSetup& iSetup);
98 
99 
100  // #######################
101  // # cfg file parameters #
102  // #######################
105  bool debugMode;
106  unsigned int nLumiReset;
108  unsigned int minNentries;
109  double xRange;
110  double xStep;
111  double yRange;
112  double yStep;
113  double zRange;
114  double zStep;
115  string fileName;
116 
117 
118  // ##############
119  // # Histograms #
120  // ##############
124 
128 
131 
135 
139 
142 
145 
148 
150 
151  // ######################
152  // # Internal variables #
153  // ######################
154  ofstream outputFile;
155  ofstream outputDebugFile;
158  unsigned int nBinsHistoricalPlot;
159  unsigned int nBinsWholeHistory;
160  unsigned int runNumber;
161  unsigned int lumiCounter;
162  unsigned int lumiCounterHisto;
163  unsigned int totalHits;
164  unsigned int maxLumiIntegration;
165  unsigned int prescaleHistory;
166  unsigned int numberGoodFits;
167  unsigned int numberFits;
168  unsigned int beginLumiOfFit;
169  unsigned int endLumiOfFit;
170  unsigned int lastLumiOfFit;
171  double minVxDoF;
173 };
174 
175 #endif
EDGetTokenT< SiPixelRecHitCollection > pixelHitCollection
unsigned int lumiCounter
MonitorElement * dxdzlumi
MonitorElement * Vx_ZX
unsigned int totalHits
double maxLongLength
unsigned int maxLumiIntegration
unsigned int numberFits
double zPos
vector< VertexType > Vertices
unsigned int beginLumiOfFit
MonitorElement * hitCountHistory
unsigned int minNentries
MonitorElement * Vx_X
unsigned int nLumiReset
MonitorElement * mYlumi
MonitorElement * sYlumi
MonitorElement * reportSummaryMap
void beginJob()
Definition: Breakpoints.cc:15
unsigned int nBinsHistoricalPlot
const Double_t pi
double maxTransRadius
MonitorElement * Vx_XY
MonitorElement * sZlumi
double Gauss3DFunc(const double *par)
bool considerVxCovariance
double xPos
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:100
MonitorElement * fitResults
int iEvent
Definition: GenABIO.cc:230
MonitorElement * Vx_ZY
unsigned int endLumiOfFit
unsigned int numberGoodFits
MonitorElement * reportSummary
MonitorElement * goodVxCounter
MonitorElement * dydzlumi
double yPos
MonitorElement * Vx_Z
MonitorElement * mXlumi
unsigned long long TimeValue_t
Definition: Timestamp.h:28
MonitorElement * mZlumi
MonitorElement * sXlumi
unsigned int lastLumiOfFit
ofstream outputDebugFile
#define DIM
unsigned int nBinsWholeHistory
unsigned int lumiCounterHisto
TimeValue_t beginTimeOfFit
EDGetTokenT< VertexCollection > vertexCollection
unsigned int runNumber
TimeValue_t endTimeOfFit
unsigned int counterVx
unsigned int prescaleHistory
double VxErrCorr
MonitorElement * goodVxCountHistory
MonitorElement * hitCounter
void reset(double vett[256])
Definition: TPedValues.cc:11
Definition: Run.h:41
MonitorElement * Vx_Y