Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes
G4DNABornIonisationModel Class Reference

#include <G4DNABornIonisationModel.hh>

Inheritance diagram for G4DNABornIonisationModel:
G4VEmModel

Public Member Functions

 G4DNABornIonisationModel (const G4ParticleDefinition *p=0, const G4String &nam="DNABornIonisationModel")
 
virtual ~G4DNABornIonisationModel ()
 
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)
 
double DifferentialCrossSection (G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
 
void SelectFasterComputation (G4bool input)
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
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 ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., 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 *)
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector
< G4EmElementSelector * > * 
GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
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)
 
G4int SelectIsotopeNumber (const G4Element *)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, 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 *)
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=0)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
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)
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetLPMFlag (G4bool val)
 
void SetDeexcitationFlag (G4bool val)
 
void SetForceBuildTable (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
const G4ElementGetCurrentElement () const
 

Protected Attributes

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

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 48 of file G4DNABornIonisationModel.hh.

Constructor & Destructor Documentation

G4DNABornIonisationModel::G4DNABornIonisationModel ( const G4ParticleDefinition p = 0,
const G4String nam = "DNABornIonisationModel" 
)

Definition at line 43 of file G4DNABornIonisationModel.cc.

References fParticleChangeForGamma, G4cout, G4endl, and G4VEmModel::SetDeexcitationFlag().

45  :G4VEmModel(nam),isInitialised(false)
46 {
47  verboseLevel= 0;
48  // Verbosity scale:
49  // 0 = nothing
50  // 1 = warning for energy non-conservation
51  // 2 = details of energy budget
52  // 3 = calculation of cross sections, file openings, sampling of atoms
53  // 4 = entering in methods
54 
55  if( verboseLevel>0 )
56  {
57  G4cout << "Born ionisation model is constructed " << G4endl;
58  }
59 
60  //Mark this model as "applicable" for atomic deexcitation
61  SetDeexcitationFlag(true);
62  fAtomDeexcitation = 0;
64  fpMolWaterDensity = 0;
65 
66  // Selection of computation method
67 
68  fasterCode = false;
69 }
G4VEmModel(const G4String &nam)
Definition: G4VEmModel.cc:65
G4GLOB_DLL std::ostream G4cout
G4ParticleChangeForGamma * fParticleChangeForGamma
#define G4endl
Definition: G4ios.hh:61
void SetDeexcitationFlag(G4bool val)
Definition: G4VEmModel.hh:739
G4DNABornIonisationModel::~G4DNABornIonisationModel ( )
virtual

Definition at line 73 of file G4DNABornIonisationModel.cc.

74 {
75  // Cross section
76 
77  std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
78  for (pos = tableData.begin(); pos != tableData.end(); ++pos)
79  {
80  G4DNACrossSectionDataSet* table = pos->second;
81  delete table;
82  }
83 
84  // Final state
85 
86  eVecm.clear();
87  pVecm.clear();
88 
89 }

Member Function Documentation

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

Reimplemented from G4VEmModel.

Definition at line 270 of file G4DNABornIonisationModel.cc.

References python.hepunit::cm, G4Electron::ElectronDefinition(), python.hepunit::eV, FatalException, G4DNACrossSectionDataSet::FindValue(), G4cout, G4endl, G4Exception(), G4Material::GetIndex(), G4ParticleDefinition::GetParticleName(), and G4Proton::ProtonDefinition().

275 {
276  if (verboseLevel > 3)
277  G4cout << "Calling CrossSectionPerVolume() of G4DNABornIonisationModel" << G4endl;
278 
279  if (
280  particleDefinition != G4Proton::ProtonDefinition()
281  &&
282  particleDefinition != G4Electron::ElectronDefinition()
283  )
284 
285  return 0;
286 
287  // Calculate total cross section for model
288 
289  G4double lowLim = 0;
290  G4double highLim = 0;
291  G4double sigma=0;
292 
293  G4double waterDensity = (*fpMolWaterDensity)[material->GetIndex()];
294 
295  if(waterDensity!= 0.0)
296  // if (material == nistwater || material->GetBaseMaterial() == nistwater)
297  {
298  const G4String& particleName = particleDefinition->GetParticleName();
299 
300  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
301  pos1 = lowEnergyLimit.find(particleName);
302  if (pos1 != lowEnergyLimit.end())
303  {
304  lowLim = pos1->second;
305  }
306 
307  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
308  pos2 = highEnergyLimit.find(particleName);
309  if (pos2 != highEnergyLimit.end())
310  {
311  highLim = pos2->second;
312  }
313 
314  if (ekin >= lowLim && ekin < highLim)
315  {
316  std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
317  pos = tableData.find(particleName);
318 
319  if (pos != tableData.end())
320  {
321  G4DNACrossSectionDataSet* table = pos->second;
322  if (table != 0)
323  {
324  sigma = table->FindValue(ekin);
325  }
326  }
327  else
328  {
329  G4Exception("G4DNABornIonisationModel::CrossSectionPerVolume","em0002",
330  FatalException,"Model not applicable to particle type.");
331  }
332  }
333 
334  if (verboseLevel > 2)
335  {
336  G4cout << "__________________________________" << G4endl;
337  G4cout << "G4DNABornIonisationModel - XS INFO START" << G4endl;
338  G4cout << "Kinetic energy(eV)=" << ekin/eV << " particle : " << particleName << G4endl;
339  G4cout << "Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
340  G4cout << "Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./cm) << G4endl;
341  G4cout << "G4DNABornIonisationModel - XS INFO END" << G4endl;
342  }
343 
344  } // if (waterMaterial)
345 
346  return sigma*waterDensity;
347 }
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
size_t GetIndex() const
Definition: G4Material.hh:260
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4GLOB_DLL std::ostream G4cout
virtual G4double FindValue(G4double e, G4int componentId=0) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
double G4DNABornIonisationModel::DifferentialCrossSection ( G4ParticleDefinition aParticleDefinition,
G4double  k,
G4double  energyTransfer,
G4int  shell 
)

Definition at line 637 of file G4DNABornIonisationModel.cc.

References G4Electron::ElectronDefinition(), G4DNAWaterIonisationStructure::IonisationEnergy(), G4Proton::ProtonDefinition(), and plottest35::t1.

641 {
642  G4double sigma = 0.;
643 
644  if (energyTransfer >= waterStructure.IonisationEnergy(ionizationLevelIndex))
645  {
646  G4double valueT1 = 0;
647  G4double valueT2 = 0;
648  G4double valueE21 = 0;
649  G4double valueE22 = 0;
650  G4double valueE12 = 0;
651  G4double valueE11 = 0;
652 
653  G4double xs11 = 0;
654  G4double xs12 = 0;
655  G4double xs21 = 0;
656  G4double xs22 = 0;
657 
658  if (particleDefinition == G4Electron::ElectronDefinition())
659  {
660  // k should be in eV and energy transfer eV also
661 
662  std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k);
663 
664  std::vector<double>::iterator t1 = t2-1;
665 
666  // SI : the following condition avoids situations where energyTransfer >last vector element
667  if (energyTransfer <= eVecm[(*t1)].back() && energyTransfer <= eVecm[(*t2)].back() )
668  {
669  std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), energyTransfer);
670  std::vector<double>::iterator e11 = e12-1;
671 
672  std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), energyTransfer);
673  std::vector<double>::iterator e21 = e22-1;
674 
675  valueT1 =*t1;
676  valueT2 =*t2;
677  valueE21 =*e21;
678  valueE22 =*e22;
679  valueE12 =*e12;
680  valueE11 =*e11;
681 
682  xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
683  xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
684  xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
685  xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
686 
687  }
688 
689  }
690 
691  if (particleDefinition == G4Proton::ProtonDefinition())
692  {
693  // k should be in eV and energy transfer eV also
694  std::vector<double>::iterator t2 = std::upper_bound(pTdummyVec.begin(),pTdummyVec.end(), k);
695  std::vector<double>::iterator t1 = t2-1;
696 
697  std::vector<double>::iterator e12 = std::upper_bound(pVecm[(*t1)].begin(),pVecm[(*t1)].end(), energyTransfer);
698  std::vector<double>::iterator e11 = e12-1;
699 
700  std::vector<double>::iterator e22 = std::upper_bound(pVecm[(*t2)].begin(),pVecm[(*t2)].end(), energyTransfer);
701  std::vector<double>::iterator e21 = e22-1;
702 
703  valueT1 =*t1;
704  valueT2 =*t2;
705  valueE21 =*e21;
706  valueE22 =*e22;
707  valueE12 =*e12;
708  valueE11 =*e11;
709 
710  xs11 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
711  xs12 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
712  xs21 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
713  xs22 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
714 
715  }
716 
717  G4double xsProduct = xs11 * xs12 * xs21 * xs22;
718  if (xsProduct != 0.)
719  {
720  sigma = QuadInterpolator( valueE11, valueE12,
721  valueE21, valueE22,
722  xs11, xs12,
723  xs21, xs22,
724  valueT1, valueT2,
725  k, energyTransfer);
726  }
727 
728  }
729 
730  return sigma;
731 }
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
tuple t1
Definition: plottest35.py:33
double G4double
Definition: G4Types.hh:76
void G4DNABornIonisationModel::Initialise ( const G4ParticleDefinition particle,
const G4DataVector = *(new G4DataVector()) 
)
virtual

