Import Geant4 8.1.0 source tree
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DNAChargeIncreaseInWater.icc,v 1.4 2006/06/29 19:33:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#ifdef G4DNACHARGEINCREASEINWATER_HH
|
||||
#include "G4Electron.hh"
|
||||
|
||||
template<typename TotalCrossSectionPolicy, typename FinalStatesPolicy>
|
||||
G4VParticleChange* G4DNAChargeIncreaseInWater<TotalCrossSectionPolicy, FinalStatesPolicy>::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
{
|
||||
this->aParticleChange.Initialize(aTrack);
|
||||
this->aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
this->aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
|
||||
G4double inK(aTrack.GetDynamicParticle()->GetKineticEnergy());
|
||||
|
||||
const G4int z(10); // H2O number of electrons
|
||||
G4int finalStateIndex(TotalCrossSectionPolicy::RandomizePartialCrossSection(inK, z));
|
||||
|
||||
G4int n(FinalStatesPolicy::NumberOfFinalStates(finalStateIndex));
|
||||
G4double outK(inK-FinalStatesPolicy::IncomingParticleBindingEnergyConstant(finalStateIndex));
|
||||
G4double electronK(inK*electron_mass_c2/proton_mass_c2);
|
||||
|
||||
if (outK<0)
|
||||
{
|
||||
G4String message;
|
||||
message="G4DNAChargeIncreaseInWater<>::PostStepDoIt - Final kinetic energy is below 0! Process ";
|
||||
message+=this->GetProcessName();
|
||||
|
||||
G4Exception(message);
|
||||
}
|
||||
|
||||
this->aParticleChange.SetNumberOfSecondaries(n+1);
|
||||
this->aParticleChange.AddSecondary(new G4DynamicParticle(FinalStatesPolicy::OutgoingParticleDefinition(finalStateIndex), aTrack.GetDynamicParticle()->GetMomentumDirection(), outK));
|
||||
|
||||
while (n>0)
|
||||
{
|
||||
n--;
|
||||
|
||||
this->aParticleChange.AddSecondary(new G4DynamicParticle(FinalStatesPolicy::OutgoingParticleDefinition(finalStateIndex), aTrack.GetDynamicParticle()->GetMomentumDirection(), electronK));
|
||||
}
|
||||
|
||||
return G4VDNAProcessInWater<TotalCrossSectionPolicy, FinalStatesPolicy>::PostStepDoIt(aTrack, aStep);
|
||||
}
|
||||
#endif /* G4DNACHARGEINCREASEINWATER_HH */
|
||||
Reference in New Issue
Block a user