ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootParticle.h
Revision: 1.4
Committed: Wed Nov 19 19:03:16 2008 UTC (16 years, 5 months ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: Common-2008_11_24, Common-2008_11_19
Changes since 1.3: +1 -1 lines
Log Message:
First skeleton for common code

File Contents

# Content
1 #ifndef TRootParticle_h
2 #define TRootParticle_h
3
4 #include <string>
5 #include <iostream>
6
7 #include "Rtypes.h"
8 #include "TLorentzVector.h"
9 #include "TVector3.h"
10 #include "TRef.h"
11
12 using namespace std;
13
14 class TRootParticle : public TLorentzVector
15 {
16
17 public:
18
19 TRootParticle() : TLorentzVector(), vertex_(), type_(0), charge_(0.) {;}
20 TRootParticle(const TRootParticle& particle) : TLorentzVector(particle), vertex_(particle.vertex_), type_(particle.type_), charge_(particle.charge_) {;}
21 TRootParticle(Double_t px, Double_t py, Double_t pz, Double_t e) : TLorentzVector(px,py,pz,e), vertex_(), type_(0), charge_(0.) {;}
22 TRootParticle(Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vtx_x, Double_t vtx_y, Double_t vtx_z) : TLorentzVector(px,py,pz,e), vertex_(vtx_x,vtx_y,vtx_z), type_(0), charge_(0.) {;}
23 TRootParticle(Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vtx_x, Double_t vtx_y, Double_t vtx_z, Int_t type, Float_t charge) : TLorentzVector(px,py,pz,e), vertex_(vtx_x,vtx_y,vtx_z), type_(type), charge_(charge) {;}
24 TRootParticle(const TLorentzVector &momentum) : TLorentzVector(momentum), vertex_(), type_(0), charge_(0.) {;}
25 TRootParticle(const TLorentzVector &momentum, const TVector3 &vertex, Int_t type, Float_t charge) : TLorentzVector(momentum), vertex_(vertex), type_(type), charge_(charge) {;}
26 ~TRootParticle() {;}
27
28 Double_t vx() const { return vertex_.x(); }
29 Double_t vy() const { return vertex_.y(); }
30 Double_t vz() const { return vertex_.z(); }
31 Int_t type() const { return type_; }
32 Float_t charge() const { return charge_; }
33
34 // FIXME setVx, setVy and setVz must modify the TLorentzVector ?
35 void setVx(Double_t vx) { vertex_.SetX(vx); }
36 void setVy(Double_t vy) { vertex_.SetY(vy); }
37 void setVz(Double_t vz) { vertex_.SetZ(vz); }
38 void setType(Int_t type) { type_ = type; }
39 void setCharge(Int_t charge) { charge_ = charge; }
40
41 friend std::ostream& operator<< (std::ostream& stream, const TRootParticle& part) {
42 stream << "Type=" << part.type_ << " Charge=" << part.charge_ << " (Et,eta,phi)=("<< part.Et() <<","<< part.Eta() <<","<< part.Phi() << ")"
43 << " vertex(x,y,z)=("<< part.vx() <<","<< part.vy() <<","<< part.vz() << ")";
44 return stream;
45 };
46
47
48 protected:
49
50 TVector3 vertex_;
51 Int_t type_;
52 Float_t charge_;
53
54 ClassDef (TRootParticle,1);
55 };
56
57 #endif