VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex01Particle Class Reference

Extended TParticle with pointers to mother and daughter particles. More...

#include <Ex01Particle.h>

Inheritance diagram for Ex01Particle:

Public Member Functions

 Ex01Particle (Int_t id, TParticle *particle)
 
 Ex01Particle (Int_t id, TParticle *particle, Ex01Particle *mother)
 
 Ex01Particle ()
 
virtual ~Ex01Particle ()
 
void SetMother (Ex01Particle *particle)
 
void AddDaughter (Ex01Particle *particle)
 
Int_t GetID () const
 
TParticle * GetParticle () const
 
Ex01ParticleGetMother () const
 
Int_t GetNofDaughters () const
 
Ex01ParticleGetDaughter (Int_t i) const
 

Private Attributes

Int_t fID
 The particle Id.
 
TParticle * fParticle
 The particle definition.
 
Ex01ParticlefMother
 The particle mother.
 
TObjArray * fDaughters
 The particle daughters.
 

Detailed Description

Extended TParticle with pointers to mother and daughter particles.

Date
05/04/2002
Author
I. Hrivnacova; IPN, Orsay

Definition at line 31 of file Ex01Particle.h.

Constructor & Destructor Documentation

◆ Ex01Particle() [1/3]

Ex01Particle::Ex01Particle ( Int_t id,
TParticle * particle )

Standard constructor

Parameters
idThe particle id
particleThe particle definition (TParticle)

Definition at line 28 of file Ex01Particle.cxx.

29 : fID(id), fParticle(particle), fMother(0), fDaughters(0)
30{
31 /// Standard constructor
32 /// \param id The particle id
33 /// \param particle The particle definition (TParticle)
34}
TParticle * fParticle
The particle definition.
TObjArray * fDaughters
The particle daughters.
Ex01Particle * fMother
The particle mother.
Int_t fID
The particle Id.

◆ Ex01Particle() [2/3]

Ex01Particle::Ex01Particle ( Int_t id,
TParticle * particle,
Ex01Particle * mother )

Standard constructor

Parameters
idThe particle id
particleThe particle definition (TParticle)
motherThe particle mother

Definition at line 37 of file Ex01Particle.cxx.

38 : fID(id), fParticle(particle), fMother(mother), fDaughters(0)
39{
40 /// Standard constructor
41 /// \param id The particle id
42 /// \param particle The particle definition (TParticle)
43 /// \param mother The particle mother
44}

◆ Ex01Particle() [3/3]

Ex01Particle::Ex01Particle ( )

Default constructor

Definition at line 47 of file Ex01Particle.cxx.

47 : fID(0), fParticle(0), fMother(0), fDaughters(0)
48{
49 /// Default constructor
50}

◆ ~Ex01Particle()

Ex01Particle::~Ex01Particle ( )
virtual

Destructor

Definition at line 53 of file Ex01Particle.cxx.

54{
55 /// Destructor
56
57 if (fDaughters) delete fDaughters;
58}

Member Function Documentation

◆ SetMother()

void Ex01Particle::SetMother ( Ex01Particle * particle)

Set particle mother

Parameters
particleThe mother particle

Definition at line 76 of file Ex01Particle.cxx.

77{
78 /// Set particle mother
79 /// \param particle The mother particle
80
81 fMother = particle;
82}

◆ AddDaughter()

void Ex01Particle::AddDaughter ( Ex01Particle * particle)

Add particles daughter

Parameters
particleThe daughter particle

Definition at line 65 of file Ex01Particle.cxx.

66{
67 /// Add particles daughter
68 /// \param particle The daughter particle
69
70 if (!fDaughters) fDaughters = new TObjArray();
71
72 fDaughters->Add(particle);
73}

◆ GetID()

Int_t Ex01Particle::GetID ( ) const
Returns
The particle Id.

Definition at line 85 of file Ex01Particle.cxx.

86{
87 /// \return The particle Id.
88
89 return fID;
90}

◆ GetParticle()

TParticle * Ex01Particle::GetParticle ( ) const
Returns
The particle definition (TParticle).

Definition at line 93 of file Ex01Particle.cxx.

94{
95 /// \return The particle definition (TParticle).
96
97 return fParticle;
98}

◆ GetMother()

Ex01Particle * Ex01Particle::GetMother ( ) const
Returns
The particle mother.

Definition at line 101 of file Ex01Particle.cxx.

102{
103 /// \return The particle mother.
104
105 return fMother;
106}

◆ GetNofDaughters()

Int_t Ex01Particle::GetNofDaughters ( ) const
Returns
The number of daughters.

Definition at line 109 of file Ex01Particle.cxx.

110{
111 /// \return The number of daughters.
112
113 if (!fDaughters) return 0;
114
115 return fDaughters->GetEntriesFast();
116}

◆ GetDaughter()

Ex01Particle * Ex01Particle::GetDaughter ( Int_t i) const
Returns
i -th daughter
Parameters
iThe daughter index

Definition at line 119 of file Ex01Particle.cxx.

120{
121 /// \return \em i -th daughter
122 /// \param i The daughter index
123
124 // add test if i
125
126 return (Ex01Particle*)fDaughters->At(i);
127}
Extended TParticle with pointers to mother and daughter particles.

Member Data Documentation

◆ fID

Int_t Ex01Particle::fID
private

The particle Id.

Definition at line 52 of file Ex01Particle.h.

◆ fParticle

TParticle* Ex01Particle::fParticle
private

The particle definition.

Definition at line 53 of file Ex01Particle.h.

◆ fMother

Ex01Particle* Ex01Particle::fMother
private

The particle mother.

Definition at line 54 of file Ex01Particle.h.

◆ fDaughters

TObjArray* Ex01Particle::fDaughters
private

The particle daughters.

Definition at line 55 of file Ex01Particle.h.


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