Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DNACPA100IonisationModel Class Reference

#include <G4DNACPA100IonisationModel.hh>

+ Inheritance diagram for G4DNACPA100IonisationModel:

Public Member Functions

 G4DNACPA100IonisationModel (const G4ParticleDefinition *p=0, const G4String &nam="DNACPA100IonisationModel")
 
virtual ~G4DNACPA100IonisationModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector()))
 
virtual G4double CrossSectionPerVolume (const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
G4double DifferentialCrossSection (G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
 
void SelectFasterComputation (G4bool input)
 
void SelectUseDcs (G4bool input)
 
void SelectStationary (G4bool input)
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)=0
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double GetPartialCrossSection (const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ComputeCrossSectionPerShell (const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void StartTracking (G4Track *)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
virtual void ModelDescription (std::ostream &outFile) const
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector< G4EmElementSelector * > * GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
virtual G4double ComputeDEDX (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
G4double CrossSection (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeMeanFreePath (const G4ParticleDefinition *, G4double kineticEnergy, const G4Material *, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, const G4Element *, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectTargetAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4int SelectRandomAtomNumber (const G4Material *)
 
G4int SelectIsotopeNumber (const G4Element *)
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
G4VEmModelGetTripletModel ()
 
void SetTripletModel (G4VEmModel *)
 
void SetAngularDistribution (G4VEmAngularDistribution *)
 
G4double HighEnergyLimit () const
 
G4double LowEnergyLimit () const
 
G4double HighEnergyActivationLimit () const
 
G4double LowEnergyActivationLimit () const
 
G4double PolarAngleLimit () const
 
G4double SecondaryThreshold () const
 
G4bool LPMFlag () const
 
G4bool DeexcitationFlag () const
 
G4bool ForceBuildTableFlag () const
 
G4bool UseAngularGeneratorFlag () const
 
void SetAngularGeneratorFlag (G4bool)
 
void SetHighEnergyLimit (G4double)
 
void SetLowEnergyLimit (G4double)
 
void SetActivationHighEnergyLimit (G4double)
 
void SetActivationLowEnergyLimit (G4double)
 
G4bool IsActive (G4double kinEnergy) const
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetLPMFlag (G4bool val)
 
void SetDeexcitationFlag (G4bool val)
 
void SetForceBuildTable (G4bool val)
 
void SetFluctuationFlag (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
void SetUseBaseMaterials (G4bool val)
 
G4bool UseBaseMaterials () const
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
const G4ElementGetCurrentElement () const
 
const G4IsotopeGetCurrentIsotope () const
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

Protected Attributes

G4ParticleChangeForGammafParticleChangeForGamma
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChangepParticleChange
 
G4PhysicsTablexSectionTable
 
const G4MaterialpBaseMaterial
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 
G4bool lossFlucFlag
 
G4double inveplus
 
G4double pFactor
 

Additional Inherited Members

- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 

Detailed Description

Definition at line 60 of file G4DNACPA100IonisationModel.hh.

Constructor & Destructor Documentation

◆ G4DNACPA100IonisationModel()

G4DNACPA100IonisationModel::G4DNACPA100IonisationModel ( const G4ParticleDefinition p = 0,
const G4String nam = "DNACPA100IonisationModel" 
)

Definition at line 55 of file G4DNACPA100IonisationModel.cc.

57:G4VEmModel(nam),isInitialised(false)
58{
59 verboseLevel= 0;
60 // Verbosity scale:
61 // 0 = nothing
62 // 1 = warning for energy non-conservation
63 // 2 = details of energy budget
64 // 3 = calculation of cross sections, file openings, sampling of atoms
65 // 4 = entering in methods
66
67 if( verboseLevel>0 )
68 {
69 G4cout << "CPA100 ionisation model is constructed " << G4endl;
70 }
71
72 SetLowEnergyLimit(11*eV);
73 SetHighEnergyLimit(255955*eV);
74
75 // Mark this model as "applicable" for atomic deexcitation
77 fAtomDeexcitation = 0;
79 fpMolWaterDensity = 0;
80
81 // Selection of computation method
82
83 // useDcs = true if usage of dcs for sampling of secondaries
84 // useDcs = false if usage of composition sampling (DEFAULT)
85
86 useDcs = true;
87
88 // if useDcs is true, one has the following choice
89 // fasterCode = true for usage of cumulated dcs (DEFAULT)
90 // fasterCode = false for usage of non-cumulated dcs
91
92 fasterCode = true;
93
94 // Selection of stationary mode
95
96 statCode = false;
97}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4ParticleChangeForGamma * fParticleChangeForGamma
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:757
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:764
void SetDeexcitationFlag(G4bool val)
Definition: G4VEmModel.hh:813

◆ ~G4DNACPA100IonisationModel()

G4DNACPA100IonisationModel::~G4DNACPA100IonisationModel ( )
virtual

Definition at line 101 of file G4DNACPA100IonisationModel.cc.

102{
103 // Cross section
104
105 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
106 for (pos = tableData.begin(); pos != tableData.end(); ++pos)
107 {
108 G4DNACrossSectionDataSet* table = pos->second;
109 delete table;
110 }
111
112 // Final state
113
114 eVecm.clear();
115
116}

Member Function Documentation

◆ CrossSectionPerVolume()

G4double G4DNACPA100IonisationModel::CrossSectionPerVolume ( const G4Material material,
const G4ParticleDefinition p,
G4double  ekin,
G4double  emin,
G4double  emax 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 251 of file G4DNACPA100IonisationModel.cc.

256{
257
258 if (verboseLevel > 3)
259 G4cout << "Calling CrossSectionPerVolume() of G4DNACPA100IonisationModel" << G4endl;
260
261 if (particleDefinition != G4Electron::ElectronDefinition()) return 0;
262
263 // Calculate total cross section for model
264
265 G4double sigma=0;
266
267 G4double waterDensity = (*fpMolWaterDensity)[material->GetIndex()];
268
269 const G4String& particleName = particleDefinition->GetParticleName();
270
271 if (ekin >= LowEnergyLimit() && ekin <= HighEnergyLimit())
272 {
273 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
274 pos = tableData.find(particleName);
275
276 if (pos != tableData.end())
277 {
278 G4DNACrossSectionDataSet* table = pos->second;
279 if (table != 0) sigma = table->FindValue(ekin);
280 }
281 else
282 {
283 G4Exception("G4DNACPA100IonisationModel::CrossSectionPerVolume","em0002",
284 FatalException,"Model not applicable to particle type.");
285 }
286 }
287
288 if (verboseLevel > 2)
289 {
290 G4cout << "__________________________________" << G4endl;
291 G4cout << "G4DNACPA100IonisationModel - XS INFO START" << G4endl;
292 G4cout << "Kinetic energy(eV)=" << ekin/eV << " particle : " << particleName << G4endl;
293 G4cout << "Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
294 G4cout << "Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./cm) << G4endl;
295 G4cout << "G4DNACPA100IonisationModel - XS INFO END" << G4endl;
296 }
297
298 return sigma*waterDensity;
299}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
double G4double
Definition: G4Types.hh:83
virtual G4double FindValue(G4double e, G4int componentId=0) const
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:88
size_t GetIndex() const
Definition: G4Material.hh:258
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:652
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:645

◆ DifferentialCrossSection()

G4double G4DNACPA100IonisationModel::DifferentialCrossSection ( G4ParticleDefinition aParticleDefinition,
G4double  k,
G4double  energyTransfer,
G4int  shell 
)

Definition at line 570 of file G4DNACPA100IonisationModel.cc.

574{
575 G4double sigma = 0.;
576
577 if (energyTransfer >= waterStructure.IonisationEnergy(ionizationLevelIndex)/eV)
578 {
579 G4double valueT1 = 0;
580 G4double valueT2 = 0;
581 G4double valueE21 = 0;
582 G4double valueE22 = 0;
583 G4double valueE12 = 0;
584 G4double valueE11 = 0;
585
586 G4double xs11 = 0;
587 G4double xs12 = 0;
588 G4double xs21 = 0;
589 G4double xs22 = 0;
590
591 if (particleDefinition == G4Electron::ElectronDefinition())
592 {
593 // Protection against out of boundary access
594 if (k==eTdummyVec.back()) k=k*(1.-1e-12);
595 //
596
597 // k should be in eV and energy transfer eV also
598
599 std::vector<G4double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k);
600
601 std::vector<G4double>::iterator t1 = t2-1;
602
603 // SI : the following condition avoids situations where energyTransfer >last vector element
604
605 if (energyTransfer <= eVecm[(*t1)].back() && energyTransfer <= eVecm[(*t2)].back() )
606 {
607 std::vector<G4double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), energyTransfer);
608 std::vector<G4double>::iterator e11 = e12-1;
609
610 std::vector<G4double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), energyTransfer);
611 std::vector<G4double>::iterator e21 = e22-1;
612
613 valueT1 =*t1;
614 valueT2 =*t2;
615 valueE21 =*e21;
616 valueE22 =*e22;
617 valueE12 =*e12;
618 valueE11 =*e11;
619
620 xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
621 xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
622 xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
623 xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
624
625 }
626
627 }
628
629 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
630 if (xsProduct != 0.)
631 {
632 sigma = QuadInterpolator( valueE11, valueE12,
633 valueE21, valueE22,
634 xs11, xs12,
635 xs21, xs22,
636 valueT1, valueT2,
637 k, energyTransfer);
638 }
639
640 }
641 return sigma;
642}

◆ Initialise()

void G4DNACPA100IonisationModel::Initialise ( const G4ParticleDefinition particle,
const G4DataVector = *(new G4DataVector()) 
)
virtual

Implements G4VEmModel.

Definition at line 120 of file G4DNACPA100IonisationModel.cc.

122{
123
124 if (verboseLevel > 3)
125 G4cout << "Calling G4DNACPA100IonisationModel::Initialise()" << G4endl;
126
127 // Energy limits
128
129 // The following file is proved by M. Terrissol et al. (sigion3)
130
131 G4String fileElectron("dna/sigma_ionisation_e_cpa100_form_rel");
132
134
136
137 G4double scaleFactor = 1.e-20 * m*m;
138
139 char *path = getenv("G4LEDATA");
140
141 // *** ELECTRON
142
143 electron = electronDef->GetParticleName();
144
145 tableFile[electron] = fileElectron;
146
147 // Cross section
148
150 new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
151
152 //G4DNACrossSectionDataSet* tableE =
153 // new G4DNACrossSectionDataSet(new G4DNACPA100LogLogInterpolation, eV,scaleFactor );
154
155 tableE->LoadData(fileElectron);
156
157 tableData[electron] = tableE;
158
159 // Final state
160
161 // ******************************
162
163 if (useDcs)
164 {
165
166 std::ostringstream eFullFileName;
167
168 if (fasterCode) eFullFileName << path << "/dna/sigmadiff_cumulated_ionisation_e_cpa100_rel.dat";
169
170 if (!fasterCode) eFullFileName << path << "/dna/sigmadiff_ionisation_e_cpa100_rel.dat";
171
172 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
173
174 if (!eDiffCrossSection)
175 {
176 if (fasterCode) G4Exception("G4DNACPA100IonisationModel::Initialise","em0003",
177 FatalException,"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_cpa100_rel.dat");
178
179 if (!fasterCode) G4Exception("G4DNACPA100IonisationModel::Initialise","em0003",
180 FatalException,"Missing data file:/dna/sigmadiff_ionisation_e_cpa100_rel.dat");
181 }
182
183 // Clear the arrays for re-initialization case (MT mode)
184 // March 25th, 2014 - Vaclav Stepan, Sebastien Incerti
185
186 eTdummyVec.clear();
187 eVecm.clear();
188 eProbaShellMap->clear();
189 eDiffCrossSectionData->clear();
190 eNrjTransfData->clear();
191
192 //
193
194 eTdummyVec.push_back(0.);
195 while(!eDiffCrossSection.eof())
196 {
197 G4double tDummy;
198 G4double eDummy;
199 eDiffCrossSection>>tDummy>>eDummy;
200 if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy);
201 for (G4int j=0; j<5; j++)
202 {
203 eDiffCrossSection>>eDiffCrossSectionData[j][tDummy][eDummy];
204
205 if (fasterCode)
206 {
207 eNrjTransfData[j][tDummy][eDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
208 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
209 }
210
211 // SI - only if eof is not reached
212 if (!eDiffCrossSection.eof() && !fasterCode)
213 eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
214
215 if (!fasterCode) eVecm[tDummy].push_back(eDummy);
216
217 }
218 }
219
220 //
221
222 } // end of if (useDcs)
223
224 // ******************************
225
226 //
227
228 if( verboseLevel>0 )
229 {
230 G4cout << "CPA100 ionisation model is initialized " << G4endl
231 << "Energy range: "
232 << LowEnergyLimit() / eV << " eV - "
233 << HighEnergyLimit() / keV << " keV for "
234 << particle->GetParticleName()
235 << G4endl;
236 }
237
238 // Initialize water density pointer
240
241 // AD
242 fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
243
244 if (isInitialised) return;
246 isInitialised = true;
247}
int G4int
Definition: G4Types.hh:85
virtual G4bool LoadData(const G4String &argFileName)
const std::vector< G4double > * GetNumMolPerVolTableFor(const G4Material *) const
Retrieve a table of molecular densities (number of molecules per unit volume) in the G4 unit system f...
static G4DNAMolecularMaterial * Instance()
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:651
const G4String & GetParticleName() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:133

◆ SampleSecondaries()

void G4DNACPA100IonisationModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  fvect,
const G4MaterialCutsCouple ,
const G4DynamicParticle particle,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 303 of file G4DNACPA100IonisationModel.cc.

308{
309 if (verboseLevel > 3)
310 G4cout << "Calling SampleSecondaries() of G4DNACPA100IonisationModel" << G4endl;
311
312 G4double k = particle->GetKineticEnergy();
313
314 const G4String& particleName = particle->GetDefinition()->GetParticleName();
315
316 if (k >= LowEnergyLimit() && k <= HighEnergyLimit())
317 {
318 G4ParticleMomentum primaryDirection = particle->GetMomentumDirection();
319 G4double particleMass = particle->GetDefinition()->GetPDGMass();
320 G4double totalEnergy = k + particleMass;
321 G4double pSquare = k * (totalEnergy + particleMass);
322 G4double totalMomentum = std::sqrt(pSquare);
323
324 G4int ionizationShell = -1;
325
326 ionizationShell = RandomSelect(k,particleName);
327
328 //SI: PROTECTION FOR G4LOGLOGINTERPOLATION ON UPPER VALUE
329 if (k<waterStructure.IonisationEnergy(ionizationShell)) { return; }
330
332 bindingEnergy = waterStructure.IonisationEnergy(ionizationShell);
333
334 G4double secondaryKinetic=-1000*eV;
335
336 if (useDcs && !fasterCode)
337 secondaryKinetic = RandomizeEjectedElectronEnergy(particle->GetDefinition(),k,ionizationShell);
338
339 if (useDcs && fasterCode)
340 secondaryKinetic = RandomizeEjectedElectronEnergyFromCumulatedDcs(particle->GetDefinition(),k,ionizationShell);
341
342 if (!useDcs)
343 secondaryKinetic = RandomizeEjectedElectronEnergyFromCompositionSampling(particle->GetDefinition(),k,ionizationShell);
344
345 // Quick test
346 /*
347 FILE* myFile;
348 myFile=fopen("nrj.txt","a");
349 fprintf(myFile,"%e\n", secondaryKinetic/eV );
350 fclose(myFile);
351 */
352
353 G4double cosTheta = 0.;
354 G4double phi = 0.;
355 RandomizeEjectedElectronDirection(particle->GetDefinition(), k,secondaryKinetic, cosTheta, phi);
356
357 G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta);
358 G4double dirX = sinTheta*std::cos(phi);
359 G4double dirY = sinTheta*std::sin(phi);
360 G4double dirZ = cosTheta;
361 G4ThreeVector deltaDirection(dirX,dirY,dirZ);
362 deltaDirection.rotateUz(primaryDirection);
363
364 // SI - For atom. deexc. tagging - 23/05/2017
365 if (secondaryKinetic>0)
366 {
367 G4DynamicParticle* dp = new G4DynamicParticle (G4Electron::Electron(),deltaDirection,secondaryKinetic) ;
368 fvect->push_back(dp);
369 }
370 //
371
373 {
374 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
375
376 G4double finalPx = totalMomentum*primaryDirection.x() - deltaTotalMomentum*deltaDirection.x();
377 G4double finalPy = totalMomentum*primaryDirection.y() - deltaTotalMomentum*deltaDirection.y();
378 G4double finalPz = totalMomentum*primaryDirection.z() - deltaTotalMomentum*deltaDirection.z();
379 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
380 finalPx /= finalMomentum;
381 finalPy /= finalMomentum;
382 finalPz /= finalMomentum;
383
384 G4ThreeVector direction;
385 direction.set(finalPx,finalPy,finalPz);
386
388 }
389
390 else fParticleChangeForGamma->ProposeMomentumDirection(primaryDirection) ;
391
392 // SI - For atom. deexc. tagging - 23/05/2017
393
394 // AM: sample deexcitation
395 // here we assume that H_{2}O electronic levels are the same of Oxigen.
396 // this can be considered true with a rough 10% error in energy on K-shell,
397
398 size_t secNumberInit = 0;// need to know at a certain point the energy of secondaries
399 size_t secNumberFinal = 0;// So I'll make the diference and then sum the energies
400
401 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
402
403 // SI: only atomic deexcitation from K shell is considered
404 if(fAtomDeexcitation && ionizationShell == 4)
405 {
406 G4int Z = 8;
407 const G4AtomicShell* shell =
408 fAtomDeexcitation->GetAtomicShell(Z, G4AtomicShellEnumerator(0));
409 secNumberInit = fvect->size();
410 fAtomDeexcitation->GenerateParticles(fvect, shell, Z, 0, 0);
411 secNumberFinal = fvect->size();
412
413 if(secNumberFinal > secNumberInit)
414 {
415 for (size_t i=secNumberInit; i<secNumberFinal; ++i)
416 {
417 //Check if there is enough residual energy
418 if (bindingEnergy >= ((*fvect)[i])->GetKineticEnergy())
419 {
420 //Ok, this is a valid secondary: keep it
421 bindingEnergy -= ((*fvect)[i])->GetKineticEnergy();
422 }
423 else
424 {
425 //Invalid secondary: not enough energy to create it!
426 //Keep its energy in the local deposit
427 delete (*fvect)[i];
428 (*fvect)[i]=0;
429 }
430 }
431 }
432
433 }
434
435 //This should never happen
436 if(bindingEnergy < 0.0)
437 G4Exception("G4DNACPA100IonisatioModel1::SampleSecondaries()",
438 "em2050",FatalException,"Negative local energy deposit");
439
440 //bindingEnergy has been decreased
441 //by the amount of energy taken away by deexc. products
442
443 if (!statCode)
444 {
447 }
448 else
449 {
452 }
453
454 // TEST //////////////////////////
455 // if (secondaryKinetic<0) abort();
456 // if (scatteredEnergy<0) abort();
457 // if (k-scatteredEnergy-secondaryKinetic-deexSecEnergy<0) abort();
458 // if (k-scatteredEnergy<0) abort();
459 /////////////////////////////////
460
461 const G4Track * theIncomingTrack = fParticleChangeForGamma->GetCurrentTrack();
463 ionizationShell,
464 theIncomingTrack);
465 }
466
467}
G4AtomicShellEnumerator
@ eIonizedMolecule
double z() const
Hep3Vector unit() const
double x() const
double y() const
void set(double x, double y, double z)
static G4DNAChemistryManager * Instance()
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
Definition: G4Electron.cc:93
const G4Track * GetCurrentTrack() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double bindingEnergy(G4int A, G4int Z)

◆ SelectFasterComputation()

void G4DNACPA100IonisationModel::SelectFasterComputation ( G4bool  input)
inline

Definition at line 179 of file G4DNACPA100IonisationModel.hh.

180{
181 fasterCode = input;
182}

◆ SelectStationary()

void G4DNACPA100IonisationModel::SelectStationary ( G4bool  input)
inline

Definition at line 195 of file G4DNACPA100IonisationModel.hh.

196{
197 statCode = input;
198}

◆ SelectUseDcs()

void G4DNACPA100IonisationModel::SelectUseDcs ( G4bool  input)
inline

Definition at line 186 of file G4DNACPA100IonisationModel.hh.

187{
188 useDcs = input;
189}

Member Data Documentation

◆ fParticleChangeForGamma

G4ParticleChangeForGamma* G4DNACPA100IonisationModel::fParticleChangeForGamma
protected

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