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

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMultipleScattering.cc,v 1.47 2007/11/09 11:35:54 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4VMultipleScattering.cc,v 1.60 2008/11/20 20:32:40 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    5555// 12-04-07 Add verbosity at destruction (V.Ivanchenko)
    5656// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
     57// 11-03-08 Set skin value does not effect step limit type (V.Ivanchenko)
    5758//
    5859// Class Description:
     
    8586//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    8687
    87 G4VMultipleScattering::G4VMultipleScattering(const G4String& name, G4ProcessType type):
    88                  G4VContinuousDiscreteProcess(name, type),
     88G4VMultipleScattering::G4VMultipleScattering(const G4String& name,
     89                                             G4ProcessType type):
     90  G4VContinuousDiscreteProcess(name, type),
     91  buildLambdaTable(true),
    8992  theLambdaTable(0),
    9093  firstParticle(0),
    91   currentParticle(0),
    92   currentCouple(0),
    93   nBins(120),
    9494  stepLimit(fUseSafety),
    95   skin(0.0),
     95  skin(3.0),
    9696  facrange(0.02),
    9797  facgeom(2.5),
    9898  latDisplasment(true),
    99   buildLambdaTable(true)
    100 {
     99  currentParticle(0),
     100  currentCouple(0)
     101{
     102  SetVerboseLevel(1);
     103  SetProcessSubType(fMultipleScattering);
     104
     105  // Size of tables assuming spline
    101106  minKinEnergy = 0.1*keV;
    102107  maxKinEnergy = 100.0*TeV;
    103   SetVerboseLevel(1);
     108  nBins        = 84;
     109
     110  // default limit on polar angle
     111  polarAngleLimit = 0.0;
    104112
    105113  pParticleChange = &fParticleChange;
     
    114122G4VMultipleScattering::~G4VMultipleScattering()
    115123{
    116   if(1 < verboseLevel)
     124  if(1 < verboseLevel) {
    117125    G4cout << "G4VMultipleScattering destruct " << GetProcessName()
    118126           << G4endl;
     127  }
    119128  delete modelManager;
    120129  if (theLambdaTable) {
     
    131140  G4String num = part.GetParticleName();
    132141  if(1 < verboseLevel) {
    133     //    G4cout << "========================================================" << G4endl;
    134142    G4cout << "### G4VMultipleScattering::BuildPhysicsTable() for "
    135143           << GetProcessName()
     
    148156      if (theLambdaTable->GetFlag(i)) {
    149157        // create physics vector and fill it
    150         const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
     158        const G4MaterialCutsCouple* couple =
     159          theCoupleTable->GetMaterialCutsCouple(i);
    151160        G4PhysicsVector* aVector = PhysicsVector(couple);
    152161        modelManager->FillLambdaVector(aVector, couple, false);
     
    162171  }
    163172  if(verboseLevel>0 && ( num == "e-" || num == "mu+" || 
    164                          num == "proton" || num == "pi-" || num == "GenericIon")) {
     173                         num == "proton" || num == "pi-" ||
     174                         num == "GenericIon")) {
    165175    PrintInfoDefinition();
    166176    if(2 < verboseLevel && theLambdaTable) G4cout << *theLambdaTable << G4endl;
     
    182192    currentCouple = 0;
    183193    if(part.GetParticleType() == "nucleus" &&
    184        part.GetParticleSubType() == "generic")
    185          firstParticle = G4GenericIon::GenericIon();
    186     else firstParticle = &part;
     194       part.GetParticleSubType() == "generic") {
     195      firstParticle = G4GenericIon::GenericIon();
     196    } else {
     197      firstParticle = &part;
     198    }
     199
    187200    currentParticle = &part;
    188201  }
    189202
    190203  if(1 < verboseLevel) {
    191     //    G4cout << "========================================================" << G4endl;
    192204    G4cout << "### G4VMultipleScattering::PrepearPhysicsTable() for "
    193205           << GetProcessName()
     
    217229{
    218230  if (0 < verboseLevel) {
    219     G4cout << G4endl << GetProcessName() << ":  Model variant of multiple scattering "
    220            << "for " << firstParticle->GetParticleName()
     231    G4cout << G4endl << GetProcessName()
     232           << ":   for " << firstParticle->GetParticleName()
     233           << "    SubType= " << GetProcessSubType()
    221234           << G4endl;
    222235    if (theLambdaTable) {
     
    225238             << " to "
    226239             << G4BestUnit(MaxKinEnergy(),"Energy")
    227              << " in " << nBins << " bins."
     240             << " in " << nBins << " bins, spline: "
     241             << (G4LossTableManager::Instance())->SplineFlag()
    228242             << G4endl;
    229243    }
    230     G4cout << "      LateralDisplacementFlag=  " << latDisplasment
    231            << "   Skin= " << skin << G4endl;
    232244    PrintInfo();
     245    modelManager->DumpModelList(verboseLevel);
    233246    if (2 < verboseLevel) {
    234247      G4cout << "LambdaTable address= " << theLambdaTable << G4endl;
     
    242255G4double G4VMultipleScattering::AlongStepGetPhysicalInteractionLength(
    243256                             const G4Track& track,
    244                              G4double previousStepSize,
     257                             G4double,
    245258                             G4double currentMinimalStep,
    246259                             G4double& currentSafety,
     
    249262  // get Step limit proposed by the process
    250263  valueGPILSelectionMSC = NotCandidateForSelection;
    251   G4double steplength = GetMscContinuousStepLimit(track,previousStepSize,
    252                                               currentMinimalStep,currentSafety);
     264  G4double steplength = GetMscContinuousStepLimit(track,
     265                                                  track.GetKineticEnergy(),
     266                                                  currentMinimalStep,
     267                                                  currentSafety);
    253268  // G4cout << "StepLimit= " << steplength << G4endl;
    254269  // set return value for G4GPILSelection
     
    315330  if( couple->IsUsed() ) nbins = nBins;
    316331  G4PhysicsVector* v = new G4PhysicsLogVector(minKinEnergy, maxKinEnergy, nbins);
     332  v->SetSpline((G4LossTableManager::Instance())->SplineFlag());
    317333  return v;
    318334}
     
    372388               << G4endl;
    373389    }
     390    if((G4LossTableManager::Instance())->SplineFlag()) {
     391      size_t n = theLambdaTable->length();
     392      for(size_t i=0; i<n; i++) {(* theLambdaTable)[i]->SetSpline(true);}
     393    }
    374394  } else {
    375395    if (1 < verboseLevel) {
Note: See TracChangeset for help on using the changeset viewer.