Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:13

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 // 
0029 //
0030 //        Inline function implementation.
0031 
0032 // =======================================================================
0033 // Created:  9 June 1998, J. Apostolakis
0034 // =======================================================================
0035 
0036 #include <CLHEP/Units/SystemOfUnits.h>
0037 #include "G4TransportationLogger.hh"
0038 
0039 inline void
0040 G4Transportation::SetPropagatorInField( G4PropagatorInField* pFieldPropagator)
0041 {
0042    fFieldPropagator= pFieldPropagator;
0043 }
0044 
0045 inline G4PropagatorInField* G4Transportation::GetPropagatorInField()
0046 {
0047    return fFieldPropagator;
0048 }
0049 
0050 inline G4double G4Transportation::GetThresholdWarningEnergy() const
0051 {
0052   return fThreshold_Warning_Energy;
0053 }
0054  
0055 inline G4double G4Transportation::GetThresholdImportantEnergy() const
0056 { 
0057   return fThreshold_Important_Energy;
0058 } 
0059 
0060 inline G4int G4Transportation::GetThresholdTrials() const
0061 {
0062   return fThresholdTrials;
0063 }
0064 
0065 inline void G4Transportation::SetThresholdWarningEnergy( G4double newEnWarn )
0066 {
0067   fThreshold_Warning_Energy= newEnWarn;
0068   if( fpLogger ) {
0069      fpLogger->SetThresholdWarningEnergy( newEnWarn );
0070   } else {
0071      ReportMissingLogger("SetThresholdWarningEnergy");
0072   }
0073   // Update the information for correct reporting  
0074 }
0075 
0076 inline void G4Transportation::SetThresholdImportantEnergy( G4double newEnImp )
0077 {
0078   fThreshold_Important_Energy = newEnImp;
0079   if( fpLogger ) { 
0080      fpLogger->SetThresholdImportantEnergy( newEnImp );
0081     // Update the information for correct reporting
0082   } else {
0083      ReportMissingLogger("SetThresholdImportantEnergy");
0084   }
0085 }
0086 
0087 inline void G4Transportation::SetThresholdTrials(G4int newMaxTrials )
0088 {
0089   fThresholdTrials = newMaxTrials;
0090   if( fpLogger ) {   
0091      fpLogger->SetThresholdTrials(newMaxTrials );
0092      // Update the information for correct reporting
0093   } else {
0094      ReportMissingLogger("SetThresholdTrials");
0095   }
0096 }
0097 
0098 inline G4double G4Transportation::GetMaxEnergyKilled() const
0099 {
0100   return fMaxEnergyKilled; 
0101 }
0102 
0103 inline G4double G4Transportation::GetSumEnergyKilled() const
0104 {
0105   return fSumEnergyKilled;
0106 }
0107 
0108 inline void G4Transportation::ResetKilledStatistics(G4int report)
0109 {
0110   // Statistics for tracks killed (currently due to looping in field)
0111 
0112   if( report )
0113   { 
0114     G4cout << " G4Transportation: Statistics for looping particles "
0115            << G4endl;
0116     G4cout << "   Sum of energy of loopers killed: " <<  fSumEnergyKilled
0117            << G4endl;
0118     G4cout << "   Max energy of loopers killed: " <<  fMaxEnergyKilled
0119            << G4endl;
0120   } 
0121 
0122   fSumEnergyKilled= 0;
0123   fMaxEnergyKilled= -1.0*CLHEP::GeV;
0124 }
0125 
0126 inline void
0127 G4Transportation::EnableShortStepOptimisation(G4bool optimiseShortStep)
0128 { 
0129   fShortStepOptimisation=optimiseShortStep;
0130 }
0131 
0132 inline void
0133 G4Transportation::PushThresholdsToLogger()
0134 {
0135   if( fpLogger )
0136      fpLogger->SetThresholds( GetThresholdWarningEnergy(),
0137                               GetThresholdImportantEnergy(),
0138                               GetThresholdTrials() );
0139   else
0140      ReportMissingLogger("PushThresholdsToLogger()");
0141 }
0142