Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

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

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScatteringModel.cc,v 1.44 2009/12/03 09:59:07 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4CoulombScatteringModel.cc,v 1.49 2010/05/27 14:22:05 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4747// 09.06.08 V.Ivanchenko SelectIsotope is moved to the base class
    4848// 16.06.09 Consolandi rows 109, 111-112, 183, 185-186
     49// 27.05.10 V.Ivanchenko added G4WentzelOKandVIxSection class to
     50//              compute cross sections and sample scattering angle
    4951//
    5052//
     
    6264#include "G4IonTable.hh"
    6365#include "G4Proton.hh"
     66#include "G4NucleiProperties.hh"
    6467
    6568//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    8689                                G4double)
    8790{
    88   SetupParticle(p);
    89   if(kinEnergy < lowEnergyLimit) return 0.0;
    90   SetupKinematic(kinEnergy, cutEnergy);
    91 
    92   // save lab system kinematics
    93   G4double xtkin = tkin;
    94   G4double xmom2 = mom2;
    95   G4double xinvb = invbeta2;
    96 
    97   // CM system
    98   iz            = G4int(Z);
    99   G4double m2   = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
    100   G4double etot = tkin + mass;
    101   G4double ptot = sqrt(mom2);
    102 
    103   G4double m12  = mass*mass;
    104   G4double momCM= ptot*m2/sqrt(m12 + m2*m2 + 2.0*etot*m2);
    105 
    106   mom2 = momCM*momCM;
    107   tkin = sqrt(mom2 + m12) - mass;
    108 
    109   //invbeta2 = 1.0 +  m12/mom2;
    110   //  G4double fm = m2/(mass + m2); 
    111 
    112   // 03.09.2009 C.Consaldi
    113   G4double Ecm=sqrt(m12 + m2*m2 + 2.0*etot*m2);
    114   G4double mu_rel=mass*m2/Ecm;
    115 
    116   invbeta2 = 1.0 +  mu_rel*mu_rel/mom2;
    117   //
    118 
    119   SetupTarget(Z, tkin);
    120 
    121   G4double xsec = CrossSectionPerAtom();
    122 
    123   // restore Lab system kinematics
    124   tkin = xtkin;
    125   mom2 = xmom2;
    126   invbeta2 = xinvb;
    127 
     91  //G4cout << "### G4CoulombScatteringModel::ComputeCrossSectionPerAtom  for "
     92  //     << p->GetParticleName()<<" Z= "<<Z<<" e(MeV)= "<< kinEnergy/MeV
     93  //     <<" cut(MeV)= " << cutEnergy<< G4endl;
     94  G4double xsec = 0.0;
     95  if(p != particle) { SetupParticle(p); }
     96  if(kinEnergy < lowEnergyLimit) { return 0.0; }
     97  DefineMaterial(CurrentCouple());
     98
     99  // Lab system
     100  G4int iz = G4int(Z);
     101  G4double etot = kinEnergy + mass;
     102  G4double m2 = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
     103
     104  // 03.09.2009 C.Consaldi suggested to use relativistic reduced mass
     105  //            from publucation
     106  // A.P. Martynenko, R.N. Faustov, Teoret. mat. Fiz. 64 (1985) 179
     107  G4double Ecm  = sqrt(mass*mass + m2*m2 + 2.0*etot*m2);
     108  G4double mu_rel = mass*m2/Ecm;
     109  G4double tkin = Ecm - mu_rel;
     110  wokvi->SetRelativisticMass(mu_rel);
     111 
     112  cosTetMinNuc = wokvi->SetupKinematic(tkin, currentMaterial);
     113  if(cosThetaMax < cosTetMinNuc) {
     114    cosTetMinNuc = wokvi->SetupTarget(iz, cutEnergy);
     115    cosTetMaxNuc = cosThetaMax;
     116    if(iz == 1 && cosTetMaxNuc < 0.0 && particle == theProton) {
     117      cosTetMaxNuc = 0.0;
     118    }
     119    xsec =  wokvi->ComputeNuclearCrossSection(cosTetMinNuc, cosTetMaxNuc);
     120    elecRatio = wokvi->ComputeElectronCrossSection(cosTetMinNuc, cosThetaMax);
     121    xsec += elecRatio;
     122    if(xsec > 0.0) { elecRatio /= xsec; } 
     123  }
     124  /*
     125  G4cout << "e(MeV)= " << kinEnergy/MeV << " xsec(b)= " << xsec/barn 
     126         << "cosTetMinNuc= " << cosTetMinNuc
     127         << " cosTetMaxNuc= " << cosTetMaxNuc
     128         << " cosTetMaxElec= " << cosTetMaxElec
     129         << " screenZ= " << screenZ
     130         << " formfactA= " << formfactA << G4endl;
     131  */
    128132  return xsec;
    129133}
     
    139143{
    140144  G4double kinEnergy = dp->GetKineticEnergy();
    141   if(kinEnergy < lowEnergyLimit) return;
     145  if(kinEnergy < lowEnergyLimit) { return; }
    142146  DefineMaterial(couple);
    143147  SetupParticle(dp->GetDefinition());
    144   SetupKinematic(kinEnergy, cutEnergy);
    145148
    146149  // Choose nucleus
    147150  currentElement = SelectRandomAtom(couple,particle,
    148                                     kinEnergy,ecut,kinEnergy);
    149 
    150   G4double Z  = currentElement->GetZ();
    151   iz          = G4int(Z);
    152   G4int ia    = SelectIsotopeNumber(currentElement);
    153   G4double m2 = theParticleTable->GetIonTable()->GetNucleusMass(iz, ia);
    154 
    155   // CM system
    156   G4double etot = tkin + mass;
    157   G4double ptot = sqrt(mom2);
    158 
    159   G4double momCM= ptot*m2/sqrt(mass*mass + m2*m2 + 2.0*etot*m2);
    160   mom2 = momCM*momCM;
    161   G4double m12 = mass*mass;
    162   G4double eCM = sqrt(mom2 + m12);
    163 
    164   // a correction for heavy projectile
    165   //  G4double fm = m2/(mass + m2);
    166   //  invbeta2 = 1.0 +  m12*fm*fm/mom2;
    167 
    168   // 03.09.2009 C.Consaldi
    169   G4double Ecm=sqrt(m12 + m2*m2 + 2.0*etot*m2);
    170   G4double mu_rel=mass*m2/Ecm;
    171 
    172   invbeta2 = 1.0 +  mu_rel*mu_rel/mom2;
    173   //
    174 
    175   // sample scattering angle in CM system
    176   SetupTarget(Z, eCM - mass);
    177 
    178   G4double cost = SampleCosineTheta();
    179   G4double z1   = 1.0 - cost;
    180   if(z1 < 0.0) return;
    181   G4double sint = sqrt(z1*(1.0 + cost));
    182   G4double phi  = twopi * G4UniformRand();
     151                                    kinEnergy,cutEnergy,kinEnergy);
     152
     153  G4double Z = currentElement->GetZ();
     154  G4int iz = G4int(Z);
     155  G4int ia = SelectIsotopeNumber(currentElement);
     156  G4double targetMass = G4NucleiProperties::GetNuclearMass(ia, iz);
     157 
     158  if(ComputeCrossSectionPerAtom(particle,kinEnergy, Z,
     159                                kinEnergy, cutEnergy, kinEnergy) == 0.0)
     160    { return; }
     161
     162  G4ThreeVector newDirection =
     163    wokvi->SampleSingleScattering(cosTetMinNuc, cosTetMaxNuc, elecRatio);
    183164
    184165  // kinematics in the Lab system
    185   G4double bet  = ptot/(etot + m2);
     166  G4double etot = mass + kinEnergy;
     167  G4double ptot = sqrt(kinEnergy*(etot + mass));
     168  G4double bet  = ptot/(etot + targetMass);
    186169  G4double gam  = 1.0/sqrt((1.0 - bet)*(1.0 + bet));
    187   G4double pzCM = momCM*cost;
    188 
    189   G4ThreeVector v1(momCM*cos(phi)*sint,momCM*sin(phi)*sint,gam*(pzCM + bet*eCM));
     170  G4double eCM  = sqrt(mass*mass + targetMass*targetMass + 2*targetMass*etot);
     171  G4double pCM  = ptot*targetMass/eCM;
     172  G4double e1   = sqrt(mass*mass + pCM*pCM);
     173
     174  newDirection *= pCM;
     175
     176  G4ThreeVector v1(newDirection.x(),newDirection.y(),gam*(newDirection.z() + bet*e1));
     177  G4double finalT = gam*(e1 + bet*newDirection.z()) - mass;
     178  newDirection = v1.unit();
     179
    190180  G4ThreeVector dir = dp->GetMomentumDirection();
    191   G4ThreeVector newDirection = v1.unit();
    192181  newDirection.rotateUz(dir);   
    193182  fParticleChange->ProposeMomentumDirection(newDirection);   
    194 
    195  //   G4double elab = gam*(eCM + bet*pzCM);
    196 
    197  // G4double Ecm  = sqrt(mass*mass + m2*m2 + 2.0*etot*m2);
    198   G4double elab = etot - m2*(ptot/Ecm)*(ptot/Ecm)*(1.-cost) ;
    199 
    200183 
    201   G4double finalT = elab - mass;
    202   if(finalT < 0.0) finalT = 0.0;
     184  // recoil
     185  G4double trec = kinEnergy - finalT;
     186  if(finalT <= lowEnergyLimit) {
     187    trec = kinEnergy; 
     188    finalT = 0.0;
     189  }
     190   
    203191  fParticleChange->SetProposedKineticEnergy(finalT);
    204192
    205   // recoil
    206   G4double erec = kinEnergy - finalT;
     193  //  G4cout << "sint= " << sint << " Erec(eV)= " << erec/eV << G4endl;
    207194
    208195  G4double tcut = recoilThreshold;
    209196  if(pCuts) { tcut= std::max(tcut,(*pCuts)[currentMaterialIndex]); }
    210 
    211   if(erec > tcut) {
     197  /* 
     198  G4cout << "sint= " << sint << " Erec(eV)= " << erec/eV
     199         << " tcut(eV)= " << tcut/eV << " th(eV)= " << recoilThreshold/eV
     200         << " cut(eV)= " << (*pCuts)[currentMaterialIndex]/eV
     201         << "  "  << fvect->size()
     202         << G4endl;
     203  */
     204  if(trec > tcut) {
    212205    G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz);
    213206    G4double plab = sqrt(finalT*(finalT + 2.0*mass));
    214207    G4ThreeVector p2 = (ptot*dir - plab*newDirection).unit();
    215     G4DynamicParticle* newdp  = new G4DynamicParticle(ion, p2, erec);
     208    G4DynamicParticle* newdp  = new G4DynamicParticle(ion, p2, trec);
    216209    fvect->push_back(newdp);
    217   } else if(erec > 0.0) {
    218     fParticleChange->ProposeLocalEnergyDeposit(erec);
    219     fParticleChange->ProposeNonIonizingEnergyDeposit(erec);
     210  } else if(trec > 0.0) {
     211    fParticleChange->ProposeLocalEnergyDeposit(trec);
     212    fParticleChange->ProposeNonIonizingEnergyDeposit(trec);
    220213  }
    221214}
Note: See TracChangeset for help on using the changeset viewer.