Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
G4VEnergyLossProcess Class Referenceabstract

#include <G4VEnergyLossProcess.hh>

Inheritance diagram for G4VEnergyLossProcess:
G4VContinuousDiscreteProcess G4VProcess G4alphaIonisation G4eBremsstrahlung G4eIonisation G4ePolarizedIonisation G4hhIonisation G4hIonisation G4ionIonisation G4mplIonisation G4MuBremsstrahlung G4MuIonisation G4MuPairProduction

Public Member Functions

 G4VEnergyLossProcess (const G4String &name="EnergyLoss", G4ProcessType type=fElectromagnetic)
 
virtual ~G4VEnergyLossProcess ()
 
virtual G4bool IsApplicable (const G4ParticleDefinition &p)=0
 
virtual void PrintInfo ()=0
 
void PreparePhysicsTable (const G4ParticleDefinition &)
 
void BuildPhysicsTable (const G4ParticleDefinition &)
 
G4PhysicsTableBuildDEDXTable (G4EmTableType tType=fRestricted)
 
G4PhysicsTableBuildLambdaTable (G4EmTableType tType=fRestricted)
 
void PrintInfoDefinition (const G4ParticleDefinition &part)
 
void StartTracking (G4Track *)
 
G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
G4VParticleChangeAlongStepDoIt (const G4Track &, const G4Step &)
 
G4double SampleSubCutSecondaries (std::vector< G4Track * > &, const G4Step &, G4VEmModel *model, G4int matIdx)
 
G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &)
 
G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)
 
G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii)
 
G4double GetDEDXDispersion (const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, G4double length)
 
G4double CrossSectionPerVolume (G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double MeanFreePath (const G4Track &track)
 
G4double ContinuousStepLimit (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety)
 
G4VEmModelSelectModelForMaterial (G4double kinEnergy, size_t &idx) const
 
void AddEmModel (G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=0, const G4Region *region=0)
 
void UpdateEmModel (const G4String &, G4double, G4double)
 
void SetEmModel (G4VEmModel *, G4int index=1)
 
G4VEmModelEmModel (G4int index=1) const
 
G4VEmModelGetModelByIndex (G4int idx=0, G4bool ver=false) const
 
G4int NumberOfModels () const
 
void SetFluctModel (G4VEmFluctuationModel *)
 
G4VEmFluctuationModelFluctModel ()
 
void SetBaseParticle (const G4ParticleDefinition *p)
 
const G4ParticleDefinitionParticle () const
 
const G4ParticleDefinitionBaseParticle () const
 
const G4ParticleDefinitionSecondaryParticle () const
 
void ActivateSubCutoff (G4bool val, const G4Region *region=0)
 
void SetCrossSectionBiasingFactor (G4double f, G4bool flag=true)
 
void ActivateForcedInteraction (G4double length=0.0, const G4String &region="", G4bool flag=true)
 
void ActivateSecondaryBiasing (const G4String &region, G4double factor, G4double energyLimit)
 
void AddCollaborativeProcess (G4VEnergyLossProcess *)
 
void SetLossFluctuations (G4bool val)
 
void SetRandomStep (G4bool val)
 
void SetIntegral (G4bool val)
 
G4bool IsIntegral () const
 
void SetIonisation (G4bool val)
 
G4bool IsIonisationProcess () const
 
void SetLinearLossLimit (G4double val)
 
void SetMinSubRange (G4double val)
 
void SetLambdaFactor (G4double val)
 
void SetStepFunction (G4double v1, G4double v2)
 
void SetLowestEnergyLimit (G4double)
 
G4int NumberOfSubCutoffRegions () const
 
void SetDEDXTable (G4PhysicsTable *p, G4EmTableType tType)
 
void SetCSDARangeTable (G4PhysicsTable *pRange)
 
void SetRangeTableForLoss (G4PhysicsTable *p)
 
void SetSecondaryRangeTable (G4PhysicsTable *p)
 
void SetInverseRangeTable (G4PhysicsTable *p)
 
void SetLambdaTable (G4PhysicsTable *p)
 
void SetSubLambdaTable (G4PhysicsTable *p)
 
void SetDEDXBinning (G4int nbins)
 
void SetLambdaBinning (G4int nbins)
 
void SetDEDXBinningForCSDARange (G4int nbins)
 
void SetMinKinEnergy (G4double e)
 
G4double MinKinEnergy () const
 
void SetMaxKinEnergy (G4double e)
 
G4double MaxKinEnergy () const
 
void SetMaxKinEnergyForCSDARange (G4double e)
 
G4double CrossSectionBiasingFactor () const
 
G4double GetDEDX (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetDEDXForSubsec (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetRange (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetCSDARange (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetRangeForLoss (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetKineticEnergy (G4double &range, const G4MaterialCutsCouple *)
 
G4double GetLambda (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4bool TablesAreBuilt () const
 
G4PhysicsTableDEDXTable () const
 
G4PhysicsTableDEDXTableForSubsec () const
 
G4PhysicsTableDEDXunRestrictedTable () const
 
G4PhysicsTableIonisationTable () const
 
G4PhysicsTableIonisationTableForSubsec () const
 
G4PhysicsTableCSDARangeTable () const
 
G4PhysicsTableSecondaryRangeTable () const
 
G4PhysicsTableRangeTableForLoss () const
 
G4PhysicsTableInverseRangeTable () const
 
G4PhysicsTableLambdaTable () const
 
G4PhysicsTableSubLambdaTable () const
 
const G4ElementGetCurrentElement () const
 
void SetDynamicMassCharge (G4double massratio, G4double charge2ratio)
 
- Public Member Functions inherited from G4VContinuousDiscreteProcess
 G4VContinuousDiscreteProcess (const G4String &, G4ProcessType aType=fNotDefined)
 
 G4VContinuousDiscreteProcess (G4VContinuousDiscreteProcess &)
 
virtual ~G4VContinuousDiscreteProcess ()
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4int operator== (const G4VProcess &right) const
 
G4int operator!= (const G4VProcess &right) const
 
G4double GetCurrentInteractionLength () const
 
void SetPILfactor (G4double value)
 
G4double GetPILfactor () const
 
G4double AlongStepGPIL (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
 
G4double AtRestGPIL (const G4Track &track, G4ForceCondition *condition)
 
G4double PostStepGPIL (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
const G4StringGetPhysicsTableFileName (const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
 
const G4StringGetProcessName () const
 
G4ProcessType GetProcessType () const
 
void SetProcessType (G4ProcessType)
 
G4int GetProcessSubType () const
 
void SetProcessSubType (G4int)
 
virtual void EndTracking ()
 
virtual void SetProcessManager (const G4ProcessManager *)
 
virtual const G4ProcessManagerGetProcessManager ()
 
virtual void ResetNumberOfInteractionLengthLeft ()
 
G4double GetNumberOfInteractionLengthLeft () const
 
G4double GetTotalNumberOfInteractionLengthTraversed () const
 
G4bool isAtRestDoItIsEnabled () const
 
G4bool isAlongStepDoItIsEnabled () const
 
G4bool isPostStepDoItIsEnabled () const
 
virtual void DumpInfo () const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
virtual void SetMasterProcess (G4VProcess *masterP)
 
const G4VProcessGetMasterProcess () const
 
virtual void BuildWorkerPhysicsTable (const G4ParticleDefinition &part)
 
virtual void PrepareWorkerPhysicsTable (const G4ParticleDefinition &)
 

Protected Member Functions

virtual void InitialiseEnergyLossProcess (const G4ParticleDefinition *, const G4ParticleDefinition *)=0
 
virtual G4double MinPrimaryEnergy (const G4ParticleDefinition *, const G4Material *, G4double cut)
 
G4double GetMeanFreePath (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
G4double GetContinuousStepLimit (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety)
 
G4PhysicsVectorLambdaPhysicsVector (const G4MaterialCutsCouple *, G4double cut)
 
size_t CurrentMaterialCutsCoupleIndex () const
 
void SelectModel (G4double kinEnergy)
 
void SetParticle (const G4ParticleDefinition *p)
 
void SetSecondaryParticle (const G4ParticleDefinition *p)
 
- Protected Member Functions inherited from G4VContinuousDiscreteProcess
void SetGPILSelection (G4GPILSelection selection)
 
G4GPILSelection GetGPILSelection () const
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double previousStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 

Protected Attributes

G4ParticleChangeForLoss fParticleChange
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager
 
G4VParticleChangepParticleChange
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft
 
G4double currentInteractionLength
 
G4double theInitialNumberOfInteractionLength
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType
 
G4int theProcessSubType
 
G4double thePILfactor
 
G4bool enableAtRestDoIt
 
G4bool enableAlongStepDoIt
 
G4bool enablePostStepDoIt
 
G4int verboseLevel
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 

Detailed Description

Definition at line 122 of file G4VEnergyLossProcess.hh.

Constructor & Destructor Documentation

G4VEnergyLossProcess::G4VEnergyLossProcess ( const G4String name = "EnergyLoss",
G4ProcessType  type = fElectromagnetic 
)

Definition at line 165 of file G4VEnergyLossProcess.cc.

References CandidateForSelection, DBL_MAX, G4Electron::Electron(), python.hepunit::eV, fParticleChange, G4Gamma::Gamma(), G4TransportationManager::GetSafetyHelper(), G4TransportationManager::GetTransportationManager(), python.hepunit::GeV, G4LossTableManager::Instance(), python.hepunit::keV, python.hepunit::mm, G4Positron::Positron(), G4VProcess::pParticleChange, G4LossTableManager::Register(), G4VParticleChange::SetSecondaryWeightByProcess(), SetStepFunction(), G4VProcess::SetVerboseLevel(), and python.hepunit::TeV.

166  :
167  G4VContinuousDiscreteProcess(name, type),
168  secondaryParticle(0),
169  nSCoffRegions(0),
170  idxSCoffRegions(0),
171  nProcesses(0),
172  theDEDXTable(0),
173  theDEDXSubTable(0),
174  theDEDXunRestrictedTable(0),
175  theIonisationTable(0),
176  theIonisationSubTable(0),
177  theRangeTableForLoss(0),
178  theCSDARangeTable(0),
179  theSecondaryRangeTable(0),
180  theInverseRangeTable(0),
181  theLambdaTable(0),
182  theSubLambdaTable(0),
183  theDensityFactor(0),
184  theDensityIdx(0),
185  baseParticle(0),
186  minSubRange(0.1),
187  lossFluctuationFlag(true),
188  rndmStepFlag(false),
189  tablesAreBuilt(false),
190  integral(true),
191  isIon(false),
192  isIonisation(true),
193  useSubCutoff(false),
194  useDeexcitation(false),
195  particle(0),
196  currentCouple(0),
197  nWarnings(0),
198  mfpKinEnergy(0.0)
199 {
200  SetVerboseLevel(1);
201 
202  // low energy limit
203  lowestKinEnergy = 1.*eV;
204  preStepKinEnergy = 0.0;
205  preStepRangeEnergy = 0.0;
206  computedRange = DBL_MAX;
207 
208  // Size of tables assuming spline
209  minKinEnergy = 0.1*keV;
210  maxKinEnergy = 10.0*TeV;
211  nBins = 77;
212  maxKinEnergyCSDA = 1.0*GeV;
213  nBinsCSDA = 35;
214 
215  // default linear loss limit for spline
216  linLossLimit = 0.01;
217 
218  // default dRoverRange and finalRange
219  SetStepFunction(0.2, 1.0*mm);
220 
221  // default lambda factor
222  lambdaFactor = 0.8;
223 
224  // cross section biasing
225  biasFactor = 1.0;
226 
227  // particle types
228  theElectron = G4Electron::Electron();
229  thePositron = G4Positron::Positron();
230  theGamma = G4Gamma::Gamma();
231  theGenericIon = 0;
232 
233  // run time objects
236  modelManager = new G4EmModelManager();
238  ->GetSafetyHelper();
239  aGPILSelection = CandidateForSelection;
240 
241  // initialise model
242  lManager = G4LossTableManager::Instance();
243  lManager->Register(this);
244  fluctModel = 0;
245  atomDeexcitation = 0;
246 
247  biasManager = 0;
248  biasFlag = false;
249  weightFlag = false;
250  isMaster = true;
251  lastIdx = 0;
252 
253  idxDEDX = idxDEDXSub = idxDEDXunRestricted = idxIonisation =
254  idxIonisationSub = idxRange = idxCSDA = idxSecRange =
255  idxInverseRange = idxLambda = idxSubLambda = 0;
256 
257  scTracks.reserve(5);
258  secParticles.reserve(5);
259 
260  secID = biasID = subsecID = -1;
261 }
G4SafetyHelper * GetSafetyHelper() const
static G4LossTableManager * Instance()
void SetStepFunction(G4double v1, G4double v2)
G4ParticleChangeForLoss fParticleChange
void SetSecondaryWeightByProcess(G4bool)
void Register(G4VEnergyLossProcess *p)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4TransportationManager * GetTransportationManager()
static G4Positron * Positron()
Definition: G4Positron.cc:94
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define DBL_MAX
Definition: templates.hh:83
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
G4VEnergyLossProcess::~G4VEnergyLossProcess ( )
virtual

Definition at line 265 of file G4VEnergyLossProcess.cc.

References G4LossTableManager::DeRegister().

266 {
267  /*
268  G4cout << "** G4VEnergyLossProcess::~G4VEnergyLossProcess() for "
269  << GetProcessName()
270  << " isMaster: " << isMaster << G4endl;
271  */
272  Clean();
273 
274  if ( !baseParticle && isMaster ) {
275  //G4cout << " isIonisation " << isIonisation << " "
276  // << theDEDXTable << G4endl;
277 
278  if(theDEDXTable) {
279  if(theIonisationTable == theDEDXTable) { theIonisationTable = 0; }
280  delete theDEDXTable;
281  if(theDEDXSubTable) {
282  if(theIonisationSubTable == theDEDXSubTable)
283  { theIonisationSubTable = 0; }
284  delete theDEDXSubTable;
285  }
286  }
287  delete theIonisationTable;
288  delete theIonisationSubTable;
289  if(theDEDXunRestrictedTable && isIonisation) {
290  delete theDEDXunRestrictedTable;
291  }
292  if(theCSDARangeTable && isIonisation) {
293  delete theCSDARangeTable;
294  }
295  if(theRangeTableForLoss && isIonisation) {
296  delete theRangeTableForLoss;
297  }
298  if(theInverseRangeTable && isIonisation) {
299  delete theInverseRangeTable;
300  }
301  delete theLambdaTable;
302  delete theSubLambdaTable;
303  }
304 
305  delete modelManager;
306  delete biasManager;
307  lManager->DeRegister(this);
308  //G4cout << "** all removed" << G4endl;
309 }
void DeRegister(G4VEnergyLossProcess *p)

Member Function Documentation

void G4VEnergyLossProcess::ActivateForcedInteraction ( G4double  length = 0.0,
const G4String region = "",
G4bool  flag = true 
)

Definition at line 2182 of file G4VEnergyLossProcess.cc.

References G4EmBiasingManager::ActivateForcedInteraction(), G4cout, G4endl, G4VProcess::GetProcessName(), python.hepunit::mm, and G4VProcess::verboseLevel.

Referenced by G4EmProcessOptions::ActivateForcedInteraction().

2185 {
2186  if(!biasManager) { biasManager = new G4EmBiasingManager(); }
2187  if(1 < verboseLevel) {
2188  G4cout << "### ActivateForcedInteraction: for "
2189  << " process " << GetProcessName()
2190  << " length(mm)= " << length/mm
2191  << " in G4Region <" << region
2192  << "> weightFlag= " << flag
2193  << G4endl;
2194  }
2195  weightFlag = flag;
2196  biasManager->ActivateForcedInteraction(length, region);
2197 }
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="")
G4int verboseLevel
Definition: G4VProcess.hh:368
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
void G4VEnergyLossProcess::ActivateSecondaryBiasing ( const G4String region,
G4double  factor,
G4double  energyLimit 
)

Definition at line 2202 of file G4VEnergyLossProcess.cc.

References G4EmBiasingManager::ActivateSecondaryBiasing(), G4Electron::Electron(), G4cout, G4endl, G4VProcess::GetProcessName(), python.hepunit::MeV, and G4VProcess::verboseLevel.

Referenced by G4EmProcessOptions::ActivateSecondaryBiasing().

2205 {
2206  if (0.0 <= factor) {
2207 
2208  // Range cut can be applied only for e-
2209  if(0.0 == factor && secondaryParticle != G4Electron::Electron())
2210  { return; }
2211 
2212  if(!biasManager) { biasManager = new G4EmBiasingManager(); }
2213  biasManager->ActivateSecondaryBiasing(region, factor, energyLimit);
2214  if(1 < verboseLevel) {
2215  G4cout << "### ActivateSecondaryBiasing: for "
2216  << " process " << GetProcessName()
2217  << " factor= " << factor
2218  << " in G4Region <" << region
2219  << "> energyLimit(MeV)= " << energyLimit/MeV
2220  << G4endl;
2221  }
2222  }
2223 }
G4int verboseLevel
Definition: G4VProcess.hh:368
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void ActivateSecondaryBiasing(const G4String &region, G4double factor, G4double energyLimit)
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
void G4VEnergyLossProcess::ActivateSubCutoff ( G4bool  val,
const G4Region region = 0 
)

Definition at line 953 of file G4VEnergyLossProcess.cc.

References G4RegionStore::GetInstance(), and G4RegionStore::GetRegion().

Referenced by G4EmManager::Register(), and G4LossTableManager::Register().

954 {
955  G4RegionStore* regionStore = G4RegionStore::GetInstance();
956  const G4Region* reg = r;
957  if (!reg) {
958  reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);
959  }
960 
961  // the region is in the list
962  if (nSCoffRegions) {
963  for (G4int i=0; i<nSCoffRegions; ++i) {
964  if (reg == scoffRegions[i]) {
965  return;
966  }
967  }
968  }
969 
970  // new region
971  if(val) {
972  useSubCutoff = true;
973  scoffRegions.push_back(reg);
974  ++nSCoffRegions;
975  } else {
976  useSubCutoff = false;
977  }
978 }
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
int G4int
Definition: G4Types.hh:78
static G4RegionStore * GetInstance()
void G4VEnergyLossProcess::AddCollaborativeProcess ( G4VEnergyLossProcess p)

Definition at line 1935 of file G4VEnergyLossProcess.cc.

References G4cout, G4endl, G4VProcess::GetProcessName(), and G4VProcess::verboseLevel.

1937 {
1938  G4bool add = true;
1939  if(p->GetProcessName() != "eBrem") { add = false; }
1940  if(add && nProcesses > 0) {
1941  for(G4int i=0; i<nProcesses; ++i) {
1942  if(p == scProcesses[i]) {
1943  add = false;
1944  break;
1945  }
1946  }
1947  }
1948  if(add) {
1949  scProcesses.push_back(p);
1950  ++nProcesses;
1951  if (1 < verboseLevel) {
1952  G4cout << "### The process " << p->GetProcessName()
1953  << " is added to the list of collaborative processes of "
1954  << GetProcessName() << G4endl;
1955  }
1956  }
1957 }
G4int verboseLevel
Definition: G4VProcess.hh:368
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
void G4VEnergyLossProcess::AddEmModel ( G4int  order,
G4VEmModel p,
G4VEmFluctuationModel fluc = 0,
const G4Region region = 0 
)

Definition at line 344 of file G4VEnergyLossProcess.cc.

References G4EmModelManager::AddEmModel(), G4VProcess::pParticleChange, and G4VEmModel::SetParticleChange().

Referenced by DicomPhysicsList::ConstructEM(), G4EmLowEPPhysics::ConstructProcess(), G4EmLivermorePolarizedPhysics::ConstructProcess(), G4EmPenelopePhysics::ConstructProcess(), G4EmLivermorePhysics::ConstructProcess(), PhysListEmLivermore::ConstructProcess(), PhysListEmPenelope::ConstructProcess(), G4EmStandardPhysics_option4::ConstructProcess(), G4ePolarizedBremsstrahlung::InitialiseEnergyLossProcess(), G4hPairProduction::InitialiseEnergyLossProcess(), G4alphaIonisation::InitialiseEnergyLossProcess(), G4hBremsstrahlung::InitialiseEnergyLossProcess(), G4mplIonisation::InitialiseEnergyLossProcess(), G4hhIonisation::InitialiseEnergyLossProcess(), G4ePolarizedIonisation::InitialiseEnergyLossProcess(), G4MuPairProduction::InitialiseEnergyLossProcess(), G4eIonisation::InitialiseEnergyLossProcess(), G4eBremsstrahlung::InitialiseEnergyLossProcess(), G4ionIonisation::InitialiseEnergyLossProcess(), G4MuBremsstrahlung::InitialiseEnergyLossProcess(), G4hIonisation::InitialiseEnergyLossProcess(), G4MuIonisation::InitialiseEnergyLossProcess(), and G4EmConfigurator::PrepareModels().

347 {
348  modelManager->AddEmModel(order, p, fluc, region);
349  if(p) { p->SetParticleChange(pParticleChange, fluc); }
350 }
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=0)
Definition: G4VEmModel.cc:387
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4VParticleChange * G4VEnergyLossProcess::AlongStepDoIt ( const G4Track track,
const G4Step step 
)
virtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 1158 of file G4VEnergyLossProcess.cc.

References G4VAtomDeexcitation::AlongStepDeexcitation(), G4SafetyHelper::ComputeSafety(), G4VEmModel::CorrectionsAlongStep(), fGeomBoundary, fParticleChange, G4Track::GetDynamicParticle(), G4VEmModel::GetModelOfFluctuations(), G4VParticleChange::GetParentWeight(), G4VEmModel::GetParticleCharge(), G4Track::GetParticleDefinition(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4ProductionCuts::GetProductionCut(), G4MaterialCutsCouple::GetProductionCuts(), G4StepPoint::GetSafety(), G4Step::GetStepLength(), G4StepPoint::GetStepStatus(), G4ParticleChangeForLoss::InitializeForAlongStep(), G4VEmModel::IsActive(), G4VEmModel::MaxSecondaryKinEnergy(), G4INCL::Math::min(), G4VParticleChange::ProposeLocalEnergyDeposit(), G4VParticleChange::ProposeWeight(), G4VEmFluctuationModel::SampleFluctuations(), SampleSubCutSecondaries(), G4ParticleChangeForLoss::SetProposedCharge(), G4ParticleChangeForLoss::SetProposedKineticEnergy(), and test::x.

1160 {
1162  // The process has range table - calculate energy loss
1163  if(!isIonisation || !currentModel->IsActive(preStepScaledEnergy)) {
1164  return &fParticleChange;
1165  }
1166 
1167  // Get the actual (true) Step length
1168  G4double length = step.GetStepLength();
1169  if(length <= 0.0) { return &fParticleChange; }
1170  G4double eloss = 0.0;
1171 
1172  /*
1173  if(-1 < verboseLevel) {
1174  const G4ParticleDefinition* d = track.GetParticleDefinition();
1175  G4cout << "AlongStepDoIt for "
1176  << GetProcessName() << " and particle "
1177  << d->GetParticleName()
1178  << " eScaled(MeV)= " << preStepScaledEnergy/MeV
1179  << " range(mm)= " << fRange/mm
1180  << " s(mm)= " << length/mm
1181  << " rf= " << reduceFactor
1182  << " q^2= " << chargeSqRatio
1183  << " md= " << d->GetPDGMass()
1184  << " status= " << track.GetTrackStatus()
1185  << " " << track.GetMaterial()->GetName()
1186  << G4endl;
1187  }
1188  */
1189 
1190  const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
1191 
1192  // define new weight for primary and secondaries
1194  if(weightFlag) {
1195  weight /= biasFactor;
1197  }
1198 
1199  // stopping
1200  if (length >= fRange) {
1201  eloss = preStepKinEnergy;
1202  if (useDeexcitation) {
1203  atomDeexcitation->AlongStepDeexcitation(scTracks, step,
1204  eloss, currentCoupleIndex);
1205  if(scTracks.size() > 0) { FillSecondariesAlongStep(eloss, weight); }
1206  if(eloss < 0.0) { eloss = 0.0; }
1207  }
1210  return &fParticleChange;
1211  }
1212  //G4cout << theDEDXTable << " idx= " << basedCoupleIndex
1213  // << " " << GetProcessName() << " "<< currentMaterial->GetName()<<G4endl;
1214  //if(particle->GetParticleName() == "e-")G4cout << (*theDEDXTable) <<G4endl;
1215  // Short step
1216  eloss = GetDEDXForScaledEnergy(preStepScaledEnergy)*length;
1217 
1218  //G4cout << "eloss= " << eloss << G4endl;
1219 
1220  // Long step
1221  if(eloss > preStepKinEnergy*linLossLimit) {
1222 
1223  G4double x = (fRange - length)/reduceFactor;
1224  //G4cout << "x= " << x << " " << theInverseRangeTable << G4endl;
1225  eloss = preStepKinEnergy - ScaledKinEnergyForLoss(x)/massRatio;
1226 
1227  /*
1228  if(-1 < verboseLevel)
1229  G4cout << "Long STEP: rPre(mm)= "
1230  << GetScaledRangeForScaledEnergy(preStepScaledEnergy)/mm
1231  << " rPost(mm)= " << x/mm
1232  << " ePre(MeV)= " << preStepScaledEnergy/MeV
1233  << " eloss(MeV)= " << eloss/MeV
1234  << " eloss0(MeV)= "
1235  << GetDEDXForScaledEnergy(preStepScaledEnergy)*length/MeV
1236  << " lim(MeV)= " << preStepKinEnergy*linLossLimit/MeV
1237  << G4endl;
1238  */
1239  }
1240 
1241  /*
1242  G4double eloss0 = eloss;
1243  if(-1 < verboseLevel ) {
1244  G4cout << "Before fluct: eloss(MeV)= " << eloss/MeV
1245  << " e-eloss= " << preStepKinEnergy-eloss
1246  << " step(mm)= " << length/mm
1247  << " range(mm)= " << fRange/mm
1248  << " fluct= " << lossFluctuationFlag
1249  << G4endl;
1250  }
1251  */
1252 
1253  G4double cut = (*theCuts)[currentCoupleIndex];
1254  G4double esec = 0.0;
1255 
1256  // SubCutOff
1257  if(useSubCutoff) {
1258  if(idxSCoffRegions[currentCoupleIndex]) {
1259 
1260  G4bool yes = false;
1261  G4StepPoint* prePoint = step.GetPreStepPoint();
1262 
1263  // Check boundary
1264  if(prePoint->GetStepStatus() == fGeomBoundary) { yes = true; }
1265 
1266  // Check PrePoint
1267  else {
1268  G4double preSafety = prePoint->GetSafety();
1269  G4double rcut =
1270  currentCouple->GetProductionCuts()->GetProductionCut(1);
1271 
1272  // recompute presafety
1273  if(preSafety < rcut) {
1274  preSafety = safetyHelper->ComputeSafety(prePoint->GetPosition());
1275  }
1276 
1277  if(preSafety < rcut) { yes = true; }
1278 
1279  // Check PostPoint
1280  else {
1281  G4double postSafety = preSafety - length;
1282  if(postSafety < rcut) {
1283  postSafety = safetyHelper->ComputeSafety(
1284  step.GetPostStepPoint()->GetPosition());
1285  if(postSafety < rcut) { yes = true; }
1286  }
1287  }
1288  }
1289 
1290  // Decided to start subcut sampling
1291  if(yes) {
1292 
1293  cut = (*theSubCuts)[currentCoupleIndex];
1294  eloss -= GetSubDEDXForScaledEnergy(preStepScaledEnergy)*length;
1295  esec = SampleSubCutSecondaries(scTracks, step,
1296  currentModel,currentCoupleIndex);
1297  // add bremsstrahlung sampling
1298  /*
1299  if(nProcesses > 0) {
1300  for(G4int i=0; i<nProcesses; ++i) {
1301  (scProcesses[i])->SampleSubCutSecondaries(
1302  scTracks, step, (scProcesses[i])->
1303  SelectModelForMaterial(preStepKinEnergy, currentCoupleIndex),
1304  currentCoupleIndex);
1305  }
1306  }
1307  */
1308  }
1309  }
1310  }
1311 
1312  // Corrections, which cannot be tabulated
1313  if(isIon) {
1314  G4double eadd = 0.0;
1315  G4double eloss_before = eloss;
1316  currentModel->CorrectionsAlongStep(currentCouple, dynParticle,
1317  eloss, eadd, length);
1318  if(eloss < 0.0) { eloss = 0.5*eloss_before; }
1319  }
1320 
1321  // Sample fluctuations
1322  if (lossFluctuationFlag) {
1323  G4VEmFluctuationModel* fluc = currentModel->GetModelOfFluctuations();
1324  if(fluc &&
1325  (eloss + esec + lowestKinEnergy) < preStepKinEnergy) {
1326 
1327  G4double tmax =
1328  std::min(currentModel->MaxSecondaryKinEnergy(dynParticle),cut);
1329  eloss = fluc->SampleFluctuations(currentCouple,dynParticle,
1330  tmax,length,eloss);
1331  /*
1332  if(-1 < verboseLevel)
1333  G4cout << "After fluct: eloss(MeV)= " << eloss/MeV
1334  << " fluc= " << (eloss-eloss0)/MeV
1335  << " ChargeSqRatio= " << chargeSqRatio
1336  << " massRatio= " << massRatio
1337  << " tmax= " << tmax
1338  << G4endl;
1339  */
1340  }
1341  }
1342 
1343  // deexcitation
1344  if (useDeexcitation) {
1345  G4double esecfluo = preStepKinEnergy - esec;
1346  G4double de = esecfluo;
1347  //G4double eloss0 = eloss;
1348  /*
1349  G4cout << "### 1: E(keV)= " << preStepKinEnergy/keV
1350  << " Efluomax(keV)= " << de/keV
1351  << " Eloss(keV)= " << eloss/keV << G4endl;
1352  */
1353  atomDeexcitation->AlongStepDeexcitation(scTracks, step,
1354  de, currentCoupleIndex);
1355 
1356  // sum of de-excitation energies
1357  esecfluo -= de;
1358 
1359  // subtracted from energy loss
1360  if(eloss >= esecfluo) {
1361  esec += esecfluo;
1362  eloss -= esecfluo;
1363  } else {
1364  esec += esecfluo;
1365  eloss = 0.0;
1366  }
1367  /*
1368  if(esecfluo > 0.0) {
1369  G4cout << "### 2: E(keV)= " << preStepKinEnergy/keV
1370  << " Esec(keV)= " << esec/keV
1371  << " Esecf(kV)= " << esecfluo/keV
1372  << " Eloss0(kV)= " << eloss0/keV
1373  << " Eloss(keV)= " << eloss/keV
1374  << G4endl;
1375  }
1376  */
1377  }
1378  if(scTracks.size() > 0) { FillSecondariesAlongStep(eloss, weight); }
1379 
1380  // Energy balanse
1381  G4double finalT = preStepKinEnergy - eloss - esec;
1382  if (finalT <= lowestKinEnergy) {
1383  eloss += finalT;
1384  finalT = 0.0;
1385  } else if(isIon) {
1387  currentModel->GetParticleCharge(track.GetParticleDefinition(),
1388  currentMaterial,finalT));
1389  }
1390 
1391  if(eloss < 0.0) { eloss = 0.0; }
1394  /*
1395  if(-1 < verboseLevel) {
1396  G4double del = finalT + eloss + esec - preStepKinEnergy;
1397  G4cout << "Final value eloss(MeV)= " << eloss/MeV
1398  << " preStepKinEnergy= " << preStepKinEnergy
1399  << " postStepKinEnergy= " << finalT
1400  << " de(keV)= " << del/keV
1401  << " lossFlag= " << lossFluctuationFlag
1402  << " status= " << track.GetTrackStatus()
1403  << G4endl;
1404  }
1405  */
1406  return &fParticleChange;
1407 }
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
Definition: G4VEmModel.hh:448
virtual G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmax, G4double length, G4double meanLoss)=0
void AlongStepDeexcitation(std::vector< G4Track * > &tracks, const G4Step &step, G4double &eLoss, G4int coupleIndex)
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
Definition: G4VEmModel.cc:339
G4double GetStepLength() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetProductionCut(G4int index) const
G4StepStatus GetStepStatus() const
G4ParticleChangeForLoss fParticleChange
G4double GetParentWeight() const
G4VEmFluctuationModel * GetModelOfFluctuations()
Definition: G4VEmModel.hh:571
void InitializeForAlongStep(const G4Track &)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4StepPoint * GetPreStepPoint() const
void ProposeWeight(G4double finalWeight)
G4double SampleSubCutSecondaries(std::vector< G4Track * > &, const G4Step &, G4VEmModel *model, G4int matIdx)
const G4ThreeVector & GetPosition() const
bool G4bool
Definition: G4Types.hh:79
void SetProposedKineticEnergy(G4double proposedKinEnergy)
const G4ParticleDefinition * GetParticleDefinition() const
G4bool IsActive(G4double kinEnergy)
Definition: G4VEmModel.hh:711
G4double ComputeSafety(const G4ThreeVector &pGlobalPoint, G4double maxRadius=DBL_MAX)
virtual G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:331
G4StepPoint * GetPostStepPoint() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double GetSafety() const
void SetProposedCharge(G4double theCharge)
double G4double
Definition: G4Types.hh:76
G4ProductionCuts * GetProductionCuts() const
G4double G4VEnergyLossProcess::AlongStepGetPhysicalInteractionLength ( const G4Track ,
G4double  previousStepSize,
G4double  currentMinimumStep,
G4double currentSafety,
G4GPILSelection selection 
)
virtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 1021 of file G4VEnergyLossProcess.cc.

References DBL_MAX, G4ProductionCuts::GetProductionCut(), G4MaterialCutsCouple::GetProductionCuts(), G4INCL::Math::min(), and test::x.

Referenced by ContinuousStepLimit().

1024 {
1025  G4double x = DBL_MAX;
1026  *selection = aGPILSelection;
1027  if(isIonisation) {
1028  fRange = GetScaledRangeForScaledEnergy(preStepScaledEnergy)*reduceFactor;
1029  x = fRange;
1030  G4double finR = finalRange;
1031  if(rndmStepFlag) {
1032  finR = std::min(finR,
1033  currentCouple->GetProductionCuts()->GetProductionCut(1));
1034  }
1035  if(fRange > finR) {
1036  x = fRange*dRoverRange + finR*(1.0 - dRoverRange)*(2.0 - finR/fRange);
1037  }
1038  /*
1039  if(particle->GetPDGMass() > 0.9*GeV)
1040  G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy
1041  <<" range= "<<fRange << " idx= " << basedCoupleIndex
1042  << " finR= " << finR
1043  << " limit= " << x <<G4endl;
1044  G4cout << "massRatio= " << massRatio << " Q^2= " << chargeSqRatio
1045  << " finR= " << finR << " dRoverRange= " << dRoverRange
1046  << " finalRange= " << finalRange << G4endl;
1047  */
1048  }
1049  //G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy
1050  //<<" stepLimit= "<<x<<G4endl;
1051  return x;
1052 }
G4double GetProductionCut(G4int index) const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double G4double
Definition: G4Types.hh:76
G4ProductionCuts * GetProductionCuts() const
#define DBL_MAX
Definition: templates.hh:83
const G4ParticleDefinition * G4VEnergyLossProcess::BaseParticle ( ) const
inline
G4PhysicsTable * G4VEnergyLossProcess::BuildDEDXTable ( G4EmTableType  tType = fRestricted)

Definition at line 706 of file G4VEnergyLossProcess.cc.

References plottest35::bin, G4EmModelManager::FillDEDXVector(), G4PhysicsVector::FillSecondDerivatives(), fRestricted, fSubRestricted, fTotal, G4cout, G4endl, G4LossTableBuilder::GetFlag(), G4PhysicsTable::GetFlag(), G4ProductionCutsTable::GetMaterialCutsCouple(), G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), G4ProductionCutsTable::GetProductionCutsTable(), G4LossTableManager::GetTableBuilder(), G4ProductionCutsTable::GetTableSize(), G4PhysicsTableHelper::SetPhysicsVector(), G4PhysicsVector::SetSpline(), G4LossTableManager::SplineFlag(), and G4VProcess::verboseLevel.

707 {
708  G4bool verb = false;
709  if(1 < verboseLevel || verb) {
710  G4cout << "G4VEnergyLossProcess::BuildDEDXTable() of type " << tType
711  << " for " << GetProcessName()
712  << " and particle " << particle->GetParticleName()
713  << G4endl;
714  }
715  G4PhysicsTable* table = 0;
716  G4double emax = maxKinEnergy;
717  G4int bin = nBins;
718 
719  if(fTotal == tType) {
720  emax = maxKinEnergyCSDA;
721  bin = nBinsCSDA;
722  table = theDEDXunRestrictedTable;
723  } else if(fRestricted == tType) {
724  table = theDEDXTable;
725  } else if(fSubRestricted == tType) {
726  table = theDEDXSubTable;
727  } else {
728  G4cout << "G4VEnergyLossProcess::BuildDEDXTable WARNING: wrong type "
729  << tType << G4endl;
730  }
731 
732  // Access to materials
733  const G4ProductionCutsTable* theCoupleTable=
735  size_t numOfCouples = theCoupleTable->GetTableSize();
736 
737  if(1 < verboseLevel || verb) {
738  G4cout << numOfCouples << " materials"
739  << " minKinEnergy= " << minKinEnergy
740  << " maxKinEnergy= " << emax
741  << " nbin= " << bin
742  << " EmTableType= " << tType
743  << " table= " << table << " " << this
744  << G4endl;
745  }
746  if(!table) { return table; }
747 
748  G4LossTableBuilder* bld = lManager->GetTableBuilder();
749  G4bool splineFlag = lManager->SplineFlag();
750  G4PhysicsLogVector* aVector = 0;
751  G4PhysicsLogVector* bVector = 0;
752 
753  for(size_t i=0; i<numOfCouples; ++i) {
754 
755  if(1 < verboseLevel || verb) {
756  G4cout << "G4VEnergyLossProcess::BuildDEDXVector Idx= " << i
757  << " flagTable= " << table->GetFlag(i)
758  << " Flag= " << bld->GetFlag(i) << G4endl;
759  }
760  if(bld->GetFlag(i)) {
761 
762  // create physics vector and fill it
763  const G4MaterialCutsCouple* couple =
764  theCoupleTable->GetMaterialCutsCouple(i);
765  delete (*table)[i];
766  if(!bVector) {
767  aVector = new G4PhysicsLogVector(minKinEnergy, emax, bin);
768  bVector = aVector;
769  } else {
770  aVector = new G4PhysicsLogVector(*bVector);
771  }
772  aVector->SetSpline(splineFlag);
773 
774  modelManager->FillDEDXVector(aVector, couple, tType);
775  if(splineFlag) { aVector->FillSecondDerivatives(); }
776 
777  // Insert vector for this material into the table
778  G4PhysicsTableHelper::SetPhysicsVector(table, i, aVector);
779  }
780  }
781 
782  if(1 < verboseLevel || verb) {
783  G4cout << "G4VEnergyLossProcess::BuildDEDXTable(): table is built for "
784  << particle->GetParticleName()
785  << " and process " << GetProcessName()
786  << G4endl;
787  //if(2 < verboseLevel) G4cout << (*table) << G4endl;
788  }
789 
790  return table;
791 }
G4bool SplineFlag() const
static void SetPhysicsVector(G4PhysicsTable *physTable, size_t idx, G4PhysicsVector *vec)
G4int verboseLevel
Definition: G4VProcess.hh:368
tuple bin
Definition: plottest35.py:22
G4bool GetFlag(size_t idx) const
int G4int
Definition: G4Types.hh:78
void FillSecondDerivatives()
const G4String & GetParticleName() const
G4LossTableBuilder * GetTableBuilder()
void SetSpline(G4bool)
G4GLOB_DLL std::ostream G4cout
void FillDEDXVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4EmTableType t=fRestricted)
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
#define G4endl
Definition: G4ios.hh:61
G4bool GetFlag(size_t i) const
double G4double
Definition: G4Types.hh:76
G4PhysicsTable * G4VEnergyLossProcess::BuildLambdaTable ( G4EmTableType  tType = fRestricted)

Definition at line 795 of file G4VEnergyLossProcess.cc.

References plottest35::bin, G4EmModelManager::FillLambdaVector(), G4PhysicsVector::FillSecondDerivatives(), fRestricted, fSubRestricted, G4cout, G4endl, G4Log(), G4lrint(), G4LossTableBuilder::GetCoupleIndexes(), G4LossTableBuilder::GetDensityFactors(), G4LossTableBuilder::GetFlag(), G4MaterialCutsCouple::GetMaterial(), G4ProductionCutsTable::GetMaterialCutsCouple(), G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), G4ProductionCutsTable::GetProductionCutsTable(), G4LossTableManager::GetTableBuilder(), G4ProductionCutsTable::GetTableSize(), MinPrimaryEnergy(), G4PhysicsTableHelper::SetPhysicsVector(), G4PhysicsVector::SetSpline(), G4LossTableManager::SplineFlag(), and G4VProcess::verboseLevel.

796 {
797  G4PhysicsTable* table = 0;
798 
799  if(fRestricted == tType) {
800  table = theLambdaTable;
801  } else if(fSubRestricted == tType) {
802  table = theSubLambdaTable;
803  } else {
804  G4cout << "G4VEnergyLossProcess::BuildLambdaTable WARNING: wrong type "
805  << tType << G4endl;
806  }
807 
808  if(1 < verboseLevel) {
809  G4cout << "G4VEnergyLossProcess::BuildLambdaTable() of type "
810  << tType << " for process "
811  << GetProcessName() << " and particle "
812  << particle->GetParticleName()
813  << " EmTableType= " << tType
814  << " table= " << table
815  << G4endl;
816  }
817  if(!table) {return table;}
818 
819  // Access to materials
820  const G4ProductionCutsTable* theCoupleTable=
822  size_t numOfCouples = theCoupleTable->GetTableSize();
823 
824  G4LossTableBuilder* bld = lManager->GetTableBuilder();
825  theDensityFactor = bld->GetDensityFactors();
826  theDensityIdx = bld->GetCoupleIndexes();
827 
828  G4bool splineFlag = lManager->SplineFlag();
829  G4PhysicsLogVector* aVector = 0;
830  G4double scale = G4Log(maxKinEnergy/minKinEnergy);
831 
832  for(size_t i=0; i<numOfCouples; ++i) {
833 
834  if (bld->GetFlag(i)) {
835 
836  // create physics vector and fill it
837  const G4MaterialCutsCouple* couple =
838  theCoupleTable->GetMaterialCutsCouple(i);
839  delete (*table)[i];
840 
841  G4bool startNull = true;
842  G4double emin =
843  MinPrimaryEnergy(particle,couple->GetMaterial(),(*theCuts)[i]);
844  if(minKinEnergy > emin) {
845  emin = minKinEnergy;
846  startNull = false;
847  }
848 
849  G4double emax = maxKinEnergy;
850  if(emax <= emin) { emax = 2*emin; }
851  G4int bin = G4lrint(nBins*G4Log(emax/emin)/scale);
852  if(bin < 3) { bin = 3; }
853  aVector = new G4PhysicsLogVector(emin, emax, bin);
854  aVector->SetSpline(splineFlag);
855 
856  modelManager->FillLambdaVector(aVector, couple, startNull, tType);
857  if(splineFlag) { aVector->FillSecondDerivatives(); }
858 
859  // Insert vector for this material into the table
860  G4PhysicsTableHelper::SetPhysicsVector(table, i, aVector);
861  }
862  }
863 
864  if(1 < verboseLevel) {
865  G4cout << "Lambda table is built for "
866  << particle->GetParticleName()
867  << G4endl;
868  }
869 
870  return table;
871 }
G4bool SplineFlag() const
const std::vector< G4double > * GetDensityFactors()
static void SetPhysicsVector(G4PhysicsTable *physTable, size_t idx, G4PhysicsVector *vec)
G4int verboseLevel
Definition: G4VProcess.hh:368
tuple bin
Definition: plottest35.py:22
G4bool GetFlag(size_t idx) const
void FillLambdaVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4bool startFromNull=true, G4EmTableType t=fRestricted)
int G4int
Definition: G4Types.hh:78
void FillSecondDerivatives()
const G4String & GetParticleName() const
G4LossTableBuilder * GetTableBuilder()
void SetSpline(G4bool)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4double G4Log(G4double x)
Definition: G4Log.hh:227
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
int G4lrint(double ad)
Definition: templates.hh:163
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *, G4double cut)
const G4Material * GetMaterial() const
const std::vector< G4int > * GetCoupleIndexes()
void G4VEnergyLossProcess::BuildPhysicsTable ( const G4ParticleDefinition part)
virtual

Reimplemented from G4VProcess.

Definition at line 603 of file G4VEnergyLossProcess.cc.

References G4LossTableManager::AtomDeexcitation(), G4LossTableManager::BuildPhysicsTable(), CSDARangeTable(), DEDXTable(), DEDXTableForSubsec(), DEDXunRestrictedTable(), fIsIonisation, fIsSubIonisation, fParticleChange, fRestricted, fSubRestricted, fTotal, G4cout, G4endl, G4LossTableBuilder::GetCoupleIndexes(), G4LossTableBuilder::GetDensityFactors(), G4VProcess::GetMasterProcess(), GetModelByIndex(), G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), G4LossTableManager::GetTableBuilder(), G4LossTableBuilder::InitialiseBaseMaterials(), G4SafetyHelper::InitialiseHelper(), G4VEmModel::InitialiseLocal(), InverseRangeTable(), IonisationTable(), IonisationTableForSubsec(), IsIonisationProcess(), G4VAtomDeexcitation::IsPIXEActive(), LambdaTable(), G4LossTableManager::LocalPhysicsTables(), G4EmModelManager::NumberOfModels(), PrintInfoDefinition(), RangeTableForLoss(), SecondaryRangeTable(), SetCSDARangeTable(), SetDEDXTable(), SetInverseRangeTable(), SetLambdaTable(), G4ParticleChangeForLoss::SetLowEnergyLimit(), SetRangeTableForLoss(), SetSecondaryRangeTable(), SetSubLambdaTable(), SubLambdaTable(), and G4VProcess::verboseLevel.

Referenced by G4ePolarizedIonisation::BuildPhysicsTable().

604 {
605  G4bool verb = false;
606  if(1 < verboseLevel || verb) {
607 
608  //if(1 < verboseLevel) {
609  G4cout << "### G4VEnergyLossProcess::BuildPhysicsTable() for "
610  << GetProcessName()
611  << " and particle " << part.GetParticleName()
612  << "; local: " << particle->GetParticleName();
613  if(baseParticle) {
614  G4cout << "; base: " << baseParticle->GetParticleName();
615  }
616  G4cout << " TablesAreBuilt= " << tablesAreBuilt
617  << " isIon= " << isIon << " " << this << G4endl;
618  }
619 
620  G4bool master = true;
621  const G4VEnergyLossProcess* masterProcess =
622  static_cast<const G4VEnergyLossProcess*>(GetMasterProcess());
623  if(masterProcess != this) { master = false; }
624 
625  if(&part == particle) {
626 
627  G4LossTableBuilder* bld = lManager->GetTableBuilder();
628  if(master) {
629  theDensityFactor = bld->GetDensityFactors();
630  theDensityIdx = bld->GetCoupleIndexes();
631  lManager->BuildPhysicsTable(particle, this);
632 
633  } else {
634 
635  // define density factors for worker thread
636  bld->InitialiseBaseMaterials(masterProcess->DEDXTable());
637  theDensityFactor = bld->GetDensityFactors();
638  theDensityIdx = bld->GetCoupleIndexes();
639 
640  // copy table pointers from master thread
641  SetDEDXTable(masterProcess->DEDXTable(),fRestricted);
643  SetDEDXTable(masterProcess->DEDXunRestrictedTable(),fTotal);
644  SetDEDXTable(masterProcess->IonisationTable(),fIsIonisation);
646  SetRangeTableForLoss(masterProcess->RangeTableForLoss());
647  SetCSDARangeTable(masterProcess->CSDARangeTable());
649  SetInverseRangeTable(masterProcess->InverseRangeTable());
650  SetLambdaTable(masterProcess->LambdaTable());
651  SetSubLambdaTable(masterProcess->SubLambdaTable());
652  isIonisation = masterProcess->IsIonisationProcess();
653 
654  tablesAreBuilt = true;
655  // local initialisation of models
656  G4bool printing = true;
657  G4int numberOfModels = modelManager->NumberOfModels();
658  for(G4int i=0; i<numberOfModels; ++i) {
659  G4VEmModel* mod = GetModelByIndex(i, printing);
660  G4VEmModel* mod0= masterProcess->GetModelByIndex(i,printing);
661  mod->InitialiseLocal(particle, mod0);
662  }
663 
664  lManager->LocalPhysicsTables(particle, this);
665  }
666 
667  // needs to be done only once
668  safetyHelper->InitialiseHelper();
669  }
670  // explicitly defined printout by particle name
671  G4String num = part.GetParticleName();
672  if(1 < verboseLevel ||
673  (0 < verboseLevel && (num == "e-" ||
674  num == "e+" || num == "mu+" ||
675  num == "mu-" || num == "proton"||
676  num == "pi+" || num == "pi-" ||
677  num == "kaon+" || num == "kaon-" ||
678  num == "alpha" || num == "anti_proton" ||
679  num == "GenericIon")))
680  {
681  PrintInfoDefinition(part);
682  }
683 
684  // Added tracking cut to avoid tracking artifacts
685  // identify deexcitation flag
686  if(isIonisation) {
687  fParticleChange.SetLowEnergyLimit(lowestKinEnergy);
688  atomDeexcitation = lManager->AtomDeexcitation();
689  if(atomDeexcitation) {
690  if(atomDeexcitation->IsPIXEActive()) { useDeexcitation = true; }
691  }
692  }
693 
694  //if(1 < verboseLevel || verb) {
695  if(1 < verboseLevel) {
696  G4cout << "### G4VEnergyLossProcess::BuildPhysicsTable() done for "
697  << GetProcessName()
698  << " and particle " << part.GetParticleName();
699  if(isIonisation) { G4cout << " isIonisation flag = 1"; }
700  G4cout << G4endl;
701  }
702 }
const G4VProcess * GetMasterProcess() const
Definition: G4VProcess.hh:538
void SetDEDXTable(G4PhysicsTable *p, G4EmTableType tType)
const std::vector< G4double > * GetDensityFactors()
void InitialiseHelper()
G4int verboseLevel
Definition: G4VProcess.hh:368
void PrintInfoDefinition(const G4ParticleDefinition &part)
G4bool IsPIXEActive() const
G4PhysicsTable * SubLambdaTable() const
void SetLowEnergyLimit(G4double elimit)
G4PhysicsTable * RangeTableForLoss() const
G4PhysicsTable * SecondaryRangeTable() const
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
Definition: G4VEmModel.cc:206
G4PhysicsTable * CSDARangeTable() const
G4ParticleChangeForLoss fParticleChange
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
G4PhysicsTable * IonisationTableForSubsec() const
G4PhysicsTable * IonisationTable() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4LossTableBuilder * GetTableBuilder()
G4PhysicsTable * LambdaTable() const
void SetInverseRangeTable(G4PhysicsTable *p)
G4GLOB_DLL std::ostream G4cout
G4PhysicsTable * DEDXTable() const
bool G4bool
Definition: G4Types.hh:79
G4PhysicsTable * DEDXTableForSubsec() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void SetLambdaTable(G4PhysicsTable *p)
G4int NumberOfModels() const
G4PhysicsTable * InverseRangeTable() const
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
void InitialiseBaseMaterials(G4PhysicsTable *table)
void SetCSDARangeTable(G4PhysicsTable *pRange)
void LocalPhysicsTables(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
#define G4endl
Definition: G4ios.hh:61
void SetSecondaryRangeTable(G4PhysicsTable *p)
G4VAtomDeexcitation * AtomDeexcitation()
G4PhysicsTable * DEDXunRestrictedTable() const
void SetSubLambdaTable(G4PhysicsTable *p)
void SetRangeTableForLoss(G4PhysicsTable *p)
const std::vector< G4int > * GetCoupleIndexes()
G4bool IsIonisationProcess() const
G4double G4VEnergyLossProcess::ContinuousStepLimit ( const G4Track track,
G4double  previousStepSize,
G4double  currentMinimumStep,
G4double currentSafety 
)

Definition at line 1892 of file G4VEnergyLossProcess.cc.

References AlongStepGetPhysicalInteractionLength().

1895 {
1896  G4GPILSelection sel;
1897  return AlongStepGetPhysicalInteractionLength(track, x, y, z, &sel);
1898 }
G4double z
Definition: TRTMaterials.hh:39
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
G4GPILSelection
G4double G4VEnergyLossProcess::CrossSectionBiasingFactor ( ) const
inline

Definition at line 1075 of file G4VEnergyLossProcess.hh.

1076 {
1077  return biasFactor;
1078 }
G4double G4VEnergyLossProcess::CrossSectionPerVolume ( G4double  kineticEnergy,
const G4MaterialCutsCouple couple 
)

Definition at line 1860 of file G4VEnergyLossProcess.cc.

References G4VEmModel::CrossSectionPerVolume(), and SelectModel().

1862 {
1863  // Cross section per volume is calculated
1864  DefineMaterial(couple);
1865  G4double cross = 0.0;
1866  if(theLambdaTable) {
1867  cross = GetLambdaForScaledEnergy(kineticEnergy*massRatio);
1868  } else {
1869  SelectModel(kineticEnergy*massRatio);
1870  cross = biasFactor*(*theDensityFactor)[currentCoupleIndex]
1871  *(currentModel->CrossSectionPerVolume(currentMaterial,
1872  particle, kineticEnergy,
1873  (*theCuts)[currentCoupleIndex]));
1874  }
1875  if(cross < 0.0) { cross = 0.0; }
1876  return cross;
1877 }
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:245
void SelectModel(G4double kinEnergy)
double G4double
Definition: G4Types.hh:76
G4PhysicsTable * G4VEnergyLossProcess::CSDARangeTable ( ) const
inline

Definition at line 1124 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable().

1125 {
1126  return theCSDARangeTable;
1127 }
size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex ( ) const
inlineprotected

Definition at line 605 of file G4VEnergyLossProcess.hh.

Referenced by G4ePolarizedIonisation::GetMeanFreePath(), and G4ePolarizedIonisation::PostStepGetPhysicalInteractionLength().

606 {
607  return currentCoupleIndex;
608 }
G4PhysicsTable * G4VEnergyLossProcess::DEDXTable ( ) const
inline

Definition at line 1089 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable(), G4LossTableManager::LocalPhysicsTables(), and G4EmCalculator::PrintDEDXTable().

1090 {
1091  return theDEDXTable;
1092 }
G4PhysicsTable * G4VEnergyLossProcess::DEDXTableForSubsec ( ) const
inline

Definition at line 1096 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable().

1097 {
1098  return theDEDXSubTable;
1099 }
G4PhysicsTable * G4VEnergyLossProcess::DEDXunRestrictedTable ( ) const
inline

Definition at line 1103 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable().

1104 {
1105  return theDEDXunRestrictedTable;
1106 }
G4VEmModel * G4VEnergyLossProcess::EmModel ( G4int  index = 1) const
G4VEmFluctuationModel * G4VEnergyLossProcess::FluctModel ( )
inline
G4double G4VEnergyLossProcess::GetContinuousStepLimit ( const G4Track track,
G4double  previousStepSize,
G4double  currentMinimumStep,
G4double currentSafety 
)
protectedvirtual

Implements G4VContinuousDiscreteProcess.

Definition at line 1914 of file G4VEnergyLossProcess.cc.

References DBL_MAX.

1917 {
1918  return DBL_MAX;
1919 }
#define DBL_MAX
Definition: templates.hh:83
G4double G4VEnergyLossProcess::GetCSDARange ( G4double kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 801 of file G4VEnergyLossProcess.hh.

References DBL_MAX, and test::x.

Referenced by G4LossTableManager::GetCSDARange().

803 {
804  DefineMaterial(couple);
805  G4double x = DBL_MAX;
806  if(theCSDARangeTable) {
807  x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
808  }
809  return x;
810 }
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
const G4Element * G4VEnergyLossProcess::GetCurrentElement ( ) const

Definition at line 2155 of file G4VEnergyLossProcess.cc.

References G4VEmModel::GetCurrentElement().

2156 {
2157  const G4Element* elm = 0;
2158  if(currentModel) { elm = currentModel->GetCurrentElement(); }
2159  return elm;
2160 }
const G4Element * GetCurrentElement() const
Definition: G4VEmModel.hh:440
G4double G4VEnergyLossProcess::GetDEDX ( G4double kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 764 of file G4VEnergyLossProcess.hh.

Referenced by G4ContinuousGainOfEnergy::AlongStepDoIt(), G4VMscModel::GetDEDX(), and G4LossTableManager::GetDEDX().

766 {
767  DefineMaterial(couple);
768  return GetDEDXForScaledEnergy(kineticEnergy*massRatio);
769 }
G4double G4VEnergyLossProcess::GetDEDXDispersion ( const G4MaterialCutsCouple couple,
const G4DynamicParticle dp,
G4double  length 
)

Definition at line 1842 of file G4VEnergyLossProcess.cc.

References G4VEmFluctuationModel::Dispersion(), fm, G4DynamicParticle::GetKineticEnergy(), G4VEmModel::GetModelOfFluctuations(), G4VEmModel::MaxSecondaryKinEnergy(), G4INCL::Math::min(), and SelectModel().

Referenced by G4LossTableManager::GetDEDXDispersion().

1846 {
1847  DefineMaterial(couple);
1848  G4double ekin = dp->GetKineticEnergy();
1849  SelectModel(ekin*massRatio);
1850  G4double tmax = currentModel->MaxSecondaryKinEnergy(dp);
1851  tmax = std::min(tmax,(*theCuts)[currentCoupleIndex]);
1852  G4double d = 0.0;
1853  G4VEmFluctuationModel* fm = currentModel->GetModelOfFluctuations();
1854  if(fm) { d = fm->Dispersion(currentMaterial,dp,tmax,length); }
1855  return d;
1856 }
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
Definition: G4VEmModel.hh:448
G4double GetKineticEnergy() const
void SelectModel(G4double kinEnergy)
G4VEmFluctuationModel * GetModelOfFluctuations()
Definition: G4VEmModel.hh:571
virtual G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double tmax, G4double length)=0
#define fm
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double G4double
Definition: G4Types.hh:76
G4double G4VEnergyLossProcess::GetDEDXForSubsec ( G4double kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 774 of file G4VEnergyLossProcess.hh.

Referenced by G4LossTableManager::GetSubDEDX().

776 {
777  DefineMaterial(couple);
778  return GetSubDEDXForScaledEnergy(kineticEnergy*massRatio);
779 }
G4double G4VEnergyLossProcess::GetKineticEnergy ( G4double range,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 830 of file G4VEnergyLossProcess.hh.

Referenced by G4ContinuousGainOfEnergy::AlongStepDoIt(), G4VMscModel::GetEnergy(), and G4LossTableManager::GetEnergy().

832 {
833  DefineMaterial(couple);
834  return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio;
835 }
G4double G4VEnergyLossProcess::GetLambda ( G4double kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 840 of file G4VEnergyLossProcess.hh.

References test::x.

842 {
843  DefineMaterial(couple);
844  G4double x = 0.0;
845  if(theLambdaTable) { x = GetLambdaForScaledEnergy(kineticEnergy*massRatio); }
846  return x;
847 }
double G4double
Definition: G4Types.hh:76
G4double G4VEnergyLossProcess::GetMeanFreePath ( const G4Track track,
G4double  previousStepSize,
G4ForceCondition condition 
)
protectedvirtual

Implements G4VContinuousDiscreteProcess.

Definition at line 1902 of file G4VEnergyLossProcess.cc.

References MeanFreePath(), and NotForced.

Referenced by G4ePolarizedIonisation::GetMeanFreePath().

1907 {
1908  *condition = NotForced;
1909  return MeanFreePath(track);
1910 }
G4double condition(const G4ErrorSymMatrix &m)
G4double MeanFreePath(const G4Track &track)
G4VEmModel * G4VEnergyLossProcess::GetModelByIndex ( G4int  idx = 0,
G4bool  ver = false 
) const

Definition at line 380 of file G4VEnergyLossProcess.cc.

References G4EmModelManager::GetModel().

Referenced by BuildPhysicsTable().

381 {
382  return modelManager->GetModel(idx, ver);
383 }
G4VEmModel * GetModel(G4int, G4bool ver=false)
G4double G4VEnergyLossProcess::GetRange ( G4double kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 784 of file G4VEnergyLossProcess.hh.

References test::x.

Referenced by G4ContinuousGainOfEnergy::AlongStepDoIt(), G4ContinuousGainOfEnergy::GetContinuousStepLimit(), and G4LossTableManager::GetRange().

786 {
787  G4double x = fRange;
788  DefineMaterial(couple);
789  if(theCSDARangeTable) {
790  x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)
791  * reduceFactor;
792  } else if(theRangeTableForLoss) {
793  x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
794  }
795  return x;
796 }
double G4double
Definition: G4Types.hh:76
G4double G4VEnergyLossProcess::GetRangeForLoss ( G4double kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 815 of file G4VEnergyLossProcess.hh.

References test::x.

Referenced by G4VMscModel::GetRange(), and G4LossTableManager::GetRangeFromRestricteDEDX().

817 {
818  // G4cout << "GetRangeForLoss: Range from " << GetProcessName() << G4endl;
819  DefineMaterial(couple);
820  G4double x =
821  GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
822  //G4cout << "GetRangeForLoss: Range from " << GetProcessName()
823  // << " e= " << kineticEnergy << " r= " << x << G4endl;
824  return x;
825 }
double G4double
Definition: G4Types.hh:76
virtual void G4VEnergyLossProcess::InitialiseEnergyLossProcess ( const G4ParticleDefinition ,
const G4ParticleDefinition  
)
protectedpure virtual
G4PhysicsTable * G4VEnergyLossProcess::InverseRangeTable ( ) const
inline

Definition at line 1145 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable(), G4LossTableManager::LocalPhysicsTables(), and G4EmCalculator::PrintInverseRangeTable().

1146 {
1147  return theInverseRangeTable;
1148 }
G4PhysicsTable * G4VEnergyLossProcess::IonisationTable ( ) const
inline

Definition at line 1110 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable().

1111 {
1112  return theIonisationTable;
1113 }
G4PhysicsTable * G4VEnergyLossProcess::IonisationTableForSubsec ( ) const
inline

Definition at line 1117 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable().

1118 {
1119  return theIonisationSubTable;
1120 }
virtual G4bool G4VEnergyLossProcess::IsApplicable ( const G4ParticleDefinition p)
pure virtual
G4bool G4VEnergyLossProcess::IsIntegral ( ) const
inline

Definition at line 951 of file G4VEnergyLossProcess.hh.

952 {
953  return integral;
954 }
G4bool G4VEnergyLossProcess::IsIonisationProcess ( ) const
inline
G4PhysicsVector * G4VEnergyLossProcess::LambdaPhysicsVector ( const G4MaterialCutsCouple ,
G4double  cut 
)
protected

Definition at line 1924 of file G4VEnergyLossProcess.cc.

References G4PhysicsVector::SetSpline(), G4LossTableManager::SplineFlag(), and test::v.

Referenced by G4ePolarizedIonisation::BuildPhysicsTable().

1926 {
1927  G4PhysicsVector* v =
1928  new G4PhysicsLogVector(minKinEnergy, maxKinEnergy, nBins);
1929  v->SetSpline(lManager->SplineFlag());
1930  return v;
1931 }
G4bool SplineFlag() const
void SetSpline(G4bool)
G4PhysicsTable * G4VEnergyLossProcess::LambdaTable ( ) const
inline

Definition at line 1152 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable().

1153 {
1154  return theLambdaTable;
1155 }
G4double G4VEnergyLossProcess::MaxKinEnergy ( ) const
inline
G4double G4VEnergyLossProcess::MeanFreePath ( const G4Track track)

Definition at line 1881 of file G4VEnergyLossProcess.cc.

References DBL_MAX, G4Track::GetKineticEnergy(), G4Track::GetMaterialCutsCouple(), and test::x.

Referenced by GetMeanFreePath().

1882 {
1883  DefineMaterial(track.GetMaterialCutsCouple());
1884  preStepLambda = GetLambdaForScaledEnergy(track.GetKineticEnergy()*massRatio);
1885  G4double x = DBL_MAX;
1886  if(0.0 < preStepLambda) { x = 1.0/preStepLambda; }
1887  return x;
1888 }
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double GetKineticEnergy() const
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
G4double G4VEnergyLossProcess::MinKinEnergy ( ) const
inline
G4double G4VEnergyLossProcess::MinPrimaryEnergy ( const G4ParticleDefinition ,
const G4Material ,
G4double  cut 
)
protectedvirtual
G4int G4VEnergyLossProcess::NumberOfModels ( ) const

Definition at line 387 of file G4VEnergyLossProcess.cc.

References G4EmModelManager::NumberOfModels().

388 {
389  return modelManager->NumberOfModels();
390 }
G4int NumberOfModels() const
G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions ( ) const
inline

Definition at line 1011 of file G4VEnergyLossProcess.hh.

1012 {
1013  return nSCoffRegions;
1014 }
const G4ParticleDefinition * G4VEnergyLossProcess::Particle ( ) const
inline

Definition at line 909 of file G4VEnergyLossProcess.hh.

Referenced by G4EmManager::BuildPhysicsTable(), G4LossTableManager::BuildPhysicsTable(), and G4LossTableManager::LocalPhysicsTables().

910 {
911  return particle;
912 }
G4VParticleChange * G4VEnergyLossProcess::PostStepDoIt ( const G4Track track,
const G4Step step 
)
virtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 1523 of file G4VEnergyLossProcess.cc.

References G4VParticleChange::AddSecondary(), G4EmBiasingManager::ApplySecondaryBiasing(), DBL_MAX, fAlive, G4EmBiasingManager::ForcedInteractionRegion(), fParticleChange, fStopAndKill, fStopButAlive, G4UniformRand, G4ProcessManager::GetAtRestProcessVector(), G4Track::GetDynamicParticle(), G4Track::GetGlobalTime(), G4Track::GetKineticEnergy(), G4VParticleChange::GetLocalEnergyDeposit(), G4VParticleChange::GetParentWeight(), G4Track::GetPosition(), G4Step::GetPostStepPoint(), G4ParticleDefinition::GetProcessManager(), G4ParticleChangeForLoss::GetProposedKineticEnergy(), G4StepPoint::GetSafety(), G4Track::GetTouchableHandle(), G4VParticleChange::GetTrackStatus(), G4ParticleChangeForLoss::InitializeForPostStep(), G4VEmModel::IsActive(), G4VProcess::pParticleChange, G4VParticleChange::ProposeLocalEnergyDeposit(), G4VParticleChange::ProposeTrackStatus(), G4VParticleChange::ProposeWeight(), G4VEmModel::SampleSecondaries(), G4EmBiasingManager::SecondaryBiasingRegion(), SelectModel(), G4Track::SetCreatorModelIndex(), G4VParticleChange::SetNumberOfSecondaries(), G4Track::SetTouchableHandle(), G4Track::SetWeight(), G4ProcessVector::size(), and G4VProcess::theNumberOfInteractionLengthLeft.

1525 {
1526  // In all cases clear number of interaction lengths
1528  mfpKinEnergy = DBL_MAX;
1529 
1531  G4double finalT = track.GetKineticEnergy();
1532  if(finalT <= lowestKinEnergy) { return &fParticleChange; }
1533 
1534  G4double postStepScaledEnergy = finalT*massRatio;
1535 
1536  if(!currentModel->IsActive(postStepScaledEnergy)) {
1537  return &fParticleChange;
1538  }
1539  /*
1540  if(-1 < verboseLevel) {
1541  G4cout << GetProcessName()
1542  << "::PostStepDoIt: E(MeV)= " << finalT/MeV
1543  << G4endl;
1544  }
1545  */
1546 
1547  // forced process - should happen only once per track
1548  if(biasFlag) {
1549  if(biasManager->ForcedInteractionRegion(currentCoupleIndex)) {
1550  biasFlag = false;
1551  }
1552  }
1553 
1554  // Integral approach
1555  if (integral) {
1556  G4double lx = GetLambdaForScaledEnergy(postStepScaledEnergy);
1557  /*
1558  if(preStepLambda<lx && 1 < verboseLevel && nWarnings<200) {
1559  G4cout << "WARNING: for " << particle->GetParticleName()
1560  << " and " << GetProcessName()
1561  << " E(MeV)= " << finalT/MeV
1562  << " preLambda= " << preStepLambda
1563  << " < " << lx << " (postLambda) "
1564  << G4endl;
1565  ++nWarnings;
1566  }
1567  */
1568  if(lx <= 0.0) {
1569  return &fParticleChange;
1570  } else if(preStepLambda*G4UniformRand() > lx) {
1571  return &fParticleChange;
1572  }
1573  }
1574 
1575  SelectModel(postStepScaledEnergy);
1576 
1577  // define new weight for primary and secondaries
1579  if(weightFlag) {
1580  weight /= biasFactor;
1582  }
1583 
1584  const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
1585  G4double tcut = (*theCuts)[currentCoupleIndex];
1586 
1587  // sample secondaries
1588  secParticles.clear();
1589  //G4cout<< "Eprimary: "<<dynParticle->GetKineticEnergy()/MeV<<G4endl;
1590  currentModel->SampleSecondaries(&secParticles, currentCouple,
1591  dynParticle, tcut);
1592 
1593  G4int num0 = secParticles.size();
1594 
1595  // bremsstrahlung splitting or Russian roulette
1596  if(biasManager) {
1597  if(biasManager->SecondaryBiasingRegion(currentCoupleIndex)) {
1598  G4double eloss = 0.0;
1599  weight *= biasManager->ApplySecondaryBiasing(
1600  secParticles,
1601  track, currentModel,
1602  &fParticleChange, eloss,
1603  currentCoupleIndex, tcut,
1604  step.GetPostStepPoint()->GetSafety());
1605  if(eloss > 0.0) {
1608  }
1609  }
1610  }
1611 
1612  // save secondaries
1613  G4int num = secParticles.size();
1614  if(num > 0) {
1615 
1617  G4double time = track.GetGlobalTime();
1618 
1619  for (G4int i=0; i<num; ++i) {
1620  if(secParticles[i]) {
1621  G4Track* t = new G4Track(secParticles[i], time, track.GetPosition());
1623  t->SetWeight(weight);
1624  if(i < num0) { t->SetCreatorModelIndex(secID); }
1625  else { t->SetCreatorModelIndex(biasID); }
1626 
1627  //G4cout << "Secondary(post step) has weight " << t->GetWeight()
1628  // << ", kenergy " << t->GetKineticEnergy()/MeV << " MeV"
1629  // << " time= " << time/ns << " ns " << G4endl;
1631  }
1632  }
1633  }
1634 
1637  if(particle->GetProcessManager()->GetAtRestProcessVector()->size() > 0)
1640  }
1641 
1642  /*
1643  if(-1 < verboseLevel) {
1644  G4cout << "::PostStepDoIt: Sample secondary; Efin= "
1645  << fParticleChange.GetProposedKineticEnergy()/MeV
1646  << " MeV; model= (" << currentModel->LowEnergyLimit()
1647  << ", " << currentModel->HighEnergyLimit() << ")"
1648  << " preStepLambda= " << preStepLambda
1649  << " dir= " << track.GetMomentumDirection()
1650  << " status= " << track.GetTrackStatus()
1651  << G4endl;
1652  }
1653  */
1654  return &fParticleChange;
1655 }
void InitializeForPostStep(const G4Track &)
G4double ApplySecondaryBiasing(std::vector< G4DynamicParticle * > &, const G4Track &track, G4VEmModel *currentModel, G4ParticleChangeForGamma *pParticleChange, G4double &eloss, G4int coupleIdx, G4double tcut, G4double safety=0.0)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
const G4DynamicParticle * GetDynamicParticle() const
G4bool SecondaryBiasingRegion(G4int coupleIdx)
const G4ThreeVector & GetPosition() const
G4bool ForcedInteractionRegion(G4int coupleIdx)
G4ParticleChangeForLoss fParticleChange
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
void SelectModel(G4double kinEnergy)
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetParentWeight() const
G4double GetProposedKineticEnergy() const
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
void SetWeight(G4double aValue)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetCreatorModelIndex(G4int idx)
Definition: G4Track.hh:245
void ProposeWeight(G4double finalWeight)
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4double GetKineticEnergy() const
#define G4UniformRand()
Definition: Randomize.hh:87
G4double GetGlobalTime() const
void AddSecondary(G4Track *aSecondary)
const G4TouchableHandle & GetTouchableHandle() const
G4bool IsActive(G4double kinEnergy)
Definition: G4VEmModel.hh:711
G4int size() const
void SetNumberOfSecondaries(G4int totSecondaries)
G4double GetLocalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4double GetSafety() const
G4TrackStatus GetTrackStatus() const
double G4double
Definition: G4Types.hh:76
void ProposeTrackStatus(G4TrackStatus status)
#define DBL_MAX
Definition: templates.hh:83
G4double G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength ( const G4Track track,
G4double  previousStepSize,
G4ForceCondition condition 
)
virtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 1056 of file G4VEnergyLossProcess.cc.

References G4VEmModel::ChargeSquareRatio(), python.hepunit::cm, G4VProcess::currentInteractionLength, DBL_MAX, G4EmBiasingManager::ForcedInteractionRegion(), G4cout, G4endl, G4Log(), G4UniformRand, G4Track::GetDefinition(), G4Track::GetKineticEnergy(), G4Track::GetMaterial(), G4Track::GetMaterialCutsCouple(), G4Material::GetName(), G4Track::GetParentID(), G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), G4EmBiasingManager::GetStepLimit(), G4VEmModel::IsActive(), python.hepunit::MeV, NotForced, SelectModel(), G4VProcess::theInitialNumberOfInteractionLength, G4VProcess::theNumberOfInteractionLengthLeft, G4VProcess::verboseLevel, and test::x.

Referenced by G4ePolarizedIonisation::PostStepGetPhysicalInteractionLength().

1060 {
1061  // condition is set to "Not Forced"
1062  *condition = NotForced;
1063  G4double x = DBL_MAX;
1064 
1065  // initialisation of material, mass, charge, model
1066  // at the beginning of the step
1067  DefineMaterial(track.GetMaterialCutsCouple());
1068  preStepKinEnergy = track.GetKineticEnergy();
1069  preStepScaledEnergy = preStepKinEnergy*massRatio;
1070  SelectModel(preStepScaledEnergy);
1071 
1072  if(!currentModel->IsActive(preStepScaledEnergy)) {
1074  return x;
1075  }
1076 
1077  // change effective charge of an ion on fly
1078  if(isIon) {
1079  G4double q2 = currentModel->ChargeSquareRatio(track);
1080  if(q2 != chargeSqRatio && q2 > 0.0) {
1081  chargeSqRatio = q2;
1082  fFactor = q2*biasFactor*(*theDensityFactor)[currentCoupleIndex];
1083  reduceFactor = 1.0/(fFactor*massRatio);
1084  }
1085  }
1086  // if(particle->GetPDGMass() > 0.9*GeV)
1087  //G4cout << "q2= "<<chargeSqRatio << " massRatio= " << massRatio << G4endl;
1088  // initialisation for sampling of the interaction length
1089  //if(previousStepSize <= 0.0) { theNumberOfInteractionLengthLeft = -1.0; }
1090  //if(theNumberOfInteractionLengthLeft < 0.0) { mfpKinEnergy = DBL_MAX; }
1091 
1092  // forced biasing only for primary particles
1093  if(biasManager) {
1094  if(0 == track.GetParentID()) {
1095  if(biasFlag &&
1096  biasManager->ForcedInteractionRegion(currentCoupleIndex)) {
1097  return biasManager->GetStepLimit(currentCoupleIndex, previousStepSize);
1098  }
1099  }
1100  }
1101 
1102  // compute mean free path
1103  if(preStepScaledEnergy < mfpKinEnergy) {
1104  if (integral) { ComputeLambdaForScaledEnergy(preStepScaledEnergy); }
1105  else { preStepLambda = GetLambdaForScaledEnergy(preStepScaledEnergy); }
1106 
1107  // zero cross section
1108  if(preStepLambda <= 0.0) {
1111  }
1112  }
1113 
1114  // non-zero cross section
1115  if(preStepLambda > 0.0) {
1117 
1118  // beggining of tracking (or just after DoIt of this process)
1119  // ResetNumberOfInteractionLengthLeft();
1122 
1123  } else if(currentInteractionLength < DBL_MAX) {
1124 
1125  // subtract NumberOfInteractionLengthLeft using previous step
1127  previousStepSize/currentInteractionLength;
1128  // SubtractNumberOfInteractionLengthLeft(previousStepSize);
1131  //theNumberOfInteractionLengthLeft = perMillion;
1132  }
1133  }
1134 
1135  // new mean free path and step limit
1136  currentInteractionLength = 1.0/preStepLambda;
1138  }
1139 #ifdef G4VERBOSE
1140  if (verboseLevel>2){
1141  // if(particle->GetPDGMass() > 0.9*GeV){
1142  G4cout << "G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength ";
1143  G4cout << "[ " << GetProcessName() << "]" << G4endl;
1144  G4cout << " for " << track.GetDefinition()->GetParticleName()
1145  << " in Material " << currentMaterial->GetName()
1146  << " Ekin(MeV)= " << preStepKinEnergy/MeV
1147  << " " << track.GetMaterial()->GetName()
1148  <<G4endl;
1149  G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]"
1150  << "InteractionLength= " << x/cm <<"[cm] " <<G4endl;
1151  }
1152 #endif
1153  return x;
1154 }
G4double condition(const G4ErrorSymMatrix &m)
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetName() const
Definition: G4Material.hh:176
G4bool ForcedInteractionRegion(G4int coupleIdx)
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
void SelectModel(G4double kinEnergy)
const G4String & GetParticleName() const
G4double GetKineticEnergy() const
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
G4double GetStepLimit(G4int coupleIdx, G4double previousStep)
G4double currentInteractionLength
Definition: G4VProcess.hh:297
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
virtual G4double ChargeSquareRatio(const G4Track &)
Definition: G4VEmModel.cc:314
G4Material * GetMaterial() const
G4bool IsActive(G4double kinEnergy)
Definition: G4VEmModel.hh:711
G4double G4Log(G4double x)
Definition: G4Log.hh:227
#define G4endl
Definition: G4ios.hh:61
G4double theInitialNumberOfInteractionLength
Definition: G4VProcess.hh:300
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
void G4VEnergyLossProcess::PreparePhysicsTable ( const G4ParticleDefinition part)
virtual

Reimplemented from G4VProcess.

Definition at line 395 of file G4VEnergyLossProcess.cc.

References G4LossTableManager::BuildCSDARange(), G4PhysicsTable::clearAndDestroy(), DBL_MAX, G4ParticleTable::FindParticle(), G4cout, G4endl, G4ProcessManager::GetAlongStepProcessVector(), G4VProcess::GetMasterProcess(), G4ProductionCutsTable::GetMaterialCutsCouple(), G4EmModelManager::GetModel(), G4Region::GetName(), G4ParticleDefinition::GetParticleName(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetParticleType(), G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGMass(), G4ParticleDefinition::GetProcessManager(), G4VProcess::GetProcessName(), G4MaterialCutsCouple::GetProductionCuts(), G4ProductionCutsTable::GetProductionCutsTable(), G4LossTableManager::GetTableBuilder(), G4ProductionCutsTable::GetTableSize(), G4VEmModel::HighEnergyLimit(), G4EmBiasingManager::Initialise(), G4EmModelManager::Initialise(), G4LossTableBuilder::InitialiseBaseMaterials(), InitialiseEnergyLossProcess(), n, G4EmModelManager::NumberOfModels(), eplot::pname, G4PhysicsTableHelper::PreparePhysicsTable(), G4LossTableManager::PreparePhysicsTable(), G4PhysicsModelCatalog::Register(), G4LossTableManager::RegisterExtraParticle(), G4VEmModel::SetHighEnergyLimit(), G4VEmModel::SetMasterThread(), G4ProcessVector::size(), G4EmModelManager::SubCutoff(), test::v, and G4VProcess::verboseLevel.

396 {
397  if(1 < verboseLevel) {
398  G4cout << "G4VEnergyLossProcess::PreparePhysicsTable for "
399  << GetProcessName() << " for " << part.GetParticleName()
400  << " " << this << G4endl;
401  }
402 
403  if(GetMasterProcess() != this) { isMaster = false; }
404 
405  currentCouple = 0;
406  preStepLambda = 0.0;
407  mfpKinEnergy = DBL_MAX;
408  fRange = DBL_MAX;
409  preStepKinEnergy = 0.0;
410  preStepRangeEnergy = 0.0;
411  chargeSqRatio = 1.0;
412  massRatio = 1.0;
413  reduceFactor = 1.0;
414  fFactor = 1.0;
415  lastIdx = 0;
416 
417  // Are particle defined?
418  if( !particle ) { particle = &part; }
419 
420  if(part.GetParticleType() == "nucleus") {
421 
422  G4String pname = part.GetParticleName();
423  if(pname != "deuteron" && pname != "triton" &&
424  pname != "alpha+" && pname != "helium" &&
425  pname != "hydrogen") {
426 
427  if(!theGenericIon) {
428  theGenericIon =
430  }
431  isIon = true;
432  if(theGenericIon && particle != theGenericIon) {
433  G4ProcessManager* pm = theGenericIon->GetProcessManager();
435  size_t n = v->size();
436  for(size_t j=0; j<n; ++j) {
437  if((*v)[j] == this) {
438  particle = theGenericIon;
439  break;
440  }
441  }
442  }
443  }
444  }
445 
446  if( particle != &part ) {
447  if(!isIon) {
448  lManager->RegisterExtraParticle(&part, this);
449  }
450  if(1 < verboseLevel) {
451  G4cout << "### G4VEnergyLossProcess::PreparePhysicsTable()"
452  << " interrupted for "
453  << part.GetParticleName() << " isIon= " << isIon
454  << " particle " << particle << " GenericIon " << theGenericIon
455  << G4endl;
456  }
457  return;
458  }
459 
460  Clean();
461  lManager->PreparePhysicsTable(&part, this, isMaster);
462  G4LossTableBuilder* bld = lManager->GetTableBuilder();
463 
464  // Base particle and set of models can be defined here
465  InitialiseEnergyLossProcess(particle, baseParticle);
466 
467  const G4ProductionCutsTable* theCoupleTable=
469  size_t n = theCoupleTable->GetTableSize();
470 
471  theDEDXAtMaxEnergy.resize(n, 0.0);
472  theRangeAtMaxEnergy.resize(n, 0.0);
473  theEnergyOfCrossSectionMax.resize(n, 0.0);
474  theCrossSectionMax.resize(n, DBL_MAX);
475 
476  // Tables preparation
477  if (isMaster && !baseParticle) {
478 
479  if(theDEDXTable && isIonisation) {
480  if(theIonisationTable && theDEDXTable != theIonisationTable) {
481  theDEDXTable->clearAndDestroy();
482  theDEDXTable = theIonisationTable;
483  }
484  if(theDEDXSubTable && theIonisationSubTable &&
485  theDEDXSubTable != theIonisationSubTable) {
486  theDEDXSubTable->clearAndDestroy();
487  theDEDXSubTable = theIonisationSubTable;
488  }
489  }
490 
491  theDEDXTable = G4PhysicsTableHelper::PreparePhysicsTable(theDEDXTable);
492  bld->InitialiseBaseMaterials(theDEDXTable);
493 
494  if(theDEDXSubTable) {
495  theDEDXSubTable =
497  }
498 
499  if (lManager->BuildCSDARange()) {
500  theDEDXunRestrictedTable =
501  G4PhysicsTableHelper::PreparePhysicsTable(theDEDXunRestrictedTable);
502  theCSDARangeTable =
504  }
505 
506  theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable);
507 
508  if(isIonisation) {
509  theRangeTableForLoss =
510  G4PhysicsTableHelper::PreparePhysicsTable(theRangeTableForLoss);
511  theInverseRangeTable =
512  G4PhysicsTableHelper::PreparePhysicsTable(theInverseRangeTable);
513  }
514 
515  if (nSCoffRegions) {
516  theDEDXSubTable =
518  theSubLambdaTable =
520  }
521  }
522 
523  // forced biasing
524  if(biasManager) {
525  biasManager->Initialise(part,GetProcessName(),verboseLevel);
526  biasFlag = false;
527  }
528 
529  G4double initialCharge = particle->GetPDGCharge();
530  G4double initialMass = particle->GetPDGMass();
531 
532  if (baseParticle) {
533  massRatio = (baseParticle->GetPDGMass())/initialMass;
534  G4double q = initialCharge/baseParticle->GetPDGCharge();
535  chargeSqRatio = q*q;
536  if(chargeSqRatio > 0.0) { reduceFactor = 1.0/(chargeSqRatio*massRatio); }
537  }
538 
539  // defined ID of secondary particles
540  if(isMaster) {
541  G4String nam1 = GetProcessName();
542  G4String nam4 = nam1 + "_split";
543  G4String nam5 = nam1 + "_subcut";
544  secID = G4PhysicsModelCatalog::Register(nam1);
545  biasID = G4PhysicsModelCatalog::Register(nam4);
546  subsecID= G4PhysicsModelCatalog::Register(nam5);
547  }
548 
549  // initialisation of models
550  G4int nmod = modelManager->NumberOfModels();
551  for(G4int i=0; i<nmod; ++i) {
552  G4VEmModel* mod = modelManager->GetModel(i);
553  mod->SetMasterThread(isMaster);
554  if(mod->HighEnergyLimit() > maxKinEnergy) {
555  mod->SetHighEnergyLimit(maxKinEnergy);
556  }
557  }
558 
559  theCuts = modelManager->Initialise(particle, secondaryParticle,
560  minSubRange, verboseLevel);
561 
562  // Sub Cutoff
563  if (nSCoffRegions>0) {
564  theSubCuts = modelManager->SubCutoff();
565 
566  if(nSCoffRegions>0) { idxSCoffRegions = new G4bool[n]; }
567  for (size_t j=0; j<n; ++j) {
568 
569  const G4MaterialCutsCouple* couple =
570  theCoupleTable->GetMaterialCutsCouple(j);
571  const G4ProductionCuts* pcuts = couple->GetProductionCuts();
572 
573  if(nSCoffRegions>0) {
574  G4bool reg = false;
575  for(G4int i=0; i<nSCoffRegions; ++i) {
576  if( pcuts == scoffRegions[i]->GetProductionCuts()) { reg = true; }
577  }
578  idxSCoffRegions[j] = reg;
579  }
580  }
581  }
582 
583  if(1 < verboseLevel) {
584  G4cout << "G4VEnergyLossProcess::PrepearPhysicsTable() is done "
585  << " for local " << particle->GetParticleName()
586  << " isIon= " << isIon;
587  if(baseParticle) { G4cout << "; base: " << baseParticle->GetParticleName(); }
588  G4cout << " chargeSqRatio= " << chargeSqRatio
589  << " massRatio= " << massRatio
590  << " reduceFactor= " << reduceFactor << G4endl;
591  if (nSCoffRegions) {
592  G4cout << " SubCutoff Regime is ON for regions: " << G4endl;
593  for (G4int i=0; i<nSCoffRegions; ++i) {
594  const G4Region* r = scoffRegions[i];
595  G4cout << " " << r->GetName() << G4endl;
596  }
597  }
598  }
599 }
const G4VProcess * GetMasterProcess() const
Definition: G4VProcess.hh:538
const G4String & GetName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4int verboseLevel
Definition: G4VProcess.hh:368
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:592
G4VEmModel * GetModel(G4int, G4bool ver=false)
G4bool BuildCSDARange() const
const G4DataVector * SubCutoff() const
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
const G4String & GetParticleName() const
G4LossTableBuilder * GetTableBuilder()
void Initialise(const G4ParticleDefinition &part, const G4String &procName, G4int verbose)
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:683
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetParticleType() const
const G4int n
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
string pname
Definition: eplot.py:33
void RegisterExtraParticle(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
void SetMasterThread(G4bool val)
Definition: G4VEmModel.hh:669
G4int size() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4int NumberOfModels() const
G4double GetPDGMass() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4ParticleTable * GetParticleTable()
void InitialiseBaseMaterials(G4PhysicsTable *table)
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
#define G4endl
Definition: G4ios.hh:61
static G4int Register(G4String &)
double G4double
Definition: G4Types.hh:76
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4double GetPDGCharge() const
G4ProductionCuts * GetProductionCuts() const
#define DBL_MAX
Definition: templates.hh:83
void clearAndDestroy()
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *)=0
virtual void G4VEnergyLossProcess::PrintInfo ( )
pure virtual
void G4VEnergyLossProcess::PrintInfoDefinition ( const G4ParticleDefinition part)

Definition at line 876 of file G4VEnergyLossProcess.cc.

References G4EmModelManager::DumpModelList(), G4BestUnit, G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), G4VProcess::GetProcessSubType(), python.hepunit::mm, PrintInfo(), G4LossTableManager::SplineFlag(), and G4VProcess::verboseLevel.

Referenced by BuildPhysicsTable().

877 {
878  if(0 < verboseLevel) {
879  G4cout << std::setprecision(6);
880  G4cout << G4endl << GetProcessName() << ": for "
881  << part.GetParticleName()
882  << " SubType= " << GetProcessSubType()
883  << G4endl;
884  G4cout << " dE/dx and range tables from "
885  << G4BestUnit(minKinEnergy,"Energy")
886  << " to " << G4BestUnit(maxKinEnergy,"Energy")
887  << " in " << nBins << " bins" << G4endl
888  << " Lambda tables from threshold to "
889  << G4BestUnit(maxKinEnergy,"Energy")
890  << " in " << nBins << " bins, spline: "
891  << lManager->SplineFlag()
892  << G4endl;
893  if(theRangeTableForLoss && isIonisation) {
894  G4cout << " finalRange(mm)= " << finalRange/mm
895  << ", dRoverRange= " << dRoverRange
896  << ", integral: " << integral
897  << ", fluct: " << lossFluctuationFlag
898  << ", linLossLimit= " << linLossLimit
899  << G4endl;
900  }
901  PrintInfo();
902  modelManager->DumpModelList(verboseLevel);
903  if(theCSDARangeTable && isIonisation) {
904  G4cout << " CSDA range table up"
905  << " to " << G4BestUnit(maxKinEnergyCSDA,"Energy")
906  << " in " << nBinsCSDA << " bins" << G4endl;
907  }
908  if(nSCoffRegions>0 && isIonisation) {
909  G4cout << " Subcutoff sampling in " << nSCoffRegions
910  << " regions" << G4endl;
911  }
912  if(2 < verboseLevel) {
913  G4cout << " DEDXTable address= " << theDEDXTable << G4endl;
914  if(theDEDXTable && isIonisation) G4cout << (*theDEDXTable) << G4endl;
915  G4cout << "non restricted DEDXTable address= "
916  << theDEDXunRestrictedTable << G4endl;
917  if(theDEDXunRestrictedTable && isIonisation) {
918  G4cout << (*theDEDXunRestrictedTable) << G4endl;
919  }
920  if(theDEDXSubTable && isIonisation) {
921  G4cout << (*theDEDXSubTable) << G4endl;
922  }
923  G4cout << " CSDARangeTable address= " << theCSDARangeTable
924  << G4endl;
925  if(theCSDARangeTable && isIonisation) {
926  G4cout << (*theCSDARangeTable) << G4endl;
927  }
928  G4cout << " RangeTableForLoss address= " << theRangeTableForLoss
929  << G4endl;
930  if(theRangeTableForLoss && isIonisation) {
931  G4cout << (*theRangeTableForLoss) << G4endl;
932  }
933  G4cout << " InverseRangeTable address= " << theInverseRangeTable
934  << G4endl;
935  if(theInverseRangeTable && isIonisation) {
936  G4cout << (*theInverseRangeTable) << G4endl;
937  }
938  G4cout << " LambdaTable address= " << theLambdaTable << G4endl;
939  if(theLambdaTable && isIonisation) {
940  G4cout << (*theLambdaTable) << G4endl;
941  }
942  G4cout << " SubLambdaTable address= " << theSubLambdaTable
943  << G4endl;
944  if(theSubLambdaTable && isIonisation) {
945  G4cout << (*theSubLambdaTable) << G4endl;
946  }
947  }
948  }
949 }
G4bool SplineFlag() const
G4int verboseLevel
Definition: G4VProcess.hh:368
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void DumpModelList(G4int verb)
virtual void PrintInfo()=0
#define G4endl
Definition: G4ios.hh:61
G4int GetProcessSubType() const
Definition: G4VProcess.hh:426
G4PhysicsTable * G4VEnergyLossProcess::RangeTableForLoss ( ) const
inline

Definition at line 1138 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable(), G4LossTableManager::LocalPhysicsTables(), and G4EmCalculator::PrintRangeTable().

1139 {
1140  return theRangeTableForLoss;
1141 }
G4bool G4VEnergyLossProcess::RetrievePhysicsTable ( const G4ParticleDefinition part,
const G4String directory,
G4bool  ascii 
)
virtual

Reimplemented from G4VProcess.

Definition at line 1720 of file G4VEnergyLossProcess.cc.

References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), and G4VProcess::verboseLevel.

