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
parameterisation
include
G4FastTrack.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
//
27
// $Id$
28
//
29
// $Id:
30
//---------------------------------------------------------------
31
//
32
// G4FastTrack.hh
33
//
34
// Description:
35
// Keeps the current track information and special features
36
// for Parameterised Simulation Models.
37
//
38
// History:
39
// Oct 97: Verderi && MoraDeFreitas - First Implementation.
40
//
41
//---------------------------------------------------------------
42
43
44
#ifndef G4FastTrack_h
45
#define G4FastTrack_h
46
47
#include "
G4VSolid.hh
"
48
#include "
G4LogicalVolume.hh
"
49
#include "
G4Region.hh
"
50
#include "
G4AffineTransform.hh
"
51
#include "
G4Track.hh
"
52
#include "
G4Navigator.hh
"
53
54
//---------------------------
55
// For possible future needs:
56
//---------------------------
57
typedef
G4Region
G4Envelope
;
58
59
60
//-------------------------------------------
61
//
62
// G4FastTrack class
63
//
64
//-------------------------------------------
65
66
// Class Description:
67
// The G4FastTrack provides you access to the current G4Track,
68
// gives simple access to envelope related features (G4Region,
69
// G4LogicalVolume, G4VSolid, G4AffineTransform references between
70
// the global and the envelope local coordinates systems) and
71
// simple access to the position, momentum expressed in the
72
// envelope coordinate system. Using those quantities and the
73
// G4VSolid methods, you can for example easily check how far you
74
// are from the envelope boundary.
75
//
76
77
78
class
G4FastTrack
79
{
80
public
:
// without description
81
//------------------------
82
// Constructor/Destructor
83
//------------------------
84
// Only one Constructor. By default the envelope can
85
// be placed n-Times. If the user is sure that it'll be
86
// placed just one time, the IsUnique flag should be set
87
// TRUE to avoid the G4AffineTransform re-calculations each
88
// time we reach the envelope.
89
G4FastTrack
(
G4Envelope
*anEnvelope,
90
G4bool
IsUnique);
91
~G4FastTrack
();
92
93
//------------------------------------------------------------
94
// The fast simulation manager uses the SetCurrentTrack
95
// method to setup the current G4FastTrack object
96
//------------------------------------------------------------
97
void
SetCurrentTrack
(
const
G4Track
&,
const
G4Navigator
*
a
= 0);
98
99
//------------------------------------------------------------
100
// The fast simulation manager uses the OnTheBoundaryButExiting
101
// method to test if the particle is leaving the envelope.
102
//------------------------------------------------------------
103
G4bool
OnTheBoundaryButExiting
()
const
;
104
105
//----------------------------------
106
// Informations useful to the user :
107
// General public get functions.
108
//----------------------------------
109
110
public
:
// with Description
111
112
const
G4Track
*
GetPrimaryTrack
()
const
;
113
// Returns the current G4Track.
114
115
G4Envelope
*
GetEnvelope
()
const
;
116
// Returns the Envelope G4Region pointer.
117
118
G4LogicalVolume
*
GetEnvelopeLogicalVolume
()
const
;
119
// Returns the Envelope G4LogicalVolume pointer.
120
121
G4VPhysicalVolume
*
GetEnvelopePhysicalVolume
()
const
;
122
// Returns the Envelope G4VPhysicalVolume pointer.
123
124
G4VSolid
*
GetEnvelopeSolid
()
const
;
125
// Returns the Envelope G4VSolid pointer.
126
127
//-----------------------------------
128
// Primary track informations in the
129
// Envelope coordinate system.
130
//-----------------------------------
131
132
G4ThreeVector
GetPrimaryTrackLocalPosition
()
const
;
133
// Returns the particle position in envelope coordinates.
134
135
G4ThreeVector
GetPrimaryTrackLocalMomentum
()
const
;
136
// Returns the particle momentum in envelope coordinates.
137
138
G4ThreeVector
GetPrimaryTrackLocalDirection
()
const
;
139
// Returns the particle direction in envelope coordinates.
140
141
G4ThreeVector
GetPrimaryTrackLocalPolarization
()
const
;
142
// Returns the particle polarization in envelope coordinates.
143
144
//------------------------------------
145
// 3D transformation of the envelope:
146
//------------------------------------
147
// Global -> Local
148
149
const
G4AffineTransform
*
GetAffineTransformation
()
const
;
150
// Returns the envelope Global -> Local G4AffineTransform
151
152
// Local -> Global
153
const
G4AffineTransform
*
GetInverseAffineTransformation
()
const
;
154
// Returns the envelope Local -> Global G4AffineTransform
155
156
//-----------------
157
// Private members
158
//-----------------
159
private
:
160
161
// Current G4Track pointer
162
const
G4Track
* fTrack;
163
164
//------------------------------------------------
165
// Records the Affine/InverseAffine transformation
166
// of the envelope.
167
//------------------------------------------------
168
void
FRecordsAffineTransformation(
const
G4Navigator
*);
169
G4bool
fAffineTransformationDefined;
170
G4Envelope
* fEnvelope;
171
G4bool
fIsUnique;
172
G4LogicalVolume
* fEnvelopeLogicalVolume;
173
G4VPhysicalVolume
* fEnvelopePhysicalVolume;
174
G4VSolid
* fEnvelopeSolid;
175
G4ThreeVector
fLocalTrackPosition,
176
fLocalTrackMomentum,
177
fLocalTrackDirection,
178
fLocalTrackPolarization;
179
G4AffineTransform
fAffineTransformation,
180
fInverseAffineTransformation;
181
};
182
183
184
// -----------------
185
// -- Inline methods
186
// -----------------
187
188
inline
G4Envelope
*
G4FastTrack::GetEnvelope
()
const
189
{
190
return
fEnvelope;
191
}
192
193
inline
G4LogicalVolume
*
G4FastTrack::GetEnvelopeLogicalVolume
()
const
194
{
195
return
fEnvelopeLogicalVolume;
196
}
197
198
inline
G4VPhysicalVolume
*
G4FastTrack::GetEnvelopePhysicalVolume
()
const
199
{
200
return
fEnvelopePhysicalVolume;
201
}
202
203
inline
G4VSolid
*
G4FastTrack::GetEnvelopeSolid
()
const
204
{
205
return
fEnvelopeSolid;
206
}
207
208
inline
const
G4Track
*
G4FastTrack::GetPrimaryTrack
()
const
209
{
210
return
fTrack;
211
}
212
213
inline
G4ThreeVector
G4FastTrack::GetPrimaryTrackLocalPosition
()
const
214
{
215
return
fLocalTrackPosition;
216
}
217
218
inline
G4ThreeVector
G4FastTrack::GetPrimaryTrackLocalMomentum
()
const
219
{
220
return
fLocalTrackMomentum;
221
}
222
223
inline
G4ThreeVector
G4FastTrack::GetPrimaryTrackLocalDirection
()
const
224
{
225
return
fLocalTrackDirection;
226
}
227
228
inline
G4ThreeVector
G4FastTrack::GetPrimaryTrackLocalPolarization
()
const
229
{
230
return
fLocalTrackPolarization;
231
}
232
233
inline
const
G4AffineTransform
*
G4FastTrack::GetAffineTransformation
()
const
234
{
235
return
&fAffineTransformation;
236
}
237
238
inline
const
G4AffineTransform
*
G4FastTrack::GetInverseAffineTransformation
()
const
239
{
240
return
&fInverseAffineTransformation;
241
}
242
243
inline
G4bool
G4FastTrack::OnTheBoundaryButExiting
()
const
244
{
245
// tests if particle are on the boundary and leaving.
246
return
GetEnvelopeSolid
()->
247
DistanceToOut(
GetPrimaryTrackLocalPosition
(),
248
GetPrimaryTrackLocalDirection
())==0.;
249
}
250
251
#endif
Generated on Sat May 25 2013 14:34:11 for Geant4 by
1.8.4