Geant4  10.03
G4FieldManager.icc
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: G4FieldManager.icc 93661 2015-10-28 09:47:47Z gcosmo $
28 //
29 //
30 // G4FieldManager inline implementation
31 //
32 // -------------------------------------------------------------------
33 
34 inline
35 const G4Field* G4FieldManager::GetDetectorField() const
36 {
37  // If pointer is null, should this raise an exception ??
38  return fDetectorField;
39 }
40 
41 inline
42 G4bool G4FieldManager::DoesFieldExist() const
43 {
44  return (fDetectorField != 0);
45 }
46 
47 inline
48 void G4FieldManager::SetChordFinder(G4ChordFinder *aChordFinder)
49 {
50  fChordFinder= aChordFinder;
51 }
52 
53 inline
54 G4ChordFinder* G4FieldManager::GetChordFinder()
55 {
56  return fChordFinder;
57 }
58 
59 inline
60 const G4ChordFinder* G4FieldManager::GetChordFinder() const
61 {
62  return fChordFinder;
63 }
64 
65 inline
66 G4double G4FieldManager::GetDeltaIntersection() const
67 {
68  return fDelta_Intersection_Val;
69 }
70 
71 inline
72 G4double G4FieldManager::GetDeltaOneStep() const
73 {
74  return fDelta_One_Step_Value;
75 }
76 
77 inline
78 void G4FieldManager::SetDeltaOneStep(G4double valDeltaOneStep)
79 {
80  fDelta_One_Step_Value= valDeltaOneStep;
81 }
82 
83 inline
84 void G4FieldManager::SetDeltaIntersection(G4double valDeltaIntersection)
85 {
86  fDelta_Intersection_Val = valDeltaIntersection;
87 }
88 
89 inline
90 void G4FieldManager::SetAccuraciesWithDeltaOneStep(G4double valDeltaOneStep)
91 {
92  fDelta_One_Step_Value= valDeltaOneStep;
93  fDelta_Intersection_Val = 0.4 * fDelta_One_Step_Value;
94 }
95 
96 inline G4bool G4FieldManager::DoesFieldChangeEnergy() const
97 { return fFieldChangesEnergy;}
98 
99 inline void G4FieldManager::SetFieldChangesEnergy(G4bool value)
100 { fFieldChangesEnergy = value; }
101 
102 
103 
104 // Minimum for Relative accuracy of any Step
105 inline
106 G4double G4FieldManager::GetMinimumEpsilonStep() const
107 {
108  return fEpsilonMin;
109 }
110 
111 inline
112 void G4FieldManager::SetMinimumEpsilonStep( G4double newEpsMin )
113 {
114  if( (newEpsMin > 0.0) && (std::fabs(1.0+newEpsMin) > 1.0) )
115  {
116  fEpsilonMin = newEpsMin;
117  }
118 }
119 
120 // Maximum for Relative accuracy of any Step
121 inline
122 G4double G4FieldManager::GetMaximumEpsilonStep() const
123 {
124  return fEpsilonMax;
125 }
126 
127 inline
128 void G4FieldManager::SetMaximumEpsilonStep( G4double newEpsMax )
129 {
130  if( (newEpsMax > 0.0)
131  && (newEpsMax >= fEpsilonMin )
132  && (std::fabs(1.0+newEpsMax)>1.0) )
133  {
134  fEpsilonMax = newEpsMax;
135  }
136 }