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