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

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMultipleScattering.cc,v 1.77 2009/10/29 18:07:08 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VMultipleScattering.cc,v 1.82 2010/04/12 11:45:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9595  firstParticle(0),
    9696  stepLimit(fUseSafety),
    97   skin(3.0),
     97  skin(1.0),
    9898  facrange(0.04),
    9999  facgeom(2.5),
     
    144144  G4VEmFluctuationModel* fm = 0;
    145145  modelManager->AddEmModel(order, p, fm, region);
    146   if(p) p->SetParticleChange(pParticleChange);
     146  if(p) { p->SetParticleChange(pParticleChange); }
    147147}
    148148//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    170170{
    171171  return modelManager->GetModel(idx, ver);
    172 }
    173 
    174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    175 
    176 void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part)
    177 {
    178   G4String num = part.GetParticleName();
    179   if(1 < verboseLevel) {
    180     G4cout << "### G4VMultipleScattering::BuildPhysicsTable() for "
    181            << GetProcessName()
    182            << " and particle " << num
    183            << G4endl;
    184   }
    185 
    186   if (buildLambdaTable && firstParticle == &part) {
    187 
    188     const G4ProductionCutsTable* theCoupleTable=
    189           G4ProductionCutsTable::GetProductionCutsTable();
    190     size_t numOfCouples = theCoupleTable->GetTableSize();
    191 
    192     G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();
    193 
    194     G4PhysicsLogVector* aVector = 0;
    195     G4PhysicsLogVector* bVector = 0;
    196 
    197     for (size_t i=0; i<numOfCouples; ++i) {
    198 
    199       if (theLambdaTable->GetFlag(i)) {
    200         // create physics vector and fill it
    201         const G4MaterialCutsCouple* couple =
    202           theCoupleTable->GetMaterialCutsCouple(i);
    203         if(!bVector) {
    204           aVector = static_cast<G4PhysicsLogVector*>(PhysicsVector(couple));
    205           bVector = aVector;
    206         } else {
    207           aVector = new G4PhysicsLogVector(*bVector);
    208         }       
    209         //G4PhysicsVector* aVector = PhysicsVector(couple);
    210         aVector->SetSpline(splineFlag);
    211         modelManager->FillLambdaVector(aVector, couple, false);
    212         if(splineFlag) aVector->FillSecondDerivatives();
    213         G4PhysicsTableHelper::SetPhysicsVector(theLambdaTable, i, aVector);
    214       }
    215     }
    216 
    217     if(1 < verboseLevel) {
    218       G4cout << "Lambda table is built for "
    219              << num
    220              << G4endl;
    221     }
    222   }
    223   if(verboseLevel>0 && ( num == "e-" || num == "mu+" || 
    224                          num == "proton" || num == "pi-" ||
    225                          num == "GenericIon")) {
    226     PrintInfoDefinition();
    227     if(2 < verboseLevel && theLambdaTable) G4cout << *theLambdaTable << G4endl;
    228   }
    229 
    230   if(1 < verboseLevel) {
    231     G4cout << "### G4VMultipleScattering::BuildPhysicsTable() done for "
    232            << GetProcessName()
    233            << " and particle " << num
    234            << G4endl;
    235   }
    236172}
    237173
     
    260196  }
    261197
     198  (G4LossTableManager::Instance())->PreparePhysicsTable(&part, this);
     199
    262200  if(1 < verboseLevel) {
    263201    G4cout << "### G4VMultipleScattering::PrepearPhysicsTable() for "
     
    267205           << G4endl;
    268206  }
    269 
    270   (G4LossTableManager::Instance())->EmConfigurator()->AddModels();
    271207
    272208  if(firstParticle == &part) {
     
    307243//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    308244
     245void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part)
     246{
     247  G4String num = part.GetParticleName();
     248  if(1 < verboseLevel) {
     249    G4cout << "### G4VMultipleScattering::BuildPhysicsTable() for "
     250           << GetProcessName()
     251           << " and particle " << num
     252           << G4endl;
     253  }
     254
     255  (G4LossTableManager::Instance())->BuildPhysicsTable(firstParticle);
     256
     257  if (buildLambdaTable && firstParticle == &part) {
     258
     259    const G4ProductionCutsTable* theCoupleTable=
     260          G4ProductionCutsTable::GetProductionCutsTable();
     261    size_t numOfCouples = theCoupleTable->GetTableSize();
     262
     263    G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();
     264
     265    G4PhysicsLogVector* aVector = 0;
     266    G4PhysicsLogVector* bVector = 0;
     267
     268    for (size_t i=0; i<numOfCouples; ++i) {
     269
     270      if (theLambdaTable->GetFlag(i)) {
     271        // create physics vector and fill it
     272        const G4MaterialCutsCouple* couple =
     273          theCoupleTable->GetMaterialCutsCouple(i);
     274        if(!bVector) {
     275          aVector = static_cast<G4PhysicsLogVector*>(PhysicsVector(couple));
     276          bVector = aVector;
     277        } else {
     278          aVector = new G4PhysicsLogVector(*bVector);
     279        }       
     280        //G4PhysicsVector* aVector = PhysicsVector(couple);
     281        aVector->SetSpline(splineFlag);
     282        modelManager->FillLambdaVector(aVector, couple, false);
     283        if(splineFlag) aVector->FillSecondDerivatives();
     284        G4PhysicsTableHelper::SetPhysicsVector(theLambdaTable, i, aVector);
     285      }
     286    }
     287
     288    if(1 < verboseLevel) {
     289      G4cout << "Lambda table is built for "
     290             << num
     291             << G4endl;
     292    }
     293  }
     294  if(verboseLevel>0 && ( num == "e-" || num == "mu+" || 
     295                         num == "proton" || num == "pi-" ||
     296                         num == "GenericIon")) {
     297    PrintInfoDefinition();
     298    if(2 < verboseLevel && theLambdaTable) G4cout << *theLambdaTable << G4endl;
     299  }
     300
     301  if(1 < verboseLevel) {
     302    G4cout << "### G4VMultipleScattering::BuildPhysicsTable() done for "
     303           << GetProcessName()
     304           << " and particle " << num
     305           << G4endl;
     306  }
     307}
     308
     309//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     310
    309311void G4VMultipleScattering::PrintInfoDefinition()
    310312{
     
    362364//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    363365
     366G4double
     367G4VMultipleScattering::PostStepGetPhysicalInteractionLength(
     368              const G4Track&, G4double, G4ForceCondition* condition)
     369{
     370  *condition = Forced;
     371  return DBL_MAX;
     372}
     373
     374//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     375
     376G4VParticleChange*
     377G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step)
     378{
     379  if(currentModel->IsActive(track.GetKineticEnergy())) {
     380    fParticleChange.ProposeTrueStepLength(currentModel->ComputeTrueStepLength(step.GetStepLength()));
     381  }
     382  return &fParticleChange;
     383}
     384
     385//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     386
     387G4VParticleChange*
     388G4VMultipleScattering::PostStepDoIt(const G4Track& track, const G4Step& step)
     389{
     390  fParticleChange.Initialize(track);
     391  if(currentModel->IsActive(track.GetKineticEnergy())) {
     392    currentModel->SampleScattering(track.GetDynamicParticle(),
     393                                   step.GetPostStepPoint()->GetSafety());
     394  }
     395  return &fParticleChange;
     396}
     397
     398//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     399
    364400G4double G4VMultipleScattering::GetContinuousStepLimit(
    365401                                       const G4Track& track,
     
    371407  return AlongStepGetPhysicalInteractionLength(track,previousStepSize,currentMinimalStep,
    372408                                               currentSafety, selection);
     409}
     410
     411//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     412
     413G4double G4VMultipleScattering::ContinuousStepLimit(
     414                                       const G4Track& track,
     415                                       G4double previousStepSize,
     416                                       G4double currentMinimalStep,
     417                                       G4double& currentSafety)
     418{
     419  return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep,
     420                                currentSafety);
    373421}
    374422
Note: See TracChangeset for help on using the changeset viewer.