source: trunk/source/geometry/navigation/include/G4PropagatorInField.icc@ 840

Last change on this file since 840 was 831, checked in by garnier, 17 years ago

import all except CVS

File size: 7.4 KB
Line 
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: G4PropagatorInField.icc,v 1.10 2006/11/13 17:34:08 gcosmo Exp $
28// GEANT4 tag $Name: $
29//
30//
31// ------------------------------------------------------------------------
32// GEANT 4 inline implementation
33//
34// ------------------------------------------------------------------------
35//
36// 25.10.96 John Apostolakis, design and implementation
37// 25.03.97 John Apostolakis, adaptation for G4Transportation and cleanup
38//
39// To create an object of this type, must have:
40// - an object that calculates the Curved paths
41// - the navigator to find (linear) intersections
42// - and ?? also must know the value of the maximum displacement allowed
43// ------------------------------------------------------------------------
44
45inline
46G4ChordFinder* G4PropagatorInField::GetChordFinder()
47{
48 // The "Chord Finder" of the current Field Mgr is used
49 // -- this could be of the global field manager
50 // or that of another, from the current volume
51 return fCurrentFieldMgr->GetChordFinder();
52}
53
54inline
55void G4PropagatorInField::SetChargeMomentumMass(
56 G4double Charge, // in e+ units
57 G4double Momentum, // in GeV/c
58 G4double Mass) // in ? units
59{
60 // GetChordFinder()->SetChargeMomentumMass(Charge, Momentum, Mass);
61 // --> Not needed anymore, as it is done in ComputeStep for the
62 // ChordFinder of the current step (which is known only then).
63 fCharge = Charge;
64 fInitialMomentumModulus = Momentum;
65 fMass = Mass;
66}
67
68// Obtain the final space-point and velocity (normal) at the end of the Step
69//
70inline
71G4ThreeVector G4PropagatorInField::EndPosition() const
72{
73 return End_PointAndTangent.GetPosition();
74}
75
76inline
77G4ThreeVector G4PropagatorInField::EndMomentumDir() const
78{
79 return End_PointAndTangent.GetMomentumDir();
80}
81
82inline
83G4double G4PropagatorInField::GetEpsilonStep() const
84{
85 return fEpsilonStep;
86}
87
88inline
89void G4PropagatorInField::SetEpsilonStep( G4double newEps )
90{
91 fEpsilonStep=newEps;
92}
93
94inline
95G4bool G4PropagatorInField::IsParticleLooping() const
96{
97 return fParticleIsLooping;
98}
99
100inline
101G4int G4PropagatorInField::GetMaxLoopCount() const
102{
103 return fMax_loop_count;
104}
105
106inline
107void G4PropagatorInField::SetMaxLoopCount( G4int new_max )
108{
109 fMax_loop_count = new_max;
110}
111
112inline
113G4double G4PropagatorInField::GetDeltaIntersection() const
114{
115 return fCurrentFieldMgr->GetDeltaIntersection();
116}
117
118inline
119G4double G4PropagatorInField::GetDeltaOneStep() const
120{
121 return fCurrentFieldMgr->GetDeltaOneStep();
122}
123
124inline
125void
126G4PropagatorInField::SetAccuraciesWithDeltaOneStep( G4double valDeltaOneStep )
127{
128 fDetectorFieldMgr->SetAccuraciesWithDeltaOneStep(valDeltaOneStep);
129}
130
131inline
132void G4PropagatorInField::SetDeltaOneStep( G4double valDeltaOneStep )
133{
134 fDetectorFieldMgr->SetDeltaOneStep(valDeltaOneStep);
135}
136
137inline
138void G4PropagatorInField::SetDeltaIntersection( G4double valDeltaIntersection )
139{
140 fDetectorFieldMgr->SetDeltaIntersection(valDeltaIntersection);
141}
142
143inline
144G4int G4PropagatorInField::GetVerboseLevel() const
145{
146 return fVerboseLevel;
147}
148
149inline
150G4int G4PropagatorInField::Verbose() const // Obsolete
151{
152 return GetVerboseLevel();
153}
154
155inline
156G4FieldTrack G4PropagatorInField::GetEndState() const
157{
158 return End_PointAndTangent;
159}
160
161// Minimum for Relative accuracy of a Step in volumes of global field
162inline
163G4double G4PropagatorInField::GetMinimumEpsilonStep() const
164{
165 return fDetectorFieldMgr->GetMinimumEpsilonStep();
166}
167
168inline
169void G4PropagatorInField::SetMinimumEpsilonStep( G4double newEpsMin )
170{
171 fDetectorFieldMgr->SetMinimumEpsilonStep(newEpsMin);
172}
173
174// Maximum for Relative accuracy of any Step
175inline
176G4double G4PropagatorInField::GetMaximumEpsilonStep() const
177{
178 return fDetectorFieldMgr->GetMaximumEpsilonStep();
179}
180
181inline
182void G4PropagatorInField::SetMaximumEpsilonStep( G4double newEpsMax )
183{
184 fDetectorFieldMgr->SetMaximumEpsilonStep( newEpsMax );
185}
186
187inline
188void G4PropagatorInField::SetLargestAcceptableStep( G4double newBigDist )
189{
190 if( fLargestAcceptableStep>0.0 )
191 {
192 fLargestAcceptableStep = newBigDist;
193 }
194}
195
196inline
197G4double G4PropagatorInField::GetLargestAcceptableStep()
198{
199 return fLargestAcceptableStep;
200}
201
202inline
203G4FieldManager* G4PropagatorInField::GetCurrentFieldManager()
204{
205 return fCurrentFieldMgr;
206}
207
208inline
209void G4PropagatorInField::SetThresholdNoZeroStep( G4int noAct,
210 G4int noHarsh,
211 G4int noAbandon )
212{
213 if( noAct>0 )
214 fActionThreshold_NoZeroSteps = noAct;
215
216 if( noHarsh > fActionThreshold_NoZeroSteps )
217 fSevereActionThreshold_NoZeroSteps = noHarsh;
218 else
219 fSevereActionThreshold_NoZeroSteps = 2*(fActionThreshold_NoZeroSteps+1);
220
221 if( noAbandon > fSevereActionThreshold_NoZeroSteps+5 )
222 fAbandonThreshold_NoZeroSteps = noAbandon;
223 else
224 fAbandonThreshold_NoZeroSteps = 2*(fSevereActionThreshold_NoZeroSteps+3);
225}
226
227inline
228G4int G4PropagatorInField::GetThresholdNoZeroSteps( G4int i )
229{
230 G4int t=0;
231 if( i==0 ) { t = 3; } // No of parameters
232 else if (i==1) { t = fActionThreshold_NoZeroSteps; }
233 else if (i==2) { t = fSevereActionThreshold_NoZeroSteps; }
234 else if (i==3) { t = fAbandonThreshold_NoZeroSteps; }
235
236 return t;
237}
238
239inline
240void G4PropagatorInField::SetDetectorFieldManager(G4FieldManager* newDetectorFieldManager)
241{
242 fDetectorFieldMgr = newDetectorFieldManager;
243}
244
245
246inline
247void G4PropagatorInField:: SetUseSafetyForOptimization( G4bool value )
248{
249 fUseSafetyForOptimisation= value;
250}
251
252inline
253G4bool G4PropagatorInField::GetUseSafetyForOptimization()
254{
255 return fUseSafetyForOptimisation;
256}
257
258inline
259void G4PropagatorInField::
260SetNavigatorForPropagating( G4Navigator *SimpleOrMultiNavigator )
261{
262 if(SimpleOrMultiNavigator) { fNavigator= SimpleOrMultiNavigator; }
263}
264
265inline
266G4Navigator* G4PropagatorInField::GetNavigatorForPropagating()
267{
268 return fNavigator;
269}
Note: See TracBrowser for help on using the repository browser.