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/utils/src/G4VEmProcess.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmProcess.cc,v 1.79 2009/11/10 20:30:55 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VEmProcess.cc,v 1.87 2010/05/10 13:35:32 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5353// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
    5454// 24-06-09 Removed hidden bin in G4PhysicsVector (V.Ivanchenko)
     55// 17-02-10 Added pointer currentParticle (VI)
    5556//
    5657// Class Description:
     
    9899  currentModel(0),
    99100  particle(0),
     101  currentParticle(0),
    100102  currentCouple(0)
    101103{
     
    165167  G4VEmFluctuationModel* fm = 0;
    166168  modelManager->AddEmModel(order, p, fm, region);
    167   if(p) p->SetParticleChange(pParticleChange);
     169  if(p) { p->SetParticleChange(pParticleChange); }
    168170}
    169171
     
    205207void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
    206208{
    207   if(!particle) particle = ∂
     209  if(!particle) { SetParticle(&part); }
    208210  if(1 < verboseLevel) {
    209211    G4cout << "G4VEmProcess::PreparePhysicsTable() for "
     
    214216  }
    215217
    216   (G4LossTableManager::Instance())->EmConfigurator()->AddModels();
     218  (G4LossTableManager::Instance())->PreparePhysicsTable(&part, this);
    217219
    218220  if(particle == &part) {
     
    230232    }
    231233
    232     theCuts = modelManager->Initialise(particle,secondaryParticle,2.,verboseLevel);
     234    theCuts = modelManager->Initialise(particle,secondaryParticle,
     235                                       2.,verboseLevel);
    233236    const G4ProductionCutsTable* theCoupleTable=
    234237          G4ProductionCutsTable::GetProductionCutsTable();
     
    242245    }
    243246  }
    244   // Sub Cutoff and Deexcitation
     247  // Deexcitation
    245248  if (nDERegions>0) {
    246249
     
    287290  }
    288291
     292  (G4LossTableManager::Instance())->BuildPhysicsTable(particle);
    289293  if(buildLambdaTable) {
    290294    BuildLambdaTable();
     
    294298  // reduce printout for nuclear stopping
    295299  G4bool gproc = true;
    296   if(GetProcessName() == "nuclearStopping" &&
     300  G4int st = GetProcessSubType();
     301  if(st == fCoulombScattering && part.GetParticleType() == "nucleus" &&
    297302     partname != "GenericIon" && partname != "alpha") { gproc = false; }
    298303
     
    354359           << particle->GetParticleName()
    355360           << G4endl;
    356     if(2 < verboseLevel) {
    357       G4cout << *theLambdaTable << G4endl;
    358     }
    359361  }
    360362}
     
    385387  if(verboseLevel > 2 && buildLambdaTable) {
    386388    G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
    387     if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
     389    if(theLambdaTable) { G4cout << (*theLambdaTable) << G4endl; }
    388390  }
    389391}
     
    399401  *condition = NotForced;
    400402  G4double x = DBL_MAX;
    401   if(previousStepSize <= DBL_MIN) theNumberOfInteractionLengthLeft = -1.0;
     403  if(previousStepSize <= DBL_MIN) { theNumberOfInteractionLengthLeft = -1.0; }
    402404  InitialiseStep(track);
    403   if(!currentModel->IsActive(preStepKinEnergy)) return x;
     405  if(!currentModel->IsActive(preStepKinEnergy)) { return x; }
    404406
    405407  if(preStepKinEnergy < mfpKinEnergy) {
     
    428430      G4cout << "G4VEmProcess::PostStepGetPhysicalInteractionLength ";
    429431      G4cout << "[ " << GetProcessName() << "]" << G4endl;
    430       G4cout << " for " << particle->GetParticleName()
     432      G4cout << " for " << currentParticle->GetParticleName()
    431433             << " in Material  " <<  currentMaterial->GetName()
    432434             << " Ekin(MeV)= " << preStepKinEnergy/MeV
     
    461463  // Do not make anything if particle is stopped, the annihilation then
    462464  // should be performed by the AtRestDoIt!
    463   if (track.GetTrackStatus() == fStopButAlive) return &fParticleChange;
     465  if (track.GetTrackStatus() == fStopButAlive) { return &fParticleChange; }
    464466
    465467  G4double finalT = track.GetKineticEnergy();
     
    469471    G4double lx = GetLambda(finalT, currentCouple);
    470472    if(preStepLambda<lx && 1 < verboseLevel) {
    471       G4cout << "WARING: for " << particle->GetParticleName()
     473      G4cout << "WARING: for " << currentParticle->GetParticleName()
    472474             << " and " << GetProcessName()
    473475             << " E(MeV)= " << finalT/MeV
     
    483485
    484486  SelectModel(finalT, currentCoupleIndex);
    485   if(!currentModel->IsActive(finalT)) return &fParticleChange;
     487  if(!currentModel->IsActive(finalT)) { return &fParticleChange; }
    486488  if(useDeexcitation) {
    487489    currentModel->SetDeexcitationFlag(idxDERegions[currentCoupleIndex]);
     
    662664    SelectModel(kineticEnergy, currentCoupleIndex);
    663665    cross = currentModel->CrossSectionPerVolume(currentMaterial,
    664                                                 particle,kineticEnergy);
    665   }
    666 
     666                                                currentParticle,kineticEnergy);
     667  }
     668
     669  if(cross < 0.0) { cross = 0.0; }
    667670  return cross;
    668671}
     
    676679  *condition = NotForced;
    677680  return G4VEmProcess::MeanFreePath(track);
     681}
     682
     683//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     684
     685G4double G4VEmProcess::MeanFreePath(const G4Track& track)
     686{
     687  DefineMaterial(track.GetMaterialCutsCouple());
     688  preStepLambda = GetCurrentLambda(track.GetKineticEnergy());
     689  G4double x = DBL_MAX;
     690  if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
     691  return x;
     692}
     693
     694//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     695
     696G4double
     697G4VEmProcess::ComputeCrossSectionPerAtom(G4double kineticEnergy,
     698                                         G4double Z, G4double A, G4double cut)
     699{
     700  SelectModel(kineticEnergy, currentCoupleIndex);
     701  G4double x = 0.0;
     702  if(currentModel) {
     703   x = currentModel->ComputeCrossSectionPerAtom(currentParticle,kineticEnergy,
     704                                                 Z,A,cut);
     705  }
     706  return x;
    678707}
    679708
     
    714743    theEnergyOfCrossSectionMax[i] = emax;
    715744    theCrossSectionMax[i] = smax;
    716     if(2 < verboseLevel) {
     745    if(1 < verboseLevel) {
    717746      G4cout << "For " << particle->GetParticleName()
    718747             << " Max CS at i= " << i << " emax(MeV)= " << emax/MeV
     
    733762
    734763//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     764
     765const G4Element* G4VEmProcess::GetCurrentElement() const
     766{
     767  const G4Element* elm = 0;
     768  if(currentModel) {elm = currentModel->GetCurrentElement(); }
     769  return elm;
     770}
     771
     772//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracChangeset for help on using the changeset viewer.