ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootVertex.h
Revision: 1.6
Committed: Mon Oct 12 09:17:39 2009 UTC (15 years, 6 months ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: all_3_3_2_01, all_3_2_5_02, HEAD
Changes since 1.5: +1 -2 lines
Error occurred while calculating annotation data.
Log Message:
Missing newline at end of file

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 ,algo_(-1)
22 ,chi2_(-1.)
23 ,ndof_(-1.)
24 ,ntracks_(-1)
25 ,higherTrackPt_(-1.)
26 ,scalarSumPt_(-1.)
27 ,vectorSumPt_(-1.)
28 ,recoIndex_(-1)
29 {;}
30
31 TRootVertex(const TRootVertex& vertex) :
32 TVector3(vertex)
33 ,error_(vertex.error_)
34 ,algo_(vertex.algo_)
35 ,chi2_(vertex.chi2_)
36 ,ndof_(vertex.ndof_)
37 ,ntracks_(vertex.ntracks_)
38 ,higherTrackPt_(vertex.higherTrackPt_)
39 ,scalarSumPt_(vertex.scalarSumPt_)
40 ,vectorSumPt_(vertex.vectorSumPt_)
41 ,recoIndex_(vertex.recoIndex_)
42 {;}
43
44 TRootVertex(Double_t vx, Double_t vy, Double_t vz) :
45 TVector3(vx,vy,vz)
46 ,error_(-1.,-1.,-1.)
47 ,algo_(-1)
48 ,chi2_(-1.)
49 ,ndof_(-1.)
50 ,ntracks_(-1)
51 ,higherTrackPt_(-1.)
52 ,scalarSumPt_(-1.)
53 ,vectorSumPt_(-1.)
54 ,recoIndex_(-1)
55 {;}
56
57 TRootVertex(Double_t vx, Double_t vy, Double_t vz, Double_t evx, Double_t evy, Double_t evz) :
58 TVector3(vx,vy,vz)
59 ,error_(evx,evy,evz)
60 ,algo_(-1)
61 ,chi2_(-1.)
62 ,ndof_(-1.)
63 ,ntracks_(-1)
64 ,higherTrackPt_(-1.)
65 ,scalarSumPt_(-1.)
66 ,vectorSumPt_(-1.)
67 ,recoIndex_(-1)
68 {;}
69
70
71 TRootVertex(const TVector3 &vertex) :
72 TVector3(vertex)
73 ,error_(-1.,-1.,-1.)
74 ,algo_(-1)
75 ,chi2_(-1.)
76 ,ndof_(-1.)
77 ,ntracks_(-1)
78 ,higherTrackPt_(-1.)
79 ,scalarSumPt_(-1.)
80 ,vectorSumPt_(-1.)
81 ,recoIndex_(-1)
82 {;}
83
84 TRootVertex( const TVector3 &vertex, const TVector3 &vertex_error) :
85 TVector3(vertex)
86 ,error_(vertex_error)
87 ,algo_(-1)
88 ,chi2_(-1.)
89 ,ndof_(-1.)
90 ,ntracks_(-1)
91 ,higherTrackPt_(-1.)
92 ,scalarSumPt_(-1.)
93 ,vectorSumPt_(-1.)
94 ,recoIndex_(-1)
95 {;}
96
97 ~TRootVertex() {;}
98
99
100 TVector3 error() const { return error_;}
101 Double_t xerr() const { return error_.x(); }
102 Double_t yerr() const { return error_.y(); }
103 Double_t zerr() const { return error_.z(); }
104 Int_t algo() const { return algo_;}
105 TString algoName() const
106 {
107 if (algo_==0) return "RECO";
108 else if (algo_==1) return "AllTracks";
109 else if (algo_==2) return "NoEE";
110 else if (algo_==3) return "OnlyEE";
111 else return "Unknown method of vertex reconstruction";
112 }
113 Float_t chi2() const { return chi2_;}
114 Float_t ndof() const { return ndof_;}
115 Float_t ntracks() const { return ntracks_;}
116 Float_t higherTrackPt() const { return higherTrackPt_;}
117 Float_t scalarSumPt() const { return scalarSumPt_;}
118 Float_t vectorSumPt() const { return vectorSumPt_;}
119 Int_t recoIndex() const { return recoIndex_;}
120
121 TString typeName() const { return "TRootVertex"; }
122
123 void setError(TVector3 error) { error_ = error; }
124 void setXerr(Double_t xerr) { error_.SetX(xerr); }
125 void setYerr(Double_t yerr) { error_.SetY(yerr); }
126 void setZerr(Double_t zerr) { error_.SetZ(zerr); }
127 void setAlgo(Int_t algo) { algo_ = algo; }
128 void setAlgoName(TString algoName)
129 {
130 if (algoName=="RECO") algo_=0;
131 else if (algoName=="AllTracks") algo_=1;
132 else if (algoName=="NoEE") algo_=2;
133 else if (algoName=="OnlyEE") algo_=3;
134 else std::cout << "***** TRootVertex::setAlgo(TString) => Unknown method of vertex reconstruction *****" << std::endl;
135 }
136 void setChi2(Float_t chi2) { chi2_ = chi2; }
137 void setNdof(Float_t ndof) { ndof_ = ndof; }
138 void setNtracks(Float_t ntracks) { ntracks_ = ntracks; }
139 void setHigherTrackPt(Float_t higherTrackPt) { higherTrackPt_ = higherTrackPt; }
140 void setScalarSumPt(Float_t scalarSumPt) { scalarSumPt_ = scalarSumPt; }
141 void setVectorSumPt(Float_t vectorSumPt) { vectorSumPt_ = vectorSumPt; }
142 void setRecoIndex(Int_t recoIndex) { recoIndex_ = recoIndex; }
143
144
145 friend std::ostream& operator<< (std::ostream& stream, const TRootVertex& vertex) {
146 stream << "TRootVertex - algo=" << setw(10) << vertex.algoName() <<" (x,y,z)=("<< setw(9) << vertex.x() <<","<< setw(9) << vertex.y() <<","<< setw(9) << vertex.z() << ")"
147 << " error(dx,dy,dz)=("<< setw(11) << vertex.xerr() <<","<< setw(11) << vertex.yerr() <<","<< setw(11) << vertex.zerr() << ")"
148 << " chi2="<< setw(8) << vertex.chi2() <<" ndof="<< setw(6) << vertex.ndof() <<" nTracks="<< setw(4) << vertex.ntracks()
149 << " higherTrackPt="<< setw(7) << vertex.higherTrackPt() <<" scalarSumPt="<< setw(7) << vertex.scalarSumPt() <<" vectorSumPt="<< setw(7) << vertex.vectorSumPt();
150 return stream;
151 };
152
153 private:
154
155 TVector3 error_;
156 Int_t algo_;
157 Float_t chi2_;
158 Float_t ndof_;
159 Float_t ntracks_;
160 Float_t higherTrackPt_;
161 Float_t scalarSumPt_;
162 Float_t vectorSumPt_;
163 Int_t recoIndex_; // corresponding index in std::vector< reco::Vertex > collection
164
165 ClassDef (TRootVertex,3);
166
167 };
168
169 #endif