2 // ********************************************************************
3 // * License and Disclaimer *
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. *
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. *
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 // ********************************************************************
27 // $Id: G4Transportation.icc 68048 2013-03-13 14:34:07Z gcosmo $
32 // Inline function implementation.
34 // =======================================================================
35 // Created: 9 June 1998, J. Apostolakis
36 // =======================================================================
39 #include <CLHEP/Units/SystemOfUnits.h>
42 G4Transportation::SetPropagatorInField( G4PropagatorInField* pFieldPropagator)
44 fFieldPropagator= pFieldPropagator;
47 inline G4PropagatorInField* G4Transportation::GetPropagatorInField()
49 return fFieldPropagator;
52 inline G4bool G4Transportation::DoesGlobalFieldExist()
54 G4TransportationManager* transportMgr;
55 transportMgr= G4TransportationManager::GetTransportationManager();
57 // fFieldExists= transportMgr->GetFieldManager()->DoesFieldExist();
58 // return fFieldExists;
59 return transportMgr->GetFieldManager()->DoesFieldExist();
62 inline void G4Transportation::SetVerboseLevel( G4int verboseLev )
64 fVerboseLevel= verboseLev;
67 inline G4int G4Transportation::GetVerboseLevel( ) const
72 inline G4double G4Transportation::GetThresholdWarningEnergy() const
74 return fThreshold_Warning_Energy;
77 inline G4double G4Transportation::GetThresholdImportantEnergy() const
79 return fThreshold_Important_Energy;
82 inline G4int G4Transportation::GetThresholdTrials() const
84 return fThresholdTrials;
87 inline void G4Transportation::SetThresholdWarningEnergy( G4double newEnWarn )
89 fThreshold_Warning_Energy= newEnWarn;
92 inline void G4Transportation::SetThresholdImportantEnergy( G4double newEnImp )
94 fThreshold_Important_Energy = newEnImp;
97 inline void G4Transportation::SetThresholdTrials(G4int newMaxTrials )
99 fThresholdTrials = newMaxTrials;
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
107 inline G4double G4Transportation::GetMaxEnergyKilled() const
109 return fMaxEnergyKilled;
112 inline G4double G4Transportation::GetSumEnergyKilled() const
114 return fSumEnergyKilled;
117 inline void G4Transportation::ResetKilledStatistics(G4int 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;
126 fMaxEnergyKilled= -1.0*CLHEP::GeV;
128 // Statistics for tracks killed (currently due to looping in field)
130 inline void G4Transportation::EnableShortStepOptimisation(G4bool optimiseShortStep)
132 fShortStepOptimisation=optimiseShortStep;
135 inline G4bool G4Transportation::EnableUseMagneticMoment(G4bool useMoment)
137 G4bool lastValue= fUseMagneticMoment;
138 fUseMagneticMoment= useMoment;