Ignore:
Timestamp:
Apr 17, 2009, 12:17:14 PM (15 years ago)
Author:
garnier
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/utils/src/G4VEmProcess.cc

    r961 r991  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmProcess.cc,v 1.62 2009/02/19 09:57:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     26// $Id: G4VEmProcess.cc,v 1.60 2008/10/17 14:46:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    9191  applyCuts(false),
    9292  startFromNull(true),
    93   useDeexcitation(false),
    94   nDERegions(0),
    95   idxDERegions(0),
    96   currentModel(0),
     93  nRegions(0),
     94  selectedModel(0),
    9795  particle(0),
    9896  currentCouple(0)
     
    137135  delete modelManager;
    138136  (G4LossTableManager::Instance())->DeRegister(this);
    139 }
    140 
    141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    142 
    143 void G4VEmProcess::Clear()
    144 {
    145   delete [] theEnergyOfCrossSectionMax;
    146   delete [] theCrossSectionMax;
    147   delete [] idxDERegions;
    148   theEnergyOfCrossSectionMax = 0;
    149   theCrossSectionMax = 0;
    150   idxDERegions = 0;
    151   currentCouple = 0;
    152   preStepLambda = 0.0;
    153   mfpKinEnergy  = DBL_MAX;
    154   deRegions.clear();
    155   nDERegions = 0;
    156137}
    157138
     
    181162      theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable);
    182163  }
    183   // Sub Cutoff and Deexcitation
    184   if (nDERegions>0) {
    185 
    186     const G4ProductionCutsTable* theCoupleTable=
    187           G4ProductionCutsTable::GetProductionCutsTable();
    188     size_t numOfCouples = theCoupleTable->GetTableSize();
    189 
    190     idxDERegions = new G4bool[numOfCouples];
    191 
    192     for (size_t j=0; j<numOfCouples; j++) {
    193 
    194       const G4MaterialCutsCouple* couple =
    195         theCoupleTable->GetMaterialCutsCouple(j);
    196       const G4ProductionCuts* pcuts = couple->GetProductionCuts();
    197       G4bool reg = false;
    198       for(G4int i=0; i<nDERegions; i++) {
    199         if(deRegions[i]) {
    200           if(pcuts == deRegions[i]->GetProductionCuts()) reg = true;
    201         }
    202       }
    203       idxDERegions[j] = reg;
    204     }
    205   }
    206   if (1 < verboseLevel && nDERegions>0) {
    207     G4cout << " Deexcitation is activated for regions: " << G4endl;
    208     for (G4int i=0; i<nDERegions; i++) {
    209       const G4Region* r = deRegions[i];
    210       G4cout << "           " << r->GetName() << G4endl;
    211     }
    212   }
     164}
     165
     166//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     167
     168void G4VEmProcess::Clear()
     169{
     170  if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax;
     171  if(theCrossSectionMax) delete [] theCrossSectionMax;
     172  theEnergyOfCrossSectionMax = 0;
     173  theCrossSectionMax = 0;
     174  currentCouple = 0;
     175  preStepLambda = 0.0;
     176  mfpKinEnergy  = DBL_MAX;
    213177}
    214178
     
    273237      G4cout << *theLambdaTable << G4endl;
    274238    }
    275   }
    276 }
    277 
    278 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    279 
    280 void G4VEmProcess::PrintInfoDefinition()
    281 {
    282   if(verboseLevel > 0) {
    283     G4cout << G4endl << GetProcessName() << ":   for  "
    284            << particle->GetParticleName();
    285     if(integral) G4cout << ", integral: 1 ";
    286     if(applyCuts) G4cout << ", applyCuts: 1 ";
    287     G4cout << "    SubType= " << GetProcessSubType() << G4endl;
    288     if(buildLambdaTable) {
    289       G4cout << "      Lambda tables from "
    290              << G4BestUnit(minKinEnergy,"Energy")
    291              << " to "
    292              << G4BestUnit(maxKinEnergy,"Energy")
    293              << " in " << nLambdaBins << " bins, spline: "
    294              << (G4LossTableManager::Instance())->SplineFlag()
    295              << G4endl;
    296     }
    297     PrintInfo();
    298     modelManager->DumpModelList(verboseLevel);
    299   }
    300 
    301   if(verboseLevel > 2 && buildLambdaTable) {
    302     G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
    303     if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
    304239  }
    305240}
     
    369304//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    370305
     306G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
     307                                       G4double,
     308                                       G4ForceCondition* condition)
     309{
     310  *condition = NotForced;
     311  return G4VEmProcess::MeanFreePath(track);
     312}
     313
     314//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     315
    371316G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
    372317                                              const G4Step&)
     
    397342  }
    398343
    399   SelectModel(finalT);
    400   if(useDeexcitation) {
    401     currentModel->SetDeexcitationFlag(idxDERegions[currentMaterialIndex]);
    402   }
     344  G4VEmModel* currentModel = SelectModel(finalT);
     345
    403346  /* 
    404347  if(0 < verboseLevel) {
     
    461404//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    462405
     406void G4VEmProcess::PrintInfoDefinition()
     407{
     408  if(verboseLevel > 0) {
     409    G4cout << G4endl << GetProcessName() << ":   for  "
     410           << particle->GetParticleName();
     411    if(integral) G4cout << ", integral: 1 ";
     412    if(applyCuts) G4cout << ", applyCuts: 1 ";
     413    G4cout << "    SubType= " << GetProcessSubType() << G4endl;
     414    if(buildLambdaTable) {
     415      G4cout << "      Lambda tables from "
     416             << G4BestUnit(minKinEnergy,"Energy")
     417             << " to "
     418             << G4BestUnit(maxKinEnergy,"Energy")
     419             << " in " << nLambdaBins << " bins, spline: "
     420             << (G4LossTableManager::Instance())->SplineFlag()
     421             << G4endl;
     422    }
     423    PrintInfo();
     424    modelManager->DumpModelList(verboseLevel);
     425  }
     426
     427  if(verboseLevel > 2 && buildLambdaTable) {
     428    G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
     429    if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
     430  }
     431}
     432
     433//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     434
     435G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
     436                                             const G4MaterialCutsCouple* couple)
     437{
     438  // Cross section per atom is calculated
     439  DefineMaterial(couple);
     440  G4double cross = 0.0;
     441  G4bool b;
     442  if(theLambdaTable) {
     443    cross = (((*theLambdaTable)[currentMaterialIndex])->
     444                           GetValue(kineticEnergy, b));
     445  } else {
     446    G4VEmModel* model = SelectModel(kineticEnergy);
     447    cross =
     448      model->CrossSectionPerVolume(currentMaterial,particle,kineticEnergy);
     449  }
     450
     451  return cross;
     452}
     453
     454//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     455
    463456G4bool G4VEmProcess::StorePhysicsTable(const G4ParticleDefinition* part,
    464457                                       const G4String& directory,
     
    528521
    529522  return yes;
    530 }
    531 
    532 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    533 
    534 void G4VEmProcess::ActivateDeexcitation(G4bool val, const G4Region* r)
    535 {
    536   G4RegionStore* regionStore = G4RegionStore::GetInstance();
    537   const G4Region* reg = r;
    538   if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);}
    539 
    540   // the region is in the list
    541   if (nDERegions) {
    542     for (G4int i=0; i<nDERegions; i++) {
    543       if (reg == deRegions[i]) {
    544         if(!val) deRegions[i] = 0;
    545         return;
    546       }
    547     }
    548   }
    549 
    550   // new region
    551   if(val) {
    552     useDeexcitation = true;
    553     deRegions.push_back(reg);
    554     nDERegions++;
    555   } else {
    556     useDeexcitation = false;
    557   }
    558 }
    559 
    560 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    561 
    562 G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
    563                                              const G4MaterialCutsCouple* couple)
    564 {
    565   // Cross section per atom is calculated
    566   DefineMaterial(couple);
    567   G4double cross = 0.0;
    568   G4bool b;
    569   if(theLambdaTable) {
    570     cross = (((*theLambdaTable)[currentMaterialIndex])->
    571                            GetValue(kineticEnergy, b));
    572   } else {
    573     SelectModel(kineticEnergy);
    574     cross = currentModel->CrossSectionPerVolume(currentMaterial,
    575                                                 particle,kineticEnergy);
    576   }
    577 
    578   return cross;
    579 }
    580 
    581 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    582 
    583 G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
    584                                        G4double,
    585                                        G4ForceCondition* condition)
    586 {
    587   *condition = NotForced;
    588   return G4VEmProcess::MeanFreePath(track);
    589523}
    590524
Note: See TracChangeset for help on using the changeset viewer.