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.1 by lethuill, Tue Apr 14 16:45:42 2009 UTC vs.
Revision 1.4 by lethuill, Wed Jun 10 11:17:06 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 <                ,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);
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 >
134   };
135  
136   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines