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

#include <G4ElasticHadrNucleusHE.hh>

+ Inheritance diagram for G4ElasticHadrNucleusHE:

Public Member Functions

 G4ElasticHadrNucleusHE (const G4String &name="hElasticGlauber")
 
 ~G4ElasticHadrNucleusHE () override
 
G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A) override
 
void InitialiseModel () override
 
void ModelDescription (std::ostream &) const override
 
- Public Member Functions inherited from G4HadronElastic
 G4HadronElastic (const G4String &name="hElasticLHEP")
 
 ~G4HadronElastic () override
 
G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus) override
 
G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A) override
 
G4double GetSlopeCof (const G4int pdg)
 
void SetLowestEnergyLimit (G4double value)
 
G4double LowestEnergyLimit () const
 
G4double ComputeMomentumCMS (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
 
void ModelDescription (std::ostream &) const override
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
 
virtual G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
 
virtual G4bool IsApplicable (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
 
G4double GetMinEnergy () const
 
G4double GetMinEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMinEnergy (G4double anEnergy)
 
void SetMinEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMinEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4double GetMaxEnergy () const
 
G4double GetMaxEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMaxEnergy (const G4double anEnergy)
 
void SetMaxEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMaxEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int value)
 
const G4StringGetModelName () const
 
void DeActivateFor (const G4Material *aMaterial)
 
void ActivateFor (const G4Material *aMaterial)
 
void DeActivateFor (const G4Element *anElement)
 
void ActivateFor (const G4Element *anElement)
 
G4bool IsBlocked (const G4Material *aMaterial) const
 
G4bool IsBlocked (const G4Element *anElement) const
 
void SetRecoilEnergyThreshold (G4double val)
 
G4double GetRecoilEnergyThreshold () const
 
virtual const std::pair< G4double, G4doubleGetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void ModelDescription (std::ostream &outFile) const
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void InitialiseModel ()
 
 G4HadronicInteraction (const G4HadronicInteraction &right)=delete
 
const G4HadronicInteractionoperator= (const G4HadronicInteraction &right)=delete
 
G4bool operator== (const G4HadronicInteraction &right) const =delete
 
G4bool operator!= (const G4HadronicInteraction &right) const =delete
 

Additional Inherited Members

- Protected Member Functions inherited from G4HadronicInteraction
void SetModelName (const G4String &nam)
 
G4bool IsBlocked () const
 
void Block ()
 
- Protected Attributes inherited from G4HadronElastic
G4double pLocalTmax
 
- Protected Attributes inherited from G4HadronicInteraction
G4HadFinalState theParticleChange
 
G4int verboseLevel
 
G4double theMinEnergy
 
G4double theMaxEnergy
 
G4bool isBlocked
 

Detailed Description

Definition at line 94 of file G4ElasticHadrNucleusHE.hh.

Constructor & Destructor Documentation

◆ G4ElasticHadrNucleusHE()

G4ElasticHadrNucleusHE::G4ElasticHadrNucleusHE ( const G4String name = "hElasticGlauber")
explicit

Definition at line 244 of file G4ElasticHadrNucleusHE.cc.

245 : G4HadronElastic(name), fDirectory(nullptr), isMaster(false)
246{
247 dQ2 = hMass = hMass2 = hLabMomentum = hLabMomentum2 = HadrEnergy
248 = R1 = R2 = Pnucl = Aeff = HadrTot = HadrSlope = HadrReIm = TotP = DDSect2
249 = DDSect3 = ConstU = Slope1 = Slope2 = Coeff1 = Coeff2
250 = Slope0 = Coeff0 = aAIm = aDIm = Dtot11 = Q2max = 0.0;
251 iHadrCode = iHadron = iHadron1 = 0;
252
253 verboseLevel = 0;
254 ekinLowLimit = 400.0*CLHEP::MeV;
255
256 BoundaryP[0]=9.0; BoundaryTG[0]=5.0;BoundaryTL[0]=0.;
257 BoundaryP[1]=20.0;BoundaryTG[1]=1.5;BoundaryTL[1]=0.;
258 BoundaryP[2]=5.0; BoundaryTG[2]=1.0;BoundaryTL[2]=1.5;
259 BoundaryP[3]=8.0; BoundaryTG[3]=3.0;BoundaryTL[3]=0.;
260 BoundaryP[4]=7.0; BoundaryTG[4]=3.0;BoundaryTL[4]=0.;
261 BoundaryP[5]=5.0; BoundaryTG[5]=2.0;BoundaryTL[5]=0.;
262 BoundaryP[6]=5.0; BoundaryTG[6]=1.5;BoundaryTL[6]=3.0;
263
264 nistManager = G4NistManager::Instance();
265
266 if(fEnergy[0] == 0.0) {
267#ifdef G4MULTITHREADED
268 G4MUTEXLOCK(&elasticMutex);
269 if(fEnergy[0] == 0.0) {
270#endif
271 isMaster = true;
272 Binom();
273 // energy in GeV
274 fEnergy[0] = 0.4;
275 fEnergy[1] = 0.6;
276 fEnergy[2] = 0.8;
277 fEnergy[3] = 1.0;
278 fLowEdgeEnergy[0] = 0.0;
279 fLowEdgeEnergy[1] = 0.5;
280 fLowEdgeEnergy[2] = 0.7;
281 fLowEdgeEnergy[3] = 0.9;
282 G4double f = G4Exp(G4Log(10.)*0.1);
283 G4double e = f*f;
284 for(G4int i=4; i<NENERGY; ++i) {
285 fEnergy[i] = e;
286 fLowEdgeEnergy[i] = e/f;
287 e *= f*f;
288 }
289 if(verboseLevel > 0) {
290 G4cout << "### G4ElasticHadrNucleusHE: energy points in GeV" << G4endl;
291 for(G4int i=0; i<NENERGY; ++i) {
292 G4cout << " " << i << " " << fLowEdgeEnergy[i]
293 << " " << fEnergy[i] << G4endl;
294 }
295 }
296#ifdef G4MULTITHREADED
297 }
298 G4MUTEXUNLOCK(&elasticMutex);
299#endif
300 }
301}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:179
G4double G4Log(G4double x)
Definition: G4Log.hh:226
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:251
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:254
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4NistManager * Instance()

◆ ~G4ElasticHadrNucleusHE()

G4ElasticHadrNucleusHE::~G4ElasticHadrNucleusHE ( )
override

Definition at line 315 of file G4ElasticHadrNucleusHE.cc.

316{
317 if(isMaster) {
318 for(G4int j = 0; j < NHADRONS; ++j) {
319 for(G4int k = 0; k < ZMAX; ++k) {
320 G4ElasticData* ptr = fElasticData[j][k];
321 if(ptr) {
322 delete ptr;
323 fElasticData[j][k] = nullptr;
324 for(G4int l = j+1; l < NHADRONS; ++l) {
325 if(ptr == fElasticData[l][k]) { fElasticData[l][k] = nullptr; }
326 }
327 }
328 }
329 }
330 delete fDirectory;
331 fDirectory = nullptr;
332 }
333}

Member Function Documentation

◆ InitialiseModel()

void G4ElasticHadrNucleusHE::InitialiseModel ( )
overridevirtual

Reimplemented from G4HadronicInteraction.

Definition at line 337 of file G4ElasticHadrNucleusHE.cc.

338{
339 if(!isMaster) { return; }
340 G4ProductionCutsTable* theCoupleTable=
342 size_t numOfCouples = theCoupleTable->GetTableSize();
343
344 for(G4int i=0; i<2; ++i) {
346 if(1 == i) { p = G4PionMinus::PionMinus(); }
347 iHadrCode = fHadronCode[i];
348 iHadron = fHadronType[i];
349 iHadron1 = fHadronType1[i];
350 hMass = p->GetPDGMass()*invGeV;
351 hMass2 = hMass*hMass;
352 for(size_t j=0; j<numOfCouples; ++j) {
353 auto mat = theCoupleTable->GetMaterialCutsCouple(j)->GetMaterial();
354 auto elmVec = mat->GetElementVector();
355 size_t numOfElem = mat->GetNumberOfElements();
356 for(size_t k=0; k<numOfElem; ++k) {
357 G4int Z = std::min((*elmVec)[k]->GetZasInt(), ZMAX-1);
358 if(!fElasticData[i][Z]) {
359 if(1 == i && Z > 1) {
360 fElasticData[1][Z] = fElasticData[0][Z];
361 } else {
362 FillData(p, i, Z);
363 }
364 }
365 }
366 }
367 }
368}
const G4double invGeV
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:188
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:97
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:97
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()

◆ ModelDescription()

void G4ElasticHadrNucleusHE::ModelDescription ( std::ostream &  outFile) const
overridevirtual

Reimplemented from G4HadronicInteraction.

Definition at line 305 of file G4ElasticHadrNucleusHE.cc.

306{
307 outFile << "G4ElasticHadrNucleusHE is a hadron-nucleus elastic scattering\n"
308 << "model developed by N. Starkov which uses a Glauber model\n"
309 << "parameterization to calculate the final state. It is valid\n"
310 << "for all hadrons with incident momentum above 0.4 GeV/c.\n";
311}

◆ SampleInvariantT()

G4double G4ElasticHadrNucleusHE::SampleInvariantT ( const G4ParticleDefinition p,
G4double  plab,
G4int  Z,
G4int  A 
)
overridevirtual

Reimplemented from G4HadronicInteraction.

Definition at line 373 of file G4ElasticHadrNucleusHE.cc.

376{
377 G4double mass = p->GetPDGMass();
378 G4double kine = sqrt(inLabMom*inLabMom + mass*mass) - mass;
379 if(kine <= ekinLowLimit) {
380 return G4HadronElastic::SampleInvariantT(p,inLabMom,iZ,A);
381 }
382 G4int Z = std::min(iZ,ZMAX-1);
383 G4double Q2 = 0.0;
384 iHadrCode = p->GetPDGEncoding();
385
386 // below computations in GeV/c
387 hMass = mass*invGeV;
388 hMass2 = hMass*hMass;
389 G4double plab = inLabMom*invGeV;
391
392 if(verboseLevel > 1) {
393 G4cout<< "G4ElasticHadrNucleusHE::SampleT: "
394 << " for " << p->GetParticleName()
395 << " at Z= " << Z << " A= " << A
396 << " plab(GeV)= " << plab
397 << " hadrCode= " << iHadrCode
398 << G4endl;
399 }
400 iHadron = -1;
401 G4int idx;
402 for(idx=0; idx<NHADRONS; ++idx) {
403 if(iHadrCode == fHadronCode[idx]) {
404 iHadron = fHadronType[idx];
405 iHadron1 = fHadronType1[idx];
406 break;
407 }
408 }
409 // Hadron is not in the list
410 if(0 > iHadron) { return 0.0; }
411
412 if(Z==1) {
413 Q2 = HadronProtonQ2(plab, tmax);
414
415 if (verboseLevel>1) {
416 G4cout<<" Proton : Q2 "<<Q2<<G4endl;
417 }
418 } else {
419 const G4ElasticData* ElD1 = fElasticData[idx][Z];
420
421 // Construct elastic data
422 if(!ElD1) {
423 FillData(p, idx, Z);
424 ElD1 = fElasticData[idx][Z];
425 if(!ElD1) { return 0.0; }
426 }
427
428 // sample scattering
429 Q2 = HadronNucleusQ2_2(ElD1, plab, tmax);
430
431 if(verboseLevel > 1) {
432 G4cout<<" SampleT: Q2(GeV^2)= "<<Q2<< " t/tmax= "
433 << Q2/tmax <<G4endl;
434 }
435 }
436 return Q2*GeV2;
437}
double A(double temperature)
const G4double invGeV2
const G4double GeV2
G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A) override
const G4String & GetParticleName() const

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