Changeset 962 for trunk/source/processes/hadronic/management/include
- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- Location:
- trunk/source/processes/hadronic/management/include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/management/include/G4EnergyRangeManager.hh
r819 r962 26 26 // 27 27 // $Id: G4EnergyRangeManager.hh,v 1.9 2006/06/29 19:58:05 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Hadronic Process: Energy Range Manager -
trunk/source/processes/hadronic/management/include/G4HadLeadBias.hh
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // GEANT4 tag $Name: $26 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 27 27 // 28 28 // -------------------------------------------------------------------- -
trunk/source/processes/hadronic/management/include/G4HadronInelasticProcess.hh
r819 r962 43 43 44 44 #include "G4HadronicProcess.hh" 45 //#include "G4LPhysicsFreeVector.hh"46 #include "G4HadronCrossSections.hh"47 #include "G4CrossSectionDataStore.hh"48 #include "G4HadronInelasticDataSet.hh"49 #include "G4ParticleChange.hh"50 51 45 52 class G4HadronInelasticProcess : public G4HadronicProcess 53 { 54 public: 46 class G4ParticleDefinition; 47 48 class G4HadronInelasticProcess : public G4HadronicProcess 49 { 50 public: 55 51 56 G4HadronInelasticProcess( 57 const G4String &processName, 58 G4ParticleDefinition *aParticle ); 52 G4HadronInelasticProcess(const G4String &processName, 53 G4ParticleDefinition *aParticle ); 59 54 60 55 virtual ~G4HadronInelasticProcess(); 61 56 62 void BuildThePhysicsTable(); 63 64 G4bool IsApplicable(const G4ParticleDefinition& aP); 57 virtual G4bool IsApplicable(const G4ParticleDefinition& aParticleType); 65 58 66 G4VParticleChange *PostStepDoIt(const G4Track &aTrack, const G4Step &aStep); 59 private: 67 60 68 private:61 G4ParticleDefinition* theParticle; 69 62 70 virtual G4double GetMicroscopicCrossSection( const G4DynamicParticle *aParticle, 71 const G4Element *anElement, 72 G4double aTemp ); 73 74 protected: 75 76 G4ParticleDefinition *theParticle; 77 G4ParticleChange theParticleChange; 78 }; 63 }; 79 64 80 65 #endif -
trunk/source/processes/hadronic/management/include/G4HadronicProcess.hh
r819 r962 26 26 // 27 27 // 28 // This is the top level Hadronic Process class 29 // The inelastic, elastic, capture, and fission processes 30 // should derive from this class 31 // This is an abstract base class, since the pure virtual function 32 // PostStepDoIt has not been defined yet. 33 // Note: there is no .cc file 34 // 35 // original by H.P.Wellisch 36 // J.L. Chuma, TRIUMF, 10-Mar-1997 37 // Last modified: 04-Apr-1997 28 // This is the top level Hadronic Process class 29 // The inelastic, elastic, capture, and fission processes 30 // should derive from this class 31 // 32 // original by H.P.Wellisch 33 // J.L. Chuma, TRIUMF, 10-Mar-1997 34 // Last modified: 04-Apr-1997 35 // 19-May-2008 V.Ivanchenko cleanup and added comments 38 36 39 37 #ifndef G4HadronicProcess_h … … 50 48 #include "G4VCrossSectionDataSet.hh" 51 49 #include "G4VLeadingParticleBiasing.hh" 52 #include "G4Delete.hh"50 //#include "G4Delete.hh" 53 51 #include "G4CrossSectionDataStore.hh" 54 #include "G4HadronicException.hh" 55 52 #include "G4HadronicProcessType.hh" 56 53 57 54 class G4Track; … … 60 57 class G4ParticleChange; 61 58 62 class G4HadronicProcess : public G4VDiscreteProcess 63 { 64 public: 65 66 G4HadronicProcess( const G4String &processName = "Hadronic", 67 G4ProcessType aType = fHadronic ); 68 virtual ~G4HadronicProcess(); 69 70 void RegisterMe( G4HadronicInteraction *a ); 71 72 void AddDataSet(G4VCrossSectionDataSet * aDataSet) 73 { 74 theCrossSectionDataStore->AddDataSet(aDataSet); 75 } 59 class G4HadronicProcess : public G4VDiscreteProcess 60 { 61 public: 62 63 G4HadronicProcess( const G4String &processName = "Hadronic", 64 G4ProcessType aType = fHadronic ); 65 66 virtual ~G4HadronicProcess(); 67 68 // register generator of secondaries 69 void RegisterMe( G4HadronicInteraction *a ); 70 71 // get cross section per element 72 virtual 73 G4double GetMicroscopicCrossSection(const G4DynamicParticle *aParticle, 74 const G4Element *anElement, 75 G4double aTemp ); 76 77 // generic PostStepDoIt recommended for all derived classes 78 virtual G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 79 const G4Step& aStep); 80 81 // initialisation of physics tables and G4HadronicProcessStore 82 virtual void PreparePhysicsTable(const G4ParticleDefinition&); 83 84 // build physics tables and print out the configuration of the process 85 virtual void BuildPhysicsTable(const G4ParticleDefinition&); 86 87 // dump physics tables 88 inline void DumpPhysicsTable(const G4ParticleDefinition& p) 89 { theCrossSectionDataStore->DumpPhysicsTable(p); } 90 91 // add cross section data set 92 inline void AddDataSet(G4VCrossSectionDataSet * aDataSet) 93 { theCrossSectionDataStore->AddDataSet(aDataSet);} 94 95 // access to the manager 96 inline G4EnergyRangeManager *GetManagerPointer() 97 { return &theEnergyRangeManager; } 98 99 // get inverse cross section per volume 100 G4double GetMeanFreePath(const G4Track &aTrack, G4double, 101 G4ForceCondition *); 102 103 protected: 104 105 // reset number of interaction length and save 106 virtual void ResetNumberOfInteractionLengthLeft() 107 { G4VProcess::ResetNumberOfInteractionLengthLeft(); 108 theInitialNumberOfInteractionLength = 109 G4VProcess::theNumberOfInteractionLengthLeft; 110 } 111 112 // generic method to choose secondary generator 113 // recommended for all derived classes 114 inline G4HadronicInteraction *ChooseHadronicInteraction( 115 G4double kineticEnergy, G4Material *aMaterial, G4Element *anElement ) 116 { return theEnergyRangeManager.GetHadronicInteraction(kineticEnergy, 117 aMaterial,anElement); 118 } 119 120 public: 121 122 // Methods for isotope production 123 static void EnableIsotopeProductionGlobally(); 124 static void DisableIsotopeProductionGlobally(); 125 126 void EnableIsotopeCounting() {isoIsOnAnyway = 1;} 127 void DisableIsotopeCounting() {isoIsOnAnyway = -1;} 128 129 void RegisterIsotopeProductionModel(G4VIsotopeProduction * aModel) 130 { theProductionModels.push_back(aModel); } 131 132 static G4IsoParticleChange * GetIsotopeProductionInfo(); 133 134 void BiasCrossSectionByFactor(G4double aScale); 135 136 protected: 137 138 // obsolete method will be removed 139 inline const G4EnergyRangeManager &GetEnergyRangeManager() const 140 { return theEnergyRangeManager; } 141 142 // obsolete method will be removed 143 inline void SetEnergyRangeManager( const G4EnergyRangeManager &value ) 144 { theEnergyRangeManager = value; } 145 146 // access to the chosen generator 147 inline G4HadronicInteraction *GetHadronicInteraction() 148 { return theInteraction; } 149 150 // access to the cross section data store 151 inline G4CrossSectionDataStore* GetCrossSectionDataStore() 152 { return theCrossSectionDataStore; } 153 154 // access to the cross section data set 155 inline G4double GetLastCrossSection() 156 { return theLastCrossSection; } 157 158 private: 159 160 void FillTotalResult(G4HadFinalState * aR, const G4Track & aT); 161 162 G4HadFinalState * DoIsotopeCounting(G4HadFinalState * aResult, 163 const G4Track & aTrack, 164 const G4Nucleus & aNucleus); 165 166 G4IsoResult * ExtractResidualNucleus(const G4Track & aTrack, 167 const G4Nucleus & aNucleus, 168 G4HadFinalState * aResult); 169 170 inline G4double GetTotalNumberOfInteractionLengthTraversed() 171 { return theInitialNumberOfInteractionLength 172 -G4VProcess::theNumberOfInteractionLengthLeft; 173 } 76 174 77 virtual G4VParticleChange *PostStepDoIt( const G4Track &aTrack, 78 const G4Step &aStep ) = 0; 79 80 virtual 81 G4double GetMicroscopicCrossSection(const G4DynamicParticle *aParticle, 82 const G4Element *anElement, 83 G4double aTemp ) = 0; 84 85 G4double GetMeanFreePath(const G4Track &aTrack, G4double, 86 G4ForceCondition *); 87 88 // Set methods for isotope production 89 90 static void EnableIsotopeProductionGlobally(); 91 static void DisableIsotopeProductionGlobally(); 92 93 void EnableIsotopeCounting() {isoIsOnAnyway = 1;} 94 void DisableIsotopeCounting() {isoIsOnAnyway = -1;} 95 96 void RegisterIsotopeProductionModel(G4VIsotopeProduction * aModel) 97 { theProductionModels.push_back(aModel); } 98 99 static G4IsoParticleChange * GetIsotopeProductionInfo() 100 { 101 G4IsoParticleChange * anIsoResult = theIsoResult; 102 if(theIsoResult) theOldIsoResult = theIsoResult; 103 theIsoResult = 0; 104 return anIsoResult; 105 } 106 107 void BiasCrossSectionByFactor(G4double aScale) 108 { 109 xBiasOn = true; 110 aScaleFactor = aScale; 111 G4String it = GetProcessName(); 112 if( (it != "PhotonInelastic") && 113 (it != "ElectroNuclear") && 114 (it != "PositronNuclear") ) 115 { 116 G4Exception("G4HadronicProcess", "007", FatalException, 117 "Cross-section biasing available only for gamma and electro nuclear reactions."); 118 } 119 if(aScale<100) 120 { 121 G4Exception("G4HadronicProcess", "001", JustWarning, 122 "Cross-section bias readjusted to be above safe limit. New value is 100"); 123 aScaleFactor = 100.; 124 } 125 } 126 127 protected: 128 129 virtual void ResetNumberOfInteractionLengthLeft() 130 { 131 G4VProcess::theNumberOfInteractionLengthLeft = 132 -std::log( G4UniformRand() ); 133 theInitialNumberOfInteractionLength = 134 G4VProcess::theNumberOfInteractionLengthLeft; 135 } 136 137 G4VParticleChange *GeneralPostStepDoIt( const G4Track &aTrack, 138 const G4Step &aStep ); 139 140 void SetDispatch( G4HadronicProcess *value ) 141 { dispatch=value; } 142 143 G4Element* ChooseAandZ(const G4DynamicParticle *aParticle, 144 const G4Material *aMaterial); 145 146 inline const G4EnergyRangeManager &GetEnergyRangeManager() const 147 { return theEnergyRangeManager; } 148 149 inline void SetEnergyRangeManager( const G4EnergyRangeManager &value ) 150 { theEnergyRangeManager = value; } 151 152 inline G4HadronicInteraction *ChooseHadronicInteraction( 153 G4double kineticEnergy, G4Material *aMaterial, G4Element *anElement ) 154 { 155 G4EnergyRangeManager* ERMan = GetManagerPointer(); 156 if(!ERMan->GetHadronicInteractionCounter()) 157 G4cout<< "*G4HadronicProcess::ChooseHadronicInteraction: process = " 158 << GetProcessName() << ", nM=" 159 << ERMan->GetHadronicInteractionCounter() << G4endl; 160 return ERMan->GetHadronicInteraction(kineticEnergy,aMaterial,anElement); 161 } 162 163 inline G4HadronicInteraction *GetHadronicInteraction() 164 { return theInteraction; } 165 166 public: 167 inline G4EnergyRangeManager *GetManagerPointer() 168 { return &theEnergyRangeManager; } 169 protected: 170 171 G4CrossSectionDataStore* GetCrossSectionDataStore() 172 { 173 return theCrossSectionDataStore; 174 } 175 176 G4double GetLastCrossSection() {return theLastCrossSection;} 177 private: 178 179 G4HadFinalState * DoIsotopeCounting(G4HadFinalState * aResult, 180 const G4Track & aTrack, 181 const G4Nucleus & aNucleus); 182 183 G4IsoResult * ExtractResidualNucleus(const G4Track & aTrack, 184 const G4Nucleus & aNucleus, 185 G4HadFinalState * aResult); 186 187 G4double GetTotalNumberOfInteractionLengthTraversed() 188 { 189 return theInitialNumberOfInteractionLength 190 -G4VProcess::theNumberOfInteractionLengthLeft; 191 } 192 193 194 void FillTotalResult(G4HadFinalState * aR, const G4Track & aT); 195 196 void SetCrossSectionDataStore(G4CrossSectionDataStore* aDataStore) 197 { 198 theCrossSectionDataStore = aDataStore; 199 } 200 201 G4double XBiasSurvivalProbability(); 202 G4double XBiasSecondaryWeight(); 203 204 private: 205 206 G4EnergyRangeManager theEnergyRangeManager; 207 208 G4HadronicInteraction *theInteraction; 209 210 G4CrossSectionDataStore* theCrossSectionDataStore; 211 212 G4Nucleus targetNucleus; 213 214 G4HadronicProcess *dispatch; 215 216 // swiches for isotope production 217 218 static G4bool isoIsEnabled; // true or false; local swich overrides 219 G4int isoIsOnAnyway; // true(1), false(-1) or default(0) 220 221 G4IsoParticleChange theIsoPC; 222 std::vector<G4VIsotopeProduction *> theProductionModels; 223 224 std::vector<G4VLeadingParticleBiasing *> theBias; 225 226 static G4IsoParticleChange* theIsoResult; 227 static G4IsoParticleChange* theOldIsoResult; 228 229 G4ParticleChange* theTotalResult; 230 231 G4double theInitialNumberOfInteractionLength; 232 233 G4double aScaleFactor; 234 G4bool xBiasOn; 235 G4double theLastCrossSection; 236 237 G4int ModelingState; 238 }; 175 // inline void SetCrossSectionDataStore(G4CrossSectionDataStore* aDataStore) 176 // { theCrossSectionDataStore = aDataStore; } 177 178 G4double XBiasSurvivalProbability(); 179 G4double XBiasSecondaryWeight(); 180 181 private: 182 183 G4EnergyRangeManager theEnergyRangeManager; 184 185 G4HadronicInteraction *theInteraction; 186 187 G4CrossSectionDataStore* theCrossSectionDataStore; 188 189 G4Nucleus targetNucleus; 190 191 G4HadronicProcess *dispatch; 192 193 bool G4HadronicProcess_debug_flag; 194 195 // swiches for isotope production 196 static G4bool isoIsEnabled; // true or false; local swich overrides 197 G4int isoIsOnAnyway; // true(1), false(-1) or default(0) 198 199 G4IsoParticleChange theIsoPC; 200 std::vector<G4VIsotopeProduction *> theProductionModels; 201 202 std::vector<G4VLeadingParticleBiasing *> theBias; 203 204 static G4IsoParticleChange* theIsoResult; 205 static G4IsoParticleChange* theOldIsoResult; 206 207 G4ParticleChange* theTotalResult; 208 209 G4double theInitialNumberOfInteractionLength; 210 211 G4double aScaleFactor; 212 G4bool xBiasOn; 213 G4double theLastCrossSection; 214 215 G4int ModelingState; 216 }; 239 217 240 218 #endif -
trunk/source/processes/hadronic/management/include/G4VLeadingParticleBiasing.hh
r819 r962 25 25 // 26 26 // $Id: G4VLeadingParticleBiasing.hh,v 1.6 2006/06/29 19:58:19 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // --------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.