ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/BaseVertex.h
Revision: 1.2
Committed: Fri Nov 14 14:46:35 2008 UTC (16 years, 5 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006
Changes since 1.1: +2 -2 lines
Log Message:
Convert more things to Double32

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.2 // $Id: BaseVertex.h,v 1.1 2008/11/12 18:18:27 bendavid Exp $
3 bendavid 1.1 //
4     // BaseVertex
5     //
6     // BaseVertex class implemented as holding a 3d vector as a point in space with fit information.
7     //
8     // Authors: J.Bendavid
9     //--------------------------------------------------------------------------------------------------
10    
11     #ifndef MITANA_DATATREE_BASEVERTEX_H
12     #define MITANA_DATATREE_BASEVERTEX_H
13    
14     #include "MitAna/DataTree/interface/DataObject.h"
15    
16     namespace mithep
17     {
18     class BaseVertex : public DataObject
19     {
20     public:
21     BaseVertex() :
22     fPosition(0,0,0), fXErr(0.0), fYErr(0.0), fZErr(0.0) {}
23     BaseVertex(Double_t x, Double_t y, Double_t z) :
24     fPosition(x,y,z), fXErr(0.0), fYErr(0.0), fZErr(0.0) {}
25    
26     BaseVertex(Double_t x, Double_t y, Double_t z, Double_t xErr, Double_t yErr, Double_t zErr) :
27     fPosition(x,y,z), fXErr(xErr), fYErr(yErr), fZErr(zErr) {}
28     BaseVertex(const ThreeVector &pos) :
29     fPosition(pos), fXErr(0.0), fYErr(0.0), fZErr(0.0) {}
30     ~BaseVertex() {}
31    
32     Double_t Phi() const { return fPosition.Phi(); }
33     const ThreeVector &Position() const { return fPosition; }
34     Double_t Rho() const { return fPosition.Rho(); }
35     Double_t X() const { return fPosition.X(); }
36     Double_t XErr() const { return fXErr; }
37     Double_t Y() const { return fPosition.Y(); }
38     Double_t YErr() const { return fYErr; }
39     Double_t Z() const { return fPosition.Z(); }
40     Double_t ZErr() const { return fZErr; }
41     void SetErrors(Double_t xErr, Double_t yErr, Double_t zErr);
42     void SetPosition(const ThreeVector &pos) { fPosition = pos; }
43     void SetPosition(Double_t x, Double_t y, Double_t z);
44    
45     protected:
46 bendavid 1.2 ThreeVector32 fPosition; //point in space
47 bendavid 1.1 Double32_t fXErr; //error in x
48     Double32_t fYErr; //error in y
49     Double32_t fZErr; //error in z
50    
51     ClassDef(BaseVertex, 1) // BaseVertex class
52     };
53     }
54    
55     //--------------------------------------------------------------------------------------------------
56     inline void mithep::BaseVertex::SetErrors(Double_t xErr, Double_t yErr, Double_t zErr)
57     {
58     // Set uncertainties on vertex position.
59    
60     fXErr = xErr;
61     fYErr = yErr;
62     fZErr = zErr;
63     }
64    
65     //--------------------------------------------------------------------------------------------------
66     inline void mithep::BaseVertex::SetPosition(Double_t x, Double_t y, Double_t z)
67     {
68     // Set vertex position.
69    
70     fPosition.SetXYZ(x,y,z);
71     }
72    
73     #endif