1723 {
1724  G4bool res = true;
1725  const G4String particleName = part->GetParticleName();
1726 
1727  if(1 < verboseLevel) {
1728  G4cout << "G4VEnergyLossProcess::RetrievePhysicsTable() for "
1729  << particleName << " and process " << GetProcessName()
1730  << "; tables_are_built= " << tablesAreBuilt
1731  << G4endl;
1732  }
1733  if(particle == part) {
1734 
1735  if ( !baseParticle ) {
1736 
1737  G4bool fpi = true;
1738  if(!RetrieveTable(part,theDEDXTable,ascii,directory,"DEDX",fpi))
1739  {fpi = false;}
1740 
1741  // ionisation table keeps individual dEdx and not sum of sub-processes
1742  if(!RetrieveTable(part,theDEDXTable,ascii,directory,"Ionisation",false))
1743  {fpi = false;}
1744 
1745  if(!RetrieveTable(part,theRangeTableForLoss,ascii,directory,"Range",fpi))
1746  {res = false;}
1747 
1748  if(!RetrieveTable(part,theDEDXunRestrictedTable,ascii,directory,
1749  "DEDXnr",false))
1750  {res = false;}
1751 
1752  if(!RetrieveTable(part,theCSDARangeTable,ascii,directory,
1753  "CSDARange",false))
1754  {res = false;}
1755 
1756  if(!RetrieveTable(part,theInverseRangeTable,ascii,directory,
1757  "InverseRange",fpi))
1758  {res = false;}
1759 
1760  if(!RetrieveTable(part,theLambdaTable,ascii,directory,"Lambda",true))
1761  {res = false;}
1762 
1763  G4bool yes = false;
1764  if(nSCoffRegions > 0) {yes = true;}
1765 
1766  if(!RetrieveTable(part,theDEDXSubTable,ascii,directory,"SubDEDX",yes))
1767  {res = false;}
1768 
1769  if(!RetrieveTable(part,theSubLambdaTable,ascii,directory,
1770  "SubLambda",yes))
1771  {res = false;}
1772 
1773  if(!fpi) yes = false;
1774  if(!RetrieveTable(part,theIonisationSubTable,ascii,directory,
1775  "SubIonisation",yes))
1776  {res = false;}
1777  }
1778  }
1779 
1780  return res;
1781 }
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
G4double G4VEnergyLossProcess::SampleSubCutSecondaries ( std::vector< G4Track * > &  tracks,
const G4Step step,
G4VEmModel model,
G4int  matIdx 
)

