ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootVertex.h
(Generate patch)

Comparing UserCode/Morgan/interface/TRootVertex.h (file contents):
Revision 1.4 by lethuill, Wed Jun 10 11:17:06 2009 UTC vs.
Revision 1.5 by lethuill, Mon Oct 12 08:32:35 2009 UTC

# Line 12 | Line 12 | 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 <      ,scalarSumPt_(-1.)
26 <      ,recoIndex_(-1)
27 <      {;}
28 <
29 <      TRootVertex(const TRootVertex& vertex) :
30 <      TVector3(vertex)
31 <      ,error_(vertex.error_)
32 <      ,chi2_(vertex.chi2_)
33 <      ,ndof_(vertex.ndof_)
34 <      ,ntracks_(vertex.ntracks_)
35 <      ,higherTrackPt_(vertex.higherTrackPt_)
36 <      ,scalarSumPt_(vertex.scalarSumPt_)
37 <      ,recoIndex_(vertex.recoIndex_)
38 <      {;}
39 <
40 <      TRootVertex(Double_t vx, Double_t vy, Double_t vz) :
41 <      TVector3(vx,vy,vz)
42 <      ,error_(-1.,-1.,-1.)
43 <      ,chi2_(-1.)
44 <      ,ndof_(-1.)
45 <      ,ntracks_(-1)
46 <      ,higherTrackPt_(-1.)
47 <      ,scalarSumPt_(-1.)
48 <      ,recoIndex_(-1)
49 <      {;}
50 <
51 <      TRootVertex(Double_t vx, Double_t vy, Double_t vz, Double_t evx, Double_t evy, Double_t evz) :
52 <      TVector3(vx,vy,vz)
53 <      ,error_(evx,evy,evz)
54 <      ,chi2_(-1.)
55 <      ,ndof_(-1.)
56 <      ,ntracks_(-1)
57 <      ,higherTrackPt_(-1.)
58 <      ,scalarSumPt_(-1.)
59 <      ,recoIndex_(-1)
60 <      {;}
61 <
62 <
63 <      TRootVertex(const TVector3 &vertex) :
64 <      TVector3(vertex)
65 <      ,error_(-1.,-1.,-1.)
66 <      ,chi2_(-1.)
67 <      ,ndof_(-1.)
68 <      ,ntracks_(-1)
69 <      ,higherTrackPt_(-1.)
70 <      ,scalarSumPt_(-1.)
71 <      ,recoIndex_(-1)
72 <      {;}
73 <
74 <      TRootVertex( const TVector3 &vertex, const TVector3 &vertex_error) :
75 <      TVector3(vertex)
76 <      ,error_(vertex_error)
77 <      ,chi2_(-1.)
78 <      ,ndof_(-1.)
79 <      ,ntracks_(-1)
80 <      ,higherTrackPt_(-1.)
81 <      ,scalarSumPt_(-1.)
82 <      ,recoIndex_(-1)
83 <      {;}
84 <
85 <      ~TRootVertex() {;}
86 <
87 <
88 <      TVector3 error() const { return error_;}
89 <      Double_t xerr() const  { return error_.x(); }
90 <      Double_t yerr() const  { return error_.y(); }
91 <      Double_t zerr() const  { return error_.z(); }
92 <      Float_t chi2() const { return chi2_;}
93 <      Float_t ndof() const { return ndof_;}
94 <      Float_t ntracks() const { return ntracks_;}
95 <      Float_t higherTrackPt() const { return higherTrackPt_;}
96 <      Float_t scalarSumPt() const { return scalarSumPt_;}
97 <      Int_t recoIndex() const { return recoIndex_;}
98 <
99 <      TString typeName() const { return "TRootVertex"; }
100 <
101 <      void setError(TVector3 error) { error_ = error; }
102 <      void setXerr(Double_t xerr) { error_.SetX(xerr);  }
103 <      void setYerr(Double_t yerr) { error_.SetY(yerr); }
104 <      void setZerr(Double_t zerr) { error_.SetZ(zerr); }
105 <      void setChi2(Float_t chi2) { chi2_ = chi2; }
106 <      void setNdof(Float_t ndof) { ndof_ = ndof; }
107 <      void setNtracks(Float_t ntracks) { ntracks_ = ntracks; }
108 <      void setHigherTrackPt(Float_t higherTrackPt) { higherTrackPt_ = higherTrackPt; }
109 <      void setScalarSumPt(Float_t scalarSumPt) { scalarSumPt_ = scalarSumPt; }
110 <      void setRecoIndex(Int_t recoIndex) { recoIndex_ = recoIndex; }
111 <
112 <
113 <      friend std::ostream& operator<< (std::ostream& stream, const TRootVertex& vertex) {
114 <         stream << "TRootVertex - (x,y,z)=("<< setw(9) << vertex.x() <<","<< setw(9) << vertex.y() <<","<< setw(9) << vertex.z() << ")"
115 <         << " error(dx,dy,dz)=("<< setw(11) << vertex.xerr() <<","<< setw(11) << vertex.yerr() <<","<< setw(11) << vertex.zerr() << ")"
116 <         << "  chi2="<< setw(8) << vertex.chi2() <<"  ndof="<< setw(6) << vertex.ndof() <<"  nTracks="<< setw(4) << vertex.ntracks()
117 <         << "  higherTrackPt="<< setw(7) << vertex.higherTrackPt() <<"  scalarSumPt="<< setw(7) << vertex.scalarSumPt();
118 <         return stream;
119 <      };
120 <
121 <
122 <   private:
123 <
124 <      TVector3 error_;
125 <      Float_t chi2_;
126 <      Float_t ndof_;
127 <      Float_t ntracks_;
128 <      Float_t higherTrackPt_;
129 <      Float_t scalarSumPt_;
130 <      Int_t recoIndex_; // corresponding index in std::vector< reco::Vertex > collection
131 <
132 <      ClassDef (TRootVertex,2);
133 <
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 <
168 >                
169   #endif
170 +                

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines