Geant4
10.02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
G4UCNLoss.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
// $Id: G4UCNLoss.cc 69576 2013-05-08 13:48:13Z gcosmo $
27
//
29
// Ultra Cold Neutron Loss Class Implementation
31
//
32
// File: G4UCNLoss.cc
33
// Description: Discrete Process -- Loss of UCN
34
// energy-independent loss cross section inside a material
35
// Version: 1.0
36
// Created: 2014-05-05
37
// Author: Peter Gumplinger
38
// Adopted from: UCN simple absorption, Peter Fierlinger 7.9.04
39
// Marcin Kuzniaka 21.4.06
40
// Updated:
41
// mail: gum@triumf.ca
42
//
44
45
#include "
G4UCNProcessSubType.hh
"
46
47
#include "
G4UCNLoss.hh
"
48
49
#include "
G4SystemOfUnits.hh
"
50
#include "
G4PhysicalConstants.hh
"
51
53
// Class Implementation
55
57
// Operators
59
60
// G4UCNLoss::operator=(const G4UCNLoss &right)
61
// {
62
// }
63
65
// Constructors
67
68
G4UCNLoss::G4UCNLoss
(
const
G4String
& processName,
G4ProcessType
type)
69
:
G4VDiscreteProcess
(processName, type)
70
{
71
if
(
verboseLevel
>0)
G4cout
<<
GetProcessName
() <<
" is created "
<<
G4endl
;
72
73
SetProcessSubType
(
fUCNLoss
);
74
}
75
76
// G4UCNLoss::G4UCNLoss(const G4UCNLoss &right)
77
// {
78
// }
79
81
// Destructors
83
84
G4UCNLoss::~G4UCNLoss
(){}
85
87
// Methods
89
90
// PostStepDoIt
91
// -------------
92
93
G4VParticleChange
*
94
G4UCNLoss::PostStepDoIt
(
const
G4Track
& aTrack,
const
G4Step
& aStep)
95
{
96
aParticleChange
.
Initialize
(aTrack);
97
98
aParticleChange
.
ProposeTrackStatus
(
fStopAndKill
);
99
100
if
(
verboseLevel
>0)
G4cout
<<
"\n** UCN lost! **"
<<
G4endl
;
101
102
return
G4VDiscreteProcess::PostStepDoIt
(aTrack, aStep);
103
}
104
105
// GetMeanFreePath
106
// ---------------
107
108
G4double
G4UCNLoss::GetMeanFreePath
(
const
G4Track
& aTrack,
109
G4double
,
110
G4ForceCondition
* )
111
{
112
G4double
AttenuationLength =
DBL_MAX
;
113
114
const
G4Material
* aMaterial = aTrack.
GetMaterial
();
115
G4MaterialPropertiesTable
* aMaterialPropertiesTable =
116
aMaterial->
GetMaterialPropertiesTable
();
117
118
G4double
crossect = 0.0;
119
if
(aMaterialPropertiesTable) {
120
crossect = aMaterialPropertiesTable->
GetConstProperty
(
"LOSSCS"
);
121
// if (crossect == 0.0)
122
// G4cout << "No Loss Cross Section specified" << G4endl;
123
}
124
// else G4cout << "No Loss Cross Section specified" << G4endl;
125
126
if
(crossect) {
127
128
// Calculate a UCN absorption length for this cross section
129
130
G4double
density
= aMaterial->
GetTotNbOfAtomsPerVolume
();
131
132
// Calculate cross section for a constant loss
133
134
crossect *=
barn
;
135
136
// Attenuation length
137
138
AttenuationLength = 1./density/crossect;
139
}
140
141
return
AttenuationLength;
142
}
G4VProcess::verboseLevel
G4int verboseLevel
Definition:
G4VProcess.hh:368
G4UCNLoss::~G4UCNLoss
virtual ~G4UCNLoss()
Definition:
G4UCNLoss.cc:84
G4Material
Definition:
G4Material.hh:120
G4UCNProcessSubType.hh
G4MaterialPropertiesTable
Definition:
G4MaterialPropertiesTable.hh:70
G4UCNLoss::GetMeanFreePath
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *condition)
Definition:
G4UCNLoss.cc:108
density
G4double density
Definition:
TRTMaterials.hh:39
G4cout
G4GLOB_DLL std::ostream G4cout
G4VProcess::SetProcessSubType
void SetProcessSubType(G4int)
Definition:
G4VProcess.hh:432
G4Step
Definition:
G4Step.hh:76
G4VProcess::GetProcessName
const G4String & GetProcessName() const
Definition:
G4VProcess.hh:408
G4Track::GetMaterial
G4Material * GetMaterial() const
G4PhysicalConstants.hh
G4Material::GetTotNbOfAtomsPerVolume
G4double GetTotNbOfAtomsPerVolume() const
Definition:
G4Material.hh:209
G4ParticleChange::Initialize
virtual void Initialize(const G4Track &)
Definition:
G4ParticleChange.cc:228
G4UCNLoss::PostStepDoIt
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
Definition:
G4UCNLoss.cc:94
G4Material::GetMaterialPropertiesTable
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
Definition:
G4Material.hh:252
fUCNLoss
Definition:
G4UCNProcessSubType.hh:46
G4VProcess::aParticleChange
G4ParticleChange aParticleChange
Definition:
G4VProcess.hh:289
fStopAndKill
Definition:
G4TrackStatus.hh:56
G4Track
Definition:
G4Track.hh:76
G4UCNLoss.hh
G4endl
#define G4endl
Definition:
G4ios.hh:61
barn
static const double barn
Definition:
G4SIunits.hh:104
G4VDiscreteProcess
Definition:
G4VDiscreteProcess.hh:58
G4double
double G4double
Definition:
G4Types.hh:76
G4VParticleChange::ProposeTrackStatus
void ProposeTrackStatus(G4TrackStatus status)
G4SystemOfUnits.hh
G4ForceCondition
G4ForceCondition
Definition:
G4ForceCondition.hh:49
G4MaterialPropertiesTable::GetConstProperty
G4double GetConstProperty(const char *key)
DBL_MAX
#define DBL_MAX
Definition:
templates.hh:83
G4VParticleChange
Definition:
G4VParticleChange.hh:94
G4VDiscreteProcess::PostStepDoIt
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
Definition:
G4VDiscreteProcess.cc:112
G4String
Definition:
G4String.hh:45
G4ProcessType
G4ProcessType
Definition:
G4ProcessType.hh:43
G4UCNLoss::G4UCNLoss
G4UCNLoss(const G4String &processName="UCNLoss", G4ProcessType type=fUCN)
Definition:
G4UCNLoss.cc:68
geant4.10.02
source
processes
hadronic
processes
src
G4UCNLoss.cc
Generated on Thu Dec 31 2015 10:49:53 for Geant4 by
1.8.8