Definition at line 1445 of file G4VEnergyLossProcess.cc.

References python.hepunit::electron_mass_c2, G4UniformRand, G4Track::GetDynamicParticle(), G4StepPoint::GetGlobalTime(), G4DynamicParticle::GetKineticEnergy(), G4Track::GetKineticEnergy(), G4Track::GetMaterialCutsCouple(), G4Track::GetParticleDefinition(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4Step::GetStepLength(), G4Track::GetTouchableHandle(), G4Step::GetTrack(), python.hepunit::perMillion, G4VEmModel::SampleSecondaries(), G4Track::SetCreatorModelIndex(), and G4Track::SetTouchableHandle().

Referenced by AlongStepDoIt().

1449 {
1450  // Fast check weather subcutoff can work
1451  G4double esec = 0.0;
1452  G4double subcut = (*theSubCuts)[idx];
1453  G4double cut = (*theCuts)[idx];
1454  if(cut <= subcut) { return esec; }
1455 
1456  const G4Track* track = step.GetTrack();
1457  const G4DynamicParticle* dp = track->GetDynamicParticle();
1458  G4double e = dp->GetKineticEnergy()*massRatio;
1459  G4double cross = (*theDensityFactor)[idx]*chargeSqRatio
1460  *(((*theSubLambdaTable)[(*theDensityIdx)[idx]])->Value(e, idxSubLambda));
1461  G4double length = step.GetStepLength();
1462 
1463  // negligible probability to get any interaction
1464  if(length*cross < perMillion) { return esec; }
1465  /*
1466  if(-1 < verboseLevel)
1467  G4cout << "<<< Subcutoff for " << GetProcessName()
1468  << " cross(1/mm)= " << cross*mm << ">>>"
1469  << " e(MeV)= " << preStepScaledEnergy
1470  << " matIdx= " << currentCoupleIndex
1471  << G4endl;
1472  */
1473 
1474  // Sample subcutoff secondaries
1475  G4StepPoint* preStepPoint = step.GetPreStepPoint();
1476  G4StepPoint* postStepPoint = step.GetPostStepPoint();
1477  G4ThreeVector prepoint = preStepPoint->GetPosition();
1478  G4ThreeVector dr = postStepPoint->GetPosition() - prepoint;
1479  G4double pretime = preStepPoint->GetGlobalTime();
1480  G4double dt = postStepPoint->GetGlobalTime() - pretime;
1481  //G4double dt = length/preStepPoint->GetVelocity();
1482  G4double fragment = 0.0;
1483 
1484  do {
1485  G4double del = -std::log(G4UniformRand())/cross;
1486  fragment += del/length;
1487  if (fragment > 1.0) break;
1488 
1489  // sample secondaries
1490  secParticles.clear();
1491  model->SampleSecondaries(&secParticles,track->GetMaterialCutsCouple(),
1492  dp,subcut,cut);
1493 
1494  // position of subcutoff particles
1495  G4ThreeVector r = prepoint + fragment*dr;
1496  std::vector<G4DynamicParticle*>::iterator it;
1497  for(it=secParticles.begin(); it!=secParticles.end(); ++it) {
1498 
1499  G4Track* t = new G4Track((*it), pretime + fragment*dt, r);
1501  t->SetCreatorModelIndex(subsecID);
1502  tracks.push_back(t);
1503  esec += t->GetKineticEnergy();
1504  if (t->GetParticleDefinition() == thePositron) {
1505  esec += 2.0*electron_mass_c2;
1506  }
1507 
1508  /*
1509  if(-1 < verboseLevel)
1510  G4cout << "New track "
1511  << t->GetParticleDefinition()->GetParticleName()
1512  << " e(keV)= " << t->GetKineticEnergy()/keV
1513  << " fragment= " << fragment
1514  << G4endl;
1515  */
1516  }
1517  } while (fragment <= 1.0);
1518  return esec;
1519 }
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
G4double GetKineticEnergy() const
G4double GetStepLength() const
const G4DynamicParticle * GetDynamicParticle() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
void SetCreatorModelIndex(G4int idx)
Definition: G4Track.hh:245
G4StepPoint * GetPreStepPoint() const
G4double GetKineticEnergy() const
#define G4UniformRand()
Definition: Randomize.hh:87
const G4ThreeVector & GetPosition() const
const G4ParticleDefinition * GetParticleDefinition() const
float electron_mass_c2
Definition: hepunit.py:274
const G4TouchableHandle & GetTouchableHandle() const
G4StepPoint * GetPostStepPoint() const
G4double GetGlobalTime() const
double G4double
Definition: G4Types.hh:76
G4Track * GetTrack() const
float perMillion
Definition: hepunit.py:241
const G4ParticleDefinition * G4VEnergyLossProcess::SecondaryParticle ( ) const
inline

Definition at line 923 of file G4VEnergyLossProcess.hh.

924 {
925  return secondaryParticle;
926 }
G4PhysicsTable * G4VEnergyLossProcess::SecondaryRangeTable ( ) const
inline

Definition at line 1131 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable().

1132 {
1133  return theSecondaryRangeTable;
1134 }
void G4VEnergyLossProcess::SelectModel ( G4double  kinEnergy)
inlineprotected

Definition at line 612 of file G4VEnergyLossProcess.hh.

References G4EmModelManager::SelectModel(), and G4VEmModel::SetCurrentCouple().

Referenced by CrossSectionPerVolume(), GetDEDXDispersion(), PostStepDoIt(), and PostStepGetPhysicalInteractionLength().

613 {
614  currentModel = modelManager->SelectModel(kinEnergy, currentCoupleIndex);
615  currentModel->SetCurrentCouple(currentCouple);
616 }
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:419
G4VEmModel * SelectModel(G4double &energy, size_t &index)
G4VEmModel * G4VEnergyLossProcess::SelectModelForMaterial ( G4double  kinEnergy,
size_t &  idx 
) const
inline

Definition at line 620 of file G4VEnergyLossProcess.hh.

References G4EmModelManager::SelectModel().

Referenced by G4ContinuousGainOfEnergy::GetContinuousStepLimit().

622 {
623  return modelManager->SelectModel(kinEnergy, idx);
624 }
G4VEmModel * SelectModel(G4double &energy, size_t &index)
void G4VEnergyLossProcess::SetBaseParticle ( const G4ParticleDefinition p)
inline
void G4VEnergyLossProcess::SetCrossSectionBiasingFactor ( G4double  f,
G4bool  flag = true 
)

Definition at line 2164 of file G4VEnergyLossProcess.cc.

References G4cout, G4endl, G4VProcess::GetProcessName(), and G4VProcess::verboseLevel.

Referenced by G4EmProcessOptions::SetProcessBiasingFactor().

2166 {
2167  if(f > 0.0) {
2168  biasFactor = f;
2169  weightFlag = flag;
2170  if(1 < verboseLevel) {
2171  G4cout << "### SetCrossSectionBiasingFactor: for "
2172  << " process " << GetProcessName()
2173  << " biasFactor= " << f << " weightFlag= " << flag
2174  << G4endl;
2175  }
2176  }
2177 }
G4int verboseLevel
Definition: G4VProcess.hh:368
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
void G4VEnergyLossProcess::SetCSDARangeTable ( G4PhysicsTable pRange)

Definition at line 2020 of file G4VEnergyLossProcess.cc.

References G4PhysicsTable::length(), n, and G4PhysicsVector::Value().

Referenced by BuildPhysicsTable().

2021 {
2022  theCSDARangeTable = p;
2023 
2024  if(p) {
2025  size_t n = p->length();
2026  G4PhysicsVector* pv;
2027  G4double emax = maxKinEnergyCSDA;
2028 
2029  for (size_t i=0; i<n; ++i) {
2030  pv = (*p)[i];
2031  G4double rmax = 0.0;
2032  if(pv) { rmax = pv->Value(emax, idxCSDA); }
2033  else {
2034  pv = (*p)[(*theDensityIdx)[i]];
2035  if(pv) { rmax = pv->Value(emax, idxCSDA)/(*theDensityFactor)[i]; }
2036  }
2037  theRangeAtMaxEnergy[i] = rmax;
2038  //G4cout << "i= " << i << " Emax(MeV)= " << emax/MeV << " Rmax= "
2039  //<< rmax<< G4endl;
2040  }
2041  }
2042 }
const char * p
Definition: xmltok.h:285
const G4int n
G4double Value(G4double theEnergy, size_t &lastidx) const
double G4double
Definition: G4Types.hh:76
void G4VEnergyLossProcess::SetDEDXBinning ( G4int  nbins)
inline
void G4VEnergyLossProcess::SetDEDXBinningForCSDARange ( G4int  nbins)
inline

Definition at line 1032 of file G4VEnergyLossProcess.hh.

1033 {
1034  nBinsCSDA = nbins;
1035 }
void G4VEnergyLossProcess::SetDEDXTable ( G4PhysicsTable p,
G4EmTableType  tType 
)

Definition at line 1962 of file G4VEnergyLossProcess.cc.

References fIsIonisation, fIsSubIonisation, fRestricted, fSubRestricted, fTotal, G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), G4PhysicsTable::length(), n, and G4PhysicsVector::Value().

