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
"
43
#include "
G4NeutronKillerMessenger.hh
"
44
#include "
G4TransportationProcessType.hh
"
45
46
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47
48
G4NeutronKiller::G4NeutronKiller
(
const
G4String
& processName,
G4ProcessType
aType)
49
:
G4VDiscreteProcess
(processName, aType)
50
{
51
// set Process Sub Type
52
SetProcessSubType
(
NEUTRON_KILLER
);
53
54
kinEnergyThreshold = 0.0;
55
timeThreshold =
DBL_MAX
;
56
pMess =
new
G4NeutronKillerMessenger
(
this
);
57
}
58
59
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60
61
G4NeutronKiller::~G4NeutronKiller
()
62
{
63
delete
pMess;
64
}
65
66
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
68
G4bool
G4NeutronKiller::IsApplicable
(
const
G4ParticleDefinition
& particle)
69
{
70
return
(particle.
GetParticleName
() ==
"neutron"
);
71
}
72
73
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74
75
void
G4NeutronKiller::SetTimeLimit
(
G4double
val)
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
85
void
G4NeutronKiller::SetKinEnergyLimit
(
G4double
val)
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
95
G4double
G4NeutronKiller::PostStepGetPhysicalInteractionLength
(
96
const
G4Track
& aTrack,
97
G4double
,
G4ForceCondition
*
condition
)
98
{
99
// condition is set to "Not Forced"
100
*
condition
=
NotForced
;
101
102
return
(aTrack.
GetGlobalTime
() > timeThreshold ||
103
aTrack.
GetKineticEnergy
() < kinEnergyThreshold) ? 0.0 :
DBL_MAX
;
104
}
105
106
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107
108
G4double
G4NeutronKiller::GetMeanFreePath
(
const
G4Track
&,
G4double
,
109
G4ForceCondition
*)
110
{
111
return
DBL_MAX
;
112
}
113
114
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115
116
G4VParticleChange
*
G4NeutronKiller::PostStepDoIt
(
const
G4Track
& aTrack,
117
const
G4Step
&)
118
{
119
pParticleChange
->
Initialize
(aTrack);
120
pParticleChange
->
ProposeTrackStatus
(
fStopAndKill
);
121
return
pParticleChange
;
122
}
123
124
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
condition
G4double condition(const G4ErrorSymMatrix &m)
G4ForceCondition
G4ForceCondition
Definition:
G4ForceCondition.hh:41
NotForced
@ NotForced
Definition:
G4ForceCondition.hh:47
G4NeutronKillerMessenger.hh
G4NeutronKiller.hh
G4ProcessType
G4ProcessType
Definition:
G4ProcessType.hh:38
G4SystemOfUnits.hh
fStopAndKill
@ fStopAndKill
Definition:
G4TrackStatus.hh:46
G4TransportationProcessType.hh
NEUTRON_KILLER
@ NEUTRON_KILLER
Definition:
G4TransportationProcessType.hh:49
G4double
double G4double
Definition:
G4Types.hh:83
G4bool
bool G4bool
Definition:
G4Types.hh:86
G4endl
#define G4endl
Definition:
G4ios.hh:57
G4cout
G4GLOB_DLL std::ostream G4cout
G4NeutronKillerMessenger
Definition:
G4NeutronKillerMessenger.hh:53
G4NeutronKiller::SetTimeLimit
void SetTimeLimit(G4double)
Definition:
G4NeutronKiller.cc:75
G4NeutronKiller::~G4NeutronKiller
virtual ~G4NeutronKiller()
Definition:
G4NeutronKiller.cc:61
G4NeutronKiller::PostStepDoIt
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
Definition:
G4NeutronKiller.cc:116
G4NeutronKiller::G4NeutronKiller
G4NeutronKiller(const G4String &processName="nKiller", G4ProcessType aType=fGeneral)
Definition:
G4NeutronKiller.cc:48
G4NeutronKiller::PostStepGetPhysicalInteractionLength
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
Definition:
G4NeutronKiller.cc:95
G4NeutronKiller::IsApplicable
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition:
G4NeutronKiller.cc:68
G4NeutronKiller::GetMeanFreePath
virtual G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *)
Definition:
G4NeutronKiller.cc:108
G4NeutronKiller::SetKinEnergyLimit
void SetKinEnergyLimit(G4double)
Definition:
G4NeutronKiller.cc:85
G4ParticleDefinition
Definition:
G4ParticleDefinition.hh:61
G4ParticleDefinition::GetParticleName
const G4String & GetParticleName() const
Definition:
G4ParticleDefinition.hh:109
G4Step
Definition:
G4Step.hh:62
G4String
Definition:
G4String.hh:62
G4Track
Definition:
G4Track.hh:67
G4Track::GetGlobalTime
G4double GetGlobalTime() const
G4Track::GetKineticEnergy
G4double GetKineticEnergy() const
G4VDiscreteProcess
Definition:
G4VDiscreteProcess.hh:46
G4VParticleChange
Definition:
G4VParticleChange.hh:69
G4VParticleChange::ProposeTrackStatus
void ProposeTrackStatus(G4TrackStatus status)
G4VParticleChange::Initialize
virtual void Initialize(const G4Track &)
G4VProcess::verboseLevel
G4int verboseLevel
Definition:
G4VProcess.hh:360
G4VProcess::SetProcessSubType
void SetProcessSubType(G4int)
Definition:
G4VProcess.hh:410
G4VProcess::pParticleChange
G4VParticleChange * pParticleChange
Definition:
G4VProcess.hh:325
DBL_MAX
#define DBL_MAX
Definition:
templates.hh:62
ns
#define ns(x)
Definition:
xmltok.c:1649
geant4-v11.1.1
source
processes
transportation
src
G4NeutronKiller.cc
Generated by
1.9.6