eic-smear  1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
erhic::ParticleMC Class Reference

#include <ParticleMC.h>

Inheritance diagram for erhic::ParticleMC:
erhic::VirtualParticle

Public Member Functions

 ParticleMC (const std::string &="")
 
virtual ~ParticleMC ()
 
virtual void Print (Option_t *="") const
 
virtual UInt_t GetIndex () const
 
virtual UShort_t GetStatus () const
 
virtual UShort_t GetParentIndex () const
 
virtual const ParticleMCGetParent () const
 
virtual UShort_t GetChild1Index () const
 
virtual UShort_t GetChildNIndex () const
 
virtual UInt_t GetNChildren () const
 
virtual const ParticleMCGetChild (UShort_t) const
 
virtual Bool_t HasChild (Int_t) const
 
virtual Double_t GetPx () const
 
virtual Double_t GetPy () const
 
virtual Double_t GetPz () const
 
virtual Double_t GetM () const
 
virtual Double_t GetPt () const
 
virtual TVector3 GetVertex () const
 
virtual Pid GetParentId () const
 
virtual Double_t GetP () const
 
virtual Double_t GetTheta () const
 
virtual Double_t GetPhi () const
 
virtual Double_t GetRapidity () const
 
virtual Double_t GetEta () const
 
virtual Double_t GetZ () const
 
virtual Double_t GetXFeynman () const
 
virtual Double_t GetThetaVsGamma () const
 
virtual Double_t GetPtVsGamma () const
 
const EventMCGetEvent () const
 
void SetEvent (EventMC *event)
 
virtual TLorentzVector Get4Vector () const
 
virtual TLorentzVector PxPyPzE () const
 
virtual TLorentzVector Get4VectorInHadronBosonFrame () const
 
virtual Double_t GetE () const
 
virtual void SetE (Double_t)
 
virtual void SetM (Double_t)
 
virtual void SetP (Double_t)
 
virtual void SetPt (Double_t)
 
virtual void SetPz (Double_t)
 
virtual void SetPhi (Double_t)
 
virtual void SetTheta (Double_t)
 
virtual void SetStatus (UShort_t)
 
virtual Pid Id () const
 
virtual Pid GetPdgCode () const
 
virtual void ComputeDerivedQuantities ()
 
virtual void ComputeEventDependentQuantities (EventMC &)
 
virtual void SetIndex (int i)
 
virtual void SetStatus (int i)
 
virtual void SetId (int i)
 
virtual void SetParentIndex (int i)
 
virtual void SetChild1Index (int i)
 
virtual void SetChildNIndex (int i)
 
virtual void Set4Vector (const TLorentzVector &)
 
virtual void SetVertex (const TVector3 &)
 
virtual void SetParentId (int i)
 
- Public Member Functions inherited from erhic::VirtualParticle
virtual ~VirtualParticle ()
 

Public Attributes

UShort_t I
 Particle index in event.
 
UShort_t KS
 Particle status code: see PYTHIA manual.
 
Int_t id
 PDG particle code.
 
UShort_t orig
 I of parent particle.
 
UShort_t daughter
 I of first child particle.
 
UShort_t ldaughter
 I of last child particle.
 
Double32_t px
 x component of particle momentum
 
Double32_t py
 y component of particle momentum
 
Double32_t pz
 z component of particle momentum
 
Double32_t E
 Energy of particle.
 
Double32_t m
 Invariant mass of particle.
 
Double32_t pt
 Transverse momentum of particle.
 
Double32_t xv
 x coordinate of particle production vertex
 
Double32_t yv
 y coordinate of particle production vertex
 
Double32_t zv
 z coordinate of particle production vertex
 
Int_t parentId
 PDG code of this particle's parent.
 
Double32_t p
 Total momentum of particle.
 
Double32_t theta
 Polar angle.
 
Double32_t phi
 Azimuthal angle.
 
Double32_t rapidity
 Rapidity of particle.
 
Double32_t eta
 Pseudorapidity of particle.
 
Double32_t z
 
