Ignore:
Timestamp:
Apr 6, 2009, 12:21:12 PM (16 years ago)
Author:
garnier
Message:

update processes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/muons/include/G4EnergyLossForExtrapolator.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EnergyLossForExtrapolator.hh,v 1.9 2007/07/28 13:44:25 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4EnergyLossForExtrapolator.hh,v 1.12 2008/11/13 14:14:07 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929//---------------------------------------------------------------------------
     
    8181
    8282  G4double EnergyBeforeStep(G4double kinEnergy, G4double step,
    83                             const G4Material*, const G4ParticleDefinition*);
     83                            const G4Material*, const G4ParticleDefinition*);
     84
     85  G4double TrueStepLength(G4double kinEnergy, G4double step,
     86                          const G4Material*, const G4ParticleDefinition* part);
    8487
    8588  inline G4double EnergyAfterStep(G4double kinEnergy, G4double step,
    86                            const G4Material*, const G4String& particleName);
     89                                  const G4Material*, const G4String& particleName);
    8790
    8891  inline G4double EnergyBeforeStep(G4double kinEnergy, G4double step,
    89                             const G4Material*, const G4String& particleName);
     92                                   const G4Material*, const G4String& particleName);
    9093
    9194  inline G4double AverageScatteringAngle(G4double kinEnergy, G4double step,
    92                                   const G4Material*, const G4ParticleDefinition* part);
     95                                         const G4Material*,
     96                                         const G4ParticleDefinition* part);
    9397
    9498  inline G4double AverageScatteringAngle(G4double kinEnergy, G4double step,
    95                                          const G4Material*, const G4String& particleName);
     99                                         const G4Material*,
     100                                         const G4String& particleName);
     101
     102  inline G4double ComputeTrueStep(const G4Material*, const G4ParticleDefinition* part,
     103                                  G4double kinEnergy, G4double stepLength);
    96104
    97105  inline G4double EnergyDispersion(G4double kinEnergy, G4double step,
    98                             const G4Material*, const G4ParticleDefinition*);
     106                                   const G4Material*, const G4ParticleDefinition*);
    99107
    100108  inline G4double EnergyDispersion(G4double kinEnergy, G4double step,
     
    113121  void Initialisation();
    114122
     123  G4bool SetupKinematics(const G4ParticleDefinition*, const G4Material*,
     124                         G4double kinEnergy);
     125
    115126  G4PhysicsTable* PrepareTable();
    116127
     
    123134  void ComputeProtonDEDX(const G4ParticleDefinition* part, G4PhysicsTable* table);
    124135
    125   G4double ComputeTrueStep(const G4Material*, const G4ParticleDefinition* part,
    126                            G4double kinEnergy, G4double stepLength);
     136  void ComputeTrasportXS(const G4ParticleDefinition* part, G4PhysicsTable* table);
    127137
    128138  inline G4double ComputeValue(G4double x, const G4PhysicsTable* table);
    129 
    130   inline G4double ComputeScatteringAngle(G4double x);
    131139
    132140  // hide assignment operator
     
    158166  G4PhysicsTable*          invRangeMuon;
    159167  G4PhysicsTable*          invRangeProton;
     168  G4PhysicsTable*          mscElectron;
    160169
    161170  const G4Material* currentMaterial;
     
    214223//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    215224
    216 inline G4double G4EnergyLossForExtrapolator::EnergyDispersion(G4double kinEnergy,
    217                                                               G4double step,
    218                                                               const G4Material* mat,
    219                                                               const G4String& name)
     225inline G4double
     226G4EnergyLossForExtrapolator::EnergyDispersion(G4double kinEnergy,
     227                                              G4double step,
     228                                              const G4Material* mat,
     229                                              const G4String& name)
    220230{
    221231  return EnergyDispersion(kinEnergy,step,mat,FindParticle(name));
     
    224234//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    225235
    226 inline G4double G4EnergyLossForExtrapolator::AverageScatteringAngle(G4double kinEnergy,
    227                                                              G4double stepLength,
    228                                                              const G4Material* mat,
    229                                                              const G4ParticleDefinition* part)
    230 {
    231   if(!isInitialised) Initialisation();
     236inline G4double
     237G4EnergyLossForExtrapolator::AverageScatteringAngle(G4double kinEnergy,
     238                                                    G4double stepLength,
     239                                                    const G4Material* mat,
     240                                                    const G4ParticleDefinition* part)
     241{
    232242  G4double theta = 0.0;
    233   if(mat && part && kinEnergy > 0.0) {
    234     G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength);
    235     if(step > 0.001*radLength) theta = ComputeScatteringAngle(stepLength);
     243  if(SetupKinematics(part, mat, kinEnergy)) {
     244    G4double t = stepLength/radLength;
     245    G4double y = std::max(0.001, t);
     246    theta = 19.23*MeV*std::sqrt(charge2*t)*(1.0 + 0.038*std::log(y))/(beta2*gam*mass);
    236247  }
    237248  return theta;
     
    240251//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    241252
    242 inline G4double G4EnergyLossForExtrapolator::ComputeScatteringAngle(G4double x)
    243 {
    244   G4double t = x/radLength;
    245   return 19.23*MeV*std::sqrt(charge2*t)*(1.0 + 0.038*std::log(t))/(beta2*gam*mass);
    246 }
     253inline G4double
     254G4EnergyLossForExtrapolator::ComputeTrueStep(const G4Material* mat,
     255                                             const G4ParticleDefinition* part,
     256                                             G4double kinEnergy,
     257                                             G4double stepLength)
     258{
     259  G4double theta = AverageScatteringAngle(kinEnergy,stepLength,mat,part);
     260  return stepLength*std::sqrt(1.0 + 0.625*theta*theta);
     261}
    247262
    248263//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    249264 
    250 inline G4double G4EnergyLossForExtrapolator::EnergyDispersion(
    251                                                        G4double kinEnergy,
     265inline
     266G4double G4EnergyLossForExtrapolator::EnergyDispersion(G4double kinEnergy,
    252267                                                       G4double stepLength,
    253268                                                       const G4Material* mat,
    254269                                                       const G4ParticleDefinition* part)
    255270{
    256   if(!isInitialised) Initialisation();
    257271  G4double sig2 = 0.0;
    258   if(mat && part ) {
     272  if(SetupKinematics(part, mat, kinEnergy)) {
    259273    G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength);
    260     sig2 = (1.0/beta2 - 0.5)* twopi_mc2_rcl2 * tmax*step * electronDensity * charge2;
     274    sig2 = (1.0/beta2 - 0.5)*twopi_mc2_rcl2*tmax*step*electronDensity*charge2;
    261275  }
    262276  return sig2;
     
    269283{
    270284  G4double res = 0.0;
    271   bool b;
    272   res = ((*table)[index])->GetValue(x, b);
     285  G4bool b;
     286  if(table) res = ((*table)[index])->GetValue(x, b);
    273287  return res;
    274288}
Note: See TracChangeset for help on using the changeset viewer.