Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronKiller.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27//---------------------------------------------------------------------------
28//
29// ClassName: G4NeutronKiller
30//
31// Description: The process to kill particles to save CPU
32//
33// Author: V.Ivanchenko 26/09/00 for HARP software
34//
35//----------------------------------------------------------------------------
36//
37//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
39
40#include "G4NeutronKiller.hh"
41
42#include "G4SystemOfUnits.hh"
45
46//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47
49 : G4VDiscreteProcess(processName, aType)
50{
51 // set Process Sub Type
53
54 kinEnergyThreshold = 0.0;
55 timeThreshold = DBL_MAX;
56 pMess = new G4NeutronKillerMessenger(this);
57}
58
59//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60
62{
63 delete pMess;
64}
65
66//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
69{
70 return (particle.GetParticleName() == "neutron");
71}
72
73//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74
76{
77 timeThreshold = val;
78 if(verboseLevel > 0)
79 G4cout << "### G4NeutronKiller: timeLimit(ns) = "
80 << timeThreshold/ns << G4endl;
81}
82
83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84
86{
87 kinEnergyThreshold = val;
88 if(verboseLevel > 0)
89 G4cout << "### G4NeutronKiller: Tracking cut E(MeV) = "
90 << kinEnergyThreshold/MeV << G4endl;
91}
92
93//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
94
96 const G4Track& aTrack,
98{
99 // condition is set to "Not Forced"
101
102 return (aTrack.GetGlobalTime() > timeThreshold ||
103 aTrack.GetKineticEnergy() < kinEnergyThreshold) ? 0.0 : DBL_MAX;
104}
105
106//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107
110{
111 return DBL_MAX;
112}
113
114//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115
117 const G4Step&)
118{
121 return pParticleChange;
122}
123
124//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double condition(const G4ErrorSymMatrix &m)
G4ForceCondition
@ NotForced
G4ProcessType
@ fStopAndKill
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void SetTimeLimit(G4double)
virtual ~G4NeutronKiller()
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4NeutronKiller(const G4String &processName="nKiller", G4ProcessType aType=fGeneral)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
virtual G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *)
void SetKinEnergyLimit(G4double)
const G4String & GetParticleName() const
Definition: G4Step.hh:62
G4double GetGlobalTime() const
G4double GetKineticEnergy() const
void ProposeTrackStatus(G4TrackStatus status)
virtual void Initialize(const G4Track &)
G4int verboseLevel
Definition: G4VProcess.hh:360
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:410
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:325
#define DBL_MAX
Definition: templates.hh:62
#define ns(x)
Definition: xmltok.c:1649