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

Last change on this file since 1199 was 921, checked in by garnier, 17 years ago

en test de gl2ps. Problemes de libraries

File size: 8.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.13 2008/10/29 14:31:55 gcosmo Exp $
28// GEANT4 tag $Name: geant4-09-02-cand-01 $
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}
148inline
149G4int G4PropagatorInField::Verbose() const // Obsolete
150{
151 return GetVerboseLevel();
152}
153
154inline
155G4FieldTrack G4PropagatorInField::GetEndState() const
156{
157 return End_PointAndTangent;
158}
159
160// Minimum for Relative accuracy of a Step in volumes of global field
161inline
162G4double G4PropagatorInField::GetMinimumEpsilonStep() const
163{
164 return fDetectorFieldMgr->GetMinimumEpsilonStep();
165}
166
167inline
168void G4PropagatorInField::SetMinimumEpsilonStep( G4double newEpsMin )
169{
170 fDetectorFieldMgr->SetMinimumEpsilonStep(newEpsMin);
171}
172
173// Maximum for Relative accuracy of any Step
174inline
175G4double G4PropagatorInField::GetMaximumEpsilonStep() const
176{
177 return fDetectorFieldMgr->GetMaximumEpsilonStep();
178}
179
180inline
181void G4PropagatorInField::SetMaximumEpsilonStep( G4double newEpsMax )
182{
183 fDetectorFieldMgr->SetMaximumEpsilonStep( newEpsMax );
184}
185
186inline
187void G4PropagatorInField::SetLargestAcceptableStep( G4double newBigDist )
188{
189 if( fLargestAcceptableStep>0.0 )
190 {
191 fLargestAcceptableStep = newBigDist;
192 }
193}
194
195inline
196G4double G4PropagatorInField::GetLargestAcceptableStep()
197{
198 return fLargestAcceptableStep;
199}
200
201inline
202G4FieldManager* G4PropagatorInField::GetCurrentFieldManager()
203{
204 return fCurrentFieldMgr;
205}
206
207inline
208void G4PropagatorInField::SetThresholdNoZeroStep( G4int noAct,
209 G4int noHarsh,
210 G4int noAbandon )
211{
212 if( noAct>0 )
213 fActionThreshold_NoZeroSteps = noAct;
214
215 if( noHarsh > fActionThreshold_NoZeroSteps )
216 fSevereActionThreshold_NoZeroSteps = noHarsh;
217 else
218 fSevereActionThreshold_NoZeroSteps = 2*(fActionThreshold_NoZeroSteps+1);
219
220 if( noAbandon > fSevereActionThreshold_NoZeroSteps+5 )
221 fAbandonThreshold_NoZeroSteps = noAbandon;
222 else
223 fAbandonThreshold_NoZeroSteps = 2*(fSevereActionThreshold_NoZeroSteps+3);
224}
225
226inline
227G4int G4PropagatorInField::GetThresholdNoZeroSteps( G4int i )
228{
229 G4int t=0;
230 if( i==0 ) { t = 3; } // No of parameters
231 else if (i==1) { t = fActionThreshold_NoZeroSteps; }
232 else if (i==2) { t = fSevereActionThreshold_NoZeroSteps; }
233 else if (i==3) { t = fAbandonThreshold_NoZeroSteps; }
234
235 return t;
236}
237
238inline
239void G4PropagatorInField::SetDetectorFieldManager(G4FieldManager* newDetectorFieldManager)
240{
241 fDetectorFieldMgr = newDetectorFieldManager;
242}
243
244
245inline
246void G4PropagatorInField:: SetUseSafetyForOptimization( G4bool value )
247{
248 fUseSafetyForOptimisation= value;
249}
250
251inline
252G4bool G4PropagatorInField::GetUseSafetyForOptimization()
253{
254 return fUseSafetyForOptimisation;
255}
256
257inline
258void G4PropagatorInField::
259SetNavigatorForPropagating( G4Navigator *SimpleOrMultiNavigator )
260{
261 if(SimpleOrMultiNavigator) { fNavigator= SimpleOrMultiNavigator; }
262}
263
264inline
265G4Navigator* G4PropagatorInField::GetNavigatorForPropagating()
266{
267 return fNavigator;
268}
269
270inline
271void G4PropagatorInField::
272SetIntersectionLocator( G4VIntersectionLocator *pIntLoc )
273{
274 if(pIntLoc) { fIntersectionLocator= pIntLoc; }
275}
276
277inline
278G4VIntersectionLocator* G4PropagatorInField::GetIntersectionLocator()
279{
280 return fIntersectionLocator;
281}
282
283inline
284G4bool G4PropagatorInField::IntersectChord( G4ThreeVector StartPointA,
285 G4ThreeVector EndPointB,
286 G4double &NewSafety,
287 G4double &LinearStepLength,
288 G4ThreeVector &IntersectionPoint )
289{
290 // Calculate the direction and length of the chord AB
291 //
292 return fIntersectionLocator
293 ->IntersectChord(StartPointA,EndPointB,NewSafety,
294 fPreviousSafety,fPreviousSftOrigin,
295 LinearStepLength,IntersectionPoint);
296}
Note: See TracBrowser for help on using the repository browser.