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/G4PAIPhotonModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
     26// $Id: G4PAIPhotonModel.cc,v 1.21 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:     G4PAIPhotonModel.cc
    2733//
     
    217223//////////////////////////////////////////////////////////////////
    218224
     225void G4PAIPhotonModel::InitialiseMe(const G4ParticleDefinition*)
     226{}
     227
     228//////////////////////////////////////////////////////////////////
     229
    219230void G4PAIPhotonModel::ComputeSandiaPhotoAbsCof()
    220231{
     
    487498  {
    488499    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    489     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     500    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     501    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    490502    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    491503  }
     
    530542  {
    531543    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    532     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     544    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     545    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    533546    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    534547  }
     
    574587  {
    575588    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    576     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     589    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     590    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    577591    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    578592  }
     
    617631  {
    618632    //  if ( x1 == x2  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    619     if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     633    //    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     634    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*0.5 ;
    620635    else             dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    621636  }
     
    626641//////////////////////////////////////////////////////////////////////////////
    627642
    628 G4double G4PAIPhotonModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
    629                                  const G4ParticleDefinition* p,
    630                                        G4double kineticEnergy,
    631                                        G4double cutEnergy)
     643G4double G4PAIPhotonModel::ComputeDEDXPerVolume(const G4Material*,
     644                                                const G4ParticleDefinition* p,
     645                                                G4double kineticEnergy,
     646                                                G4double cutEnergy)
    632647{
    633648  G4int iTkin,iPlace;
    634649  size_t jMat;
     650
     651  //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);
     652  G4double cut = cutEnergy;
     653
    635654  G4double particleMass = p->GetPDGMass();
    636655  G4double scaledTkin   = kineticEnergy*proton_mass_c2/particleMass;
     
    638657  G4double charge2      = charge*charge;
    639658  G4double dEdx         = 0.;
     659  const G4MaterialCutsCouple* matCC = CurrentCouple();
    640660
    641661  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    653673  iPlace = iTkin - 1;
    654674  if(iPlace < 0) iPlace = 0;
    655   dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 
     675  dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ) ; 
    656676
    657677  if( dEdx < 0.) dEdx = 0.;
     
    661681/////////////////////////////////////////////////////////////////////////
    662682
    663 G4double G4PAIPhotonModel::CrossSection( const G4MaterialCutsCouple* matCC,
    664                                    const G4ParticleDefinition* p,
    665                                          G4double kineticEnergy,
    666                                          G4double cutEnergy,
    667                                          G4double maxEnergy  )
     683G4double G4PAIPhotonModel::CrossSectionPerVolume( const G4Material*,
     684                                                  const G4ParticleDefinition* p,
     685                                                  G4double kineticEnergy,
     686                                                  G4double cutEnergy,
     687                                                  G4double maxEnergy  )
    668688{
    669689  G4int iTkin,iPlace;
    670690  size_t jMat, jMatCC;
    671   G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     691  G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     692  if(cutEnergy >= tmax) return 0.0;
    672693  G4double particleMass = p->GetPDGMass();
    673694  G4double scaledTkin   = kineticEnergy*proton_mass_c2/particleMass;
     
    675696  G4double charge2      = charge*charge, cross, cross1, cross2;
    676697  G4double photon1, photon2, plasmon1, plasmon2;
     698
     699  const G4MaterialCutsCouple* matCC = CurrentCouple();
    677700
    678701  const G4ProductionCutsTable* theCoupleTable=
     
    12251248}
    12261249
     1250/////////////////////////////////////////////////////////////////////
     1251
     1252G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,
     1253                                                      G4double kinEnergy)
     1254{
     1255  G4double tmax = kinEnergy;
     1256  if(p == fElectron) tmax *= 0.5;
     1257  else if(p != fPositron) {
     1258    G4double mass = p->GetPDGMass();
     1259    G4double ratio= electron_mass_c2/mass;
     1260    G4double gamma= kinEnergy/mass + 1.0;
     1261    tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
     1262                  (1. + 2.0*gamma*ratio + ratio*ratio);
     1263  }
     1264  return tmax;
     1265}
     1266
     1267///////////////////////////////////////////////////////////////
     1268
     1269void G4PAIPhotonModel::DefineForRegion(const G4Region* r)
     1270{
     1271  fPAIRegionVector.push_back(r);
     1272}
     1273
    12271274
    12281275//
Note: See TracChangeset for help on using the changeset viewer.