Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // Class Description: 27 // 28 // A utility static class, responsable for kee 29 // for all transportation processes. These pa 30 // to some types of particles, e.g. only stabl 31 // 32 // Constraints (creation/update): 33 // - It must initialized only by the master th 34 // - It should be updated before the transport 35 // Note: It can be updated only if the state o 36 // 37 // Only those instances of G4Transportation ( 38 // *after* G4TransportationParameters will 39 // the values of its parameters. 40 // (So in a multithreaded application, runs t 41 // 42 // Use: Parameters may be used in run time or 43 // 44 // Meaning of parameters: 45 // - Warning energy: below this, looping tra 46 // - Important energy: between warning E and t 47 // - Number of Trials: above 'important energy 48 49 // Author: J. Apostolakis Nov 2022 50 // Inspired by G4EmParameters by V. I 51 // ------------------------------------------- 52 // 53 54 #ifndef G4TransportationParameters_hh 55 #define G4TransportationParameters_hh 56 57 #include "globals.hh" 58 59 class G4TransportationParameters 60 { 61 public: 62 static G4TransportationParameters* Instanc 63 64 ~G4TransportationParameters() = default; 65 66 G4bool SetNumberOfTrials( G4int val ); 67 68 // All three methods below enforce the rela 69 G4bool SetWarningEnergy( G4double val ); 70 G4bool SetImportantEnergy( G4double val ); 71 // If the relation fails, the methods abov 72 G4bool SetWarningAndImportantEnergies( G4d 73 // If the relation does *not* hold, it war 74 // uses the smaller as the 'warning Ene 75 // and the larger as the 'important e 76 77 G4int GetNumberOfTrials() const { return 78 G4double GetWarningEnergy() const { return f 79 G4double GetImportantEnergy() const { return 80 G4bool IsMagneticMomentEnabled() const { r 81 82 G4bool EnableUseOfMagneticMoment(G4bool us 83 // Whether to deflect particles with force 84 85 G4bool SetHighLooperThresholds(); // Short 86 G4bool SetIntermediateLooperThresholds(); 87 G4bool SetLowLooperThresholds(); // Set l 88 G4bool SetSilenceAllLooperWarnings(G4bool 89 // return value = success or failure of sett 90 91 G4bool GetSilenceAllLooperWarnings(){ retu 92 93 void ReportLockError(G4String methodName 94 // Report error - in case the state of G4 i 95 96 // Probe whether the 'default' instance exis 97 static G4bool Exists() { return theInstance 98 99 // printing 100 void StreamInfo(std::ostream& os) const; 101 void Dump() const; 102 friend std::ostream& operator<< (std::ostrea 103 104 private: 105 G4TransportationParameters(); 106 // Currently private - but potentially will 107 108 // void Initialise(); 109 110 G4bool IsLocked() const; 111 112 void PrintWarning(G4ExceptionDescription& 113 114 private: 115 static G4TransportationParameters* theInst 116 117 // STATE 118 // Values for initialising 'loopers' paramet 119 G4double fWarningEnergy = -1.0; // Warn 120 G4double fImportantEnergy = -1.0; // Give 121 G4int fNumberOfTrials = 10; // Numb 122 123 // Flags for use of gravity field(s) or fiel 124 G4bool fUseMagneticMoment = false; 125 G4bool fUseGravity = false; 126 127 // Flag to *Supress* all 'looper' warnings 128 G4bool fSilenceLooperWarnings= false; 129 }; 130 131 #endif 132