Files
geant4/source/processes/transportation/include/G4Transportation.icc
2022-07-01 10:44:02 +02:00

143 lines
4.5 KiB
Plaintext

//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//
// Inline function implementation.
// =======================================================================
// Created: 9 June 1998, J. Apostolakis
// =======================================================================
#include <CLHEP/Units/SystemOfUnits.h>
#include "G4TransportationLogger.hh"
inline void
G4Transportation::SetPropagatorInField( G4PropagatorInField* pFieldPropagator)
{
fFieldPropagator= pFieldPropagator;
}
inline G4PropagatorInField* G4Transportation::GetPropagatorInField()
{
return fFieldPropagator;
}
inline G4double G4Transportation::GetThresholdWarningEnergy() const
{
return fThreshold_Warning_Energy;
}
inline G4double G4Transportation::GetThresholdImportantEnergy() const
{
return fThreshold_Important_Energy;
}
inline G4int G4Transportation::GetThresholdTrials() const
{
return fThresholdTrials;
}
inline void G4Transportation::SetThresholdWarningEnergy( G4double newEnWarn )
{
fThreshold_Warning_Energy= newEnWarn;
if( fpLogger ) {
fpLogger->SetThresholdWarningEnergy( newEnWarn );
} else {
ReportMissingLogger("SetThresholdWarningEnergy");
}
// Update the information for correct reporting
}
inline void G4Transportation::SetThresholdImportantEnergy( G4double newEnImp )
{
fThreshold_Important_Energy = newEnImp;
if( fpLogger ) {
fpLogger->SetThresholdImportantEnergy( newEnImp );
// Update the information for correct reporting
} else {
ReportMissingLogger("SetThresholdImportantEnergy");
}
}
inline void G4Transportation::SetThresholdTrials(G4int newMaxTrials )
{
fThresholdTrials = newMaxTrials;
if( fpLogger ) {
fpLogger->SetThresholdTrials(newMaxTrials );
// Update the information for correct reporting
} else {
ReportMissingLogger("SetThresholdTrials");
}
}
inline G4double G4Transportation::GetMaxEnergyKilled() const
{
return fMaxEnergyKilled;
}
inline G4double G4Transportation::GetSumEnergyKilled() const
{
return fSumEnergyKilled;
}
inline void G4Transportation::ResetKilledStatistics(G4int report)
{
// Statistics for tracks killed (currently due to looping in field)
if( report )
{
G4cout << " G4Transportation: Statistics for looping particles "
<< G4endl;
G4cout << " Sum of energy of loopers killed: " << fSumEnergyKilled
<< G4endl;
G4cout << " Max energy of loopers killed: " << fMaxEnergyKilled
<< G4endl;
}
fSumEnergyKilled= 0;
fMaxEnergyKilled= -1.0*CLHEP::GeV;
}
inline void
G4Transportation::EnableShortStepOptimisation(G4bool optimiseShortStep)
{
fShortStepOptimisation=optimiseShortStep;
}
inline void
G4Transportation::PushThresholdsToLogger()
{
if( fpLogger )
fpLogger->SetThresholds( GetThresholdWarningEnergy(),
GetThresholdImportantEnergy(),
GetThresholdTrials() );
else
ReportMissingLogger("PushThresholdsToLogger()");
}