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

#include <G4BoldyshevTripletModel.hh>

+ Inheritance diagram for G4BoldyshevTripletModel:

Public Member Functions

 G4BoldyshevTripletModel (const G4ParticleDefinition *p=nullptr, const G4String &nam="BoldyshevTripletConversion")
 
virtual ~G4BoldyshevTripletModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cut=0., G4double emax=DBL_MAX)
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double)
 
- 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 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 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 *, const G4double &length, G4double &eloss)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
virtual void FillNumberOfSecondaries (G4int &numberOfTriplets, G4int &numberOfRecoil)
 
virtual void ModelDescription (std::ostream &outFile) const
 
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)
 
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)
 
const G4ElementGetCurrentElement (const G4Material *mat=nullptr) const
 
G4int SelectRandomAtomNumber (const G4Material *) const
 
const G4IsotopeGetCurrentIsotope (const G4Element *elm=nullptr) const
 
G4int SelectIsotopeNumber (const G4Element *) const
 
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 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 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 *)
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 
void SetLPMFlag (G4bool)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

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 *)
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData = nullptr
 
G4VParticleChangepParticleChange = nullptr
 
G4PhysicsTablexSectionTable = nullptr
 
const G4MaterialpBaseMaterial = nullptr
 
const std::vector< G4double > * theDensityFactor = nullptr
 
const std::vector< G4int > * theDensityIdx = nullptr
 
G4double inveplus
 
G4double pFactor = 1.0
 
std::size_t currentCoupleIndex = 0
 
std::size_t basedCoupleIndex = 0
 
G4bool lossFlucFlag = true
 

Detailed Description

Definition at line 39 of file G4BoldyshevTripletModel.hh.

Constructor & Destructor Documentation

◆ G4BoldyshevTripletModel()

G4BoldyshevTripletModel::G4BoldyshevTripletModel ( const G4ParticleDefinition * p = nullptr,
const G4String & nam = "BoldyshevTripletConversion" )
explicit

Definition at line 46 of file G4BoldyshevTripletModel.cc.

47 :G4VEmModel(nam),smallEnergy(4.*MeV)
48{
49 fParticleChange = nullptr;
50
51 lowEnergyLimit = 4.0*electron_mass_c2;
52 momentumThreshold_c = energyThreshold = xb = xn = lowEnergyLimit;
53
54 verboseLevel= 0;
55 // Verbosity scale for debugging purposes:
56 // 0 = nothing
57 // 1 = calculation of cross sections, file openings...
58 // 2 = entering in methods
59
60 if(verboseLevel > 0)
61 {
62 G4cout << "G4BoldyshevTripletModel is constructed " << G4endl;
63 }
64}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4VEmModel(const G4String &nam)
Definition G4VEmModel.cc:67

◆ ~G4BoldyshevTripletModel()

G4BoldyshevTripletModel::~G4BoldyshevTripletModel ( )
virtual

Definition at line 68 of file G4BoldyshevTripletModel.cc.

69{
70 if(IsMaster()) {
71 for(G4int i=0; i<maxZ; ++i) {
72 if(data[i]) {
73 delete data[i];
74 data[i] = nullptr;
75 }
76 }
77 }
78}
int G4int
Definition G4Types.hh:85
G4bool IsMaster() const

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4BoldyshevTripletModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition * part,
G4double kinEnergy,
G4double Z,
G4double A = 0.,
G4double cut = 0.,
G4double emax = DBL_MAX )
virtual

Reimplemented from G4VEmModel.

Definition at line 208 of file G4BoldyshevTripletModel.cc.

