Geant4
10.01.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ExUCNExtraPhysics.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: ExUCNExtraPhysics.cc 69762 2013-05-14 08:08:54Z gcosmo $
27
//
30
//
31
//
32
#include "
G4ParticleDefinition.hh
"
33
#include "
G4ProcessManager.hh
"
34
35
#include "
G4Transportation.hh
"
36
#include "
G4PhysicsListHelper.hh
"
37
38
#include "
G4Decay.hh
"
39
#include "
G4DecayTable.hh
"
40
#include "
G4NeutronBetaDecayChannel.hh
"
41
42
#include "
G4UserSpecialCuts.hh
"
43
#include "
G4StepLimiter.hh
"
44
#include "
G4SystemOfUnits.hh
"
45
46
#include "
G4UCNLoss.hh
"
47
#include "
G4UCNAbsorption.hh
"
48
#include "
G4UCNMultiScattering.hh
"
49
#include "
G4UCNBoundaryProcess.hh
"
50
51
#include "
ExUCNExtraPhysics.hh
"
52
53
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54
55
ExUCNExtraPhysics::ExUCNExtraPhysics
()
56
:
G4VPhysicsConstructor
(
"Extra"
) {;}
57
58
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59
60
ExUCNExtraPhysics::~ExUCNExtraPhysics
() {;}
61
62
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63
64
void
ExUCNExtraPhysics::ConstructParticle
() {;}
65
66
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
68
void
ExUCNExtraPhysics::ConstructProcess
()
69
{
70
aParticleIterator
->reset();
71
72
while
((*
aParticleIterator
)()) {
73
G4ParticleDefinition
* particle =
aParticleIterator
->value();
74
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
75
G4String
particleName = particle->
GetParticleName
();
76
77
if
(!pmanager) {
78
std::ostringstream o;
79
o <<
"Particle "
<< particleName <<
"without a Process Manager"
;
80
G4Exception
(
"ExUCNExtraPhysics::ConstructProcess()"
,
""
,
81
FatalException
,o.str().c_str());
82
}
83
84
pmanager->
AddDiscreteProcess
(
new
G4StepLimiter
());
85
pmanager->
AddDiscreteProcess
(
new
G4UserSpecialCuts
());
86
}
87
88
AddBetaDecay
();
89
90
ConstructUCN
();
91
92
// G4Transportation* transportation = NULL;
93
// G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
94
// transportation = (G4Transportation*) ph->GetTransportation();
95
96
// if (transportation) transportation->EnableUseMagneticMoment();
97
}
98
99
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100
101
void
ExUCNExtraPhysics::AddBetaDecay
()
102
{
103
aParticleIterator
->reset();
104
105
while
((*
aParticleIterator
)()) {
106
107
G4ParticleDefinition
* particle =
aParticleIterator
->value();
108
G4String
particleName = particle->
GetParticleName
();
109
110
if
( particleName ==
"neutron"
) {
111
112
particle->
SetPDGLifeTime
(886.7*
second
);
113
particle->
SetPDGStable
(
false
);
114
115
G4DecayTable
* table =
new
G4DecayTable
();
116
G4VDecayChannel
* mode =
117
new
G4NeutronBetaDecayChannel
(
"neutron"
,1.00);
118
table->
Insert
(mode);
119
particle->
SetDecayTable
(table);
120
121
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
122
if
(!pmanager) {
123
std::ostringstream o;
124
o <<
"Particle "
<< particleName <<
"without a Process Manager"
;
125
G4Exception
(
"ExUCNExtraPhysics::ConstructProcess()"
,
""
,
126
FatalException
,o.str().c_str());
127
}
128
129
G4Decay
* theDecayProcess =
new
G4Decay
();
130
pmanager->
AddProcess
(theDecayProcess);
131
pmanager->
SetProcessOrdering
(theDecayProcess,
idxPostStep
);
132
pmanager->
SetProcessOrdering
(theDecayProcess,
idxAtRest
);
133
}
134
}
135
}
136
137
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138
139
void
ExUCNExtraPhysics::ConstructUCN
()
140
{
141
aParticleIterator
->reset();
142
G4ProcessManager
* pmanager = NULL;
143
144
while
((*
aParticleIterator
)()) {
145
G4ParticleDefinition
* particle =
aParticleIterator
->value();
146
pmanager = particle->
GetProcessManager
();
147
G4String
particleName = particle->
GetParticleName
();
148
149
if
(!pmanager) {
150
std::ostringstream o;
151
o <<
"Particle "
<< particleName <<
"without a Process Manager"
;
152
G4Exception
(
"ExUCNExtraPhysics::ConstructProcess()"
,
""
,
153
FatalException
,o.str().c_str());
154
}
155
156
if
(particleName ==
"neutron"
) {
157
pmanager->
AddDiscreteProcess
(
new
G4UCNLoss
());
158
pmanager->
AddDiscreteProcess
(
new
G4UCNAbsorption
());
159
pmanager->
AddDiscreteProcess
(
new
G4UCNMultiScattering
());
160
161
G4UCNBoundaryProcess
* ucnBoundaryProcess =
162
new
G4UCNBoundaryProcess
();
163
ucnBoundaryProcess->
SetMicroRoughness
(
true
);
164
ucnBoundaryProcess->
SetVerboseLevel
(0);
165
166
pmanager->
AddDiscreteProcess
(ucnBoundaryProcess);
167
}
168
}
169
}
170
171
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExUCNExtraPhysics::ExUCNExtraPhysics
ExUCNExtraPhysics()
Definition:
ExUCNExtraPhysics.cc:55
G4ParticleDefinition::SetDecayTable
void SetDecayTable(G4DecayTable *aDecayTable)
ExUCNExtraPhysics.hh
Definition of the ExUCNExtraPhysics class.
G4ParticleDefinition::SetPDGStable
void SetPDGStable(const G4bool aFlag)
Definition:
G4ParticleDefinition.hh:199
G4UserSpecialCuts.hh
G4UCNAbsorption.hh
G4UserSpecialCuts
Definition:
G4UserSpecialCuts.hh:47
ExUCNExtraPhysics::ConstructProcess
virtual void ConstructProcess()
Definition:
ExUCNExtraPhysics.cc:68
G4ProcessManager::AddDiscreteProcess
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4UCNLoss
Definition:
G4UCNLoss.hh:66
G4ParticleDefinition::SetPDGLifeTime
void SetPDGLifeTime(G4double aLifeTime)
Definition:
G4ParticleDefinition.hh:202
G4PhysicsListHelper.hh
G4Transportation.hh
G4ParticleDefinition
Definition:
G4ParticleDefinition.hh:111
G4ParticleDefinition::GetProcessManager
G4ProcessManager * GetProcessManager() const
G4UCNBoundaryProcess.hh
G4ParticleDefinition::GetParticleName
const G4String & GetParticleName() const
Definition:
G4ParticleDefinition.hh:159
ExUCNExtraPhysics::ConstructParticle
virtual void ConstructParticle()
Definition:
ExUCNExtraPhysics.cc:64
G4UCNMultiScattering
Definition:
G4UCNMultiScattering.hh:66
G4VDecayChannel
Definition:
G4VDecayChannel.hh:104
G4UCNBoundaryProcess
Definition:
G4UCNBoundaryProcess.hh:83
G4DecayTable
Definition:
G4DecayTable.hh:50
aParticleIterator
#define aParticleIterator
Definition:
G4VPhysicsConstructor.hh:119
G4UCNBoundaryProcess::SetMicroRoughness
void SetMicroRoughness(G4bool)
Definition:
G4UCNBoundaryProcess.cc:870
idxPostStep
Definition:
G4ProcessManager.hh:94
G4ProcessManager::AddProcess
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
Definition:
G4ProcessManager.cc:410
G4Decay
Definition:
G4Decay.hh:63
G4Decay.hh
second
static const double second
Definition:
G4SIunits.hh:138
G4ProcessManager.hh
G4ParticleDefinition.hh
G4UCNAbsorption
Definition:
G4UCNAbsorption.hh:66
G4StepLimiter.hh
G4StepLimiter
Definition:
G4StepLimiter.hh:45
G4ProcessManager::SetProcessOrdering
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
Definition:
G4ProcessManager.cc:607
G4Exception
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition:
G4Exception.cc:41
G4DecayTable::Insert
void Insert(G4VDecayChannel *aChannel)
Definition:
G4DecayTable.cc:60
FatalException
Definition:
G4ExceptionSeverity.hh:60
G4UCNLoss.hh
G4ProcessManager
Definition:
G4ProcessManager.hh:106
ExUCNExtraPhysics::~ExUCNExtraPhysics
virtual ~ExUCNExtraPhysics()
Definition:
ExUCNExtraPhysics.cc:60
ExUCNExtraPhysics::ConstructUCN
void ConstructUCN()
Definition:
ExUCNExtraPhysics.cc:139
ExUCNExtraPhysics::AddBetaDecay
void AddBetaDecay()
Definition:
ExUCNExtraPhysics.cc:101
G4SystemOfUnits.hh
G4UCNMultiScattering.hh
G4DecayTable.hh
G4NeutronBetaDecayChannel
Definition:
G4NeutronBetaDecayChannel.hh:43
G4VPhysicsConstructor
Definition:
G4VPhysicsConstructor.hh:121
G4VProcess::SetVerboseLevel
void SetVerboseLevel(G4int value)
Definition:
G4VProcess.hh:437
G4NeutronBetaDecayChannel.hh
idxAtRest
Definition:
G4ProcessManager.hh:92
G4String
Definition:
G4String.hh:45
geant4.10.01.p02
examples
extended
exoticphysics
ucn
src
ExUCNExtraPhysics.cc
Generated on Wed Dec 30 2015 22:37:27 for Geant4 by
1.8.8