Belle II Software  release-08-01-10
G4MonopoleTransportationInline.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 // modified from GEANT4 exoticphysics/monopole/*
10 
11 #pragma once
12 
13 #include <CLHEP/Units/SystemOfUnits.h>
14 #include <framework/logging/Logger.h>
15 
16 namespace Belle2 {
22  namespace Monopoles {
23 
24  inline void
25  G4MonopoleTransportation::SetPropagatorInField(G4PropagatorInField* pFieldPropagator)
26  {
27  fFieldPropagator = pFieldPropagator;
28  }
29 
30  inline G4PropagatorInField* G4MonopoleTransportation::GetPropagatorInField()
31  {
32  return fFieldPropagator;
33  }
34 
36  {
37  G4TransportationManager* transportMgr;
38  transportMgr = G4TransportationManager::GetTransportationManager();
39 
40  // fFieldExists= transportMgr->GetFieldManager()->DoesFieldExist();
41  // return fFieldExists;
42  return transportMgr->GetFieldManager()->DoesFieldExist();
43  }
44 
46  {
48  }
49 
51  {
53  }
54 
56  {
57  return fThresholdTrials;
58  }
59 
61  {
62  fThreshold_Warning_Energy = newEnWarn;
63  }
64 
66  {
67  fThreshold_Important_Energy = newEnImp;
68  }
69 
70  inline void G4MonopoleTransportation::SetThresholdTrials(G4int newMaxTrials)
71  {
72  fThresholdTrials = newMaxTrials;
73  }
74 
75  // Get/Set parameters for killing loopers:
76  // Above 'important' energy a 'looping' particle in field will
77  // *NOT* be abandoned, except after fThresholdTrials attempts.
78  // Below Warning energy, no verbosity for looping particles is issued
79 
81  {
82  return fMaxEnergyKilled;
83  }
84 
86  {
87  return fSumEnergyKilled;
88  }
89 
91  {
92  if (report) {
93  B2INFO(" G4MonopoleTransportation: Statistics for looping particles ");
94  B2INFO(" Sum of energy of loopers killed: " << fSumEnergyKilled);
95  B2INFO(" Max energy of loopers killed: " << fMaxEnergyKilled);
96  }
97 
98  fSumEnergyKilled = 0;
99  fMaxEnergyKilled = -1.0 * CLHEP::GeV;
100  }
101  // Statistics for tracks killed (currently due to looping in field)
102 
103  inline void G4MonopoleTransportation::EnableShortStepOptimisation(G4bool optimiseShortStep)
104  {
105  fShortStepOptimisation = optimiseShortStep;
106  }
107 
108  }
109 
111 }
G4int GetThresholdTrials() const
Access fThresholdTrials.
G4double GetThresholdImportantEnergy() const
Access fThreshold_Important_Energy.
G4int fThresholdTrials
Nubmer of trials for looping particles.
G4PropagatorInField * GetPropagatorInField()
Access fFieldPropagator, the assistant class that Propagate in a Field.
G4double GetMaxEnergyKilled() const
Access fMaxEnergyKilled.
void SetThresholdWarningEnergy(G4double newEnWarn)
Set fThreshold_Warning_Energy.
void SetThresholdImportantEnergy(G4double newEnImp)
Set fThreshold_Important_Energy.
G4double fMaxEnergyKilled
Max of abandoned looping tracks energies.
void SetThresholdTrials(G4int newMaxTrials)
Set fThresholdTrials.
void SetPropagatorInField(G4PropagatorInField *pFieldPropagator)
Set fFieldPropagator, the assistant class that Propagate in a Field.
G4double fSumEnergyKilled
Sum of abandoned looping tracks energies.
G4double fThreshold_Important_Energy
Hesitate above this about looping particle for a certain no of trials.
G4bool fShortStepOptimisation
Whether to avoid calling G4Navigator for short step ( < safety) If using it, the safety estimate for ...
G4double fThreshold_Warning_Energy
Warn above this energy about looping particle.
void EnableShortStepOptimisation(G4bool optimise=true)
Whether short steps < safety will avoid to call Navigator (if field=0)
G4bool DoesGlobalFieldExist()
Checks whether a field exists for the "global" field manager.
G4double GetSumEnergyKilled() const
Access fSumEnergyKilled.
void ResetKilledStatistics(G4int report=1)
Statistics for tracks killed (currently due to looping in field)
G4double GetThresholdWarningEnergy() const
Access fThreshold_Warning_Energy.
G4PropagatorInField * fFieldPropagator
Propagator used to transport the particle.
Abstract base class for different kinds of events.