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 //
16 //
17 // Original Author: Mauro Dinardo,28 S-020,+41227673777,
18 // Created: Tue Feb 23 13:15:31 CET 2010
19 // $Id: Vx3DHLTAnalyzer.h,v 1.13 2010/08/05 14:06:48 dinardo Exp $
20 //
21 //
22 
23 
24 // system include files
25 #include <memory>
26 
27 // user include files
34 
37 
38 #include <TF3.h>
39 
40 #include <iostream>
41 #include <fstream>
42 #include <vector>
43 
44 
45 // #################
46 // # Fit variables #
47 // #################
48 #define DIM 3
49 void Gauss3DFunc(int& /*npar*/, double* /*gin*/, double& fval, double* par, int /*iflag*/);
50 typedef struct
51 {
52  double x;
53  double y;
54  double z;
55  double Covariance[DIM][DIM];
56 } VertexType;
57 std::vector<VertexType> Vertices;
59 unsigned int counterVx; // Counts the number of vertices taken into account for the fit
60 double maxTransRadius; // Max transverse radius in which the vertices must be [cm]
61 double maxLongLength; // Max longitudinal length in which the vertices must be [cm]
62 double xPos,yPos,zPos; // x,y,z approximate positions of the beam spot
63 double pi;
64 // ######################
65 // # cfg file parameter #
66 // ######################
67 double VxErrCorr; // Coefficient to compensate the under-estimation of the vertex errors
68 
69 
71  public:
72  explicit Vx3DHLTAnalyzer(const edm::ParameterSet&);
74 
75 
76  private:
77  virtual void beginJob();
78  virtual void analyze(const edm::Event&, const edm::EventSetup&);
79  virtual unsigned int HitCounter(const edm::Event& iEvent);
80  virtual char* formatTime(const time_t& t);
81  virtual int MyFit(std::vector<double>* vals);
82  virtual void reset(std::string ResetType);
83  virtual void writeToFile(std::vector<double>* vals,
84  edm::TimeValue_t BeginTimeOfFit,
85  edm::TimeValue_t EndTimeOfFit,
86  unsigned int BeginLumiOfFit,
87  unsigned int EndLumiOfFit,
88  int dataType);
89  virtual void beginLuminosityBlock(const edm::LuminosityBlock& lumiBlock,
90  const edm::EventSetup& iSetup);
91  virtual void endLuminosityBlock(const edm::LuminosityBlock& lumiBlock,
92  const edm::EventSetup& iSetup);
93  virtual void endJob();
94 
95 
96  // #######################
97  // # cfg file parameters #
98  // #######################
100  bool debugMode;
101  unsigned int nLumiReset;
103  unsigned int minNentries;
104  double xRange;
105  double xStep;
106  double yRange;
107  double yStep;
108  double zRange;
109  double zStep;
110  std::string fileName;
111 
112 
113  // ##############
114  // # Histograms #
115  // ##############
119 
123 
126 
130 
134 
137 
140 
143 
145 
146  // ######################
147  // # Internal variables #
148  // ######################
149  ofstream outputFile;
150  ofstream outputDebugFile;
153  unsigned int nBinsHistoricalPlot;
154  unsigned int nBinsWholeHistory;
155  unsigned int runNumber;
156  unsigned int lumiCounter;
157  unsigned int lumiCounterHisto;
158  unsigned int totalHits;
159  unsigned int maxLumiIntegration;
160  unsigned int prescaleHistory;
161  unsigned int numberGoodFits;
162  unsigned int numberFits;
163  unsigned int beginLumiOfFit;
164  unsigned int endLumiOfFit;
165  unsigned int lastLumiOfFit;
166  double minVxDoF;
168 };
169 
170 #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
double zPos
unsigned int beginLumiOfFit
virtual int MyFit(std::vector< double > *vals)
MonitorElement * hitCountHistory
unsigned int minNentries
MonitorElement * Vx_X
unsigned int nLumiReset
MonitorElement * mYlumi
edm::TimeValue_t beginTimeOfFit
edm::InputTag vertexCollection
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
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()
unsigned int endLumiOfFit
unsigned int numberGoodFits
MonitorElement * reportSummary
MonitorElement * goodVxCounter
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:27
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
MonitorElement * mZlumi
MonitorElement * sXlumi
unsigned int lastLumiOfFit
ofstream outputDebugFile
#define DIM
unsigned int nBinsWholeHistory
unsigned int lumiCounterHisto
void Gauss3DFunc(int &, double *, double &fval, double *par, int)
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
const double par[8 *NPar][4]