Geant4  10.00.p02
G4Transportation.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: G4Transportation.icc 68048 2013-03-13 14:34:07Z gcosmo $
28 //
29 
30 //
31 //
32 // Inline function implementation.
33 //
34 // =======================================================================
35 // Created: 9 June 1998, J. Apostolakis
36 // =======================================================================
37 //
38 
39 #include <CLHEP/Units/SystemOfUnits.h>
40 
41 inline void
42 G4Transportation::SetPropagatorInField( G4PropagatorInField* pFieldPropagator)
43 {
44  fFieldPropagator= pFieldPropagator;
45 }
46 
47 inline G4PropagatorInField* G4Transportation::GetPropagatorInField()
48 {
49  return fFieldPropagator;
50 }
51 
52 inline G4bool G4Transportation::DoesGlobalFieldExist()
53 {
54  G4TransportationManager* transportMgr;
55  transportMgr= G4TransportationManager::GetTransportationManager();
56 
57  // fFieldExists= transportMgr->GetFieldManager()->DoesFieldExist();
58  // return fFieldExists;
59  return transportMgr->GetFieldManager()->DoesFieldExist();
60 }
61 
62 inline void G4Transportation::SetVerboseLevel( G4int verboseLev )
63 {
64  fVerboseLevel= verboseLev;
65 }
66 
67 inline G4int G4Transportation::GetVerboseLevel( ) const
68 {
69  return fVerboseLevel;
70 }
71 
72 inline G4double G4Transportation::GetThresholdWarningEnergy() const
73 {
74  return fThreshold_Warning_Energy;
75 }
76 
77 inline G4double G4Transportation::GetThresholdImportantEnergy() const
78 {
79  return fThreshold_Important_Energy;
80 }
81 
82 inline G4int G4Transportation::GetThresholdTrials() const
83 {
84  return fThresholdTrials;
85 }
86 
87 inline void G4Transportation::SetThresholdWarningEnergy( G4double newEnWarn )
88 {
89  fThreshold_Warning_Energy= newEnWarn;
90 }
91 
92 inline void G4Transportation::SetThresholdImportantEnergy( G4double newEnImp )
93 {
94  fThreshold_Important_Energy = newEnImp;
95 }
96 
97 inline void G4Transportation::SetThresholdTrials(G4int newMaxTrials )
98 {
99  fThresholdTrials = newMaxTrials;
100 }
101 
102  // Get/Set parameters for killing loopers:
103  // Above 'important' energy a 'looping' particle in field will
104  // *NOT* be abandoned, except after fThresholdTrials attempts.
105  // Below Warning energy, no verbosity for looping particles is issued
106 
107 inline G4double G4Transportation::GetMaxEnergyKilled() const
108 {
109  return fMaxEnergyKilled;
110 }
111 
112 inline G4double G4Transportation::GetSumEnergyKilled() const
113 {
114  return fSumEnergyKilled;
115 }
116 
117 inline void G4Transportation::ResetKilledStatistics(G4int report)
118 {
119  if( report ) {
120  G4cout << " G4Transportation: Statistics for looping particles " << G4endl;
121  G4cout << " Sum of energy of loopers killed: " << fSumEnergyKilled << G4endl;
122  G4cout << " Max energy of loopers killed: " << fMaxEnergyKilled << G4endl;
123  }
124 
125  fSumEnergyKilled= 0;
126  fMaxEnergyKilled= -1.0*CLHEP::GeV;
127 }
128  // Statistics for tracks killed (currently due to looping in field)
129 
130 inline void G4Transportation::EnableShortStepOptimisation(G4bool optimiseShortStep)
131 {
132  fShortStepOptimisation=optimiseShortStep;
133 }
134 
135 inline G4bool G4Transportation::EnableUseMagneticMoment(G4bool useMoment)
136 {
137  G4bool lastValue= fUseMagneticMoment;
138  fUseMagneticMoment= useMoment;
139  return lastValue;
140 }