#include <G4ITReactionChange.hh>
Definition at line 50 of file G4ITReactionChange.hh.
G4ITReactionChange::G4ITReactionChange | ( | ) |
Default constructor
Definition at line 38 of file G4ITReactionChange.cc.
00038 : 00039 fSecondaries(0), 00040 fNumberOfSecondaries(0), 00041 fKillParents(false), 00042 fParticleChangeIsSet(false) 00043 { 00044 //ctor 00045 }
G4ITReactionChange::~G4ITReactionChange | ( | ) | [virtual] |
Default destructor
Definition at line 47 of file G4ITReactionChange.cc.
References fSecondaries.
00048 { 00049 //dtor 00050 delete fSecondaries; 00051 fSecondaries = 0 ; 00052 }
G4ITReactionChange::G4ITReactionChange | ( | const G4ITReactionChange & | other | ) | [protected] |
Copy constructor
other | Object to copy from |
Definition at line 55 of file G4ITReactionChange.cc.
00055 : 00056 fSecondaries(0), 00057 fNumberOfSecondaries(0), 00058 fKillParents(false), 00059 fParticleChangeIsSet(false) 00060 { 00061 //copy ctor 00062 }
void G4ITReactionChange::AddSecondary | ( | G4Track * | aSecondary | ) |
Definition at line 108 of file G4ITReactionChange.cc.
References fNumberOfSecondaries, fSecondaries, G4cerr, G4endl, G4TrackFastVectorSize, and G4FastVector< Type, N >::SetElement().
Referenced by G4DNAMolecularReaction::MakeReaction().
00109 { 00110 if(fSecondaries==0) fSecondaries = new G4TrackFastVector(); 00111 00112 // add a secondary after size check 00113 if (G4TrackFastVectorSize > fNumberOfSecondaries) 00114 { 00115 fSecondaries->SetElement(fNumberOfSecondaries, aTrack); 00116 fNumberOfSecondaries++; 00117 } 00118 else 00119 { 00120 G4cerr << "G4ITReactionChange::AddSecondary() Warning "; 00121 G4cerr << "fSecondaries is full !! " << G4endl; 00122 G4cerr << " The object will not be added in fSecondaries" << G4endl; 00123 } 00124 }
G4TrackFastVector * G4ITReactionChange::GetfSecondary | ( | ) | [inline] |
Definition at line 130 of file G4ITReactionChange.hh.
References fSecondaries.
00131 { 00132 return fSecondaries; 00133 }
G4int G4ITReactionChange::GetNumberOfSecondaries | ( | ) | const [inline] |
Definition at line 115 of file G4ITReactionChange.hh.
References fNumberOfSecondaries.
00116 { 00117 return fNumberOfSecondaries; 00118 }
G4VParticleChange * G4ITReactionChange::GetParticleChange | ( | const G4Track * | ) |
Definition at line 132 of file G4ITReactionChange.cc.
References fParticleChange.
00133 { 00134 std::map<const G4Track*, G4VParticleChange*>::iterator it = fParticleChange.find(track); 00135 00136 if(it == fParticleChange.end()) return 0; 00137 else return it ->second; 00138 }
Definition at line 110 of file G4ITReactionChange.hh.
References fSecondaries.
00111 { 00112 return (*fSecondaries)[anIndex]; 00113 }
const G4Track * G4ITReactionChange::GetTrackA | ( | ) |
Definition at line 140 of file G4ITReactionChange.cc.
References FatalErrorInArgument, fParticleChange, and G4Exception().
00141 { 00142 std::map<const G4Track*, G4VParticleChange*>::iterator it = fParticleChange.begin(); 00143 if(it != fParticleChange.end()) 00144 { 00145 return it->first; 00146 } 00147 00148 G4ExceptionDescription exceptionDescription ; 00149 exceptionDescription << "No track A found ! Have you initialized the ReactionChange ?"; 00150 G4Exception("G4ITReactionChange::GetTrackA","ITReactionChange001", 00151 FatalErrorInArgument,exceptionDescription); 00152 return 0; 00153 }
const G4Track * G4ITReactionChange::GetTrackB | ( | ) |
Definition at line 155 of file G4ITReactionChange.cc.
References FatalErrorInArgument, fParticleChange, and G4Exception().
00156 { 00157 std::map<const G4Track*, G4VParticleChange*>::iterator it = fParticleChange.begin(); 00158 std::map<const G4Track*, G4VParticleChange*>::iterator next = it++; 00159 if(next == fParticleChange.end()) 00160 { 00161 G4ExceptionDescription exceptionDescription ; 00162 exceptionDescription << "No track B found ! Have you initialized the ReactionChange ?"; 00163 G4Exception("G4ITReactionChange::GetTrackB","ITReactionChange002", 00164 FatalErrorInArgument,exceptionDescription); 00165 } 00166 00167 return it->first; 00168 }
void G4ITReactionChange::Initialize | ( | const G4Track & | , | |
const G4Track & | , | |||
G4VParticleChange * | particleChangeA = 0 , |
|||
G4VParticleChange * | particleChangeB = 0 | |||
) |
Definition at line 72 of file G4ITReactionChange.cc.
References FatalErrorInArgument, fKillParents, fNumberOfSecondaries, fParticleChange, fParticleChangeIsSet, fSecondaries, and G4Exception().
Referenced by G4DNAMolecularReaction::MakeReaction().
00077 { 00078 fParticleChange.clear(); 00079 fParticleChange[&trackA] = particleChangeA; 00080 fParticleChange[&trackB] = particleChangeB; 00081 00082 if(particleChangeA || particleChangeB) 00083 { 00084 G4bool test = particleChangeA && particleChangeB ; 00085 00086 if(test == false) 00087 { 00088 G4ExceptionDescription exceptionDescription ; 00089 exceptionDescription << "If you give for one track a particleChange, "; 00090 exceptionDescription << "G4ITReactionChange is expecting that you give for both "; 00091 exceptionDescription << "reacting tracks a particleChange."; 00092 G4Exception("G4ITReactionChange::Initialize","ITReactionChange001", 00093 FatalErrorInArgument,exceptionDescription); 00094 } 00095 00096 fParticleChangeIsSet = true; 00097 00098 fParticleChange[&trackA]->Initialize(trackA); 00099 fParticleChange[&trackB]->Initialize(trackB);; 00100 00101 } 00102 00103 fSecondaries = 0; 00104 fNumberOfSecondaries = 0; 00105 fKillParents = false; 00106 }
void G4ITReactionChange::KillParents | ( | G4bool | ) | [inline] |
Definition at line 120 of file G4ITReactionChange.hh.
References fKillParents.
Referenced by G4DNAMolecularReaction::MakeReaction().
00121 { 00122 fKillParents = kill; 00123 }
G4bool G4ITReactionChange::operator!= | ( | const G4ITReactionChange & | right | ) | const [protected] |
G4ITReactionChange & G4ITReactionChange::operator= | ( | const G4ITReactionChange & | other | ) | [protected] |
Assignment operator
other | Object to assign from |
Definition at line 65 of file G4ITReactionChange.cc.
00066 { 00067 if (this == &rhs) return *this; // handle self assignment 00068 //assignment operator 00069 return *this; 00070 }
G4bool G4ITReactionChange::operator== | ( | const G4ITReactionChange & | right | ) | const [protected] |
Definition at line 126 of file G4ITReactionChange.cc.
References fParticleChange, and G4Step::GetTrack().
00127 { 00128 fParticleChange[stepA->GetTrack()]->UpdateStepForPostStep(stepA); 00129 fParticleChange[stepB->GetTrack()]->UpdateStepForPostStep(stepB); 00130 }
G4bool G4ITReactionChange::WereParentsKilled | ( | ) | const [inline] |
Definition at line 125 of file G4ITReactionChange.hh.
References fKillParents.
00126 { 00127 return fKillParents ; 00128 }
G4bool G4ITReactionChange::fKillParents [protected] |
Definition at line 106 of file G4ITReactionChange.hh.
Referenced by Initialize(), KillParents(), and WereParentsKilled().
G4int G4ITReactionChange::fNumberOfSecondaries [protected] |
Definition at line 105 of file G4ITReactionChange.hh.
Referenced by AddSecondary(), GetNumberOfSecondaries(), and Initialize().
std::map<const G4Track*, G4VParticleChange*> G4ITReactionChange::fParticleChange [protected] |
Definition at line 103 of file G4ITReactionChange.hh.
Referenced by GetParticleChange(), GetTrackA(), GetTrackB(), Initialize(), and UpdateStepInfo().
G4bool G4ITReactionChange::fParticleChangeIsSet [protected] |
G4TrackFastVector* G4ITReactionChange::fSecondaries [protected] |
Definition at line 104 of file G4ITReactionChange.hh.
Referenced by AddSecondary(), GetfSecondary(), GetSecondary(), Initialize(), and ~G4ITReactionChange().