ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/BaseVertex.h
Revision: 1.5
Committed: Tue Mar 3 17:04:09 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre2, Mit_008pre1
Changes since 1.4: +4 -4 lines
Log Message:
Cleanup and double32.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.5 // $Id: BaseVertex.h,v 1.4 2009/02/18 15:38:54 loizides 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.5 fXErr(0), fYErr(0), fZErr(0) {}
23 bendavid 1.1 BaseVertex(Double_t x, Double_t y, Double_t z) :
24 loizides 1.5 fPosition(x,y,z), fXErr(0), fYErr(0), fZErr(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.5 fPosition(pos), fXErr(0), fYErr(0), fZErr(0) {}
29 bendavid 1.1
30 loizides 1.3 EObjType ObjType() const { return kBaseVertex; }
31 bendavid 1.1 Double_t Phi() const { return fPosition.Phi(); }
32     const ThreeVector &Position() const { return fPosition; }
33     Double_t Rho() const { return fPosition.Rho(); }
34     Double_t X() const { return fPosition.X(); }
35 loizides 1.3 Double_t XErr() const { return fXErr; }
36 bendavid 1.1 Double_t Y() const { return fPosition.Y(); }
37 loizides 1.3 Double_t YErr() const { return fYErr; }
38 bendavid 1.1 Double_t Z() const { return fPosition.Z(); }
39 loizides 1.3 Double_t ZErr() const { return fZErr; }
40 bendavid 1.1 void SetErrors(Double_t xErr, Double_t yErr, Double_t zErr);
41     void SetPosition(const ThreeVector &pos) { fPosition = pos; }
42     void SetPosition(Double_t x, Double_t y, Double_t z);
43    
44     protected:
45 bendavid 1.2 ThreeVector32 fPosition; //point in space
46 bendavid 1.1 Double32_t fXErr; //error in x
47     Double32_t fYErr; //error in y
48     Double32_t fZErr; //error in z
49    
50 loizides 1.3 ClassDef(BaseVertex, 1) // Base vertex class
51 bendavid 1.1 };
52     }
53    
54     //--------------------------------------------------------------------------------------------------
55     inline void mithep::BaseVertex::SetErrors(Double_t xErr, Double_t yErr, Double_t zErr)
56     {
57     // Set uncertainties on vertex position.
58    
59     fXErr = xErr;
60     fYErr = yErr;
61     fZErr = zErr;
62     }
63    
64     //--------------------------------------------------------------------------------------------------
65     inline void mithep::BaseVertex::SetPosition(Double_t x, Double_t y, Double_t z)
66     {
67     // Set vertex position.
68    
69     fPosition.SetXYZ(x,y,z);
70     }
71     #endif