Geant4-11
G4CoupledTransportation.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//
28//
29// Inline function implementation.
30
31// =======================================================================
32// Created: 9 June 1998, J. Apostolakis
33// =======================================================================
34
35#include <CLHEP/Units/SystemOfUnits.h>
36#include "G4TransportationLogger.hh"
37#include "G4FieldManagerStore.hh"
38
39inline void G4CoupledTransportation::
40SetPropagatorInField( G4PropagatorInField* pFieldPropagator)
41{
42 fFieldPropagator= pFieldPropagator;
43}
44
45inline G4PropagatorInField* G4CoupledTransportation::GetPropagatorInField()
46{
47 return fFieldPropagator;
48}
49
50inline G4bool G4CoupledTransportation::DoesAnyFieldExist()
51{
52 G4FieldManagerStore* fieldMgrStore= G4FieldManagerStore::GetInstance();
53 return fieldMgrStore->size() > 0;
54}
55
56inline G4double G4CoupledTransportation::GetThresholdWarningEnergy() const
57{
58 return fThreshold_Warning_Energy;
59}
60
61inline G4double G4CoupledTransportation::GetThresholdImportantEnergy() const
62{
63 return fThreshold_Important_Energy;
64}
65
66inline G4int G4CoupledTransportation::GetThresholdTrials() const
67{
68 return fThresholdTrials;
69}
70
71inline void G4CoupledTransportation::SetThresholdWarningEnergy( G4double newEnWarn )
72{
73 fThreshold_Warning_Energy= newEnWarn;
74 if( fpLogger ) {
75 fpLogger->SetThresholdWarningEnergy( newEnWarn );
76 } else {
77 ReportMissingLogger("SetThresholdWarningEnergy");
78 }
79 // Update the information for correct reporting
80}
81
82inline void G4CoupledTransportation::SetThresholdImportantEnergy( G4double newEnImp )
83{
84 fThreshold_Important_Energy = newEnImp;
85 if( fpLogger ) {
86 fpLogger->SetThresholdImportantEnergy( newEnImp );
87 // Update the information for correct reporting
88 } else {
89 ReportMissingLogger("SetThresholdImportantEnergy");
90 }
91}
92
93inline void G4CoupledTransportation::SetThresholdTrials(G4int newMaxTrials )
94{
95 fThresholdTrials = newMaxTrials;
96 if( fpLogger ) {
97 fpLogger->SetThresholdTrials(newMaxTrials );
98 // Update the information for correct reporting
99 } else {
100 ReportMissingLogger("SetThresholdTrials");
101 }
102}
103
104inline G4double G4CoupledTransportation::GetMaxEnergyKilled() const
105{
106 return fMaxEnergyKilled;
107}
108
109inline G4double G4CoupledTransportation::GetSumEnergyKilled() const
110{
111 return fSumEnergyKilled;
112}
113
114inline void G4CoupledTransportation::ResetKilledStatistics(G4int report)
115{
116 // Statistics for tracks killed (currently due to looping in field)
117
118 if( report )
119 {
120 G4cout << " G4CoupledTransportation: Statistics for looping particles "
121 << G4endl;
122 G4cout << " Sum of energy of loopers killed: " << fSumEnergyKilled
123 << G4endl;
124 G4cout << " Max energy of loopers killed: " << fMaxEnergyKilled
125 << G4endl;
126 }
127 fSumEnergyKilled= 0;
128 fMaxEnergyKilled= -1.0*CLHEP::GeV;
129}
130
131inline void
132G4CoupledTransportation::PushThresholdsToLogger()
133{
134 if( fpLogger )
135 fpLogger->SetThresholds( GetThresholdWarningEnergy(),
136 GetThresholdImportantEnergy(),
137 GetThresholdTrials() );
138 else
139 ReportMissingLogger("PushThresholdsToLogger()");
140}
141