Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ITReactionChange Class Reference

#include <G4ITReactionChange.hh>

Public Member Functions

 G4ITReactionChange ()
 
virtual ~G4ITReactionChange ()
 
void Initialize (const G4Track &, const G4Track &, G4VParticleChange *particleChangeA=0, G4VParticleChange *particleChangeB=0)
 
void AddSecondary (G4Track *aSecondary)
 
void KillParents (G4bool)
 
G4VParticleChangeGetParticleChange (const G4Track *)
 
void UpdateStepInfo (G4Step *, G4Step *)
 
G4TrackGetSecondary (G4int) const
 
std::vector< G4Track * > * GetfSecondary ()
 
G4int GetNumberOfSecondaries () const
 
G4bool WereParentsKilled () const
 
const G4TrackGetTrackA ()
 
const G4TrackGetTrackB ()
 

Protected Member Functions

 G4ITReactionChange (const G4ITReactionChange &other)
 
G4ITReactionChangeoperator= (const G4ITReactionChange &other)
 
G4bool operator== (const G4ITReactionChange &right) const
 
G4bool operator!= (const G4ITReactionChange &right) const
 

Protected Attributes

std::map< const G4Track
*, G4VParticleChange * > 
fParticleChange
 
std::vector< G4Track * > * fSecondaries
 
G4int fNumberOfSecondaries
 
G4bool fKillParents
 
G4bool fParticleChangeIsSet
 

Detailed Description

Similar to G4ParticleChange, but deal with two tracks rather than one.

Definition at line 59 of file G4ITReactionChange.hh.

Constructor & Destructor Documentation

G4ITReactionChange::G4ITReactionChange ( )

Default constructor

Definition at line 38 of file G4ITReactionChange.cc.

38  :
39  fSecondaries(0),
41  fKillParents(false),
43 {
44  //ctor
45 }
std::vector< G4Track * > * fSecondaries
G4ITReactionChange::~G4ITReactionChange ( )
virtual

Default destructor

Definition at line 47 of file G4ITReactionChange.cc.

48 {
49  //dtor
50  delete fSecondaries;
51  fSecondaries = 0;
52 }
std::vector< G4Track * > * fSecondaries
G4ITReactionChange::G4ITReactionChange ( const G4ITReactionChange other)
protected

Copy constructor

Parameters
otherObject to copy from

Definition at line 55 of file G4ITReactionChange.cc.

55  :
56  fSecondaries(0),
58  fKillParents(false),
60 {
61  //copy ctor
62 }
std::vector< G4Track * > * fSecondaries

Member Function Documentation

void G4ITReactionChange::AddSecondary ( G4Track aSecondary)

Definition at line 109 of file G4ITReactionChange.cc.

110 {
111  if (fSecondaries == 0) fSecondaries = new std::vector<G4Track*>();
112  fSecondaries->push_back(aTrack);
114 }
std::vector< G4Track * > * fSecondaries

Here is the caller graph for this function:

std::vector< G4Track * > * G4ITReactionChange::GetfSecondary ( )
inline

Definition at line 139 of file G4ITReactionChange.hh.

140 {
141  return fSecondaries;
142 }
std::vector< G4Track * > * fSecondaries

Here is the caller graph for this function:

G4int G4ITReactionChange::GetNumberOfSecondaries ( ) const
inline

Definition at line 124 of file G4ITReactionChange.hh.

125 {
126  return fNumberOfSecondaries;
127 }

Here is the caller graph for this function:

G4VParticleChange * G4ITReactionChange::GetParticleChange ( const G4Track track)

Definition at line 122 of file G4ITReactionChange.cc.

123 {
124  std::map<const G4Track*, G4VParticleChange*>::iterator it = fParticleChange
125  .find(track);
126 
127  if (it == fParticleChange.end()) return 0;
128  else return it->second;
129 }
std::map< const G4Track *, G4VParticleChange * > fParticleChange
G4Track * G4ITReactionChange::GetSecondary ( G4int  anIndex) const
inline

Definition at line 118 of file G4ITReactionChange.hh.

119 {
120  if (fSecondaries) return (*fSecondaries)[anIndex];
121  else return 0;
122 }
std::vector< G4Track * > * fSecondaries
const G4Track * G4ITReactionChange::GetTrackA ( )

Definition at line 131 of file G4ITReactionChange.cc.