211{
212 if (verboseLevel > 1)
213 {
214 G4cout << "Calling ComputeCrossSectionPerAtom() of G4BoldyshevTripletModel"
215 << G4endl;
216 }
217
218 if (GammaEnergy < lowEnergyLimit) { return 0.0; }
219
220 G4double xs = 0.0;
221 G4int intZ = std::max(1, std::min(G4lrint(Z), maxZ));
222 G4PhysicsFreeVector* pv = data[intZ];
223
224 // if element was not initialised
225 // do initialisation safely for MT mode
226 if(!pv)
227 {
228 InitialiseForElement(part, intZ);
229 pv = data[intZ];
230 if(!pv) { return xs; }
231 }
232 // x-section is taken from the table
233 xs = pv->Value(GammaEnergy);
234
235 if(verboseLevel > 1)
236 {
237 G4cout << "*** Triplet conversion xs for Z=" << Z << " at energy E(MeV)="
238 << GammaEnergy/MeV << " cs=" << xs/millibarn << " mb" << G4endl;
239 }
240 return xs;
241}
double G4double
Definition G4Types.hh:83
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
G4double Value(const G4double energy, std::size_t &lastidx) const
int G4lrint(double ad)
Definition templates.hh:134

◆ Initialise()

void G4BoldyshevTripletModel::Initialise ( const G4ParticleDefinition * ,
const G4DataVector &  )
virtual

Implements G4VEmModel.

Definition at line 82 of file G4BoldyshevTripletModel.cc.

84{
85 if (verboseLevel > 1)
86 {
87 G4cout << "Calling Initialise() of G4BoldyshevTripletModel."
88 << G4endl
89 << "Energy range: "
90 << LowEnergyLimit() / MeV << " MeV - "
91 << HighEnergyLimit() / GeV << " GeV isMaster: " << IsMaster()
92 << G4endl;
93 }
94 // compute values only once
95 energyThreshold = 1.1*electron_mass_c2;
96 momentumThreshold_c = std::sqrt(energyThreshold * energyThreshold
97 - electron_mass_c2*electron_mass_c2);
98 G4double momentumThreshold_N = momentumThreshold_c/electron_mass_c2;
99 G4double t = 0.5*G4Log(momentumThreshold_N +
100 std::sqrt(momentumThreshold_N*momentumThreshold_N + 1.0));
101 //G4cout << 0.5*asinh(momentumThreshold_N) << " " << t << G4endl;
102 G4double sinht = std::sinh(t);
103 G4double cosht = std::cosh(t);
104 G4double logsinht = G4Log(2.*sinht);
105 G4double J1 = 0.5*(t*cosht/sinht - logsinht);
106 G4double J2 = (-2./3.)*logsinht + t*cosht/sinht
107 + (sinht - t*cosht*cosht*cosht)/(3.*sinht*sinht*sinht);
108
109 xb = 2.*(J1-J2)/J1;
110 xn = 1. - xb/6.;
111
112 if(IsMaster())
113 {
114 // Access to elements
115 const char* path = G4FindDataDir("G4LEDATA");
116
117 G4ProductionCutsTable* theCoupleTable =
119
120 G4int numOfCouples = (G4int)theCoupleTable->GetTableSize();
121
122 for(G4int i=0; i<numOfCouples; ++i)
123 {
124 const G4Material* material =
125 theCoupleTable->GetMaterialCutsCouple(i)->GetMaterial();
126 const G4ElementVector* theElementVector = material->GetElementVector();
127 std::size_t nelm = material->GetNumberOfElements();
128
129 for (std::size_t j=0; j<nelm; ++j)
130 {
131 G4int Z = std::min((*theElementVector)[j]->GetZasInt(), maxZ);
132 if(!data[Z]) { ReadData(Z, path); }
133 }
134 }
135 }
136 if(!fParticleChange) {
137 fParticleChange = GetParticleChangeForGamma();
138 }
139}
std::vector< const G4Element * > G4ElementVector
const char * G4FindDataDir(const char *)
G4double G4Log(G4double x)
Definition G4Log.hh:227
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
std::size_t GetNumberOfElements() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const

◆ InitialiseForElement()

void G4BoldyshevTripletModel::InitialiseForElement ( const G4ParticleDefinition * ,
G4int Z )
virtual