Referenced by BuildPhysicsTable().

1963 {
1964  G4bool verb = false;
1965  if(fTotal == tType) {
1966  theDEDXunRestrictedTable = p;
1967  if(p) {
1968  size_t n = p->length();
1969  G4PhysicsVector* pv = (*p)[0];
1970  G4double emax = maxKinEnergyCSDA;
1971 
1972  for (size_t i=0; i<n; ++i) {
1973  G4double dedx = 0.0;
1974  pv = (*p)[i];
1975  if(pv) {
1976  dedx = pv->Value(emax, idxDEDXunRestricted);
1977  } else {
1978  pv = (*p)[(*theDensityIdx)[i]];
1979  if(pv) {
1980  dedx =
1981  pv->Value(emax, idxDEDXunRestricted)*(*theDensityFactor)[i];
1982  }
1983  }
1984  theDEDXAtMaxEnergy[i] = dedx;
1985  //G4cout << "i= " << i << " emax(MeV)= " << emax/MeV<< " dedx= "
1986  //<< dedx << G4endl;
1987  }
1988  }
1989 
1990  } else if(fRestricted == tType) {
1991  if(verb) {
1992  G4cout<< "G4VEnergyLossProcess::SetDEDXTable "
1993  << particle->GetParticleName()
1994  << " oldTable " << theDEDXTable << " newTable " << p
1995  << " ion " << theIonisationTable
1996  << " IsMaster " << isMaster
1997  << " " << GetProcessName() << G4endl;
1998  G4cout << (*p) << G4endl;
1999  }
2000  theDEDXTable = p;
2001  } else if(fSubRestricted == tType) {
2002  theDEDXSubTable = p;
2003  } else if(fIsIonisation == tType) {
2004  if(verb) {
2005  G4cout<< "G4VEnergyLossProcess::SetIonisationTable "
2006  << particle->GetParticleName()
2007  << " oldTable " << theDEDXTable << " newTable " << p
2008  << " ion " << theIonisationTable
2009  << " IsMaster " << isMaster
2010  << " " << GetProcessName() << G4endl;
2011  }
2012  theIonisationTable = p;
2013  } else if(fIsSubIonisation == tType) {
2014  theIonisationSubTable = p;
2015  }
2016 }
const char * p
Definition: xmltok.h:285
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4int n
G4double Value(G4double theEnergy, size_t &lastidx) const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
size_t length() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void G4VEnergyLossProcess::SetDynamicMassCharge ( G4double  massratio,
G4double  charge2ratio 
)
inline