132 {
133  std::map<const G4Track*, G4VParticleChange*>::iterator it = fParticleChange
134  .begin();
135  if (it != fParticleChange.end())
136  {
137  return it->first;
138  }
139 
140  G4ExceptionDescription exceptionDescription;
141  exceptionDescription
142  << "No track A found ! Have you initialized the ReactionChange ?";
143  G4Exception("G4ITReactionChange::GetTrackA", "ITReactionChange001",
144  FatalErrorInArgument, exceptionDescription);
145  return 0;
146 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::map< const G4Track *, G4VParticleChange * > fParticleChange

Here is the call graph for this function:

Here is the caller graph for this function:

const G4Track * G4ITReactionChange::GetTrackB ( )

Definition at line 148 of file G4ITReactionChange.cc.

149 {
150  std::map<const G4Track*, G4VParticleChange*>::iterator it = fParticleChange
151  .begin();
152  std::map<const G4Track*, G4VParticleChange*>::iterator next = it++;
153  if (next == fParticleChange.end())
154  {
155  G4ExceptionDescription exceptionDescription;
156  exceptionDescription
157  << "No track B found ! Have you initialized the ReactionChange ?";
158  G4Exception("G4ITReactionChange::GetTrackB", "ITReactionChange002",
159  FatalErrorInArgument, exceptionDescription);
160  }
161 
162  return it->first;
163 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::map< const G4Track *, G4VParticleChange * > fParticleChange

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ITReactionChange::Initialize ( const G4Track trackA,
const G4Track trackB,
G4VParticleChange particleChangeA = 0,
G4VParticleChange particleChangeB = 0 
)

Definition at line 72 of file G4ITReactionChange.cc.

76 {
77  fParticleChange.clear();
78  fParticleChange[&trackA] = particleChangeA;
79  fParticleChange[&trackB] = particleChangeB;
80 
81  if (particleChangeA || particleChangeB)
82  {
83  G4bool test = particleChangeA && particleChangeB;
84 
85  if (test == false)
86  {
87  G4ExceptionDescription exceptionDescription;
88  exceptionDescription << "If you give for one track a particleChange, ";
89  exceptionDescription
90  << "G4ITReactionChange is expecting that you give for both ";
91  exceptionDescription << "reacting tracks a particleChange.";
92  G4Exception("G4ITReactionChange::Initialize", "ITReactionChange001",
93  FatalErrorInArgument, exceptionDescription);
94  }
95 
96  fParticleChangeIsSet = true;
97 
98  fParticleChange[&trackA]->Initialize(trackA);
99  fParticleChange[&trackB]->Initialize(trackB);
100  ;
101 
102  }
103 
104  fSecondaries = 0;
106  fKillParents = false;
107 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
std::vector< G4Track * > * fSecondaries
bool G4bool
Definition: G4Types.hh:79
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::map< const G4Track *, G4VParticleChange * > fParticleChange

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ITReactionChange::KillParents ( G4bool  kill)
inline

Definition at line 129 of file G4ITReactionChange.hh.

130 {
131  fKillParents = kill;
132 }

Here is the caller graph for this function:

G4bool G4ITReactionChange::operator!= ( const G4ITReactionChange right) const
protected
G4ITReactionChange & G4ITReactionChange::operator= ( const G4ITReactionChange other)
protected

Assignment operator

Parameters
otherObject to assign from
Returns
A reference to this

Definition at line 65 of file G4ITReactionChange.cc.

66 {
67  if (this == &rhs) return *this; // handle self assignment
68  //assignment operator
69  return *this;
70 }
G4bool G4ITReactionChange::operator== ( const G4ITReactionChange right) const
protected
void G4ITReactionChange::UpdateStepInfo ( G4Step stepA,
G4Step stepB 
)

Definition at line 116 of file G4ITReactionChange.cc.

117 {
118  fParticleChange[stepA->GetTrack()]->UpdateStepForPostStep(stepA);
119  fParticleChange[stepB->GetTrack()]->UpdateStepForPostStep(stepB);
120 }
std::map< const G4Track *, G4VParticleChange * > fParticleChange
G4Track * GetTrack() const

Here is the call graph for this function:

G4bool G4ITReactionChange::WereParentsKilled ( ) const
inline

Definition at line 134 of file G4ITReactionChange.hh.

135 {
136  return fKillParents;
137 }

Here is the caller graph for this function:

Member Data Documentation

G4bool G4ITReactionChange::fKillParents
protected

Definition at line 114 of file G4ITReactionChange.hh.

G4int G4ITReactionChange::fNumberOfSecondaries
protected

Definition at line 113 of file G4ITReactionChange.hh.

std::map<const G4Track*, G4VParticleChange*> G4ITReactionChange::fParticleChange
protected

Definition at line 111 of file G4ITReactionChange.hh.

G4bool G4ITReactionChange::fParticleChangeIsSet
protected

Definition at line 115 of file G4ITReactionChange.hh.

std::vector<G4Track*>* G4ITReactionChange::fSecondaries
protected

Definition at line 112 of file G4ITReactionChange.hh.


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