Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
processes
electromagnetic
dna
management
include
G4VITProcess.hh
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: G4VITProcess.hh 64057 2012-10-30 15:04:49Z gcosmo $
27
//
28
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
29
//
30
// WARNING : This class is released as a prototype.
31
// It might strongly evolve or even disapear in the next releases.
32
//
33
// History:
34
// -----------
35
// 10 Oct 2011 M.Karamitros created
36
//
37
// -------------------------------------------------------------------
38
39
#ifndef G4VITProcess_H
40
#define G4VITProcess_H
41
42
#include <
G4VProcess.hh
>
43
#include "
AddClone_def.hh
"
44
#include "
G4ReferenceCast.hh
"
45
46
class
G4IT
;
47
class
G4TrackingInformation
;
48
49
struct
G4ProcessState_Lock
{
50
inline
virtual
~G4ProcessState_Lock
(){;}
51
};
52
53
#define InitProcessState(destination,source) \
54
destination(reference_cast(destination,source))
55
63
class
G4VITProcess
:
public
G4VProcess
64
{
65
public
:
66
//__________________________________
67
// Constructors & destructors
68
G4VITProcess
(
const
G4String
&
name
,
G4ProcessType
type =
fNotDefined
);
69
70
virtual
~G4VITProcess
();
71
G4VITProcess
(
const
G4VITProcess
& other);
72
G4VITProcess
&
operator=
(
const
G4VITProcess
& other);
73
74
// equal opperators
75
G4int
operator==
(
const
G4VITProcess
&
right
)
const
;
76
G4int
operator!=
(
const
G4VITProcess
&right)
const
;
77
78
G4IT_TO_BE_CLONED
(
G4VITProcess
)
79
80
size_t
GetProcessID
()
const
81
{
82
return
fProcessID;
83
}
84
85
G4ProcessState_Lock
*
GetProcessState
()
86
{
87
return
fpState
;
88
}
89
90
void
SetProcessState
(
G4ProcessState_Lock
* aProcInfo)
91
{
92
fpState
= (
G4ProcessState
*) aProcInfo;
93
}
94
95
//__________________________________
96
// Initialize and Save process info
97
98
virtual
void
StartTracking
(
G4Track
*);
99
100
virtual
void
BuildPhysicsTable
(
const
G4ParticleDefinition
&){}
101
102
inline
G4double
GetInteractionTimeLeft
();
103
107
virtual
void
ResetNumberOfInteractionLengthLeft
();
108
109
inline
G4bool
ProposesTimeStep
()
const
;
110
111
inline
static
const
size_t
&
GetMaxProcessIndex
();
112
113
protected
:
// with description
114
115
void
RetrieveProcessInfo
();
116
void
CreateInfo
();
117
118
//__________________________________
119
// Process info
120
// friend class G4TrackingInformation ;
121
122
struct
G4ProcessState
:
public
G4ProcessState_Lock
123
{
124
public
:
125
G4ProcessState
();
126
virtual
~G4ProcessState
();
127
128
G4double
theNumberOfInteractionLengthLeft
;
129
// The flight length left for the current tracking particle
130
// in unit of "Interaction length".
131
132
G4double
theInteractionTimeLeft
;
133
// Time left before the interaction : for at rest processes
134
135
G4double
currentInteractionLength
;
136
// The InteractionLength in the current material
137
};
138
139
G4ProcessState
*
fpState
;
140
141
inline
virtual
void
ClearInteractionTimeLeft
();
142
143
//_________________________________________________
144
// Redefine needed members and method of G4VProcess
145
virtual
void
SubtractNumberOfInteractionLengthLeft
(
146
G4double
previousStepSize
147
);
148
// subtract NumberOfInteractionLengthLeft by the value corresponding to
149
// previousStepSize
150
151
inline
virtual
void
ClearNumberOfInteractionLengthLeft
();
152
// clear NumberOfInteractionLengthLeft
153
// !!! This method should be at the end of PostStepDoIt()
154
// !!! and AtRestDoIt
155
//_________________________________________________
156
157
158
void
SetInstantiateProcessState
(
G4bool
flag)
159
{ fInstantiateProcessState = flag; }
160
161
G4bool
InstantiateProcessState
() {
return
fInstantiateProcessState; }
162
163
G4bool
fProposesTimeStep
;
164
165
private
:
166
const
size_t
fProcessID;
// During all the simulation will identify a
167
// process, so if two identical process are created using a copy constructor
168
// they will have the same fProcessID
169
static
size_t
fNbProcess ;
170
171
G4bool
fInstantiateProcessState;
172
//_________________________________________________
173
// Redefine needed members and method of G4VProcess
174
G4double
* theNumberOfInteractionLengthLeft;
175
G4double
* currentInteractionLength;
176
G4double
* theInteractionTimeLeft;
177
};
178
179
inline
void
G4VITProcess::ClearInteractionTimeLeft
()
180
{
181
fpState
->
theInteractionTimeLeft
= -1.0;
182
}
183
184
inline
void
G4VITProcess::ClearNumberOfInteractionLengthLeft
()
185
{
186
fpState
->
theNumberOfInteractionLengthLeft
= -1.0;
187
}
188
189
inline
void
G4VITProcess::ResetNumberOfInteractionLengthLeft
()
190
{
191
fpState
->
theNumberOfInteractionLengthLeft
= -std::log(
G4UniformRand
() );
192
}
193
194
inline
G4double
G4VITProcess::GetInteractionTimeLeft
()
195
{
196
if
(
fpState
)
197
return
fpState
->
theInteractionTimeLeft
;
198
199
return
-1 ;
200
}
201
202
inline
G4bool
G4VITProcess::ProposesTimeStep
()
const
203
{
204
return
fProposesTimeStep
;
205
}
206
207
inline
const
size_t
&
G4VITProcess::GetMaxProcessIndex
()
208
{
209
return
fNbProcess ;
210
}
211
#endif // G4VITProcess_H
Generated on Sat May 25 2013 14:33:30 for Geant4 by
1.8.4