ROOT logo
ROOT » MONTECARLO » EG » TParticle

class TParticle: public TObject, public TAttLine, public TAtt3D


 a dynamic particle class created by event generators and used during
 the propagation in detectors. The static attributes of a TParticle
 are described by TParticlePDG.

  Int_t          fPdgCode;              // PDG code of the particle
  Int_t          fStatusCode;           // generation status code
  Int_t          fMother[2];            // Indices of the mother particles
  Int_t          fDaughter[2];          // Indices of the daughter particles
  Float_t        fWeight;               // particle weight

  Double_t       fCalcMass;             // Calculated mass

  Double_t       fPx;                   // x component of momentum
  Double_t       fPy;                   // y component of momentum
  Double_t       fPz;                   // z component of momentum
  Double_t       fE;                    // Energy

  Double_t       fVx;                   // x of production vertex
  Double_t       fVy;                   // y of production vertex
  Double_t       fVz;                   // z of production vertex
  Double_t       fVt;                   // t of production vertex

  Double_t       fPolarTheta;           // Polar angle of polarisation
  Double_t       fPolarPhi;             // azymutal angle of polarisation

  TParticlePDG*  fParticlePDG;          //! reference to the particle record in PDG database

Function Members (Methods)

public:
TParticle()
TParticle(const TParticle& part)
TParticle(Int_t pdg, Int_t status, Int_t mother1, Int_t mother2, Int_t daughter1, Int_t daughter2, const TLorentzVector& p, const TLorentzVector& v)
TParticle(Int_t pdg, Int_t status, Int_t mother1, Int_t mother2, Int_t daughter1, Int_t daughter2, Double_t px, Double_t py, Double_t pz, Double_t etot, Double_t vx, Double_t vy, Double_t vz, Double_t time)
virtual~TParticle()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
Int_tBeauty() const
virtual voidTObject::Browse(TBrowser* b)
Int_tCharm() const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
Int_tTAttLine::DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
virtual Int_tDistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
Double_tEnergy() const
virtual voidTObject::Error(const char* method, const char* msgfmt) const
Double_tEta() const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Double_tGetCalcMass() const
Int_tGetDaughter(Int_t i) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Int_tGetFirstDaughter() const
Int_tGetFirstMother() const
virtual const char*TObject::GetIconName() const
Int_tGetLastDaughter() const
virtual Color_tTAttLine::GetLineColor() const
virtual Style_tTAttLine::GetLineStyle() const
virtual Width_tTAttLine::GetLineWidth() const
Double_tGetMass() const
Int_tGetMother(Int_t i) const
virtual const char*GetName() const
Int_tGetNDaughters() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TParticlePDG*GetPDG(Int_t mode = 0) const
Int_tGetPdgCode() const
voidGetPolarisation(TVector3& v) const
Int_tGetSecondMother() const
Int_tGetStatusCode() const
virtual const char*GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Float_tGetWeight() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tIsPrimary() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTAttLine::Modify()
voidMomentum(TLorentzVector& v) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TParticle&operator=(const TParticle&)
Double_tP() const
virtual voidPaint(Option_t* option = "")
Double_tPhi() const
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
voidProductionVertex(TLorentzVector& v) const
Double_tPt() const
Double_tPx() const
Double_tPy() const
Double_tPz() const
Double_tR() const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidTAttLine::ResetAttLine(Option_t* option = "")
voidTObject::ResetBit(UInt_t f)
Double_tRho() const
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTAttLine::SaveLineAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1, Int_t widdef = 1)
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetCalcMass(Double_t mass)
voidSetDaughter(int i, int code)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetFirstDaughter(int code)
voidSetFirstMother(int code)
voidSetLastDaughter(int code)
voidSetLastMother(int code)
virtual voidTAttLine::SetLineAttributes()MENU
virtual voidTAttLine::SetLineColor(Color_t lcolor)
virtual voidTAttLine::SetLineStyle(Style_t lstyle)
virtual voidTAttLine::SetLineWidth(Width_t lwidth)
voidSetMomentum(const TLorentzVector& p)
voidSetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
voidSetMother(int i, int code)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetPdgCode(Int_t pdg)
voidSetPolarisation(const TVector3& v)
voidSetPolarisation(Double_t polx, Double_t poly, Double_t polz)
voidSetProductionVertex(const TLorentzVector& v)
voidSetProductionVertex(Double_t vx, Double_t vy, Double_t vz, Double_t t)
voidSetStatusCode(int status)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetWeight(Float_t weight = 1)
virtual voidShowMembers(TMemberInspector& insp)
virtual voidSizeof3D() const
Int_tStrangeness() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Double_tT() const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
Double_tTheta() const
virtual voidTObject::UseCurrentStyle()
Double_tVx() const
Double_tVy() const
Double_tVz() const
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
Double_tY() const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