Definition at line 645 of file G4VEnergyLossProcess.hh.

Referenced by G4ContinuousGainOfEnergy::AlongStepDoIt(), and G4ContinuousGainOfEnergy::GetContinuousStepLimit().

647 {
648  massRatio = massratio;
649  fFactor = charge2ratio*biasFactor*(*theDensityFactor)[currentCoupleIndex];
650  chargeSqRatio = charge2ratio;
651  reduceFactor = 1.0/(fFactor*massRatio);
652 }
void G4VEnergyLossProcess::SetEmModel ( G4VEmModel p,
G4int  index = 1 
)

Definition at line 362 of file G4VEnergyLossProcess.cc.

References n.

Referenced by DicomPhysicsList::ConstructEM(), DMXPhysicsList::ConstructEM(), G4EmLowEPPhysics::ConstructProcess(), G4EmLivermorePolarizedPhysics::ConstructProcess(), G4EmPenelopePhysics::ConstructProcess(), G4EmLivermorePhysics::ConstructProcess(), PhysListEmStandardGS::ConstructProcess(), PhysListEmStandardNR::ConstructProcess(), PhysListEmStandardWVI::ConstructProcess(), PhysListEmStandard_WVI::ConstructProcess(), PhysListEmStandard_GS::ConstructProcess(), PhysListEmStandard_option0::ConstructProcess(), PhysListEmStandard_option3::ConstructProcess(), PhysListEmStandard_SS::ConstructProcess(), GammaRayTelEMlowePhysics::ConstructProcess(), G4EmStandardPhysics_option3::ConstructProcess(), G4EmStandardPhysics_option4::ConstructProcess(), G4EmStandardPhysics_option2::ConstructProcess(), G4hPairProduction::InitialiseEnergyLossProcess(), G4alphaIonisation::InitialiseEnergyLossProcess(), G4hBremsstrahlung::InitialiseEnergyLossProcess(), G4MuPairProduction::InitialiseEnergyLossProcess(), G4eIonisation::InitialiseEnergyLossProcess(), G4eBremsstrahlung::InitialiseEnergyLossProcess(), G4ionIonisation::InitialiseEnergyLossProcess(), G4MuBremsstrahlung::InitialiseEnergyLossProcess(), G4MuIonisation::InitialiseEnergyLossProcess(), and G4hIonisation::InitialiseEnergyLossProcess().

