Import Geant4 10.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2019-12-06 15:12:28 +01:00
parent b2a62ae692
commit 5baee230e9
2997 changed files with 141580 additions and 98673 deletions
+26 -16
View File
@@ -100,12 +100,13 @@ G4OpWLS::~G4OpWLS()
G4VParticleChange*
G4OpWLS::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
{
std::vector<G4Track*> proposedSecondaries;
aParticleChange.Initialize(aTrack);
aParticleChange.ProposeTrackStatus(fStopAndKill);
if (verboseLevel>0) {
G4cout << "\n** Photon absorbed! **" << G4endl;
G4cout << "\n** G4OpWLS: Photon absorbed! **" << G4endl;
}
const G4Material* aMaterial = aTrack.GetMaterial();
@@ -144,8 +145,6 @@ G4OpWLS::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
}
aParticleChange.SetNumberOfSecondaries(NumPhotons);
G4double primaryEnergy = aTrack.GetDynamicParticle()->GetKineticEnergy();
G4int materialIndex = aMaterial->GetIndex();
@@ -180,10 +179,10 @@ G4OpWLS::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
G4double CIIvalue = G4UniformRand()*CIImax;
sampledEnergy = WLSIntegral->GetEnergy(CIIvalue);
if (verboseLevel>1) {
G4cout << "sampledEnergy = " << sampledEnergy << G4endl;
G4cout << "CIIvalue = " << CIIvalue << G4endl;
}
//if (verboseLevel>1) {
// G4cout << "G4OpWLS: sampledEnergy = " << sampledEnergy << G4endl;
// G4cout << "G4OpWLS: CIIvalue = " << CIIvalue << G4endl;
//}
if (sampledEnergy <= primaryEnergy) break;
}
@@ -191,19 +190,26 @@ G4OpWLS::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
// If no such energy can be sampled, return one less secondary, or none
if (sampledEnergy > primaryEnergy) {
if (verboseLevel>1)
G4cout << " *** One less WLS photon will be returned ***" << G4endl;
if (verboseLevel>1) {
G4cout << " *** G4OpWLS: One less WLS photon will be returned ***"
<< G4endl;
}
NumberOfPhotons--;
aParticleChange.SetNumberOfSecondaries(NumberOfPhotons);
if (NumberOfPhotons == 0) {
if (verboseLevel>1)
G4cout << " *** No WLS photon can be sampled for this primary ***"
<< G4endl;
if (verboseLevel>1) {
G4cout <<
" *** G4OpWLS: No WLS photon can be sampled for this primary ***"
<< G4endl;
}
// return unchanged particle and no secondaries
aParticleChange.SetNumberOfSecondaries(0);
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
continue;
}
} else if (verboseLevel > 0) {
G4cout << "G4OpWLS: Created photon with energy: " << sampledEnergy
<< G4endl;
}
// Generate random photon direction
@@ -268,10 +274,14 @@ G4OpWLS::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
// aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0);
aSecondaryTrack->SetParentID(aTrack.GetTrackID());
aParticleChange.AddSecondary(aSecondaryTrack);
proposedSecondaries.push_back(aSecondaryTrack);
}
aParticleChange.SetNumberOfSecondaries(proposedSecondaries.size());
for (auto sec : proposedSecondaries) {
aParticleChange.AddSecondary(sec);
}
if (verboseLevel>0) {
G4cout << "\n Exiting from G4OpWLS::DoIt -- NumberOfSecondaries = "
<< aParticleChange.GetNumberOfSecondaries() << G4endl;