protected:
Double_tfCalcMassCalculated mass
Int_tfDaughter[2]Indices of the daughter particles
Double_tfEEnergy
Color_tTAttLine::fLineColorline color
Style_tTAttLine::fLineStyleline style
Width_tTAttLine::fLineWidthline width
Int_tfMother[2]Indices of the mother particles
TParticlePDG*fParticlePDG! reference to the particle record in PDG database
Int_tfPdgCodePDG code of the particle
Double_tfPolarPhiazymutal angle of polarisation
Double_tfPolarThetaPolar angle of polarisation
Double_tfPxx component of momentum
Double_tfPyy component of momentum
Double_tfPzz component of momentum
Int_tfStatusCodegeneration status code
Double_tfVtt of production vertex
Double_tfVxx of production vertex
Double_tfVyy of production vertex
Double_tfVzz of production vertex
Float_tfWeightparticle weight

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TParticle()
default constructor
TParticle(Int_t pdg, Int_t status, Int_t mother1, Int_t mother2, Int_t daughter1, Int_t daughter2, Double_t px, Double_t py, Double_t pz, Double_t etot, Double_t vx, Double_t vy, Double_t vz, Double_t time)
constructor
TParticle(Int_t pdg, Int_t status, Int_t mother1, Int_t mother2, Int_t daughter1, Int_t daughter2, const TLorentzVector& p, const TLorentzVector& v)
constructor
TParticle(const TParticle& part)
 copy constructor
TParticle& operator=(const TParticle& )
 Equal operator
~TParticle()
destructor
Double_t GetMass() const
 Return nominal particle mass from PDG table.
Int_t Beauty() const
 Return beauty quantum number.
Int_t Charm() const
 Return charm quantum number.
Int_t Strangeness() const
 Return strangeness quantum number.
Int_t DistancetoPrimitive(Int_t px, Int_t py)
-*-*-*-*Compute distance from point px,py to a primary track
*-*            ====================================================
-
*-*  Compute the closest distance of approach from point px,py to each segment
*-*  of a track.
*-*  The distance is computed in pixels units.
-
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
-*-*-*-*-*-*-*Execute action corresponding to one event
*-*                  =========================================
const char* GetName() const
return particle name
TParticlePDG* GetPDG(Int_t mode = 0) const
 returns a pointer to the TParticlePDG object using the pdgcode
 if mode == 0 (default) always get a fresh value for the pointer.
 if mode != 0 this function returns directly the previously
              computed pointer from a previous call
 One can use mode=1 (faster) when the TParticle object is not part of a
 TClonesArray used in split mode in a Root TTree.
void GetPolarisation(TVector3& v) const
return particle polarisation
const char * GetTitle() const
return particle title
void Paint(Option_t* option = "")
  Paint a primary track

void Print(Option_t* option = "") const
  Print the internals of the primary vertex particle

