- Timestamp:
- Jan 8, 2010, 11:56:51 AM (14 years ago)
- Location:
- trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4LeptonHadronProcess.cc
r819 r1228 33 33 G4LeptonHadronProcess::G4LeptonHadronProcess( const G4String &processName ) 34 34 //----------------------------------------------------------------------------- 35 : G4VDiscreteProcess( processName ) 35 : G4VDiscreteProcess( processName ), theInteractionModel(0) 36 36 { 37 37 } … … 47 47 //----------------------------------------------------------------------------- 48 48 G4VParticleChange* 49 G4LeptonHadronProcess:: GeneralPostStepDoIt( const G4Track &leptonTrack,50 49 G4LeptonHadronProcess::PostStepDoIt( const G4Track &leptonTrack, 50 const G4Step & ) 51 51 //----------------------------------------------------------------------------- 52 52 { -
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4MuNuclearInteraction.cc
r1196 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuNuclearInteraction.cc,v 1.1 2 2009/01/24 11:59:37vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-03 -cand-01$26 // $Id: G4MuNuclearInteraction.cc,v 1.13 2009/03/04 19:09:20 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03 $ 28 28 // 29 29 // $Id: … … 97 97 } 98 98 99 100 G4bool G4MuNuclearInteraction::IsApplicable(const G4ParticleDefinition& particle) 101 { 102 return( (&particle == theMuonMinus)||(&particle == theMuonPlus)) ; 103 } 104 99 105 void G4MuNuclearInteraction::PreparePhysicsTable( 100 106 const G4ParticleDefinition& aParticleType) … … 522 528 G4Nucleus theTarget(aMaterial); 523 529 524 G4VParticleChange* aHadronicFS; 525 aHadronicFS = theHadronicVertex.ApplyYourself(theTarget, gammaTrack); 526 // delete aGamma; 530 G4VParticleChange* aHadronicFS = theHadronicVertex.ApplyYourself(theTarget, gammaTrack); 531 //delete aGamma; 527 532 528 533 G4int numSecondaries = aHadronicFS->GetNumberOfSecondaries(); 529 534 aParticleChange.SetNumberOfSecondaries(numSecondaries); 530 535 531 G4ParticleMomentum secondaryMomentum = G4ThreeVector(0.,0.,0.);536 // G4ParticleMomentum secondaryMomentum = G4ThreeVector(0.,0.,0.); 532 537 for(G4int iSec=0; iSec<numSecondaries; iSec++) 533 538 { 534 secondaryMomentum535 = secondaryMomentum + aHadronicFS->GetSecondary(iSec)->GetMomentum();539 //secondaryMomentum 540 // = secondaryMomentum + aHadronicFS->GetSecondary(iSec)->GetMomentum(); 536 541 aParticleChange.AddSecondary(aHadronicFS->GetSecondary(iSec)); 537 542 } 538 aHadronicFS->Clear();543 //aHadronicFS->Clear(); 539 544 540 545 return G4VDiscreteProcess::PostStepDoIt(trackData,stepData); … … 574 579 } 575 580 581 G4double G4MuNuclearInteraction::GetMeanFreePath(const G4Track& trackData, 582 G4double, 583 G4ForceCondition* condition) 584 { 585 const G4DynamicParticle* aDynamicParticle; 586 G4Material* aMaterial; 587 G4double MeanFreePath; 588 G4bool isOutRange ; 589 590 *condition = NotForced ; 591 592 aDynamicParticle = trackData.GetDynamicParticle(); 593 aMaterial = trackData.GetMaterial(); 594 595 G4double KineticEnergy = aDynamicParticle->GetKineticEnergy(); 596 597 if (KineticEnergy < LowestKineticEnergy) 598 MeanFreePath = DBL_MAX ; 599 else { 600 if (KineticEnergy > HighestKineticEnergy) 601 KineticEnergy = 0.99*HighestKineticEnergy ; 602 MeanFreePath = (*theMeanFreePathTable)(aMaterial->GetIndex())-> 603 GetValue( KineticEnergy, isOutRange ); 604 } 605 return MeanFreePath; 606 } 607 608 G4double G4MuNuclearInteraction::ComputeMeanFreePath( 609 const G4ParticleDefinition* ParticleType, 610 G4double KineticEnergy, 611 const G4Material* aMaterial) 612 { 613 const G4ElementVector* theElementVector = aMaterial->GetElementVector() ; 614 const G4double* theAtomNumDensityVector = 615 aMaterial->GetAtomicNumDensityVector(); 616 617 G4double SIGMA = 0 ; 618 619 for ( size_t i=0 ; i < aMaterial->GetNumberOfElements() ; i++ ) 620 { 621 SIGMA += theAtomNumDensityVector[i] * 622 ComputeMicroscopicCrossSection( ParticleType, KineticEnergy, 623 (*theElementVector)[i]->GetZ(), 624 (*theElementVector)[i]->GetA()) ; 625 } 626 627 return SIGMA<=0.0 ? DBL_MAX : 1./SIGMA ; 628 } 629 630 -
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4MuonNucleusInteractionModel.cc
r1196 r1228 26 26 // 27 27 // $Id: G4MuonNucleusInteractionModel.cc,v 1.6 2006/06/29 20:57:36 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-03 -cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------- -
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4MuonNucleusProcess.cc
r819 r1228 36 36 : G4LeptonHadronProcess( processName) 37 37 { 38 theInteractionModel = chooseInteractionModel();38 theInteractionModel = new G4MuonNucleusInteractionModel; 39 39 } 40 40 … … 46 46 delete theInteractionModel; 47 47 } 48 49 50 //-----------------------------------------------------------------------------51 G4LeptonHadronInteractionModel*52 G4MuonNucleusProcess::chooseInteractionModel()53 //-----------------------------------------------------------------------------54 {55 G4MuonNucleusInteractionModel* aModel = new G4MuonNucleusInteractionModel;56 return aModel;57 }58 59 48 60 49 //----------------------------------------------------------------------------- -
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4ParametrizedHadronicVertex.cc
r1196 r1228 25 25 // 26 26 // 27 // $Id: G4ParametrizedHadronicVertex.cc,v 1. 6 2006/06/29 20:57:40 gunterExp $28 // GEANT4 tag $Name: geant4-09-03 -cand-01$27 // $Id: G4ParametrizedHadronicVertex.cc,v 1.7 2009/03/04 19:09:20 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------- 31 31 32 #include "G4ParametrizedHadronicVertex.hh" 32 33 #include "G4HadFinalState.hh" 33 #include "G4ParticleChange.hh" 34 #include "G4HadProjectile.hh" 35 #include "G4LEPionPlusInelastic.hh" 36 #include "G4LEPionMinusInelastic.hh" 37 #include "G4HEPionPlusInelastic.hh" 38 #include "G4HEPionMinusInelastic.hh" 34 39 35 G4VParticleChange * G4ParametrizedHadronicVertex:: 36 ApplyYourself(G4Nucleus & theTarget, const G4Track &thePhoton) 40 G4ParametrizedHadronicVertex::G4ParametrizedHadronicVertex() 41 { 42 theLowEPionPlus = new G4LEPionPlusInelastic; 43 theLowEPionMinus = new G4LEPionMinusInelastic; 44 theHighEPionPlus = new G4HEPionPlusInelastic; 45 theHighEPionMinus = new G4HEPionMinusInelastic; 46 } 47 48 G4ParametrizedHadronicVertex::~G4ParametrizedHadronicVertex() 49 {} 50 51 G4VParticleChange* 52 G4ParametrizedHadronicVertex::ApplyYourself(G4Nucleus & theTarget, 53 const G4Track &thePhoton) 37 54 { 38 static G4ParticleChange theTotalResult; 55 theTotalResult.Clear(); 56 theTotalResult.Initialize(thePhoton); 39 57 40 theTotalResult.Clear(); 41 theTotalResult.ProposeLocalEnergyDeposit(0.); 42 theTotalResult.Initialize(thePhoton); 43 theTotalResult.ProposeTrackStatus(fAlive); 44 G4double theKineticEnergy = thePhoton.GetKineticEnergy(); 45 G4HadFinalState * aR = 0; 46 G4HadProjectile thePro(thePhoton); 47 if(CLHEP::RandBit::shootBit()) 58 G4double theKineticEnergy = thePhoton.GetKineticEnergy(); 59 G4HadFinalState * aR = 0; 60 G4HadProjectile thePro(thePhoton); 61 if(G4UniformRand() > 0.5) 48 62 { 49 63 if(theKineticEnergy<20*GeV) aR = theLowEPionMinus->ApplyYourself(thePro, theTarget); 50 64 else aR = theHighEPionMinus->ApplyYourself(thePro, theTarget); 51 65 } 52 66 else 53 67 { 54 68 if(theKineticEnergy<20*GeV) aR = theLowEPionPlus->ApplyYourself(thePro, theTarget); 55 69 else aR = theHighEPionPlus->ApplyYourself(thePro, theTarget); 56 70 } 57 aR->SetTrafoToLab(thePro.GetTrafoToLab()); 58 if(aR->GetStatusChange()==stopAndKill) 59 { 60 theTotalResult.ProposeTrackStatus(fStopAndKill); 61 theTotalResult.ProposeEnergy( 0.0 ); 62 } 63 if(aR->GetStatusChange()==suspend) 64 { 65 theTotalResult.ProposeTrackStatus(fSuspend); 66 } 67 if(aR->GetStatusChange()!=stopAndKill ) 68 { 69 G4double newWeight = aR->GetWeightChange()*thePhoton.GetWeight(); 70 theTotalResult.ProposeParentWeight(newWeight); 71 if(aR->GetEnergyChange()>-.5) theTotalResult.ProposeEnergy(aR->GetEnergyChange()); 72 G4LorentzVector newDirection(aR->GetMomentumChange().unit(), 1.); 73 newDirection*=aR->GetTrafoToLab(); 74 theTotalResult.ProposeMomentumDirection(newDirection.vect()); 75 } 71 if(!aR) return &theTotalResult; 76 72 77 theTotalResult.ProposeLocalEnergyDeposit(aR->GetLocalEnergyDeposit()); 78 theTotalResult.SetNumberOfSecondaries(aR->GetNumberOfSecondaries()); 73 aR->SetTrafoToLab(thePro.GetTrafoToLab()); 79 74 80 G4ThreeVector it(0., 0., 1.); 81 G4double what = 2.*pi*G4UniformRand(); 82 for(G4int i=0; i<aR->GetNumberOfSecondaries(); i++) 75 G4int nsec = aR->GetNumberOfSecondaries(); 76 theTotalResult.SetNumberOfSecondaries(nsec); 77 78 G4ThreeVector it(0., 0., 1.); 79 G4double what = twopi*G4UniformRand(); 80 for(G4int i=0; i<nsec; i++) 83 81 { 84 82 G4LorentzVector theM = aR->GetSecondary(i)->GetParticle()->Get4Momentum();
Note: See TracChangeset
for help on using the changeset viewer.