ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/BaseVertex.h
Revision: 1.3
Committed: Tue Dec 9 17:46:59 2008 UTC (16 years, 4 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006b, Mit_006a
Changes since 1.2: +10 -10 lines
Log Message:
Added ObjType to retrieve type of object.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.3 // $Id: BaseVertex.h,v 1.2 2008/11/14 14:46:35 bendavid Exp $
3 bendavid 1.1 //
4     // BaseVertex
5     //
6 loizides 1.3 // Base vertex class implemented as holding a 3d vector as a point in space with fit information.
7 bendavid 1.1 //
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 loizides 1.3 fPosition(0,0,0), fXErr(0.0), fYErr(0.0), fZErr(0.0) {}
23 bendavid 1.1 BaseVertex(Double_t x, Double_t y, Double_t z) :
24 loizides 1.3 fPosition(x,y,z), fXErr(0.0), fYErr(0.0), fZErr(0.0) {}
25 bendavid 1.1 BaseVertex(Double_t x, Double_t y, Double_t z, Double_t xErr, Double_t yErr, Double_t zErr) :
26     fPosition(x,y,z), fXErr(xErr), fYErr(yErr), fZErr(zErr) {}
27     BaseVertex(const ThreeVector &pos) :
28 loizides 1.3 fPosition(pos), fXErr(0.0), fYErr(0.0), fZErr(0.0) {}
29 bendavid 1.1 ~BaseVertex() {}
30    
31 loizides 1.3 EObjType ObjType() const { return kBaseVertex; }
32 bendavid 1.1 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 loizides 1.3 Double_t XErr() const { return fXErr; }
37 bendavid 1.1 Double_t Y() const { return fPosition.Y(); }
38 loizides 1.3 Double_t YErr() const { return fYErr; }
39 bendavid 1.1 Double_t Z() const { return fPosition.Z(); }
40 loizides 1.3 Double_t ZErr() const { return fZErr; }
41 bendavid 1.1 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 loizides 1.3 ClassDef(BaseVertex, 1) // Base vertex class
52 bendavid 1.1 };
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