TParticlePDG* pdg = ((TParticle*)this)->GetPDG();
void SetPdgCode(Int_t pdg)
change the PDG code for this particle
Get a new pointer to a TParticlePDG from TDatabasePDG
Recompute the mass
void SetPolarisation(Double_t polx, Double_t poly, Double_t polz)
set particle polarisation
void Sizeof3D() const
Return total X3D size of this primary*-
*-*        =====================================
void Streamer(TBuffer& b)
 Stream an object of class TParticle.
Int_t GetStatusCode() const
   virtual TString* Name   () const { return fName.Data(); }
   virtual char*  GetName()   const { return fName.Data(); }
{ return fStatusCode; }
Int_t GetPdgCode() const
{ return fPdgCode; }
Int_t GetFirstMother() const
{ return fMother[0]; }
Int_t GetMother(Int_t i) const
{ return fMother[i]; }
Int_t GetSecondMother() const
{ return fMother[1]; }
Bool_t IsPrimary() const
{ return fMother[0]>-1 ? kFALSE : kTRUE; }
Int_t GetFirstDaughter() const
{ return fDaughter[0]; }
Int_t GetDaughter(Int_t i) const
{ return fDaughter[i]; }
Int_t GetLastDaughter() const
{ return fDaughter[1]; }
Double_t GetCalcMass() const
{ return fCalcMass; }
Int_t GetNDaughters() const
{ return fDaughter[1]>0 ? fDaughter[1]-fDaughter[0]+1 : 0;}
Float_t GetWeight() const
{ return fWeight; }
void Momentum(TLorentzVector& v) const
{ v.SetPxPyPzE(fPx,fPy,fPz,fE); }
void ProductionVertex(TLorentzVector& v) const
{ v.SetXYZT(fVx,fVy,fVz,fVt); }
Double_t Vx() const
 ****** redefine several most oftenly used methods of LORENTZ_VECTOR
{ return fVx; }
Double_t Vy() const
{ return fVy; }
Double_t Vz() const
{ return fVz; }
Double_t T() const
{ return fVt; }
Double_t R() const
{ return TMath::Sqrt(fVx*fVx+fVy*fVy); }
Double_t Rho() const
{ return TMath::Sqrt(fVx*fVx+fVy*fVy+fVz*fVz); }
Double_t Px() const
{ return fPx; }
Double_t Py() const
{ return fPy; }
Double_t Pz() const
{ return fPz; }
Double_t P() const
{ return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz); }
Double_t Pt() const
{ return TMath::Sqrt(fPx*fPx+fPy*fPy); }
Double_t Energy() const
{ return fE; }
Double_t Eta() const
Double_t Y() const
Double_t Phi() const
{ return TMath::Pi()+TMath::ATan2(-fPy,-fPx); }
Double_t Theta() const
{ return (fPz==0)?TMath::PiOver2():TMath::ACos(fPz/P()); }
void SetFirstMother(int code)
 setters
{ fMother[0] = code ; }
void SetMother(int i, int code)
{ fMother[i] = code ; }
void SetLastMother(int code)
{ fMother[1] = code ; }
void SetFirstDaughter(int code)
{ fDaughter[0] = code ; }
void SetDaughter(int i, int code)
{ fDaughter[i] = code ; }
void SetLastDaughter(int code)
{ fDaughter[1] = code ; }
void SetCalcMass(Double_t mass)
{ fCalcMass=mass;}
void SetPolarisation(Double_t polx, Double_t poly, Double_t polz)
void SetStatusCode(int status)
{fStatusCode = status;}
void SetWeight(Float_t weight = 1)
{fWeight = weight; }
void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
{fPx=px; fPy=py; fPz=pz; fE=e;}
void SetMomentum(const TLorentzVector& p)
{SetMomentum(p.Px(),p.Py(),p.Pz(),p.Energy());}
void SetProductionVertex(Double_t vx, Double_t vy, Double_t vz, Double_t t)
{fVx=vx; fVy=vy; fVz=vz; fVt=t;}
void SetProductionVertex(const TLorentzVector& v)
{SetProductionVertex(v.X(),v.Y(),v.Z(),v.T());}