Reimplemented from G4VEmModel.

Definition at line 393 of file G4BoldyshevTripletModel.cc.

395{
396 G4AutoLock l(&BoldyshevTripletModelMutex);
397 // G4cout << "G4BoldyshevTripletModel::InitialiseForElement Z= "
398 // << Z << G4endl;
399 if(!data[Z]) { ReadData(Z); }
400 l.unlock();
401}

Referenced by ComputeCrossSectionPerAtom().

◆ MinPrimaryEnergy()

G4double G4BoldyshevTripletModel::MinPrimaryEnergy ( const G4Material * ,
const G4ParticleDefinition * ,
G4double  )
virtual

Reimplemented from G4VEmModel.

Definition at line 144 of file G4BoldyshevTripletModel.cc.

147{
148 return lowEnergyLimit;
149}

◆ SampleSecondaries()

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

Implements G4VEmModel.

Definition at line 245 of file G4BoldyshevTripletModel.cc.

250{
251
252 // The energies of the secondary particles are sampled using
253 // a modified Wheeler-Lamb model (see PhysRevD 7 (1973), 26)
254 if (verboseLevel > 1) {
255 G4cout << "Calling SampleSecondaries() of G4BoldyshevTripletModel"
256 << G4endl;
257 }
258
259 G4double photonEnergy = aDynamicGamma->GetKineticEnergy();
260 G4ParticleMomentum photonDirection = aDynamicGamma->GetMomentumDirection();
261
263
264 CLHEP::HepRandomEngine* rndmEngine = G4Random::getTheEngine();
265
266 // recoil electron thould be 3d particle
267 G4DynamicParticle* particle3 = nullptr;
268 static const G4double costlim = std::cos(4.47*CLHEP::pi/180.);
269
270 G4double loga, f1_re, greject, cost;
271 G4double cosThetaMax = (energyThreshold - electron_mass_c2
272 + electron_mass_c2*(energyThreshold + electron_mass_c2)/photonEnergy )
273 /momentumThreshold_c;
274 if (cosThetaMax > 1.) {
275 //G4cout << "G4BoldyshevTripletModel::SampleSecondaries: ERROR cosThetaMax= "
276 // << cosThetaMax << G4endl;
277 cosThetaMax = 1.0;
278 }
279
280 G4double logcostm = G4Log(cosThetaMax);
281 do {
282 cost = G4Exp(logcostm*rndmEngine->flat());
283 G4double are = 1./(14.*cost*cost);
284 G4double bre = (1.-5.*cost*cost)/(2.*cost);
285 loga = G4Log((1.+ cost)/(1.- cost));
286 f1_re = 1. - bre*loga;
287 greject = (cost < costlim) ? are*f1_re : 1.0;
288 } while(greject < rndmEngine->flat());
289
290 // Calculo de phi - elecron de recoil
291 G4double sint2 = (1. - cost)*(1. + cost);
292 G4double fp = 1. - sint2*loga/(2.*cost) ;
293 G4double rt, phi_re;
294 do {
295 phi_re = twopi*rndmEngine->flat();
296 rt = (1. - std::cos(2.*phi_re)*fp/f1_re)/twopi;
297 } while(rt < rndmEngine->flat());
298
299 // Calculo de la energia - elecron de recoil - relacion momento maximo <-> angulo
300 G4double S = electron_mass_c2*(2.* photonEnergy + electron_mass_c2);
301 G4double P2 = S - electron_mass_c2*electron_mass_c2;
302
303 G4double D2 = 4.*S * electron_mass_c2*electron_mass_c2 + P2*P2*sint2;
304 G4double ener_re = electron_mass_c2 * (S + electron_mass_c2*electron_mass_c2)/sqrt(D2);
305
306 if(ener_re >= energyThreshold)
307 {
308 G4double electronRKineEnergy = ener_re - electron_mass_c2;
309 G4double sint = std::sqrt(sint2);
310 G4ThreeVector electronRDirection (sint*std::cos(phi_re), sint*std::sin(phi_re), cost);
311 electronRDirection.rotateUz(photonDirection);
312 particle3 = new G4DynamicParticle (G4Electron::Electron(),
313 electronRDirection,
314 electronRKineEnergy);
315 }
316 else
317 {
318 // deposito la energia ener_re - electron_mass_c2
319 // G4cout << "electron de retroceso " << ener_re << G4endl;
320 fParticleChange->ProposeLocalEnergyDeposit(std::max(0.0, ener_re - electron_mass_c2));
321 ener_re = 0.0;
322 }
323
324 // Depaola (2004) suggested distribution for e+e- energy
325 // VI: very suspect that 1 random number is not enough
326 // and sampling below is not correct - should be fixed
327 G4double re = rndmEngine->flat();
328
329 G4double a = std::sqrt(16./xb - 3. - 36.*re*xn + 36.*re*re*xn*xn + 6.*xb*re*xn);
330 G4double c1 = G4Exp(G4Log((-6. + 12.*re*xn + xb + 2*a)*xb*xb)/3.);
331 epsilon = c1/(2.*xb) + (xb - 4.)/(2.*c1) + 0.5;
332
333 G4double photonEnergy1 = photonEnergy - ener_re ;
334 // resto al foton la energia del electron de retro.
335 G4double positronTotEnergy = std::max(epsilon*photonEnergy1, electron_mass_c2);
336 G4double electronTotEnergy = std::max(photonEnergy1 - positronTotEnergy, electron_mass_c2);
337
338 static const G4double a1 = 1.6;
339 static const G4double a2 = 0.5333333333;
340 G4double uu = -G4Log(rndmEngine->flat()*rndmEngine->flat());
341 G4double u = (0.25 > rndmEngine->flat()) ? uu*a1 : uu*a2;
342
343 G4double thetaEle = u*electron_mass_c2/electronTotEnergy;
344 G4double sinte = std::sin(thetaEle);
345 G4double coste = std::cos(thetaEle);
346
347 G4double thetaPos = u*electron_mass_c2/positronTotEnergy;
348 G4double sintp = std::sin(thetaPos);
349 G4double costp = std::cos(thetaPos);
350
351 G4double phi = twopi * rndmEngine->flat();
352 G4double sinp = std::sin(phi);
353 G4double cosp = std::cos(phi);
354
355 // Kinematics of the created pair:
356 // the electron and positron are assumed to have a symetric angular
357 // distribution with respect to the Z axis along the parent photon
358
359 G4double electronKineEnergy = electronTotEnergy - electron_mass_c2;
360
361 G4ThreeVector electronDirection (sinte*cosp, sinte*sinp, coste);
362 electronDirection.rotateUz(photonDirection);
363
365 electronDirection,
366 electronKineEnergy);
367
368 G4double positronKineEnergy = positronTotEnergy - electron_mass_c2;
369
370 G4ThreeVector positronDirection (-sintp*cosp, -sintp*sinp, costp);
371 positronDirection.rotateUz(photonDirection);
372
373 // Create G4DynamicParticle object for the particle2
375 positronDirection, positronKineEnergy);
376 // Fill output vector
377
378 fvect->push_back(particle1);
379 fvect->push_back(particle2);
380
381 if(particle3) { fvect->push_back(particle3); }
382
383 // kill incident photon
384 fParticleChange->SetProposedKineticEnergy(0.);
385 fParticleChange->ProposeTrackStatus(fStopAndKill);
386}
G4double epsilon(G4double density, G4double temperature)
G4double S(G4double temp)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition G4Exp.hh:180
@ fStopAndKill
virtual double flat()=0
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
Definition G4Electron.cc:91
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static G4Positron * Positron()
Definition G4Positron.cc:90
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
double flat()

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