ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Vertex.h
(Generate patch)

Comparing UserCode/MitAna/DataTree/interface/Vertex.h (file contents):
Revision 1.5 by loizides, Tue Oct 14 05:27:54 2008 UTC vs.
Revision 1.6 by bendavid, Wed Nov 12 18:18:27 2008 UTC

# Line 12 | Line 12
12   #define MITANA_DATATREE_VERTEX_H
13  
14   #include <TMath.h>
15 < #include "MitAna/DataTree/interface/DataObject.h"
15 > #include "MitAna/DataTree/interface/BaseVertex.h"
16  
17   namespace mithep
18   {
19 <  class Vertex : public DataObject
19 >  class Vertex : public BaseVertex
20    {
21      public:
22        Vertex() :
23 <        fPosition(0,0,0), fXErr(0.0), fYErr(0.0), fZErr(0.0), fChi2(0.0), fNdof(0), fNTracks(0) {}
23 >        fChi2(0.0), fNdof(0), fNTracks(0) {}
24        Vertex(Double_t x, Double_t y, Double_t z) :
25 <        fPosition(x,y,z), fXErr(0.0), fYErr(0.0), fZErr(0.0), fChi2(0.0), fNdof(0), fNTracks(0) {}
25 >        BaseVertex(x,y,z), fChi2(0.0), fNdof(0), fNTracks(0) {}
26  
27        Vertex(Double_t x, Double_t y, Double_t z, Double_t xErr, Double_t yErr, Double_t zErr) :
28 <        fPosition(x,y,z), fXErr(xErr), fYErr(yErr), fZErr(zErr), fChi2(0.0), fNdof(0), fNTracks(0) {}
28 >        BaseVertex(x,y,z,xErr,yErr,zErr), fChi2(0.0), fNdof(0), fNTracks(0) {}
29        Vertex(const ThreeVector &pos) :
30 <        fPosition(pos), fXErr(0.0), fYErr(0.0), fZErr(0.0), fChi2(0.0), fNdof(0), fNTracks(0) {}
30 >        BaseVertex(pos), fChi2(0.0), fNdof(0), fNTracks(0) {}
31        ~Vertex() {}
32        
33        Double_t            Chi2()      const { return fChi2; }
34        UInt_t              Ndof()      const { return fNdof; }
35        UInt_t              NTracks()   const { return fNTracks; }
36      Double_t            Phi()       const { return fPosition.Phi();  }
37      const ThreeVector  &Position()  const { return fPosition;        }
38      Double_t            Rho()       const { return fPosition.Rho();  }
39      Double_t            X()         const { return fPosition.X();    }
40      Double_t            XErr()      const { return fXErr; }
41      Double_t            Y()         const { return fPosition.Y();    }
42      Double_t            YErr()      const { return fYErr; }
43      Double_t            Z()         const { return fPosition.Z();    }
44      Double_t            ZErr()      const { return fZErr; }
36        Double_t            Prob()      const { return TMath::Prob(fChi2,fNdof); }
37        void                SetChi2(Double_t chi2)              { fChi2 = chi2; }
38 <      void                SetErrors(Double_t xErr, Double_t yErr, Double_t zErr);
48 <      void                SetNdof(UInt_t nDof)                { fNdof = nDof; }
49 <      void                SetPosition(const ThreeVector &pos) { fPosition = pos; }
50 <      void                SetPosition(Double_t x, Double_t y, Double_t z);
38 >      void                SetNdof(UInt_t nDof)                { fNdof = nDof; }
39        void                SetNTracks(UInt_t ntrks)            { fNTracks = ntrks; }
40              
41      protected:
54      ThreeVector         fPosition; //point in space
55      Double32_t          fXErr;     //error in x
56      Double32_t          fYErr;     //error in y
57      Double32_t          fZErr;     //error in z
42        Double32_t          fChi2;     //chi squared of conversion vertex fit
43        UInt_t              fNdof;     //number of degrees of freedom of conversion vertex fit
44        UInt_t              fNTracks;  //number of tracks used for the fit
# Line 62 | Line 46 | namespace mithep
46      ClassDef(Vertex, 1) // Vertex class
47    };
48   }
65
66 //--------------------------------------------------------------------------------------------------
67 inline void mithep::Vertex::SetErrors(Double_t xErr, Double_t yErr, Double_t zErr)
68 {
69  // Set uncertainties on vertex position.
70
71  fXErr = xErr;
72  fYErr = yErr;
73  fZErr = zErr;
74 }
75
76 //--------------------------------------------------------------------------------------------------
77 inline void mithep::Vertex::SetPosition(Double_t x, Double_t y, Double_t z)
78 {
79  // Set vertex position.
80
81  fPosition.SetXYZ(x,y,z);
82 }
83
49   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines