Ignore:
Timestamp:
Apr 17, 2009, 12:17:14 PM (15 years ago)
Author:
garnier
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/standard/src/G4PAIModel.cc

    r961 r991  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PAIModel.cc,v 1.46 2009/02/19 19:17:50 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
    28 //
    29 // -------------------------------------------------------------------
    30 //
    31 // GEANT4 Class
    3226// File name:     G4PAIModel.cc
    3327//
     
    183177      fCutCouple = theCoupleTable->GetMaterialCutsCouple( fMaterial,
    184178                                          curReg->GetProductionCuts() );
    185       //G4cout << "Reg <" <<curReg->GetName() << ">  mat <"
    186       //             << fMaterial->GetName() << ">  fCouple= "
    187       //             << fCutCouple<<G4endl;
    188179      if( fCutCouple ) {
    189180        fMaterialCutsCoupleVector.push_back(fCutCouple);
     
    206197  }
    207198}
    208 
    209 //////////////////////////////////////////////////////////////////
    210 
    211 void G4PAIModel::InitialiseMe(const G4ParticleDefinition*)
    212 {}
    213199
    214200//////////////////////////////////////////////////////////////////
     
    407393  {
    408394    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    409     //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    410     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
     395    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    411396    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    412397  }
     
    450435  {
    451436    //  if ( x1 == x2  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    452     //    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    453     if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*0.5 ;
     437    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    454438    else             dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    455439  }
     
    460444//////////////////////////////////////////////////////////////////////////////
    461445
    462 G4double G4PAIModel::ComputeDEDXPerVolume(const G4Material*,
    463                                           const G4ParticleDefinition* p,
    464                                           G4double kineticEnergy,
    465                                           G4double cutEnergy)
     446G4double G4PAIModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
     447                                 const G4ParticleDefinition* p,
     448                                       G4double kineticEnergy,
     449                                       G4double cutEnergy)
    466450{
    467451  G4int iTkin,iPlace;
    468452  size_t jMat;
    469  
    470   //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);
    471   G4double cut = cutEnergy;
    472 
    473453  G4double massRatio  = fMass/p->GetPDGMass();
    474454  G4double scaledTkin = kineticEnergy*massRatio;
    475455  G4double charge     = p->GetPDGCharge();
    476   G4double charge2    = charge*charge;
    477   const G4MaterialCutsCouple* matCC = CurrentCouple();
     456  G4double charge2    = charge*charge, dEdx;
    478457
    479458  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    491470  iPlace = iTkin - 1;
    492471  if(iPlace < 0) iPlace = 0;
    493   G4double dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) );
     472  dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 
     473
    494474  if( dEdx < 0.) dEdx = 0.;
    495475  return dEdx;
     
    498478/////////////////////////////////////////////////////////////////////////
    499479
    500 G4double G4PAIModel::CrossSectionPerVolume( const G4Material*,
    501                                             const G4ParticleDefinition* p,
    502                                             G4double kineticEnergy,
    503                                             G4double cutEnergy,
    504                                             G4double maxEnergy  )
     480G4double G4PAIModel::CrossSection( const G4MaterialCutsCouple* matCC,
     481                                   const G4ParticleDefinition* p,
     482                                         G4double kineticEnergy,
     483                                         G4double cutEnergy,
     484                                         G4double maxEnergy  )
    505485{
    506486  G4int iTkin,iPlace;
    507487  size_t jMat;
    508   G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
    509   if(tmax <= cutEnergy) return 0.0;
     488  G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
    510489  G4double massRatio  = fMass/p->GetPDGMass();
    511490  G4double scaledTkin = kineticEnergy*massRatio;
    512491  G4double charge     = p->GetPDGCharge();
    513492  G4double charge2    = charge*charge, cross, cross1, cross2;
    514   const G4MaterialCutsCouple* matCC = CurrentCouple();
    515493
    516494  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    957935}
    958936
    959 /////////////////////////////////////////////////////////////////////
    960 
    961 G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,
    962                                          G4double kinEnergy)
    963 {
    964   G4double tmax = kinEnergy;
    965   if(p == fElectron) tmax *= 0.5;
    966   else if(p != fPositron) {
    967     G4double mass = p->GetPDGMass();
    968     G4double ratio= electron_mass_c2/mass;
    969     G4double gamma= kinEnergy/mass + 1.0;
    970     tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
    971                   (1. + 2.0*gamma*ratio + ratio*ratio);
    972   }
    973   return tmax;
    974 }
    975 
    976 ///////////////////////////////////////////////////////////////
    977 
    978 void G4PAIModel::DefineForRegion(const G4Region* r)
    979 {
    980   fPAIRegionVector.push_back(r);
    981 }
    982937
    983938//
Note: See TracChangeset for help on using the changeset viewer.