363 {
364  G4int n = emModels.size();
365  if(index >= n) { for(G4int i=n; i<=index; ++i) {emModels.push_back(0);} }
366  emModels[index] = p;
367 }
const char * p
Definition: xmltok.h:285
int G4int
Definition: G4Types.hh:78
const G4int n
void G4VEnergyLossProcess::SetFluctModel ( G4VEmFluctuationModel p)
inline
void G4VEnergyLossProcess::SetIntegral ( G4bool  val)
inline

Definition at line 944 of file G4VEnergyLossProcess.hh.

Referenced by G4EmManager::Register(), and G4LossTableManager::Register().

945 {
946  integral = val;
947 }
void G4VEnergyLossProcess::SetInverseRangeTable ( G4PhysicsTable p)

Definition at line 2070 of file G4VEnergyLossProcess.cc.

References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), and G4VProcess::verboseLevel.

Referenced by BuildPhysicsTable().

2071 {
2072  theInverseRangeTable = p;
2073  if(1 < verboseLevel) {
2074  G4cout << "### Set InverseRange table " << p
2075  << " for " << particle->GetParticleName()
2076  << " and process " << GetProcessName() << G4endl;
2077  }
2078 }
G4int verboseLevel
Definition: G4VProcess.hh:368
const char * p
Definition: xmltok.h:285
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
void G4VEnergyLossProcess::SetIonisation ( G4bool  val)
inline
void G4VEnergyLossProcess::SetLambdaBinning ( G4int  nbins)
inline

