ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootVertex.h
Revision: 1.1
Committed: Tue Apr 14 16:45:42 2009 UTC (16 years ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: pat_2_2_5_03
Log Message:
Add "Vertices" branch with TCloneArray of TRootVertex

File Contents

# Content
1 #ifndef TRootVertex_h
2 #define TRootVertex_h
3
4 #include <string>
5 #include <iostream>
6 #include <iomanip>
7
8 #include "Rtypes.h"
9 #include "TVector3.h"
10
11 using namespace std;
12
13 class TRootVertex : public TVector3
14 {
15
16 public:
17
18 TRootVertex() :
19 TVector3(-999999.,-999999.,-999999.)
20 ,error_(-1.,-1.,-1.)
21 ,chi2_(-1.)
22 ,ndof_(-1.)
23 ,ntracks_(-1)
24 ,higherTrackPt_(-1.)
25 ,scalarEt_(-1.)
26 {;}
27
28 TRootVertex(const TRootVertex& vertex) :
29 TVector3(vertex)
30 ,error_(vertex.error_)
31 ,chi2_(vertex.chi2_)
32 ,ndof_(vertex.ndof_)
33 ,ntracks_(vertex.ntracks_)
34 ,higherTrackPt_(vertex.higherTrackPt_)
35 ,scalarEt_(vertex.scalarEt_)
36 {;}
37
38 TRootVertex(Double_t vx, Double_t vy, Double_t vz) :
39 TVector3(vx,vy,vz)
40 ,error_(-1.,-1.,-1.)
41 ,chi2_(-1.)
42 ,ndof_(-1.)
43 ,ntracks_(-1)
44 ,higherTrackPt_(-1.)
45 ,scalarEt_(-1.)
46 {;}
47
48 TRootVertex(Double_t vx, Double_t vy, Double_t vz, Double_t evx, Double_t evy, Double_t evz) :
49 TVector3(vx,vy,vz)
50 ,error_(evx,evy,evz)
51 ,chi2_(-1.)
52 ,ndof_(-1.)
53 ,ntracks_(-1)
54 ,higherTrackPt_(-1.)
55 ,scalarEt_(-1.)
56 {;}
57
58
59 TRootVertex(const TVector3 &vertex) :
60 TVector3(vertex)
61 ,error_(-1.,-1.,-1.)
62 ,chi2_(-1.)
63 ,ndof_(-1.)
64 ,ntracks_(-1)
65 ,higherTrackPt_(-1.)
66 ,scalarEt_(-1.)
67 {;}
68
69 TRootVertex( const TVector3 &vertex, const TVector3 &vertex_error) :
70 TVector3(vertex)
71 ,error_(vertex_error)
72 ,chi2_(-1.)
73 ,ndof_(-1.)
74 ,ntracks_(-1)
75 ,higherTrackPt_(-1.)
76 ,scalarEt_(-1.)
77 {;}
78
79 ~TRootVertex() {;}
80
81
82 TVector3 error() const { return error_;}
83 Double_t xerr() const { return error_.x(); }
84 Double_t yerr() const { return error_.y(); }
85 Double_t zerr() const { return error_.z(); }
86 Float_t chi2() const { return chi2_;}
87 Float_t ndof() const { return ndof_;}
88 Float_t ntracks() const { return ntracks_;}
89 Float_t higherTrackPt() const { return higherTrackPt_;}
90 Float_t scalarEt() const { return scalarEt_;}
91
92 TString typeName() const { return "TRootVertex"; }
93
94 void setError(TVector3 error) { error_ = error; }
95 void setXerr(Double_t xerr) { error_.SetX(xerr); }
96 void setYerr(Double_t yerr) { error_.SetY(yerr); }
97 void setZerr(Double_t zerr) { error_.SetZ(zerr); }
98 void setChi2(Float_t chi2) { chi2_ = chi2; }
99 void setNdof(Float_t ndof) { ndof_ = ndof; }
100 void setNtracks(Float_t ntracks) { ntracks_ = ntracks; }
101 void setHigherTrackPt(Float_t higherTrackPt) { higherTrackPt_ = higherTrackPt; }
102 void setScalarEt(Float_t scalarEt) { scalarEt_ = scalarEt; }
103
104
105 friend std::ostream& operator<< (std::ostream& stream, const TRootVertex& vertex) {
106 stream << "TRootVertex - (x,y,z)=("<< setw(9) << vertex.x() <<","<< setw(9) << vertex.y() <<","<< setw(9) << vertex.z() << ")"
107 << " error(dx,dy,dz)=("<< setw(11) << vertex.xerr() <<","<< setw(11) << vertex.yerr() <<","<< setw(11) << vertex.zerr() << ")"
108 << " chi2="<< setw(8) << vertex.chi2() <<" ndof="<< setw(6) << vertex.ndof() <<" nTracks="<< setw(4) << vertex.ntracks()
109 << " higherTrackPt="<< setw(7) << vertex.higherTrackPt() <<" scalarEt="<< setw(7) << vertex.scalarEt();
110 return stream;
111 };
112
113
114 private:
115
116 TVector3 error_;
117 Float_t chi2_;
118 Float_t ndof_;
119 Float_t ntracks_;
120 Float_t higherTrackPt_;
121 Float_t scalarEt_;
122
123 ClassDef (TRootVertex,1);
124 };
125
126 #endif