Geant4  10.02.p03
G4DNAMolecularDissociation Class Reference

#include <G4DNAMolecularDissociation.hh>

Inheritance diagram for G4DNAMolecularDissociation:
Collaboration diagram for G4DNAMolecularDissociation:

Public Member Functions

 G4DNAMolecularDissociation (const G4String &processName="DNAMolecularDecay", G4ProcessType type=fDecay)
 
virtual ~G4DNAMolecularDissociation ()
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
G4double AtRestGetPhysicalInteractionLength (const G4Track &track, G4ForceCondition *condition)
 
G4VParticleChange * AtRestDoIt (const G4Track &track, const G4Step &step)
 
G4VParticleChange * PostStepDoIt (const G4Track &track, const G4Step &step)
 
void SetVerbose (G4int)
 
void SetDecayDisplacer (const G4ParticleDefinition *, G4VMolecularDecayDisplacer *)
 
G4VMolecularDecayDisplacerGetDecayDisplacer (const G4ParticleDefinition *)
 

Protected Member Functions

virtual G4VParticleChange * DecayIt (const G4Track &, const G4Step &)
 
virtual G4double GetMeanLifeTime (const G4Track &, G4ForceCondition *)
 
virtual G4double GetMeanFreePath (const G4Track &, G4double, G4ForceCondition *)
 

Private Types

typedef std::map< const G4ParticleDefinition *, G4VMolecularDecayDisplacer * > DecayDisplacementMap
 

Private Member Functions

 G4DNAMolecularDissociation ()
 
 G4DNAMolecularDissociation (const G4DNAMolecularDissociation &right)
 
G4DNAMolecularDissociationoperator= (const G4DNAMolecularDissociation &right)
 

Private Attributes

G4bool fDecayAtFixedTime
 
DecayDisplacementMap fDecayDisplacementMap
 
G4int fVerbose
 

Detailed Description

G4DNAMolecularDissociation should be called only for molecules. It will dissociate the molecules using the decay associated to this molecule and if a displacement scheme has been registered, it will place the products to the expected position.

Definition at line 66 of file G4DNAMolecularDissociation.hh.

Member Typedef Documentation

◆ DecayDisplacementMap

Constructor & Destructor Documentation

◆ G4DNAMolecularDissociation() [1/3]

G4DNAMolecularDissociation::G4DNAMolecularDissociation ( const G4String processName = "DNAMolecularDecay",
G4ProcessType  type = fDecay 
)

Definition at line 52 of file G4DNAMolecularDissociation.cc.