Definition at line 1025 of file G4VEnergyLossProcess.hh.

1026 {
1027  nBins = nbins;
1028 }
void G4VEnergyLossProcess::SetLambdaFactor ( G4double  val)
inline

Definition at line 988 of file G4VEnergyLossProcess.hh.

Referenced by G4EmProcessOptions::SetLambdaFactor().

989 {
990  if(val > 0.0 && val <= 1.0) { lambdaFactor = val; }
991 }
void G4VEnergyLossProcess::SetLambdaTable ( G4PhysicsTable p)

Definition at line 2082 of file G4VEnergyLossProcess.cc.

References DBL_MAX, G4PhysicsVector::Energy(), G4cout, G4endl, G4LossTableBuilder::GetCoupleIndexes(), G4LossTableBuilder::GetDensityFactors(), G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), G4LossTableManager::GetTableBuilder(), G4PhysicsVector::GetVectorLength(), G4PhysicsTable::length(), python.hepunit::MeV, n, smax, and G4VProcess::verboseLevel.

Referenced by BuildPhysicsTable().

2083 {
2084  if(1 < verboseLevel) {
2085  G4cout << "### Set Lambda table " << p
2086  << " for " << particle->GetParticleName()
2087  << " and process " << GetProcessName() << G4endl;
2088  }
2089  theLambdaTable = p;
2090  tablesAreBuilt = true;
2091 
2092  G4LossTableBuilder* bld = lManager->GetTableBuilder();
2093  theDensityFactor = bld->GetDensityFactors();
2094  theDensityIdx = bld->GetCoupleIndexes();
2095 
2096  if(theLambdaTable) {
2097  size_t n = theLambdaTable->length();
2098  G4PhysicsVector* pv = (*theLambdaTable)[0];
2099  G4double e, ss, smax, emax;
2100 
2101  size_t i;
2102 
2103  // first loop on existing vectors
2104  for (i=0; i<n; ++i) {
2105  pv = (*theLambdaTable)[i];
2106  if(pv) {
2107  size_t nb = pv->GetVectorLength();
2108  emax = DBL_MAX;
2109  smax = 0.0;
2110  if(nb > 0) {
2111  for (size_t j=0; j<nb; ++j) {
2112  e = pv->Energy(j);
2113  ss = (*pv)(j);
2114  if(ss > smax) {
2115  smax = ss;
2116  emax = e;
2117  }
2118  }
2119  }
2120  theEnergyOfCrossSectionMax[i] = emax;
2121  theCrossSectionMax[i] = smax;
2122  if(1 < verboseLevel) {
2123  G4cout << "For " << particle->GetParticleName()
2124  << " Max CS at i= " << i << " emax(MeV)= " << emax/MeV
2125  << " lambda= " << smax << G4endl;
2126  }
2127  }
2128  }
2129  // second loop using base materials
2130  for (i=0; i<n; ++i) {
2131  pv = (*theLambdaTable)[i];
2132  if(!pv){
2133  G4int j = (*theDensityIdx)[i];
2134  theEnergyOfCrossSectionMax[i] = theEnergyOfCrossSectionMax[j];
2135  theCrossSectionMax[i] = (*theDensityFactor)[i]*theCrossSectionMax[j];
2136  }
2137  }
2138  }
2139 }
const std::vector< G4double > * GetDensityFactors()
G4int verboseLevel
Definition: G4VProcess.hh:368
const char * p
Definition: xmltok.h:285
size_t GetVectorLength() const
int G4int
Definition: G4Types.hh:78
const G4int smax
const G4String & GetParticleName() const
G4LossTableBuilder * GetTableBuilder()
G4GLOB_DLL std::ostream G4cout
const G4int n
G4double Energy(size_t index) const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
size_t length() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
const std::vector< G4int > * GetCoupleIndexes()
void G4VEnergyLossProcess::SetLinearLossLimit ( G4double  val)
inline

Definition at line 974 of file G4VEnergyLossProcess.hh.

Referenced by G4alphaIonisation::G4alphaIonisation(), and G4ionIonisation::G4ionIonisation().

975 {
976  linLossLimit = val;
977 }
void G4VEnergyLossProcess::SetLossFluctuations ( G4bool  val)
inline
void G4VEnergyLossProcess::SetLowestEnergyLimit ( G4double  val)
inline

Definition at line 1004 of file G4VEnergyLossProcess.hh.

Referenced by G4EmUserPhysics::ConstructProcess().

1005 {
1006  lowestKinEnergy = val;
1007 }
void G4VEnergyLossProcess::SetMaxKinEnergy ( G4double  e)
inline

Definition at line 1053 of file G4VEnergyLossProcess.hh.

Referenced by G4MonopolePhysics::ConstructProcess(), G4mplIonisation::InitialiseEnergyLossProcess(), G4hhIonisation::InitialiseEnergyLossProcess(), G4EmManager::Register(), and G4LossTableManager::Register().

1054 {
1055  maxKinEnergy = e;
1056  if(e < maxKinEnergyCSDA) { maxKinEnergyCSDA = e; }
1057 }
void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange ( G4double  e)
inline

Definition at line 1068 of file G4VEnergyLossProcess.hh.

1069 {
1070  maxKinEnergyCSDA = e;
1071 }
void G4VEnergyLossProcess::SetMinKinEnergy ( G4double  e)
inline
void G4VEnergyLossProcess::SetMinSubRange ( G4double  val)
inline

Definition at line 981 of file G4VEnergyLossProcess.hh.

982 {
983  minSubRange = val;
984 }
void G4VEnergyLossProcess::SetParticle ( const G4ParticleDefinition p)
inlineprotected

Definition at line 888 of file G4VEnergyLossProcess.hh.

889 {
890  particle = p;
891 }
const char * p
Definition: xmltok.h:285
void G4VEnergyLossProcess::SetRandomStep ( G4bool  val)
inline

Definition at line 937 of file G4VEnergyLossProcess.hh.

Referenced by G4EmManager::Register(), and G4LossTableManager::Register().

938 {
939  rndmStepFlag = val;
940 }
void G4VEnergyLossProcess::SetRangeTableForLoss ( G4PhysicsTable p)

Definition at line 2046 of file G4VEnergyLossProcess.cc.

References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), and G4VProcess::verboseLevel.

Referenced by BuildPhysicsTable().

2047 {
2048  theRangeTableForLoss = p;
2049  if(1 < verboseLevel) {
2050  G4cout << "### Set Range table " << p
2051  << " for " << particle->GetParticleName()
2052  << " and process " << GetProcessName() << G4endl;
2053  }
2054 }
G4int verboseLevel
Definition: G4VProcess.hh:368
const char * p
Definition: xmltok.h:285
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
void G4VEnergyLossProcess::SetSecondaryParticle ( const G4ParticleDefinition p)
inlineprotected
void G4VEnergyLossProcess::SetSecondaryRangeTable ( G4PhysicsTable p)

Definition at line 2058 of file G4VEnergyLossProcess.cc.

References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), and G4VProcess::verboseLevel.

Referenced by BuildPhysicsTable().

2059 {
2060  theSecondaryRangeTable = p;
2061  if(1 < verboseLevel) {
2062  G4cout << "### Set SecondaryRange table " << p
2063  << " for " << particle->GetParticleName()
2064  << " and process " << GetProcessName() << G4endl;
2065  }
2066 }
G4int verboseLevel
Definition: G4VProcess.hh:368
const char * p
Definition: xmltok.h:285
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
void G4VEnergyLossProcess::SetStepFunction ( G4double  v1,
G4double  v2 
)
inline
void G4VEnergyLossProcess::SetSubLambdaTable ( G4PhysicsTable p)

Definition at line 2143 of file G4VEnergyLossProcess.cc.

References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), and G4VProcess::verboseLevel.

Referenced by BuildPhysicsTable().

2144 {
2145  theSubLambdaTable = p;
2146  if(1 < verboseLevel) {
2147  G4cout << "### Set SebLambda table " << p
2148  << " for " << particle->GetParticleName()
2149  << " and process " << GetProcessName() << G4endl;
2150  }
2151 }
G4int verboseLevel
Definition: G4VProcess.hh:368
const char * p
Definition: xmltok.h:285
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
void G4VEnergyLossProcess::StartTracking ( G4Track track)
virtual

Reimplemented from G4VProcess.

Definition at line 982 of file G4VEnergyLossProcess.cc.

References DBL_MAX, G4Track::GetDefinition(), G4Track::GetParentID(), G4ParticleDefinition::GetPDGMass(), python.hepunit::proton_mass_c2, G4EmBiasingManager::ResetForcedInteraction(), and G4VProcess::theNumberOfInteractionLengthLeft.

983 {
984  /*
985  G4cout << track->GetDefinition()->GetParticleName()
986  << " e(MeV)= " << track->GetKineticEnergy()
987  << " baseParticle " << baseParticle << " proc " << this;
988  if(particle) G4cout << " " << particle->GetParticleName();
989  G4cout << " isIon= " << isIon << " dedx " << theDEDXTable <<G4endl;
990  */
991  // reset parameters for the new track
993  mfpKinEnergy = DBL_MAX;
994  preStepRangeEnergy = 0.0;
995 
996  // reset ion
997  if(isIon) {
998  chargeSqRatio = 0.5;
999 
1000  G4double newmass = track->GetDefinition()->GetPDGMass();
1001  if(baseParticle) {
1002  massRatio = baseParticle->GetPDGMass()/newmass;
1003  } else if(theGenericIon) {
1004  massRatio = proton_mass_c2/newmass;
1005  } else {
1006  massRatio = 1.0;
1007  }
1008  }
1009  // forced biasing only for primary particles
1010  if(biasManager) {
1011  if(0 == track->GetParentID()) {
1012  // primary particle
1013  biasFlag = true;
1014  biasManager->ResetForcedInteraction();
1015  }
1016  }
1017 }
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
float proton_mass_c2
Definition: hepunit.py:275
G4double GetPDGMass() const
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
G4bool G4VEnergyLossProcess::StorePhysicsTable ( const G4ParticleDefinition part,
const G4String directory,
G4bool  ascii = false 
)
virtual

Reimplemented from G4VProcess.

Definition at line 1659 of file G4VEnergyLossProcess.cc.

References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), and G4VProcess::verboseLevel.

1662 {
1663  G4bool res = true;
1664  if ( baseParticle || part != particle ) return res;
1665 
1666  if(!StoreTable(part,theDEDXTable,ascii,directory,"DEDX"))
1667  {res = false;}
1668 
1669  if(!StoreTable(part,theDEDXunRestrictedTable,ascii,directory,"DEDXnr"))
1670  {res = false;}
1671 
1672  if(!StoreTable(part,theDEDXSubTable,ascii,directory,"SubDEDX"))
1673  {res = false;}
1674 
1675  if(!StoreTable(part,theIonisationTable,ascii,directory,"Ionisation"))
1676  {res = false;}
1677 
1678  if(!StoreTable(part,theIonisationSubTable,ascii,directory,"SubIonisation"))
1679  {res = false;}
1680 
1681  if(isIonisation &&
1682  !StoreTable(part,theCSDARangeTable,ascii,directory,"CSDARange"))
1683  {res = false;}
1684 
1685  if(isIonisation &&
1686  !StoreTable(part,theRangeTableForLoss,ascii,directory,"Range"))
1687  {res = false;}
1688 
1689  if(isIonisation &&
1690  !StoreTable(part,theInverseRangeTable,ascii,directory,"InverseRange"))
1691  {res = false;}
1692 
1693  if(!StoreTable(part,theLambdaTable,ascii,directory,"Lambda"))
1694  {res = false;}
1695 
1696  if(!StoreTable(part,theSubLambdaTable,ascii,directory,"SubLambda"))
1697  {res = false;}
1698 
1699  if ( res ) {
1700  if(0 < verboseLevel) {
1701  G4cout << "Physics tables are stored for "
1702  << particle->GetParticleName()
1703  << " and process " << GetProcessName()
1704  << " in the directory <" << directory
1705  << "> " << G4endl;
1706  }
1707  } else {
1708  G4cout << "Fail to store Physics Tables for "
1709  << particle->GetParticleName()
1710  << " and process " << GetProcessName()
1711  << " in the directory <" << directory
1712  << "> " << G4endl;
1713  }
1714  return res;
1715 }
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
G4PhysicsTable * G4VEnergyLossProcess::SubLambdaTable ( ) const
inline

Definition at line 1159 of file G4VEnergyLossProcess.hh.

Referenced by BuildPhysicsTable().

1160 {
1161  return theSubLambdaTable;
1162 }
G4bool G4VEnergyLossProcess::TablesAreBuilt ( ) const
inline

Definition at line 1082 of file G4VEnergyLossProcess.hh.

1083 {
1084  return tablesAreBuilt;
1085 }
void G4VEnergyLossProcess::UpdateEmModel ( const G4String nam,
G4double  emin,
G4double  emax 
)

Definition at line 354 of file G4VEnergyLossProcess.cc.

References G4EmModelManager::UpdateEmModel().

356 {
357  modelManager->UpdateEmModel(nam, emin, emax);
358 }
void UpdateEmModel(const G4String &, G4double, G4double)

Field Documentation

G4ParticleChangeForLoss G4VEnergyLossProcess::fParticleChange
protected

The documentation for this class was generated from the following files: