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 /// \file HadronicGenerator.hh 27 /// \brief Definition of the HadronicGenerator 28 // 29 //-------------------------------------------- 30 // Class: HadronicGenerator 31 // Author: Alberto Ribon (CERN EP/SFT) 32 // Date: May 2020 33 // 34 // This class shows how to use Geant4 as a gen 35 // inelastic hadron-nuclear interactions. 36 // Some of the most used hadronic models are c 37 // this class: 38 // - the hadronic string models Fritiof (FTF) 39 // coupled with Precompound/de-excitation 40 // - the intranuclear cascade models: Bertini 41 // and Lieg 42 // Combinations of two models - in a transitio 43 // linear probability as a function of the ene 44 // "mimic" the transition between hadronic mod 45 // Geant4 reference physics lists. 46 // 47 // The current version of this class does NOT 48 // - hadron elastic interactions 49 // - neutron capture and fission 50 // - precise low-energy inelastic interaction 51 // charged particles (i.e. ParticleHP) 52 // - gamma/lepton-nuclear inelastic interacti 53 // 54 // This class does NOT use the Geant4 run-mana 55 // be usable in a multi-threaded application, 56 // class in each thread. 57 // 58 // This class has been inspired by test30 (who 59 // Ivanchenko), with various simplifications a 60 // inelastic interactions. 61 //-------------------------------------------- 62 63 //....oooOO0OOooo........oooOO0OOooo........oo 64 //....oooOO0OOooo........oooOO0OOooo........oo 65 66 #ifndef HadronicGenerator_h 67 #define HadronicGenerator_h 1 68 69 #include "G4HadronicProcess.hh" 70 #include "G4ThreeVector.hh" 71 #include "G4ios.hh" 72 #include "globals.hh" 73 74 #include <iomanip> 75 #include <map> 76 77 class G4ParticleDefinition; 78 class G4VParticleChange; 79 class G4ParticleTable; 80 class G4Material; 81 class G4HadronicInteraction; 82 83 //....oooOO0OOooo........oooOO0OOooo........oo 84 85 class HadronicGenerator 86 { 87 // This class provides the functionality o 88 // for Geant4 final-state inelastic hadron 89 // Only a few of the available Geant4 fina 90 // "physics cases" are currently available 91 // be extended to other cases if needed. 92 // It is important to notice that this cla 93 // run-manager, so it should work fine in 94 // with a separate instance of this class 95 public: 96 explicit HadronicGenerator(const G4String 97 // Currently supported final-state hadroni 98 // - Hadronic models : BERT, BIC, 99 // - "Physics-list proxies" : FTFP_BERT_A 100 // QGSP_BERT, 101 // (i.e. they are not real, complete ph 102 // they do not have: transportation, e 103 // hadron elastic scattering, neutron 104 // however, they cover all hadron type 105 // combining different hadronic models 106 // between two hadronic models in well 107 // e.g. "FTFP_BERT" has the transition 108 // hadronic models; moreover, the tran 109 // our "physics cases"might not be the 110 // physics lists). 111 112 ~HadronicGenerator(); 113 114 inline G4bool IsPhysicsCaseSupported() con 115 // Returns "true" if the physicsCase is su 116 117 G4bool IsApplicable(const G4String& namePr 118 G4bool IsApplicable(G4ParticleDefinition* 119 const G4double project 120 // Returns "true" if the specified project 121 // of given energy is applicable, "false" 122 123 G4VParticleChange* GenerateInteraction(con 124 con 125 con 126 G4M 127 G4VParticleChange* GenerateInteraction(G4P 128 con 129 con 130 G4M 131 // This is the main method provided by the 132 // in input it receives the projectile (ei 133 // its energy, its direction and the targe 134 // final-state of the inelastic hadron-nuc 135 // final-state hadronic inelastic "physics 136 // If the required hadronic collision is n 137 // immediately an empty "G4VParticleChange 138 139 inline G4HadronicProcess* GetHadronicProce 140 inline G4HadronicInteraction* GetHadronicI 141 // Returns the hadronic process and the ha 142 // that handled the last call of "Generate 143 144 G4double GetImpactParameter() const; 145 G4int GetNumberOfTargetSpectatorNucleons() 146 G4int GetNumberOfProjectileSpectatorNucleo 147 G4int GetNumberOfNNcollisions() const; 148 // In the case of hadronic interactions ha 149 // respectively, the impact parameter, the 150 // spectator nucleons, and the number of n 151 // else, returns a negative value (-999). 152 153 private: 154 G4String fPhysicsCase; 155 G4bool fPhysicsCaseIsSupported; 156 G4HadronicProcess* fLastHadronicProcess; 157 G4ParticleTable* fPartTable; 158 std::map<G4ParticleDefinition*, G4Hadronic 159 }; 160 161 inline G4bool HadronicGenerator::IsPhysicsCase 162 { 163 return fPhysicsCaseIsSupported; 164 } 165 166 inline G4HadronicProcess* HadronicGenerator::G 167 { 168 return fLastHadronicProcess; 169 } 170 171 inline G4HadronicInteraction* HadronicGenerato 172 { 173 return fLastHadronicProcess == nullptr ? nul 174 } 175 176 //....oooOO0OOooo........oooOO0OOooo........oo 177 178 #endif 179