source: trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/include/G4MuNuclearInteraction.icc @ 1196

Last change on this file since 1196 was 1196, checked in by garnier, 15 years ago

update CVS release candidate geant4.9.3.01

File size: 4.3 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: G4MuNuclearInteraction.icc,v 1.3 2006/06/29 20:57:22 gunter Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30// $Id:
31// ---------------------------------------------------------------
32//      GEANT 4 class inlined methods file
33//
34//      History: first implementation, based on object model of
35//      2nd December 1995, G.Cosmo
36//      -------- G4MuNuclearInteraction physics process ---------
37//                by Laszlo Urban, May 1998
38// ***************************************************************
39
40inline G4double G4MuNuclearInteraction::GetMeanFreePath(
41                                                    const G4Track& trackData,
42                                                    G4double,
43                                                    G4ForceCondition* condition)
44{
45   const G4DynamicParticle* aDynamicParticle;
46   G4Material* aMaterial;
47   G4double MeanFreePath;
48   G4bool isOutRange ;
49 
50   *condition = NotForced ;
51
52   aDynamicParticle = trackData.GetDynamicParticle();
53   aMaterial = trackData.GetMaterial();
54
55   G4double KineticEnergy = aDynamicParticle->GetKineticEnergy();
56
57   if (KineticEnergy <  LowestKineticEnergy)
58     MeanFreePath = DBL_MAX ;
59   else {
60     if (KineticEnergy > HighestKineticEnergy)
61                                 KineticEnergy = 0.99*HighestKineticEnergy ;
62     MeanFreePath = (*theMeanFreePathTable)(aMaterial->GetIndex())->
63                                 GetValue( KineticEnergy, isOutRange );
64   }
65   return MeanFreePath;
66}
67
68inline G4double G4MuNuclearInteraction::ComputeMeanFreePath(
69                                     const G4ParticleDefinition* ParticleType,
70                                           G4double KineticEnergy,
71                                           const G4Material* aMaterial)
72{
73  const G4ElementVector* theElementVector = aMaterial->GetElementVector() ;
74  const G4double* theAtomNumDensityVector =
75                                      aMaterial->GetAtomicNumDensityVector();
76
77  G4double SIGMA = 0 ;
78
79  for ( size_t i=0 ; i < aMaterial->GetNumberOfElements() ; i++ )
80  {             
81    SIGMA += theAtomNumDensityVector[i] *
82             ComputeMicroscopicCrossSection( ParticleType, KineticEnergy,
83                                          (*theElementVector)[i]->GetZ(),
84                                          (*theElementVector)[i]->GetA()) ;
85  }       
86
87  return SIGMA<=0.0 ? DBL_MAX : 1./SIGMA ;
88}
89
90
91inline G4bool G4MuNuclearInteraction::IsApplicable(
92                            const G4ParticleDefinition& particle)
93{
94   return(   (&particle == (const G4ParticleDefinition *)theMuonMinus)
95           ||(&particle == (const G4ParticleDefinition *)theMuonPlus)
96         ) ;
97}
Note: See TracBrowser for help on using the repository browser.