Double32_t xFeynman
 Feynman x = pz/(2sqrt(s))
 
Double32_t thetaGamma
 
Double32_t ptVsGamma
 
Double32_t phiPrf
 
TRef event
 

Detailed Description

A particle produced by a Monte Carlo generator.

Definition at line 28 of file ParticleMC.h.

Constructor & Destructor Documentation

erhic::ParticleMC::ParticleMC ( const std::string &  line = "")
explicit

Default constructor. Optionally pass a string with particle information in a HEPEVT format, namely: "index status id parent firstChild lastChild px py pz E m xv yv zv"

Definition at line 55 of file ParticleMC.cxx.

erhic::ParticleMC::~ParticleMC ( )
virtual

Destructor

Definition at line 100 of file ParticleMC.cxx.

Member Function Documentation

void erhic::ParticleMC::ComputeDerivedQuantities ( )
virtual

Sets quantities derived from the four-momentum (E, px, py, pz), namely

  • total momentum
  • transverse momentum
  • rapidity
  • pseudorapidity
  • theta
  • phi

This should be called if (E, px, py, pz) are manually altered in order to propagate the changes to these other quantities.

Definition at line 110 of file ParticleMC.cxx.

void erhic::ParticleMC::ComputeEventDependentQuantities ( EventMC event)
virtual

Sets quantities that depend on the properties of the event or associations of one particle with another, namely

  • z
  • Feynman x
  • angle and pt with respect to the exchanged boson
  • azimuthal angle around the exchanged boson
  • parent pdg code

Important: this particle is assumed to be in the same frame of reference as those contained in the event that is passed as an argument.

Definition at line 132 of file ParticleMC.cxx.

TLorentzVector erhic::ParticleMC::Get4Vector ( ) const
virtual

Returns the (E,p) 4-vector in the lab frame.

Implements erhic::VirtualParticle.

Definition at line 176 of file ParticleMC.cxx.

TLorentzVector erhic::ParticleMC::Get4VectorInHadronBosonFrame ( ) const
virtual

Returns the (E,p) 4-vector in the hadron-boson frame. This frame is defined such that

  • the beam hadron is at rest
  • the z direction is the exchange boson momentum vector
  • the y direction is defined as q x e, where q is the boson and e is the scattered lepton momentum
  • x is defined to complete the right-handed coordinate system
Note
Due to details of the implementation and how ROOT handles reading events in a TTree, this function will not work for the exchange boson when using a TTree::Draw (or similar) statement. It does work for the exchange boson if reading events manually via TTree::GetEntry.

Definition at line 229 of file ParticleMC.cxx.

const ParticleMC * erhic::ParticleMC::GetChild ( UShort_t  u) const
virtual

Returns a pointer to the nth child particle of this particle, where n is in the range [0, GetNChildren()). GetChild(0) returns the child whose index in this particle's event is GetChild1Index(). GetChild(GetNChildren()-1) returns the child whose index is GetChildNIndex(). Returns NULL if there is no such child particle or it cannot be accessed via the event for some reason (see GetEvent()).

Definition at line 184 of file ParticleMC.cxx.

UShort_t erhic::ParticleMC::GetChild1Index ( ) const
inlinevirtual

Returns the index of this particle's first child particle. Returns 0 if this particle has no children.

Definition at line 424 of file ParticleMC.h.

UShort_t erhic::ParticleMC::GetChildNIndex ( ) const
inlinevirtual

Returns the index of this particle's last child particle. Returns 0 if this particle has zero or one children.

Definition at line 428 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetE ( ) const
inlinevirtual

Returns the energy of the particle in the lab frame.

Implements erhic::VirtualParticle.

Definition at line 506 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetEta ( ) const
inlinevirtual

Returns the pseudorapidity.

Implements erhic::VirtualParticle.

Definition at line 476 of file ParticleMC.h.

const EventMC * erhic::ParticleMC::GetEvent ( ) const

Returns a pointer to the event containing this particle. Returns NULL if this particle has not been associated with an event.

Definition at line 180 of file ParticleMC.cxx.

UInt_t erhic::ParticleMC::GetIndex ( ) const
inlinevirtual

Returns the particle index in an event, in the range [1, N].

Definition at line 412 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetM ( ) const
inlinevirtual

Returns invariant mass (GeV/c2).

Implements erhic::VirtualParticle.

Definition at line 444 of file ParticleMC.h.

UInt_t erhic::ParticleMC::GetNChildren ( ) const
inlinevirtual

Returns the number of children of this particle. Returns 0 if the particle did not decay.

Definition at line 500 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetP ( ) const
inlinevirtual

Returns the total momentum (GeV).

Implements erhic::VirtualParticle.

Definition at line 460 of file ParticleMC.h.

const ParticleMC * erhic::ParticleMC::GetParent ( ) const
virtual

Returns a pointer to the parent of this particle. This is the particle with index GetParentIndex() in the event containing this particle (obtainable via GetEvent()). Returns NULL if this particle has no parent or if it cannot be accessed via GetEvent().

Definition at line 205 of file ParticleMC.cxx.

erhic::Pid erhic::ParticleMC::GetParentId ( ) const
inlinevirtual

Returns the identity information of this particle's parent.

Definition at line 456 of file ParticleMC.h.

UShort_t erhic::ParticleMC::GetParentIndex ( ) const
inlinevirtual

Returns the index of this particle's parent in an event.

Implements erhic::VirtualParticle.

Definition at line 420 of file ParticleMC.h.

virtual Pid erhic::ParticleMC::GetPdgCode ( ) const
inlinevirtual

Returns the ID of the particle.

Definition at line 272 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetPhi ( ) const
inlinevirtual

Returns the polar angle in the range [0, 2pi] radians.

Implements erhic::VirtualParticle.

Definition at line 468 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetPt ( ) const
inlinevirtual

Returns momentum transverse to the beam direction.

Implements erhic::VirtualParticle.

Definition at line 448 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetPtVsGamma ( ) const
inlinevirtual

Returns the pT with respect to the exchange boson. Defined in the beam hadron's rest frame.

Definition at line 492 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetPx ( ) const
inlinevirtual

Returns the x component of 3-momentum.

Implements erhic::VirtualParticle.

Definition at line 432 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetPy ( ) const
inlinevirtual

Returns the y component of 3-momentum.

Implements erhic::VirtualParticle.

Definition at line 436 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetPz ( ) const
inlinevirtual

Returns the z component of 3-momentum.

Implements erhic::VirtualParticle.

Definition at line 440 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetRapidity ( ) const
inlinevirtual

Returns the rapidity.

Implements erhic::VirtualParticle.

Definition at line 472 of file ParticleMC.h.

UShort_t erhic::ParticleMC::GetStatus ( ) const
inlinevirtual

Returns the status of the particle. The meaning of the status code depends on the generator. For PYTHIA, see the description of variable K(I,1) in the manual.

Implements erhic::VirtualParticle.

Definition at line 416 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetTheta ( ) const
inlinevirtual

Returns the polar angle in the range [0, pi] radians.

Implements erhic::VirtualParticle.

Definition at line 464 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetThetaVsGamma ( ) const
inlinevirtual

Returns the angle with respect to the exchange boson. Defined in the beam hadron's rest frame. Given in the range [0,pi] radians.

Definition at line 488 of file ParticleMC.h.

TVector3 erhic::ParticleMC::GetVertex ( ) const
inlinevirtual

Returns the origin point of the particle (cm). (0,0,0) indicates a particle originating in the collision.

Implements erhic::VirtualParticle.

Definition at line 452 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetXFeynman ( ) const
inlinevirtual

Returns Feynman-x. xF = 2*pz/sqrt(s).

Definition at line 484 of file ParticleMC.h.

Double_t erhic::ParticleMC::GetZ ( ) const
inlinevirtual

Returns the variable z. z = (P.p_h)/(P.q).

Definition at line 480 of file ParticleMC.h.

