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

update processes

File:
1 edited

Legend:

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

    r819 r961  
    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
    2632// File name:     G4PAIModel.cc
    2733//
     
    177183      fCutCouple = theCoupleTable->GetMaterialCutsCouple( fMaterial,
    178184                                          curReg->GetProductionCuts() );
     185      //G4cout << "Reg <" <<curReg->GetName() << ">  mat <"
     186      //             << fMaterial->GetName() << ">  fCouple= "
     187      //             << fCutCouple<<G4endl;
    179188      if( fCutCouple ) {
    180189        fMaterialCutsCoupleVector.push_back(fCutCouple);
     
    197206  }
    198207}
     208
     209//////////////////////////////////////////////////////////////////
     210
     211void G4PAIModel::InitialiseMe(const G4ParticleDefinition*)
     212{}
    199213
    200214//////////////////////////////////////////////////////////////////
     
    393407  {
    394408    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    395     if ( std::abs(x1-x2) <= eV  ) 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 ;
    396411    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    397412  }
     
    435450  {
    436451    //  if ( x1 == x2  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    437     if ( std::abs(x1-x2) <= eV  ) 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 ;
    438454    else             dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    439455  }
     
    444460//////////////////////////////////////////////////////////////////////////////
    445461
    446 G4double G4PAIModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
    447                                  const G4ParticleDefinition* p,
    448                                        G4double kineticEnergy,
    449                                        G4double cutEnergy)
     462G4double G4PAIModel::ComputeDEDXPerVolume(const G4Material*,
     463                                          const G4ParticleDefinition* p,
     464                                          G4double kineticEnergy,
     465                                          G4double cutEnergy)
    450466{
    451467  G4int iTkin,iPlace;
    452468  size_t jMat;
     469 
     470  //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);
     471  G4double cut = cutEnergy;
     472
    453473  G4double massRatio  = fMass/p->GetPDGMass();
    454474  G4double scaledTkin = kineticEnergy*massRatio;
    455475  G4double charge     = p->GetPDGCharge();
    456   G4double charge2    = charge*charge, dEdx;
     476  G4double charge2    = charge*charge;
     477  const G4MaterialCutsCouple* matCC = CurrentCouple();
    457478
    458479  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    470491  iPlace = iTkin - 1;
    471492  if(iPlace < 0) iPlace = 0;
    472   dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 
    473 
     493  G4double dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) );
    474494  if( dEdx < 0.) dEdx = 0.;
    475495  return dEdx;
     
    478498/////////////////////////////////////////////////////////////////////////
    479499
    480 G4double G4PAIModel::CrossSection( const G4MaterialCutsCouple* matCC,
    481                                    const G4ParticleDefinition* p,
    482                                          G4double kineticEnergy,
    483                                          G4double cutEnergy,
    484                                          G4double maxEnergy  )
     500G4double G4PAIModel::CrossSectionPerVolume( const G4Material*,
     501                                            const G4ParticleDefinition* p,
     502                                            G4double kineticEnergy,
     503                                            G4double cutEnergy,
     504                                            G4double maxEnergy  )
    485505{
    486506  G4int iTkin,iPlace;
    487507  size_t jMat;
    488   G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     508  G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     509  if(tmax <= cutEnergy) return 0.0;
    489510  G4double massRatio  = fMass/p->GetPDGMass();
    490511  G4double scaledTkin = kineticEnergy*massRatio;
    491512  G4double charge     = p->GetPDGCharge();
    492513  G4double charge2    = charge*charge, cross, cross1, cross2;
     514  const G4MaterialCutsCouple* matCC = CurrentCouple();
    493515
    494516  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    935957}
    936958
     959/////////////////////////////////////////////////////////////////////
     960
     961G4double 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
     978void G4PAIModel::DefineForRegion(const G4Region* r)
     979{
     980  fPAIRegionVector.push_back(r);
     981}
    937982
    938983//
Note: See TracChangeset for help on using the changeset viewer.