53  :
54  G4VITRestDiscreteProcess(processName, type)
55 {
56  // set Process Sub Type
57  SetProcessSubType(59); // DNA sub-type
58  enableAlongStepDoIt = false;
59  enablePostStepDoIt = true;
60  enableAtRestDoIt = true;
61 
62  fVerbose = 0;
63 
64 #ifdef G4VERBOSE
65  if(verboseLevel > 1)
66  {
67  G4cout << "G4MolecularDissociationProcess constructor " << " Name:"
68  << processName << G4endl;
69  }
70 #endif
71 
72  pParticleChange = &aParticleChange;
73 
74  fDecayAtFixedTime = true;
75  fProposesTimeStep = true;
76 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

◆ ~G4DNAMolecularDissociation()

G4DNAMolecularDissociation::~G4DNAMolecularDissociation ( )
virtual

Definition at line 80 of file G4DNAMolecularDissociation.cc.

81 {
82  DecayDisplacementMap::iterator it = fDecayDisplacementMap.begin();
83 
84  for(; it != fDecayDisplacementMap.end(); it++)
85  {
86  if(it->second)
87  {
88  delete it->second;
89  it->second = 0;
90  }
91  }
92  fDecayDisplacementMap.clear();
93 }
Here is the call graph for this function:

◆ G4DNAMolecularDissociation() [2/3]

G4DNAMolecularDissociation::G4DNAMolecularDissociation ( )
private
Here is the caller graph for this function:

◆ G4DNAMolecularDissociation() [3/3]

G4DNAMolecularDissociation::G4DNAMolecularDissociation ( const G4DNAMolecularDissociation right)
private

Definition at line 98 of file G4DNAMolecularDissociation.cc.

98  :
99  G4VITRestDiscreteProcess(right)
100 {
103  fVerbose = right.fVerbose;
104 }
Here is the call graph for this function:

Member Function Documentation

◆ AtRestDoIt()

G4VParticleChange * G4DNAMolecularDissociation::AtRestDoIt ( const G4Track &  track,
const G4Step &  step 
)
inline

Definition at line 151 of file G4DNAMolecularDissociation.hh.

155 {
156  ClearNumberOfInteractionLengthLeft();
157  ClearInteractionTimeLeft();
158  return DecayIt(track, step);
159 }
virtual G4VParticleChange * DecayIt(const G4Track &, const G4Step &)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AtRestGetPhysicalInteractionLength()

G4double G4DNAMolecularDissociation::AtRestGetPhysicalInteractionLength ( const G4Track &  track,
G4ForceCondition *  condition 
)
inline

Definition at line 138 of file G4DNAMolecularDissociation.hh.

141 {
143  {
145  }
146 
147  return G4VITRestDiscreteProcess::AtRestGetPhysicalInteractionLength(track, condition);
148 // return G4VITRestProcess::AtRestGetPhysicalInteractionLength(track, condition);
149 }
G4double condition(const G4ErrorSymMatrix &m)
virtual G4double GetMeanLifeTime(const G4Track &, G4ForceCondition *)
Here is the call graph for this function:

◆ DecayIt()

G4VParticleChange * G4DNAMolecularDissociation::DecayIt ( const G4Track &  track,
const G4Step &   
)
protectedvirtual

Definition at line 141 of file G4DNAMolecularDissociation.cc.

143 {
144  // DEBUG
145  // G4cout << "Is calling G4MolecularDecayProcess::DecayIt" << G4endl;
146 
147  aParticleChange.Initialize(track);
148  const G4Molecule * theMotherMolecule = GetMolecule(track);
149  const G4MoleculeDefinition* moleculeDefinition = theMotherMolecule
150  ->GetDefinition();
151 
152  // DEBUG
153  // G4cout <<"Calling G4MolecularDecayProcess::DecayIt"<<G4endl;
154  // G4cout << "The mother molecule state : " << G4endl;
155  // theMotherMolecule -> PrintState();
156 
157  if(moleculeDefinition->GetDecayTable())
158  {
159  const vector<const G4MolecularDissociationChannel*>* DecayVector =
160  (theMotherMolecule->GetDecayChannel());
161 
162  if(DecayVector == 0)
163  {
164  G4ExceptionDescription exceptionDescription;
165  theMotherMolecule->PrintState();
166  exceptionDescription << "No decay channel was found for the molecule : "
167  << theMotherMolecule->GetName() << G4endl;
168  G4Exception("G4DNAMolecularDissociation::DecayIt",
169  "G4DNAMolecularDissociation::NoDecayChannel",
171  exceptionDescription);
172  return &aParticleChange;
173  }
174 
175  G4int DecayVectorSize = DecayVector->size();
176  // DEBUG
177  // G4cout<< "Number of decay channels : " << DecayVectorSize <<G4endl;
178  G4double RdmValue = G4UniformRand();
179 
180  const G4MolecularDissociationChannel* decayChannel(0);
181  G4int i = 0;
182  do
183  {
184  decayChannel = (*DecayVector)[i];
185  if(RdmValue < decayChannel->GetProbability()) break;
186  RdmValue -= decayChannel->GetProbability();
187  i++;
188  }
189  while(i < DecayVectorSize);
190 
191  // DEBUG
192  // G4cout << "Selected Decay channel : "
193  // << decayChannel->GetName() << G4endl;
194 
195  G4double decayEnergy = decayChannel->GetEnergy();
196  G4int nbProducts = decayChannel->GetNbProducts();
197 
198  if(decayEnergy)
199  {
200  // DEBUG
201  // G4cout << "Deposit energy :"
202  // << decayChannel->GetEnergy()/eV << " eV" << G4endl;
203 
204  aParticleChange.ProposeLocalEnergyDeposit(decayChannel->GetEnergy());
205  }
206 
207  if(nbProducts)
208  {
209 
210  // DEBUG
211  // G4cout << "Number of products :" << nbProducts << G4endl;
212 
213  vector<G4ThreeVector> ProductsDisplacement(nbProducts);
214  G4ThreeVector theMotherMoleculeDisplacement;
215 
216  DecayDisplacementMap::iterator it =
217  fDecayDisplacementMap.find(moleculeDefinition);
218 
219  if(it != fDecayDisplacementMap.end())
220  {
221  G4VMolecularDecayDisplacer* displacer = it->second;
222  ProductsDisplacement = displacer->GetProductsDisplacement(decayChannel);
223  theMotherMoleculeDisplacement =
224  displacer->GetMotherMoleculeDisplacement(decayChannel);
225  }
226  else
227  {
228  G4ExceptionDescription errMsg;
229  errMsg << "No G4MolecularDecayProcess::theDecayDisplacementMap["
230  << theMotherMolecule->GetName() + "]";
231  G4Exception("G4MolecularDecayProcess::DecayIt",
232  "DNAMolecularDecay001",
234  errMsg);
235  }
236 
237  aParticleChange.SetNumberOfSecondaries(nbProducts);
238 
239 // G4cout << " nbProducts = " << nbProducts << G4endl;
240 // theMotherMolecule->PrintState();
241 
242 #ifdef G4VERBOSE
243  if(fVerbose)
244  {
245  G4cout << "Decay Process : " << theMotherMolecule->GetName()
246  << " (trackID :" << track.GetTrackID() << ") "
247  << decayChannel->GetName() << G4endl;
248  }
249 #endif
250 
251  G4ITNavigator* navigator =
254 
255  for(G4int j = 0; j < nbProducts; j++)
256  {
257  G4Molecule* product = new G4Molecule(decayChannel->GetProduct(j));
258 
259  G4ThreeVector displacement = theMotherMoleculeDisplacement
260  + ProductsDisplacement[j];
261  double mag_displacement = displacement.mag();
262  G4ThreeVector displacement_direction = displacement / mag_displacement;
263 
264  double prNewSafety = DBL_MAX;
265 
266  navigator->CheckNextStep(track.GetPosition(),
267  displacement_direction,
268  mag_displacement,
269  prNewSafety); // returns a value
270 
271  if(prNewSafety < mag_displacement) mag_displacement = prNewSafety;
272 
273 // const G4AffineTransform& transform = navigator
274 // ->GetGlobalToLocalTransform();
275 //
276 // G4ThreeVector localPoint =
277 // transform.TransformPoint(track.GetPosition());
278 //
279 // if(track.GetTouchable()->GetSolid()->Inside(localPoint) != EInside::kInside)
280 // {
281 // G4Exception("G4DNAMolecularDissociation::DecayIt",
282 // "OUTSIDE_OF_MOTHER_VOLUME",
283 // FatalException,
284 // "Product has been placed outside of the volume "
285 // "containing the mother molecule");
286 // }
287 
288  G4Track* secondary =
289  product->BuildTrack(track.GetGlobalTime(),
290  track.GetPosition() + displacement_direction
291  * mag_displacement);
292 
293  secondary->SetTrackStatus(fAlive);
294 #ifdef G4VERBOSE
295  if(fVerbose)
296  {
297  G4cout << "Product : " << product->GetName() << G4endl;
298  }
299 #endif
300  // add the secondary track in the List
301  aParticleChange.G4VParticleChange::AddSecondary(secondary);
302  }
303 #ifdef G4VERBOSE
304  if(fVerbose) G4cout << "-------------" << G4endl;
305 #endif
306  }
307  //DEBUG
308  else if(fVerbose && decayEnergy)
309  {
310  G4cout << "No products for this channel" << G4endl;
311  G4cout<<"-------------"<<G4endl;
312  }
313  /*
314  else if(!decayEnergy && !nbProducts)
315  {
316  G4ExceptionDescription errMsg;
317  errMsg << "There is no products and no energy specified in the molecular "
318  "dissociation channel";
319  G4Exception("G4MolecularDissociationProcess::DecayIt",
320  "DNAMolecularDissociation002",
321  FatalErrorInArgument,
322  errMsg);
323  }
324  */
325  }
326 
327  aParticleChange.ProposeTrackStatus(fStopAndKill);
328 
329  return &aParticleChange;
330 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4ITNavigator * GetNavigatorForTracking() const
const G4MolecularDissociationTable * GetDecayTable() const
void PrintState() const
Definition: G4Molecule.cc:373
int G4int
Definition: G4Types.hh:78
const G4MoleculeDefinition * GetDefinition() const
Definition: G4Molecule.cc:535
const std::vector< const G4MolecularDissociationChannel * > * GetDecayChannel() const
Definition: G4Molecule.cc:458
static G4ITTransportationManager * GetTransportationManager()
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
Definition: G4Molecule.cc:345
double mag() const
virtual std::vector< G4ThreeVector > GetProductsDisplacement(const G4MolecularDissociationChannel *) const =0
G4Molecule * GetMolecule(const G4Track &track)
Definition: G4Molecule.cc:69
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector &Position)
Definition: G4Molecule.cc:380
#define G4endl
Definition: G4ios.hh:61
virtual G4ThreeVector GetMotherMoleculeDisplacement(const G4MolecularDissociationChannel *) const =0
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDecayDisplacer()

G4VMolecularDecayDisplacer * G4DNAMolecularDissociation::GetDecayDisplacer ( const G4ParticleDefinition molDef)

Definition at line 345 of file G4DNAMolecularDissociation.cc.

346 {
347  return fDecayDisplacementMap[molDef];
348 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMeanFreePath()

virtual G4double G4DNAMolecularDissociation::GetMeanFreePath ( const G4Track &  ,
G4double  ,
G4ForceCondition *   
)
inlineprotectedvirtual

Definition at line 112 of file G4DNAMolecularDissociation.hh.

115  {
116  return 0;
117  }
Here is the call graph for this function:

◆ GetMeanLifeTime()

G4double G4DNAMolecularDissociation::GetMeanLifeTime ( const G4Track &  track,
G4ForceCondition *   
)
protectedvirtual

Definition at line 132 of file G4DNAMolecularDissociation.cc.

134 {
135  G4double output = GetMolecule(track)->GetDecayTime() - track.GetProperTime();
136  return (output > 0 ? output : 0);
137 }
G4double GetDecayTime() const
Definition: G4Molecule.cc:486
G4Molecule * GetMolecule(const G4Track &track)
Definition: G4Molecule.cc:69
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsApplicable()

G4bool G4DNAMolecularDissociation::IsApplicable ( const G4ParticleDefinition aParticleType)
virtual

Definition at line 109 of file G4DNAMolecularDissociation.cc.

110 {
111  if(aParticleType.GetParticleType() == "Molecule")
112  {
113 #ifdef G4VERBOSE
114 
115  if(fVerbose > 1)
116  {
117  G4cout << "G4MolecularDissociation::IsApplicable(";
118  G4cout << aParticleType.GetParticleName() << ",";
119  G4cout << aParticleType.GetParticleType() << ")" << G4endl;
120  }
121 #endif
122  return (true);
123  }
124  else
125  {
126  return false;
127  }
128 }
const G4String & GetParticleType() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

G4DNAMolecularDissociation& G4DNAMolecularDissociation::operator= ( const G4DNAMolecularDissociation right)
private
Here is the caller graph for this function:

◆ PostStepDoIt()

G4VParticleChange* G4DNAMolecularDissociation::PostStepDoIt ( const G4Track &  track,
const G4Step &  step 
)
inline

Definition at line 93 of file G4DNAMolecularDissociation.hh.

97  {
98  return AtRestDoIt(track, step);
99  }
G4VParticleChange * AtRestDoIt(const G4Track &track, const G4Step &step)
Here is the call graph for this function:

◆ PostStepGetPhysicalInteractionLength()

G4double G4DNAMolecularDissociation::PostStepGetPhysicalInteractionLength ( const G4Track &  track,
G4double  previousStepSize,
G4ForceCondition *  condition 
)
virtual

Definition at line 353 of file G4DNAMolecularDissociation.cc.

356 {
357  return 0; //-1*(-log(1-G4UniformRand())*100*1e-15*s);
358 }
Here is the caller graph for this function:

◆ SetDecayDisplacer()

void G4DNAMolecularDissociation::SetDecayDisplacer ( const G4ParticleDefinition molDef,
G4VMolecularDecayDisplacer aDisplacer 
)

Definition at line 335 of file G4DNAMolecularDissociation.cc.

337 {
338  fDecayDisplacementMap[molDef] = aDisplacer;
339 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVerbose()

void G4DNAMolecularDissociation::SetVerbose ( G4int  verbose)
inline

Definition at line 133 of file G4DNAMolecularDissociation.hh.

134 {
135  fVerbose = verbose ;
136 }
Here is the caller graph for this function:

Member Data Documentation

◆ fDecayAtFixedTime

G4bool G4DNAMolecularDissociation::fDecayAtFixedTime
private

Definition at line 125 of file G4DNAMolecularDissociation.hh.

◆ fDecayDisplacementMap

DecayDisplacementMap G4DNAMolecularDissociation::fDecayDisplacementMap
private

Definition at line 128 of file G4DNAMolecularDissociation.hh.

◆ fVerbose

G4int G4DNAMolecularDissociation::fVerbose
private

Definition at line 130 of file G4DNAMolecularDissociation.hh.


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