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
G4TrackFastVectorGetfSecondary ()
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
G4TrackFastVectorfSecondaries
G4int fNumberOfSecondaries
G4bool fKillParents
G4bool fParticleChangeIsSet


Detailed Description

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

Definition at line 50 of file G4ITReactionChange.hh.


Constructor & Destructor Documentation

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

Parameters:
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 }


Member Function Documentation

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 }

G4Track * G4ITReactionChange::GetSecondary ( G4int   )  const [inline]

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

Parameters:
other Object to assign from
Returns:
A reference to this

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]

void G4ITReactionChange::UpdateStepInfo ( G4Step ,
G4Step  
)

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 }


Field Documentation

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]

Definition at line 107 of file G4ITReactionChange.hh.

Referenced by Initialize().

G4TrackFastVector* G4ITReactionChange::fSecondaries [protected]

Definition at line 104 of file G4ITReactionChange.hh.

Referenced by AddSecondary(), GetfSecondary(), GetSecondary(), Initialize(), and ~G4ITReactionChange().


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:19 2013 for Geant4 by  doxygen 1.4.7