Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -16,7 +16,14 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
23 May 19: D. Sawkey (op-v10-05-00)
|
||||
28 Oct 19: D. Sawkey (op-V10-05-02)
|
||||
- G4OpWLS.cc - call G4VParticleChange->SetNumberOfSecondaries only once
|
||||
- address bug 2200
|
||||
|
||||
23 Aug 19: D. Sawkey (op-V10-05-01)
|
||||
- G4OpBoundaryProcess: fix Coverity reports
|
||||
|
||||
23 May 19: D. Sawkey (op-V10-05-00)
|
||||
- most files: format indentation, parentheses; add C++11 keywords;
|
||||
- some changes to if/else loops and variable names
|
||||
|
||||
|
||||
@@ -471,9 +471,10 @@ G4OpBoundaryProcess::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
|
||||
if (theStatus == FresnelRefraction || theStatus == Transmission ) {
|
||||
G4MaterialPropertyVector* groupvel =
|
||||
Material2->GetMaterialPropertiesTable()->GetProperty(kGROUPVEL);
|
||||
G4double finalVelocity = groupvel->Value(thePhotonMomentum);
|
||||
aParticleChange.ProposeVelocity(finalVelocity);
|
||||
Material2->GetMaterialPropertiesTable()->GetProperty(kGROUPVEL);
|
||||
if (groupvel) {
|
||||
aParticleChange.ProposeVelocity(groupvel->Value(thePhotonMomentum));
|
||||
}
|
||||
}
|
||||
|
||||
if (theStatus == Detection && fInvokeSD) InvokeSD(pStep);
|
||||
@@ -1131,7 +1132,6 @@ void G4OpBoundaryProcess::DielectricDielectric()
|
||||
alpha = cost1 - cost2*(Rindex2/Rindex1);
|
||||
NewMomentum = OldMomentum + alpha*theFacetNormal;
|
||||
NewMomentum = NewMomentum.unit();
|
||||
PdotN = -cost2;
|
||||
A_paral = NewMomentum.cross(A_trans);
|
||||
A_paral = A_paral.unit();
|
||||
E2_abs = std::sqrt(E2_total);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user