Changeset 962 for trunk/source/processes/hadronic/models/photolepton_hadron
- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- Location:
- trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/History
r819 r962 1 $Id: History,v 1. 3 2006/11/04 22:21:09 dennisExp $1 $Id: History,v 1.8 2009/02/06 08:58:20 vnivanch Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 16 16 --------------------------------------------------------------- 17 17 18 4 Nov 2006 Dennis Wright for V. Ivantchenko (hadr-munuclear-V08-01-00) 18 06 Feb 2009 V.Ivantchenko (hadr-munuclear-V09-02-01) 19 ---------------------------------------------------- 20 21 24 Jan 2009 V.Ivantchenko (hadr-munuclear-V09-02-00) 22 ---------------------------------------------------- 23 - G4MuNuclearInteraction added deregistration of the process 24 25 4 Oct 2008 Dennis Wright (hadr-munuclear-V09-01-01) 26 ---------------------------------------------------- 27 - G4MuNuclearInteraction - include process type enum and change type from 28 12 to fHadronInelastic 29 30 2 Sep 2008 V.Ivanchenko (hadr-munuclear-V09-01-00) 31 --------------------------------------------------- 32 - G4MuNuclearInteraction added SubType and registration in the 33 G4HadronicProcessStore; added PreparePhysicsTable 34 method and cleanup for readability 35 36 4 Nov 2006 Dennis Wright for V.Ivanchenko (hadr-munuclear-V08-01-00) 19 37 ----------------------------------------------------------------------- 20 38 - G4MuNuclearInteraction::ComputeMicroscopicCrossSection: prevent NaN -
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/include/G4MuNuclearInteraction.hh
r819 r962 25 25 // 26 26 // 27 // $Id: G4MuNuclearInteraction.hh,v 1. 4 2006/06/29 20:57:20 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4MuNuclearInteraction.hh,v 1.6 2008/10/02 21:04:35 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // $Id: … … 55 55 #include "G4PhysicsLogVector.hh" 56 56 #include "G4ParametrizedHadronicVertex.hh" 57 #include "G4HadronicProcessType.hh" 57 58 58 59 class G4MuNuclearInteraction : public G4VDiscreteProcess 59 60 60 61 { 61 62 public: 62 63 63 64 G4MuNuclearInteraction(const G4String& processName = "muNuclear"); 64 65 65 66 virtual ~G4MuNuclearInteraction(); 66 67 67 68 virtual G4bool IsApplicable(const G4ParticleDefinition&); 68 69 69 70 void SetPhysicsTableBining(G4double lowE, G4double highE, G4int nBins); 70 71 71 void BuildPhysicsTable(const G4ParticleDefinition& ParticleType);72 virtual void PreparePhysicsTable(const G4ParticleDefinition& ParticleType); 72 73 73 void PrintInfoDefinition();74 virtual void BuildPhysicsTable(const G4ParticleDefinition& ParticleType); 74 75 75 G4double GetMeanFreePath(const G4Track& track, 76 G4double previousStepSize, 77 G4ForceCondition* condition ) ; 76 virtual void PrintInfoDefinition() ; 77 78 virtual G4double GetMeanFreePath(const G4Track& track, 79 G4double previousStepSize, 80 G4ForceCondition* condition ) ; 78 81 79 80 82 virtual G4VParticleChange *PostStepDoIt(const G4Track& track, 83 const G4Step& Step ) ; 81 84 82 85 protected: 83 86 84 85 86 87 virtual G4double ComputeMeanFreePath( const G4ParticleDefinition* ParticleType, 88 G4double KineticEnergy, 89 const G4Material* aMaterial); 87 90 88 89 90 91 void ComputePartialSumSigma( const G4ParticleDefinition* ParticleType, 92 G4double KineticEnergy, 93 const G4Material* aMaterial); 91 94 92 93 94 95 96 95 virtual G4double ComputeMicroscopicCrossSection( 96 const G4ParticleDefinition* ParticleType, 97 G4double KineticEnergy, 98 G4double AtomicNumber, 99 G4double AtomicMass); 97 100 98 99 100 101 102 103 101 virtual G4double ComputeDMicroscopicCrossSection( 102 const G4ParticleDefinition* ParticleType, 103 G4double KineticEnergy, 104 G4double AtomicNumber, 105 G4double AtomicMass, 106 G4double epsilon); 104 107 105 108 private: 106 109 107 108 110 G4MuNuclearInteraction & operator=(const G4MuNuclearInteraction &right); 111 G4MuNuclearInteraction(const G4MuNuclearInteraction&); 109 112 110 113 G4Element* SelectRandomAtom(G4Material* aMaterial) const; 111 114 112 115 void MakeSamplingTables( const G4ParticleDefinition* ParticleType ); 113 116 114 117 private: 115 118 116 117 119 G4PhysicsTable* theMeanFreePathTable; 120 G4PhysicsTable* theCrossSectionTable ; 118 121 119 122 G4OrderedTable PartialSumSigma; 120 123 121 122 123 124 G4double LowestKineticEnergy; 125 G4double HighestKineticEnergy; 126 G4int TotBin; 124 127 125 126 127 128 128 //cut from R.P. Kokoulin 129 const G4double CutFixed ; 130 // for the atomic weight conversion 131 G4double GramPerMole ; 129 132 130 131 132 133 const G4MuonMinus* theMuonMinus; 134 const G4MuonPlus* theMuonPlus; 135 const G4PionZero* thePionZero; 133 136 134 135 136 137 137 // tables for sampling .............. 138 static G4int nzdat,ntdat,NBIN ; 139 static G4double zdat[5],adat[5],tdat[8] ; 140 static G4double ya[1001],proba[5][8][1001] ; 138 141 139 // for the hadronic final state; use base cass * in next release 140 G4ParametrizedHadronicVertex theHadronicVertex; 142 G4ParametrizedHadronicVertex theHadronicVertex; 141 143 }; 142 144 -
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/include/G4MuNuclearInteraction.icc
r819 r962 26 26 // 27 27 // $Id: G4MuNuclearInteraction.icc,v 1.3 2006/06/29 20:57:22 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // $Id: -
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4MuNuclearInteraction.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4MuNuclearInteraction.cc,v 1.7 2006/11/04 02:15:05 vnivanch Exp $ 28 // GEANT4 tag $Name: $ 26 // $Id: G4MuNuclearInteraction.cc,v 1.12 2009/01/24 11:59:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 28 // 30 29 // $Id: … … 38 37 // added simple model for hadronic vertex, J.P. Wellisch, November 1998 39 38 // -------------------------------------------------------------- 40 // 26/10/98: new corr.s from R.Kokoulin + cleanup , L.Urban 39 // 26/10/1998: new corr.s from R.Kokoulin + cleanup , L.Urban 40 // 23/01/2009 V.Ivanchenko Add deregistration 41 41 // 42 42 43 #include "G4MuNuclearInteraction.hh" 43 44 #include "G4UnitsTable.hh" 45 #include "G4HadronicProcessStore.hh" 44 46 45 47 // static members ........ … … 66 68 theMuonPlus ( G4MuonPlus::MuonPlus() ), 67 69 thePionZero (G4PionZero::PionZero() ) 68 { } 70 { 71 SetProcessSubType(fHadronInelastic); 72 G4HadronicProcessStore::Instance()->RegisterExtraProcess(this); 73 } 69 74 70 75 G4MuNuclearInteraction::~G4MuNuclearInteraction() 71 76 { 72 if (theMeanFreePathTable) { 73 theMeanFreePathTable->clearAndDestroy(); 74 delete theMeanFreePathTable; 75 } 76 if (theCrossSectionTable) { 77 theCrossSectionTable->clearAndDestroy(); 78 delete theCrossSectionTable; 79 } 80 81 if (&PartialSumSigma) { 82 PartialSumSigma.clearAndDestroy(); 83 } 77 G4HadronicProcessStore::Instance()->DeRegisterExtraProcess(this); 78 79 if (theMeanFreePathTable) { 80 theMeanFreePathTable->clearAndDestroy(); 81 delete theMeanFreePathTable; 82 } 83 if (theCrossSectionTable) { 84 theCrossSectionTable->clearAndDestroy(); 85 delete theCrossSectionTable; 86 } 87 88 if (&PartialSumSigma) { 89 PartialSumSigma.clearAndDestroy(); 90 } 84 91 } 85 92 86 93 void G4MuNuclearInteraction::SetPhysicsTableBining(G4double lowE, 87 94 G4double highE, G4int nBins) 88 95 { 89 96 LowestKineticEnergy = lowE; HighestKineticEnergy = highE ; TotBin = nBins ; 97 } 98 99 void G4MuNuclearInteraction::PreparePhysicsTable( 100 const G4ParticleDefinition& aParticleType) 101 { 102 G4HadronicProcessStore::Instance() 103 ->RegisterParticleForExtraProcess(this, &aParticleType); 90 104 } 91 105 … … 93 107 const G4ParticleDefinition& aParticleType) 94 108 { 109 G4HadronicProcessStore::Instance()->PrintInfo(&aParticleType); 110 95 111 G4double LowEdgeEnergy , Value; 96 112 G4PhysicsLogVector* ptrVector; 97 113 98 114 if (theCrossSectionTable) { 99 100 115 theCrossSectionTable->clearAndDestroy() ; 116 delete theCrossSectionTable ; 101 117 } 102 118 … … 111 127 { 112 128 ptrVector = new G4PhysicsLogVector(LowestKineticEnergy, 113 129 HighestKineticEnergy,TotBin) ; 114 130 AtomicNumber = (*theElementTable )[J]->GetZ() ; 115 131 AtomicWeight = (*theElementTable )[J]->GetA() ; … … 119 135 LowEdgeEnergy = ptrVector->GetLowEdgeEnergy(i) ; 120 136 Value = ComputeMicroscopicCrossSection(&aParticleType, 121 122 137 LowEdgeEnergy, 138 AtomicNumber,AtomicWeight) ; 123 139 ptrVector->PutValue(i,Value) ; 124 140 } … … 130 146 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable() ; 131 147 if (theMeanFreePathTable) { 132 133 148 theMeanFreePathTable->clearAndDestroy(); 149 delete theMeanFreePathTable; 134 150 } 135 151 theMeanFreePathTable = new G4PhysicsTable(G4Material::GetNumberOfMaterials()); … … 142 158 { 143 159 ptrVector = new G4PhysicsLogVector(LowestKineticEnergy, 144 145 160 HighestKineticEnergy, 161 TotBin ) ; 146 162 147 163 const G4Material* material= (*theMaterialTable)[K]; … … 167 183 void G4MuNuclearInteraction::ComputePartialSumSigma( 168 184 const G4ParticleDefinition* ParticleType, 169 170 185 G4double KineticEnergy, 186 const G4Material* aMaterial) 171 187 172 188 // Build the table of cross section per element. The table is built for MATERIALS. … … 183 199 184 200 for ( G4int Ielem=0 ; Ielem < NbOfElements ; Ielem++ ) 185 186 187 188 189 190 191 201 { 202 SIGMA += theAtomNumDensityVector[Ielem] * 203 ComputeMicroscopicCrossSection( ParticleType, KineticEnergy, 204 (*theElementVector)[Ielem]->GetZ(), 205 (*theElementVector)[Ielem]->GetA()) ; 206 PartialSumSigma[Imate]->push_back(SIGMA); 207 } 192 208 } 193 209 … … 529 545 // select randomly 1 element within the material 530 546 531 constG4int Index = aMaterial->GetIndex();532 constG4int NumberOfElements = aMaterial->GetNumberOfElements();547 G4int Index = aMaterial->GetIndex(); 548 G4int NumberOfElements = aMaterial->GetNumberOfElements(); 533 549 const G4ElementVector* theElementVector = aMaterial->GetElementVector(); 550 if(1 == NumberOfElements) return ((*theElementVector)[0]); 534 551 535 552 G4double rval = G4UniformRand()*((*PartialSumSigma[Index])[NumberOfElements-1]); 536 for ( G4int i=0; i < NumberOfElements; i++ ) 553 for ( G4int i=0; i < NumberOfElements; i++ ) { 537 554 if (rval <= (*PartialSumSigma[Index])[i]) return ((*theElementVector)[i]); 538 G4cout << " WARNING !!! - The Material '"<< aMaterial->GetName() 539 << "' has no elements, NULL pointer returned." << G4endl; 540 return 0; 541 } 555 } 556 G4cout << "G4MuNuclearInteraction WARNING !!! no element selected for '" 557 << aMaterial->GetName() 558 << " 1st element returned." << G4endl; 559 return ((*theElementVector)[0]); 560 } 561 542 562 void G4MuNuclearInteraction::PrintInfoDefinition() 543 563 { -
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4MuonNucleusInteractionModel.cc
r819 r962 26 26 // 27 27 // $Id: G4MuonNucleusInteractionModel.cc,v 1.6 2006/06/29 20:57:36 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -------------------------------------------------------------- -
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4ParametrizedHadronicVertex.cc
r819 r962 26 26 // 27 27 // $Id: G4ParametrizedHadronicVertex.cc,v 1.6 2006/06/29 20:57:40 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // --------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.