ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootParticle.h
Revision: 1.5
Committed: Mon Dec 15 19:08:52 2008 UTC (16 years, 4 months ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: pat_2_1_12_01
Changes since 1.4: +37 -9 lines
Log Message:
MC infos from Silvano

File Contents

# User Rev Content
1 mlethuil 1.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 lethuill 1.3 #include "TRef.h"
11 mlethuil 1.1
12     using namespace std;
13    
14     class TRootParticle : public TLorentzVector
15     {
16 mlethuil 1.2
17 mlethuil 1.1 public:
18    
19 lethuill 1.5 TRootParticle() : TLorentzVector(), vertex_(), type_(0), charge_(0.), status_(0), nDau_(0), motherType_(0), grannyType_(0), dauOneId_(0), dauTwoId_(0), dauThreeId_(0), dauFourId_(0), indexInList_(-1) {;}
20     TRootParticle(const TRootParticle& particle) : TLorentzVector(particle), vertex_(particle.vertex_),type_(particle.type_), charge_(particle.charge_), status_(particle.status_),nDau_(particle.nDau_),motherType_(particle.motherType_),grannyType_(particle.grannyType_), dauOneId_(particle.dauOneId_), dauTwoId_(particle.dauTwoId_), dauThreeId_(particle.dauThreeId_), dauFourId_(particle.dauFourId_), indexInList_(particle.indexInList_) {;}
21     TRootParticle(Double_t px, Double_t py, Double_t pz, Double_t e) : TLorentzVector(px,py,pz,e), vertex_(), type_(0),charge_(0.), status_(0), nDau_(0), motherType_(0), grannyType_(0), dauOneId_(0), dauTwoId_(0), dauThreeId_(0), dauFourId_(0), indexInList_(-1) {;}
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.),status_(0), nDau_(0), motherType_(0), grannyType_(0), dauOneId_(0), dauTwoId_(0), dauThreeId_(0), dauFourId_(0), indexInList_(-1) {;}
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), status_(0), nDau_(0), motherType_(0), grannyType_(0), dauOneId_(0), dauTwoId_(0), dauThreeId_(0), dauFourId_(0), indexInList_(-1) {;}
24     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, Int_t status, Int_t nDau, Int_t motherType, Int_t grannyType, Int_t dauOneId, Int_t dauTwoId, Int_t dauThreeId, Int_t dauFourId, Int_t indexInList) : TLorentzVector(px,py,pz,e),vertex_(vtx_x,vtx_y,vtx_z), type_(type), charge_(charge), status_(status), nDau_(nDau), motherType_(motherType), grannyType_(grannyType), dauOneId_(dauOneId), dauTwoId_(dauTwoId), dauThreeId_(dauThreeId), dauFourId_(dauFourId), indexInList_(indexInList) {;}
25     TRootParticle(const TLorentzVector &momentum) : TLorentzVector(momentum), vertex_(), type_(0), charge_(0.), status_(0), nDau_(0), motherType_(0), grannyType_(0), dauOneId_(0), dauTwoId_(0), dauThreeId_(0), dauFourId_(0), indexInList_(-1) {;}
26     TRootParticle(const TLorentzVector &momentum, const TVector3 &vertex, Int_t type, Float_t charge) : TLorentzVector(momentum), vertex_(vertex), type_(type), charge_(charge), status_(0), nDau_(0), motherType_(0), grannyType_(0), dauOneId_(0), dauTwoId_(0), dauThreeId_(0), dauFourId_(0), indexInList_(-1) {;}
27     TRootParticle(const TLorentzVector &momentum, const TVector3 &vertex, Int_t type, Float_t charge, Int_t status, Int_t nDau, Int_t motherType, Int_t grannyType, Int_t dauOneId, Int_t dauTwoId, Int_t dauThreeId, Int_t dauFourId, Int_t indexInList) : TLorentzVector(momentum), vertex_(vertex), type_(type), charge_(charge), status_(status), nDau_(nDau), motherType_(motherType), grannyType_(grannyType), dauOneId_(dauOneId), dauTwoId_(dauTwoId), dauThreeId_(dauThreeId), dauFourId_(dauFourId), indexInList_(indexInList) {;}
28 mlethuil 1.1 ~TRootParticle() {;}
29    
30     Double_t vx() const { return vertex_.x(); }
31     Double_t vy() const { return vertex_.y(); }
32     Double_t vz() const { return vertex_.z(); }
33     Int_t type() const { return type_; }
34     Float_t charge() const { return charge_; }
35 lethuill 1.5 Int_t status() const {return status_; }
36     Int_t nDau() const {return nDau_; }
37     Int_t motherType() const {return motherType_; }
38     Int_t grannyType() const {return grannyType_; }
39     Int_t dauOneId() const {return dauOneId_;}
40     Int_t dauTwoId() const {return dauTwoId_;}
41     Int_t dauThreeId() const {return dauThreeId_;}
42     Int_t dauFourId() const {return dauFourId_;}
43     Int_t indexInList() const {return indexInList_; }
44 mlethuil 1.1
45 lethuill 1.4 // FIXME setVx, setVy and setVz must modify the TLorentzVector ?
46 mlethuil 1.1 void setVx(Double_t vx) { vertex_.SetX(vx); }
47     void setVy(Double_t vy) { vertex_.SetY(vy); }
48     void setVz(Double_t vz) { vertex_.SetZ(vz); }
49     void setType(Int_t type) { type_ = type; }
50     void setCharge(Int_t charge) { charge_ = charge; }
51 lethuill 1.5 void setStatus(Int_t status) { status_ = status; }
52     void setnDau(Int_t nDau) { nDau_ = nDau; }
53     void setMotherType(Int_t motherType) { motherType_ = motherType; }
54     void setGrannyType(Int_t grannyType) { grannyType_ = grannyType; }
55     void setIndexInList(Int_t indexInList) {indexInList_ = indexInList; }
56 mlethuil 1.1
57     friend std::ostream& operator<< (std::ostream& stream, const TRootParticle& part) {
58 lethuill 1.5 stream << "Type=" << part.type_ << " Charge=" << part.charge_ << " Status=" << part.status_ << " number of daughters=" <<
59     part.nDau_ << " mother ID=" << part.motherType_ << " granny ID=" << part.grannyType_ << " index in the MC list=" << part.indexInList_ << " (Et,eta,phi)=("<< part.Et() <<","<< part.Eta() <<","<< part.Phi() << ")"
60 mlethuil 1.1 << " vertex(x,y,z)=("<< part.vx() <<","<< part.vy() <<","<< part.vz() << ")";
61     return stream;
62 lethuill 1.5 };
63 mlethuil 1.1
64    
65     protected:
66    
67     TVector3 vertex_;
68     Int_t type_;
69     Float_t charge_;
70 lethuill 1.5 Int_t status_;
71     Int_t nDau_;
72     Int_t motherType_;
73     Int_t grannyType_;
74     Int_t dauOneId_;
75     Int_t dauTwoId_;
76     Int_t dauThreeId_;
77     Int_t dauFourId_;
78     Int_t indexInList_;
79 mlethuil 1.1
80     ClassDef (TRootParticle,1);
81     };
82    
83     #endif
84 lethuill 1.5
85