- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- Location:
- trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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.