Bool_t erhic::ParticleMC::HasChild ( Int_t  pdg) const
virtual

Returns true if n in the range [0, N), where N is the number of children of this particle. Returns false otherwise. Equivalent to GetChild(n) != NULL.

Definition at line 217 of file ParticleMC.cxx.

Pid erhic::ParticleMC::Id ( ) const
inlinevirtual

Returns the ID of the particle.

Implements erhic::VirtualParticle.

Definition at line 496 of file ParticleMC.h.

void erhic::ParticleMC::Print ( Option_t *  = "") const
virtual

Print the contents of Particle to standard output. The format is that of the input Monte Carlo i.e. I KS id orig daughter ldaughter px py pz E m xv yv zv. Inherited from TObject. The argument is unused.

Definition at line 103 of file ParticleMC.cxx.

virtual TLorentzVector erhic::ParticleMC::PxPyPzE ( ) const
inlinevirtual

Returns the (E,p) 4-vector in the lab frame.

Definition at line 222 of file ParticleMC.h.

void erhic::ParticleMC::Set4Vector ( const TLorentzVector &  v)
virtual

Sets the four-momentum of the particle. Changes are propagated to derived quantities.

Implements erhic::VirtualParticle.

Definition at line 284 of file ParticleMC.cxx.

virtual void erhic::ParticleMC::SetChild1Index ( int  i)
inlinevirtual

Sets the index of this particle's first child. By default this is zero, indicating no children.

Definition at line 327 of file ParticleMC.h.

virtual void erhic::ParticleMC::SetChildNIndex ( int  i)
inlinevirtual

Sets the index of this particle's last child. By default this is zero, indication zero or one children.

Definition at line 331 of file ParticleMC.h.

void erhic::ParticleMC::SetEvent ( EventMC event)

Set the event with which to associate this particle.

Definition at line 280 of file ParticleMC.cxx.

virtual void erhic::ParticleMC::SetId ( int  i)
inlinevirtual

Sets the ID of the particle. In order to make use of class Pid this should be the PDG code of the particle, but in principle can be any value you wish to use to identify it.

Definition at line 319 of file ParticleMC.h.

virtual void erhic::ParticleMC::SetIndex ( int  i)
inlinevirtual

Sets the index of the particle i.e. its position in the track list (in principle this can be any integer you require to associated with the particle).

Definition at line 310 of file ParticleMC.h.

virtual void erhic::ParticleMC::SetParentId ( int  i)
inlinevirtual

Sets the ID of this particle's parent. See comments in SetId()

Definition at line 347 of file ParticleMC.h.

virtual void erhic::ParticleMC::SetParentIndex ( int  i)
inlinevirtual

Sets the index of this particle's parent if it has one. By default this is zero, indicating no parent.

Definition at line 323 of file ParticleMC.h.

virtual void erhic::ParticleMC::SetStatus ( int  i)
inlinevirtual

Sets the status code of the particle (generally final state particles are given status == 1

Definition at line 314 of file ParticleMC.h.

void erhic::ParticleMC::SetVertex ( const TVector3 &  v)
virtual

Sets the origin coordinates

Implements erhic::VirtualParticle.

Definition at line 299 of file ParticleMC.cxx.

Member Data Documentation

TRef erhic::ParticleMC::event

Persistent reference to the event containing this particle.

Definition at line 406 of file ParticleMC.h.

Double32_t erhic::ParticleMC::phiPrf

Azimuthal angle around virtual photon in hadron beam rest frame

Definition at line 403 of file ParticleMC.h.

Double32_t erhic::ParticleMC::ptVsGamma

pt w.r.t. the virtual photon in the hadron beam rest frame

Definition at line 401 of file ParticleMC.h.

Double32_t erhic::ParticleMC::thetaGamma

Angle between particle and the exchange boson in the hadron beam rest frame

Definition at line 399 of file ParticleMC.h.

Double32_t erhic::ParticleMC::z

Fraction of virtual photon energy carried by particle

Definition at line 396 of file ParticleMC.h.


The documentation for this class was generated from the following files: