ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Vertex.h
Revision: 1.4
Committed: Tue Sep 30 12:51:37 2008 UTC (16 years, 7 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_004
Changes since 1.3: +71 -11 lines
Log Message:
merged FitVertex class into Vertex

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Vertex.h,v 1.3 2008/07/07 15:32:28 bendavid Exp $
3 //
4 // Vertex
5 //
6 // Vertex class implemented as holding a 3d vector as a point in space with fit information
7 //
8 // Authors: J.Bendavid
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef DATATREE_VERTEX_H
12 #define DATATREE_VERTEX_H
13
14 #include <TMath.h>
15 #include "MitAna/DataTree/interface/DataObject.h"
16
17 namespace mithep
18 {
19 class Vertex : public DataObject
20 {
21 public:
22 Vertex() :
23 fPosition(0,0,0),
24 fXErr(0.0),
25 fYErr(0.0),
26 fZErr(0.0),
27 fChi2(0.0),
28 fNdof(0),
29 fNTracks(0) {}
30 Vertex(Double_t x, Double_t y, Double_t z) :
31 fPosition(x,y,z),
32 fXErr(0.0),
33 fYErr(0.0),
34 fZErr(0.0),
35 fChi2(0.0),
36 fNdof(0),
37 fNTracks(0) {}
38 Vertex(Double_t x, Double_t y, Double_t z, Double_t xErr, Double_t yErr, Double_t zErr) :
39 fPosition(x,y,z),
40 fXErr(xErr),
41 fYErr(yErr),
42 fZErr(zErr),
43 fChi2(0.0),
44 fNdof(0),
45 fNTracks(0) {}
46 Vertex(const ThreeVector &pos) :
47 fPosition(pos),
48 fXErr(0.0),
49 fYErr(0.0),
50 fZErr(0.0),
51 fChi2(0.0),
52 fNdof(0),
53 fNTracks(0) {}
54 ~Vertex() {}
55
56 Double_t Phi() const { return fPosition.Phi(); }
57 Double_t Rho() const { return fPosition.Rho(); }
58 const ThreeVector &Position() const { return fPosition; }
59 void SetPosition(const ThreeVector &pos) { fPosition = pos; }
60 void SetPosition(Double_t x, Double_t y, Double_t z) { fPosition.SetXYZ(x,y,z); }
61 Double_t X() const { return fPosition.X(); }
62 Double_t Y() const { return fPosition.Y(); }
63 Double_t Z() const { return fPosition.Z(); }
64 Double_t Chi2() const { return fChi2; }
65 UInt_t Ndof() const { return fNdof; }
66 Double_t XErr() const { return fXErr; }
67 Double_t YErr() const { return fYErr; }
68 Double_t ZErr() const { return fZErr; }
69 Double_t Prob() const { return TMath::Prob(fChi2,fNdof); }
70 void SetChi2(Double_t chi2) { fChi2 = chi2; }
71 void SetErrors(Double_t xErr, Double_t yErr, Double_t zErr);
72 void SetNdof(UInt_t nDof) { fNdof = nDof; }
73 UInt_t NTracks() const { return fNTracks; }
74 void SetNTracks(UInt_t ntrks) { fNTracks = ntrks; }
75
76 protected:
77 ThreeVector fPosition; //point in space
78 Double32_t fXErr; //error in x
79 Double32_t fYErr; //error in y
80 Double32_t fZErr; //error in z
81 Double32_t fChi2; //chi squared of conversion vertex fit
82 UInt_t fNdof; //number of degrees of freedom of conversion vertex fit
83 UInt_t fNTracks; //number of tracks used for the fit
84
85 ClassDef(Vertex, 1) // Vertex class
86 };
87 }
88
89 //--------------------------------------------------------------------------------------------------
90 inline void mithep::Vertex::SetErrors(Double_t xErr, Double_t yErr, Double_t zErr)
91 {
92 // set uncertainties on vertex position
93
94 fXErr = xErr;
95 fYErr = yErr;
96 fZErr = zErr;
97 }
98 #endif