Implements G4VEmModel.

Definition at line 93 of file G4DNABornIonisationModel.cc.

References G4LossTableManager::AtomDeexcitation(), G4InuclParticleNames::electron, G4Electron::ElectronDefinition(), python.hepunit::eV, FatalException, fParticleChangeForGamma, G4cout, G4endl, G4Exception(), G4Material::GetMaterial(), G4DNAMolecularMaterial::GetNumMolPerVolTableFor(), G4VEmModel::GetParticleChangeForGamma(), G4ParticleDefinition::GetParticleName(), G4VEmModel::HighEnergyLimit(), G4DNAMolecularMaterial::Instance(), G4LossTableManager::Instance(), python.hepunit::keV, G4DNACrossSectionDataSet::LoadData(), G4VEmModel::LowEnergyLimit(), python.hepunit::m, python.hepunit::MeV, G4InuclParticleNames::proton, G4Proton::ProtonDefinition(), G4VEmModel::SetHighEnergyLimit(), and G4VEmModel::SetLowEnergyLimit().

95 {
96 
97  if (verboseLevel > 3)
98  G4cout << "Calling G4DNABornIonisationModel::Initialise()" << G4endl;
99 
100  // Energy limits
101 
102  G4String fileElectron("dna/sigma_ionisation_e_born");
103  G4String fileProton("dna/sigma_ionisation_p_born");
104 
107 
110 
111  G4double scaleFactor = (1.e-22 / 3.343) * m*m;
112 
113  char *path = getenv("G4LEDATA");
114 
115  // *** ELECTRON
116 
117  electron = electronDef->GetParticleName();
118 
119  tableFile[electron] = fileElectron;
120 
121  lowEnergyLimit[electron] = 11. * eV;
122  highEnergyLimit[electron] = 1. * MeV;
123 
124  // Cross section
125 
127  tableE->LoadData(fileElectron);
128 
129  tableData[electron] = tableE;
130 
131  // Final state
132 
133  std::ostringstream eFullFileName;
134 
135  if (fasterCode) eFullFileName << path << "/dna/sigmadiff_cumulated_ionisation_e_born.dat";
136  if (!fasterCode) eFullFileName << path << "/dna/sigmadiff_ionisation_e_born.dat";
137 
138  std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
139 
140  if (!eDiffCrossSection)
141  {
142  if (fasterCode) G4Exception("G4DNABornIonisationModel::Initialise","em0003",
143  FatalException,"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_born.dat");
144 
145  if (!fasterCode) G4Exception("G4DNABornIonisationModel::Initialise","em0003",
146  FatalException,"Missing data file:/dna/sigmadiff_ionisation_e_born.dat");
147  }
148 
149  eTdummyVec.push_back(0.);
150  while(!eDiffCrossSection.eof())
151  {
152  double tDummy;
153  double eDummy;
154  eDiffCrossSection>>tDummy>>eDummy;
155  if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy);
156  for (int j=0; j<5; j++)
157  {
158  eDiffCrossSection>>eDiffCrossSectionData[j][tDummy][eDummy];
159 
160  if (fasterCode)
161  {
162  eNrjTransfData[j][tDummy][eDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
163  eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
164  }
165 
166  // SI - only if eof is not reached
167  if (!eDiffCrossSection.eof() && !fasterCode) eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
168 
169  if (!fasterCode) eVecm[tDummy].push_back(eDummy);
170 
171  }
172  }
173 
174  // *** PROTON
175 
176  proton = protonDef->GetParticleName();
177 
178  tableFile[proton] = fileProton;
179 
180  lowEnergyLimit[proton] = 500. * keV;
181  highEnergyLimit[proton] = 100. * MeV;
182 
183  // Cross section
184 
186  tableP->LoadData(fileProton);
187 
188  tableData[proton] = tableP;
189 
190  // Final state
191 
192  std::ostringstream pFullFileName;
193 
194  if (fasterCode) pFullFileName << path << "/dna/sigmadiff_cumulated_ionisation_p_born.dat";
195 
196  if (!fasterCode) pFullFileName << path << "/dna/sigmadiff_ionisation_p_born.dat";
197 
198  std::ifstream pDiffCrossSection(pFullFileName.str().c_str());
199 
200  if (!pDiffCrossSection)
201  {
202  if (fasterCode) G4Exception("G4DNABornIonisationModel::Initialise","em0003",
203  FatalException,"Missing data file:/dna/sigmadiff_cumulated_ionisation_p_born.dat");
204 
205  if (!fasterCode) G4Exception("G4DNABornIonisationModel::Initialise","em0003",
206  FatalException,"Missing data file:/dna/sigmadiff_ionisation_p_born.dat");
207  }
208 
209  pTdummyVec.push_back(0.);
210  while(!pDiffCrossSection.eof())
211  {
212  double tDummy;
213  double eDummy;
214  pDiffCrossSection>>tDummy>>eDummy;
215  if (tDummy != pTdummyVec.back()) pTdummyVec.push_back(tDummy);
216  for (int j=0; j<5; j++)
217  {
218  pDiffCrossSection>>pDiffCrossSectionData[j][tDummy][eDummy];
219 
220  if (fasterCode)
221  {
222  pNrjTransfData[j][tDummy][pDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
223  pProbaShellMap[j][tDummy].push_back(pDiffCrossSectionData[j][tDummy][eDummy]);
224  }
225 
226  // SI - only if eof is not reached !
227  if (!pDiffCrossSection.eof() && !fasterCode) pDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
228 
229  if (!fasterCode) pVecm[tDummy].push_back(eDummy);
230  }
231  }
232 
233  //
234 
235  if (particle==electronDef)
236  {
237  SetLowEnergyLimit(lowEnergyLimit[electron]);
238  SetHighEnergyLimit(highEnergyLimit[electron]);
239  }
240 
241  if (particle==protonDef)
242  {
243  SetLowEnergyLimit(lowEnergyLimit[proton]);
244  SetHighEnergyLimit(highEnergyLimit[proton]);
245  }
246 
247  if( verboseLevel>0 )
248  {
249  G4cout << "Born ionisation model is initialized " << G4endl
250  << "Energy range: "
251  << LowEnergyLimit() / eV << " eV - "
252  << HighEnergyLimit() / keV << " keV for "
253  << particle->GetParticleName()
254  << G4endl;
255  }
256 
257  // Initialize water density pointer
259 
260  //
261  fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
262 
263  if (isInitialised) { return; }
265  isInitialised = true;
266 }
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:599
static G4LossTableManager * Instance()
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:592
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:578
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
virtual G4bool LoadData(const G4String &argFileName)
const G4String & GetParticleName() const
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:683
G4GLOB_DLL std::ostream G4cout
const std::vector< double > * GetNumMolPerVolTableFor(const G4Material *) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4DNAMolecularMaterial * Instance()
G4ParticleChangeForGamma * fParticleChangeForGamma
#define G4endl
Definition: G4ios.hh:61
G4VAtomDeexcitation * AtomDeexcitation()
double G4double
Definition: G4Types.hh:76
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:690
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:121
void G4DNABornIonisationModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  fvect,
const G4MaterialCutsCouple ,
const G4DynamicParticle particle,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 351 of file G4DNABornIonisationModel.cc.

References G4InuclSpecialFunctions::bindingEnergy(), G4DNAChemistryManager::CreateWaterMolecule(), eIonizedMolecule, G4Electron::Electron(), python.hepunit::electron_mass_c2, G4Electron::ElectronDefinition(), python.hepunit::eV, fKShell, fParticleChangeForGamma, G4cout, G4endl, G4VAtomDeexcitation::GenerateParticles(), G4VAtomDeexcitation::GetAtomicShell(), G4ParticleChangeForGamma::GetCurrentTrack(), G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetMomentumDirection(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGMass(), G4DNAChemistryManager::Instance(), G4DNAWaterIonisationStructure::IonisationEnergy(), G4VParticleChange::ProposeLocalEnergyDeposit(), G4ParticleChangeForGamma::ProposeMomentumDirection(), CLHEP::Hep3Vector::rotateUz(), CLHEP::Hep3Vector::set(), G4ParticleChangeForGamma::SetProposedKineticEnergy(), CLHEP::Hep3Vector::unit(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

356 {
357 
358  if (verboseLevel > 3)
359  G4cout << "Calling SampleSecondaries() of G4DNABornIonisationModel" << G4endl;
360 
361  G4double lowLim = 0;
362  G4double highLim = 0;
363 
364  G4double k = particle->GetKineticEnergy();
365 
366  const G4String& particleName = particle->GetDefinition()->GetParticleName();
367 
368  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
369  pos1 = lowEnergyLimit.find(particleName);
370 
371  if (pos1 != lowEnergyLimit.end())
372  {
373  lowLim = pos1->second;
374  }
375 
376  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
377  pos2 = highEnergyLimit.find(particleName);
378 
379  if (pos2 != highEnergyLimit.end())
380  {
381  highLim = pos2->second;
382  }
383 
384  if (k >= lowLim && k < highLim)
385  {
386  G4ParticleMomentum primaryDirection = particle->GetMomentumDirection();
387  G4double particleMass = particle->GetDefinition()->GetPDGMass();
388  G4double totalEnergy = k + particleMass;
389  G4double pSquare = k * (totalEnergy + particleMass);
390  G4double totalMomentum = std::sqrt(pSquare);
391 
392  G4int ionizationShell = -1;
393 
394  if (!fasterCode) ionizationShell = RandomSelect(k,particleName);
395 
396  // SI: The following protection is necessary to avoid infinite loops :
397  // sigmadiff_ionisation_e_born.dat has non zero partial xs at 18 eV for shell 3 (ionizationShell ==2)
398  // sigmadiff_cumulated_ionisation_e_born.dat has zero cumulated partial xs at 18 eV for shell 3 (ionizationShell ==2)
399  // this is due to the fact that the max allowed transfered energy is (18+10.79)/2=17.025 eV and only transfered energies
400  // strictly above this value have non zero partial xs in sigmadiff_ionisation_e_born.dat (starting at trans = 17.12 eV)
401 
402  if (fasterCode)
403  do
404  {
405  ionizationShell = RandomSelect(k,particleName);
406  } while (k<19*eV && ionizationShell==2 && particle->GetDefinition()==G4Electron::ElectronDefinition());
407 
408 
409  // AM: sample deexcitation
410  // here we assume that H_{2}O electronic levels are the same of Oxigen.
411  // this can be considered true with a rough 10% error in energy on K-shell,
412 
413  G4int secNumberInit = 0; // need to know at a certain point the enrgy of secondaries
414  G4int secNumberFinal = 0; // So I'll make the diference and then sum the energies
415 
417  bindingEnergy = waterStructure.IonisationEnergy(ionizationShell);
418 
419  if(fAtomDeexcitation) {
420  G4int Z = 8;
422 
423  if (ionizationShell <5 && ionizationShell >1)
424  {
425  as = G4AtomicShellEnumerator(4-ionizationShell);
426  }
427  else if (ionizationShell <2)
428  {
429  as = G4AtomicShellEnumerator(3);
430  }
431 
432  // FOR DEBUG ONLY
433  // if (ionizationShell == 4) {
434  //
435  // G4cout << "Z: " << Z << " as: " << as
436  // << " ionizationShell: " << ionizationShell << " bindingEnergy: "<< bindingEnergy/eV << G4endl;
437  // G4cout << "Press <Enter> key to continue..." << G4endl;
438  // G4cin.ignore();
439  // }
440 
441  const G4AtomicShell* shell = fAtomDeexcitation->GetAtomicShell(Z, as);
442  secNumberInit = fvect->size();
443  fAtomDeexcitation->GenerateParticles(fvect, shell, Z, 0, 0);
444  secNumberFinal = fvect->size();
445  }
446 
447  G4double secondaryKinetic=-1000*eV;
448 
449  if (!fasterCode) secondaryKinetic = RandomizeEjectedElectronEnergy(particle->GetDefinition(),k,ionizationShell);
450 
451  if (fasterCode)
452  do
453  {
454  secondaryKinetic = RandomizeEjectedElectronEnergyFromCumulatedDcs(particle->GetDefinition(),k,ionizationShell);
455 
456  }
457  while (secondaryKinetic<0) ;
458 
459  G4double cosTheta = 0.;
460  G4double phi = 0.;
461  RandomizeEjectedElectronDirection(particle->GetDefinition(), k,secondaryKinetic, cosTheta, phi);
462 
463  G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta);
464  G4double dirX = sinTheta*std::cos(phi);
465  G4double dirY = sinTheta*std::sin(phi);
466  G4double dirZ = cosTheta;
467  G4ThreeVector deltaDirection(dirX,dirY,dirZ);
468  deltaDirection.rotateUz(primaryDirection);
469 
470  if (particle->GetDefinition() == G4Electron::ElectronDefinition())
471  {
472  G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
473 
474  G4double finalPx = totalMomentum*primaryDirection.x() - deltaTotalMomentum*deltaDirection.x();
475  G4double finalPy = totalMomentum*primaryDirection.y() - deltaTotalMomentum*deltaDirection.y();
476  G4double finalPz = totalMomentum*primaryDirection.z() - deltaTotalMomentum*deltaDirection.z();
477  G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
478  finalPx /= finalMomentum;
479  finalPy /= finalMomentum;
480  finalPz /= finalMomentum;
481 
482  G4ThreeVector direction;
483  direction.set(finalPx,finalPy,finalPz);
484 
486  }
487 
488  else fParticleChangeForGamma->ProposeMomentumDirection(primaryDirection) ;
489 
490  // note thta secondaryKinetic is the nergy of the delta ray, not of all secondaries.
491  G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
492  G4double deexSecEnergy = 0;
493  for (G4int j=secNumberInit; j < secNumberFinal; j++) {
494 
495  deexSecEnergy = deexSecEnergy + (*fvect)[j]->GetKineticEnergy();
496 
497  }
498 
500 
501  fParticleChangeForGamma->ProposeLocalEnergyDeposit(k-scatteredEnergy-secondaryKinetic-deexSecEnergy);
502 
503  G4DynamicParticle* dp = new G4DynamicParticle (G4Electron::Electron(),deltaDirection,secondaryKinetic) ;
504  fvect->push_back(dp);
505 
506  const G4Track * theIncomingTrack = fParticleChangeForGamma->GetCurrentTrack();
508  ionizationShell,
509  theIncomingTrack);
510  }
511 
512 }
void set(double x, double y, double z)
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
G4double GetKineticEnergy() const
double x() const
G4ParticleDefinition * GetDefinition() const
int G4int
Definition: G4Types.hh:78
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4String & GetParticleName() const
double z() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
float electron_mass_c2
Definition: hepunit.py:274
static G4DNAChemistryManager * Instance()
G4double GetPDGMass() const
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
Hep3Vector unit() const
double y() const
G4ParticleChangeForGamma * fParticleChangeForGamma
const G4Track * GetCurrentTrack() const
static G4Electron * Electron()
Definition: G4Electron.cc:94
void SetProposedKineticEnergy(G4double proposedKinEnergy)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
G4double bindingEnergy(G4int A, G4int Z)
G4AtomicShellEnumerator
void G4DNABornIonisationModel::SelectFasterComputation ( G4bool  input)
inline

Definition at line 162 of file G4DNABornIonisationModel.hh.

163 {
164  fasterCode = input;
165 }

Field Documentation

G4ParticleChangeForGamma* G4DNABornIonisationModel::fParticleChangeForGamma
protected

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