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

#include <G4RDVeLowEnergyLoss.hh>

Inheritance diagram for G4RDVeLowEnergyLoss:
G4VContinuousDiscreteProcess G4VProcess G4eLowEnergyLoss G4LowEnergyBremsstrahlung G4LowEnergyIonisation

Public Member Functions

 G4RDVeLowEnergyLoss (const G4String &, G4ProcessType aType=fNotDefined)
 
 G4RDVeLowEnergyLoss (G4RDVeLowEnergyLoss &)
 
virtual ~G4RDVeLowEnergyLoss ()
 
virtual G4double GetContinuousStepLimit (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety)=0
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &track, const G4Step &Step)=0
 
virtual G4double GetMeanFreePath (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)=0
 
virtual G4VParticleChangePostStepDoIt (const G4Track &track, const G4Step &Step)=0
 
- Public Member Functions inherited from G4VContinuousDiscreteProcess
 G4VContinuousDiscreteProcess (const G4String &, G4ProcessType aType=fNotDefined)
 
 G4VContinuousDiscreteProcess (G4VContinuousDiscreteProcess &)
 
virtual ~G4VContinuousDiscreteProcess ()
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
 
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)
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void PreparePhysicsTable (const G4ParticleDefinition &)
 
virtual G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
virtual G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
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 StartTracking (G4Track *)
 
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 &)
 

Static Public Member Functions

static void SetRndmStep (G4bool value)
 
static void SetEnlossFluc (G4bool value)
 
static void SetStepFunction (G4double c1, G4double c2)
 
- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 

Protected Member Functions

G4double GetLossWithFluct (const G4DynamicParticle *aParticle, const G4MaterialCutsCouple *couple, G4double MeanLoss, G4double step)
 
- 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 ()
 

Static Protected Member Functions

static G4PhysicsTableBuildRangeTable (G4PhysicsTable *theDEDXTable, G4PhysicsTable *theRangeTable, G4double Tmin, G4double Tmax, G4int nbin)
 
static G4PhysicsTableBuildLabTimeTable (G4PhysicsTable *theDEDXTable, G4PhysicsTable *theLabTimeTable, G4double Tmin, G4double Tmax, G4int nbin)
 
static G4PhysicsTableBuildProperTimeTable (G4PhysicsTable *theDEDXTable, G4PhysicsTable *ProperTimeTable, G4double Tmin, G4double Tmax, G4int nbin)
 
static G4PhysicsTableBuildRangeCoeffATable (G4PhysicsTable *theRangeTable, G4PhysicsTable *theCoeffATable, G4double Tmin, G4double Tmax, G4int nbin)
 
static G4PhysicsTableBuildRangeCoeffBTable (G4PhysicsTable *theRangeTable, G4PhysicsTable *theCoeffBTable, G4double Tmin, G4double Tmax, G4int nbin)
 
static G4PhysicsTableBuildRangeCoeffCTable (G4PhysicsTable *theRangeTable, G4PhysicsTable *theCoeffCTable, G4double Tmin, G4double Tmax, G4int nbin)
 
static G4PhysicsTableBuildInverseRangeTable (G4PhysicsTable *theRangeTable, G4PhysicsTable *theRangeCoeffATable, G4PhysicsTable *theRangeCoeffBTable, G4PhysicsTable *theRangeCoeffCTable, G4PhysicsTable *theInverseRangeTable, G4double Tmin, G4double Tmax, G4int nbin)
 

Protected Attributes

const G4MateriallastMaterial
 
G4int imat
 
G4double f1Fluct
 
G4double f2Fluct
 
G4double e1Fluct
 
G4double e2Fluct
 
G4double rateFluct
 
G4double ipotFluct
 
G4double e1LogFluct
 
G4double e2LogFluct
 
G4double ipotLogFluct
 
const G4int nmaxCont1
 
const G4int nmaxCont2
 
- 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
 

Static Protected Attributes

static G4double ParticleMass
 
static G4double taulow
 
static G4double tauhigh
 
static G4double ltaulow
 
static G4double ltauhigh
 
static G4double dRoverRange = 20*perCent
 
static G4double finalRange = 200*micrometer
 
static G4double c1lim = dRoverRange
 
static G4double c2lim = 2.*(1.-dRoverRange)*finalRange
 
static G4double c3lim = -(1.-dRoverRange)*finalRange*finalRange
 
static G4bool rndmStepFlag = false
 
static G4bool EnlossFlucFlag = true
 

Detailed Description

Definition at line 78 of file G4RDVeLowEnergyLoss.hh.

Constructor & Destructor Documentation

G4RDVeLowEnergyLoss::G4RDVeLowEnergyLoss ( const G4String aName,
G4ProcessType  aType = fNotDefined 
)

Definition at line 85 of file G4RDVeLowEnergyLoss.cc.

References G4RDVeLowEnergyLoss().

Referenced by G4RDVeLowEnergyLoss().

G4RDVeLowEnergyLoss::G4RDVeLowEnergyLoss ( G4RDVeLowEnergyLoss right)

Definition at line 101 of file G4RDVeLowEnergyLoss.cc.

References G4RDVeLowEnergyLoss().

G4RDVeLowEnergyLoss::~G4RDVeLowEnergyLoss ( )
virtual

Definition at line 95 of file G4RDVeLowEnergyLoss.cc.

96 {
97 }

Member Function Documentation

virtual G4VParticleChange* G4RDVeLowEnergyLoss::AlongStepDoIt ( const G4Track track,
const G4Step Step 
)
pure virtual

Reimplemented from G4VContinuousDiscreteProcess.

Implemented in G4eLowEnergyLoss.

G4PhysicsTable * G4RDVeLowEnergyLoss::BuildInverseRangeTable ( G4PhysicsTable theRangeTable,
G4PhysicsTable theRangeCoeffATable,
G4PhysicsTable theRangeCoeffBTable,
G4PhysicsTable theRangeCoeffCTable,
G4PhysicsTable theInverseRangeTable,
G4double  Tmin,
G4double  Tmax,
G4int  nbin 
)
staticprotected

Definition at line 514 of file G4RDVeLowEnergyLoss.cc.

References test::b, G4PhysicsTable::clearAndDestroy(), G4PhysicsVector::GetLowEdgeEnergy(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), G4PhysicsVector::GetValue(), G4PhysicsVector::GetVectorLength(), G4PhysicsTable::insert(), G4PhysicsVector::PutValue(), and test::v.

Referenced by G4eLowEnergyLoss::BuildDEDXTable().

523 {
524  G4bool b;
525 
527 
528  if(theInverseRangeTable)
529  { theInverseRangeTable->clearAndDestroy();
530  delete theInverseRangeTable; }
531  theInverseRangeTable = new G4PhysicsTable(numOfCouples);
532 
533  // loop for materials
534  for (G4int i=0; i<numOfCouples; i++)
535  {
536 
537  G4PhysicsVector* pv = (*theRangeTable)[i];
538  size_t nbins = pv->GetVectorLength();
539  G4double elow = pv->GetLowEdgeEnergy(0);
540  G4double ehigh = pv->GetLowEdgeEnergy(nbins-1);
541  G4double rlow = pv->GetValue(elow, b);
542  G4double rhigh = pv->GetValue(ehigh, b);
543 
544  rhigh *= std::exp(std::log(rhigh/rlow)/((G4double)(nbins-1)));
545 
546  G4PhysicsLogVector* v = new G4PhysicsLogVector(rlow, rhigh, nbins);
547 
548  v->PutValue(0,elow);
549  G4double energy1 = elow;
550  G4double range1 = rlow;
551  G4double energy2 = elow;
552  G4double range2 = rlow;
553  size_t ilow = 0;
554  size_t ihigh;
555 
556  for (size_t j=1; j<nbins; j++) {
557 
558  G4double range = v->GetLowEdgeEnergy(j);
559 
560  for (ihigh=ilow+1; ihigh<nbins; ihigh++) {
561  energy2 = pv->GetLowEdgeEnergy(ihigh);
562  range2 = pv->GetValue(energy2, b);
563  if(range2 >= range || ihigh == nbins-1) {
564  ilow = ihigh - 1;
565  energy1 = pv->GetLowEdgeEnergy(ilow);
566  range1 = pv->GetValue(energy1, b);
567  break;
568  }
569  }
570 
571  G4double e = std::log(energy1) + std::log(energy2/energy1)*std::log(range/range1)/std::log(range2/range1);
572 
573  v->PutValue(j,std::exp(e));
574  }
575  theInverseRangeTable->insert(v);
576 
577  }
578  return theInverseRangeTable ;
579 }
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
void insert(G4PhysicsVector *)
size_t GetVectorLength() const
G4double GetLowEdgeEnergy(size_t binNumber) const
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
void PutValue(size_t index, G4double theValue)
static G4ProductionCutsTable * GetProductionCutsTable()
double G4double
Definition: G4Types.hh:76
void clearAndDestroy()
G4PhysicsTable * G4RDVeLowEnergyLoss::BuildLabTimeTable ( G4PhysicsTable theDEDXTable,
G4PhysicsTable theLabTimeTable,
G4double  Tmin,
G4double  Tmax,
G4int  nbin 
)
staticprotected

Definition at line 262 of file G4RDVeLowEnergyLoss.cc.

References G4PhysicsTable::clearAndDestroy(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), and G4PhysicsTable::insert().

Referenced by G4eLowEnergyLoss::BuildDEDXTable().

267 {
268 
270 
271  if(theLabTimeTable)
272  { theLabTimeTable->clearAndDestroy();
273  delete theLabTimeTable; }
274  theLabTimeTable = new G4PhysicsTable(numOfCouples);
275 
276 
277  for (G4int J=0; J<numOfCouples; J++)
278  {
279  G4PhysicsLogVector* aVector;
280 
281  aVector = new G4PhysicsLogVector(lowestKineticEnergy,
282  highestKineticEnergy,TotBin);
283 
284  BuildLabTimeVector(theDEDXTable,
285  lowestKineticEnergy,highestKineticEnergy,TotBin,J,aVector);
286  theLabTimeTable->insert(aVector);
287 
288 
289  }
290  return theLabTimeTable ;
291 }
void insert(G4PhysicsVector *)
int G4int
Definition: G4Types.hh:78
static G4ProductionCutsTable * GetProductionCutsTable()
void clearAndDestroy()
G4PhysicsTable * G4RDVeLowEnergyLoss::BuildProperTimeTable ( G4PhysicsTable theDEDXTable,
G4PhysicsTable ProperTimeTable,
G4double  Tmin,
G4double  Tmax,
G4int  nbin 
)
staticprotected

Definition at line 295 of file G4RDVeLowEnergyLoss.cc.

References G4PhysicsTable::clearAndDestroy(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), and G4PhysicsTable::insert().

Referenced by G4eLowEnergyLoss::BuildDEDXTable().

300 {
301 
303 
304  if(theProperTimeTable)
305  { theProperTimeTable->clearAndDestroy();
306  delete theProperTimeTable; }
307  theProperTimeTable = new G4PhysicsTable(numOfCouples);
308 
309 
310  for (G4int J=0; J<numOfCouples; J++)
311  {
312  G4PhysicsLogVector* aVector;
313 
314  aVector = new G4PhysicsLogVector(lowestKineticEnergy,
315  highestKineticEnergy,TotBin);
316 
317  BuildProperTimeVector(theDEDXTable,
318  lowestKineticEnergy,highestKineticEnergy,TotBin,J,aVector);
319  theProperTimeTable->insert(aVector);
320 
321 
322  }
323  return theProperTimeTable ;
324 }
int G4int
Definition: G4Types.hh:78
static G4ProductionCutsTable * GetProductionCutsTable()
G4PhysicsTable * G4RDVeLowEnergyLoss::BuildRangeCoeffATable ( G4PhysicsTable theRangeTable,
G4PhysicsTable theCoeffATable,
G4double  Tmin,
G4double  Tmax,
G4int  nbin 
)
staticprotected

Definition at line 639 of file G4RDVeLowEnergyLoss.cc.

References G4PhysicsTable::clearAndDestroy(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), G4PhysicsVector::GetValue(), G4PhysicsTable::insert(), and G4PhysicsVector::PutValue().

Referenced by G4eLowEnergyLoss::BuildDEDXTable().

645 {
646 
648 
649  if(theRangeCoeffATable)
650  { theRangeCoeffATable->clearAndDestroy();
651  delete theRangeCoeffATable; }
652  theRangeCoeffATable = new G4PhysicsTable(numOfCouples);
653 
654  G4double RTable = std::exp(std::log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
655  G4double R2 = RTable*RTable ;
656  G4double R1 = RTable+1.;
657  G4double w = R1*(RTable-1.)*(RTable-1.);
658  G4double w1 = RTable/w , w2 = -RTable*R1/w , w3 = R2/w ;
659  G4double Ti , Tim , Tip , Ri , Rim , Rip , Value ;
660  G4bool isOut;
661 
662  // loop for materials
663  for (G4int J=0; J<numOfCouples; J++)
664  {
665  G4int binmax=TotBin ;
666  G4PhysicsLinearVector* aVector =
667  new G4PhysicsLinearVector(0.,binmax, TotBin);
668  Ti = lowestKineticEnergy ;
669  G4PhysicsVector* rangeVector= (*theRangeTable)[J];
670 
671  for ( G4int i=0; i<TotBin; i++)
672  {
673  Ri = rangeVector->GetValue(Ti,isOut) ;
674  if ( i==0 )
675  Rim = 0. ;
676  else
677  {
678  Tim = Ti/RTable ;
679  Rim = rangeVector->GetValue(Tim,isOut);
680  }
681  if ( i==(TotBin-1))
682  Rip = Ri ;
683  else
684  {
685  Tip = Ti*RTable ;
686  Rip = rangeVector->GetValue(Tip,isOut);
687  }
688  Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti) ;
689 
690  aVector->PutValue(i,Value);
691  Ti = RTable*Ti ;
692  }
693 
694  theRangeCoeffATable->insert(aVector);
695  }
696  return theRangeCoeffATable ;
697 }
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
void PutValue(size_t index, G4double theValue)
static G4ProductionCutsTable * GetProductionCutsTable()
double G4double
Definition: G4Types.hh:76
G4PhysicsTable * G4RDVeLowEnergyLoss::BuildRangeCoeffBTable ( G4PhysicsTable theRangeTable,
G4PhysicsTable theCoeffBTable,
G4double  Tmin,
G4double  Tmax,
G4int  nbin 
)
staticprotected

Definition at line 701 of file G4RDVeLowEnergyLoss.cc.

References G4PhysicsTable::clearAndDestroy(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), G4PhysicsVector::GetValue(), G4PhysicsTable::insert(), and G4PhysicsVector::PutValue().

Referenced by G4eLowEnergyLoss::BuildDEDXTable().

707 {
708 
710 
711  if(theRangeCoeffBTable)
712  { theRangeCoeffBTable->clearAndDestroy();
713  delete theRangeCoeffBTable; }
714  theRangeCoeffBTable = new G4PhysicsTable(numOfCouples);
715 
716  G4double RTable = std::exp(std::log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
717  G4double R2 = RTable*RTable ;
718  G4double R1 = RTable+1.;
719  G4double w = R1*(RTable-1.)*(RTable-1.);
720  G4double w1 = -R1/w , w2 = R1*(R2+1.)/w , w3 = -R2*R1/w ;
721  G4double Ti , Tim , Tip , Ri , Rim , Rip , Value ;
722  G4bool isOut;
723 
724  // loop for materials
725  for (G4int J=0; J<numOfCouples; J++)
726  {
727  G4int binmax=TotBin ;
728  G4PhysicsLinearVector* aVector =
729  new G4PhysicsLinearVector(0.,binmax, TotBin);
730  Ti = lowestKineticEnergy ;
731  G4PhysicsVector* rangeVector= (*theRangeTable)[J];
732 
733  for ( G4int i=0; i<TotBin; i++)
734  {
735  Ri = rangeVector->GetValue(Ti,isOut) ;
736  if ( i==0 )
737  Rim = 0. ;
738  else
739  {
740  Tim = Ti/RTable ;
741  Rim = rangeVector->GetValue(Tim,isOut);
742  }
743  if ( i==(TotBin-1))
744  Rip = Ri ;
745  else
746  {
747  Tip = Ti*RTable ;
748  Rip = rangeVector->GetValue(Tip,isOut);
749  }
750  Value = (w1*Rip + w2*Ri + w3*Rim)/Ti;
751 
752  aVector->PutValue(i,Value);
753  Ti = RTable*Ti ;
754  }
755  theRangeCoeffBTable->insert(aVector);
756  }
757  return theRangeCoeffBTable ;
758 }
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
void PutValue(size_t index, G4double theValue)
static G4ProductionCutsTable * GetProductionCutsTable()
double G4double
Definition: G4Types.hh:76
G4PhysicsTable * G4RDVeLowEnergyLoss::BuildRangeCoeffCTable ( G4PhysicsTable theRangeTable,
G4PhysicsTable theCoeffCTable,
G4double  Tmin,
G4double  Tmax,
G4int  nbin 
)
staticprotected

Definition at line 762 of file G4RDVeLowEnergyLoss.cc.

References G4PhysicsTable::clearAndDestroy(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), G4PhysicsVector::GetValue(), G4PhysicsTable::insert(), and G4PhysicsVector::PutValue().

Referenced by G4eLowEnergyLoss::BuildDEDXTable().

768 {
769 
771 
772  if(theRangeCoeffCTable)
773  { theRangeCoeffCTable->clearAndDestroy();
774  delete theRangeCoeffCTable; }
775  theRangeCoeffCTable = new G4PhysicsTable(numOfCouples);
776 
777  G4double RTable = std::exp(std::log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
778  G4double R2 = RTable*RTable ;
779  G4double R1 = RTable+1.;
780  G4double w = R1*(RTable-1.)*(RTable-1.);
781  G4double w1 = 1./w , w2 = -RTable*R1/w , w3 = RTable*R2/w ;
782  G4double Ti , Tim , Tip , Ri , Rim , Rip , Value ;
783  G4bool isOut;
784 
785  // loop for materials
786  for (G4int J=0; J<numOfCouples; J++)
787  {
788  G4int binmax=TotBin ;
789  G4PhysicsLinearVector* aVector =
790  new G4PhysicsLinearVector(0.,binmax, TotBin);
791  Ti = lowestKineticEnergy ;
792  G4PhysicsVector* rangeVector= (*theRangeTable)[J];
793 
794  for ( G4int i=0; i<TotBin; i++)
795  {
796  Ri = rangeVector->GetValue(Ti,isOut) ;
797  if ( i==0 )
798  Rim = 0. ;
799  else
800  {
801  Tim = Ti/RTable ;
802  Rim = rangeVector->GetValue(Tim,isOut);
803  }
804  if ( i==(TotBin-1))
805  Rip = Ri ;
806  else
807  {
808  Tip = Ti*RTable ;
809  Rip = rangeVector->GetValue(Tip,isOut);
810  }
811  Value = w1*Rip + w2*Ri + w3*Rim ;
812 
813  aVector->PutValue(i,Value);
814  Ti = RTable*Ti ;
815  }
816  theRangeCoeffCTable->insert(aVector);
817  }
818  return theRangeCoeffCTable ;
819 }
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
void PutValue(size_t index, G4double theValue)
static G4ProductionCutsTable * GetProductionCutsTable()
double G4double
Definition: G4Types.hh:76
G4PhysicsTable * G4RDVeLowEnergyLoss::BuildRangeTable ( G4PhysicsTable theDEDXTable,
G4PhysicsTable theRangeTable,
G4double  Tmin,
G4double  Tmax,
G4int  nbin 
)
staticprotected

Definition at line 128 of file G4RDVeLowEnergyLoss.cc.

References G4PhysicsTable::clearAndDestroy(), G4PhysicsTable::insert(), and G4PhysicsTable::length().

Referenced by G4eLowEnergyLoss::BuildDEDXTable().

134 {
135 
136  G4int numOfCouples = theDEDXTable->length();
137 
138  if(theRangeTable)
139  { theRangeTable->clearAndDestroy();
140  delete theRangeTable; }
141  theRangeTable = new G4PhysicsTable(numOfCouples);
142 
143  // loop for materials
144 
145  for (G4int J=0; J<numOfCouples; J++)
146  {
147  G4PhysicsLogVector* aVector;
148  aVector = new G4PhysicsLogVector(lowestKineticEnergy,
149  highestKineticEnergy,TotBin);
150  BuildRangeVector(theDEDXTable,lowestKineticEnergy,highestKineticEnergy,
151  TotBin,J,aVector);
152  theRangeTable->insert(aVector);
153  }
154  return theRangeTable ;
155 }
void insert(G4PhysicsVector *)
int G4int
Definition: G4Types.hh:78
size_t length() const
void clearAndDestroy()
virtual G4double G4RDVeLowEnergyLoss::GetContinuousStepLimit ( const G4Track track,
G4double  previousStepSize,
G4double  currentMinimumStep,
G4double currentSafety 
)
pure virtual

Implements G4VContinuousDiscreteProcess.

Implemented in G4eLowEnergyLoss.

G4double G4RDVeLowEnergyLoss::GetLossWithFluct ( const G4DynamicParticle aParticle,
const G4MaterialCutsCouple couple,
G4double  MeanLoss,
G4double  step 
)
protected

Definition at line 823 of file G4RDVeLowEnergyLoss.cc.

References e1Fluct, e1LogFluct, e2Fluct, e2LogFluct, python.hepunit::electron_mass_c2, python.hepunit::eV, f1Fluct, f2Fluct, G4Poisson(), G4UniformRand, G4Material::GetElectronDensity(), G4IonisParamMat::GetEnergy0fluct(), G4IonisParamMat::GetEnergy1fluct(), G4IonisParamMat::GetEnergy2fluct(), G4IonisParamMat::GetF1fluct(), G4IonisParamMat::GetF2fluct(), G4MaterialCutsCouple::GetIndex(), G4Material::GetIonisation(), G4DynamicParticle::GetKineticEnergy(), G4IonisParamMat::GetLogEnergy1fluct(), G4IonisParamMat::GetLogEnergy2fluct(), G4IonisParamMat::GetLogMeanExcEnergy(), G4MaterialCutsCouple::GetMaterial(), G4IonisParamMat::GetMeanExcitationEnergy(), G4ProductionCutsTable::GetProductionCutsTable(), G4IonisParamMat::GetRateionexcfluct(), imat, ipotFluct, ipotLogFluct, lastMaterial, G4INCL::Math::max(), nmaxCont1, nmaxCont2, ParticleMass, rateFluct, G4INCL::DeJongSpin::shoot(), and python.hepunit::twopi_mc2_rcl2.

Referenced by G4eLowEnergyLoss::AlongStepDoIt().

829 {
830  static const G4double minLoss = 1.*eV ;
831  static const G4double probLim = 0.01 ;
832  static const G4double sumaLim = -std::log(probLim) ;
833  static const G4double alim=10.;
834  static const G4double kappa = 10. ;
835  static const G4double factor = twopi_mc2_rcl2 ;
836  const G4Material* aMaterial = couple->GetMaterial();
837 
838  // check if the material has changed ( cache mechanism)
839 
840  if (aMaterial != lastMaterial)
841  {
842  lastMaterial = aMaterial;
843  imat = couple->GetIndex();
844  f1Fluct = aMaterial->GetIonisation()->GetF1fluct();
845  f2Fluct = aMaterial->GetIonisation()->GetF2fluct();
846  e1Fluct = aMaterial->GetIonisation()->GetEnergy1fluct();
847  e2Fluct = aMaterial->GetIonisation()->GetEnergy2fluct();
848  e1LogFluct = aMaterial->GetIonisation()->GetLogEnergy1fluct();
849  e2LogFluct = aMaterial->GetIonisation()->GetLogEnergy2fluct();
850  rateFluct = aMaterial->GetIonisation()->GetRateionexcfluct();
853  }
854  G4double threshold,w1,w2,C,
855  beta2,suma,e0,loss,lossc,w;
856  G4double a1,a2,a3;
857  G4int p1,p2,p3;
858  G4int nb;
859  G4double Corrfac, na,alfa,rfac,namean,sa,alfa1,ea,sea;
860  // G4double dp1;
861  G4double dp3;
862  G4double siga ;
863 
864  // shortcut for very very small loss
865  if(MeanLoss < minLoss) return MeanLoss ;
866 
867  // get particle data
868  G4double Tkin = aParticle->GetKineticEnergy();
869 
870  // G4cout << "MGP -- Fluc Tkin " << Tkin/keV << " keV " << " MeanLoss = " << MeanLoss/keV << G4endl;
871 
873  ->GetEnergyCutsVector(1)))[imat];
875  G4double tau = Tkin/ParticleMass, tau1 = tau+1., tau2 = tau*(tau+2.);
876  G4double Tm = 2.*electron_mass_c2*tau2/(1.+2.*tau1*rmass+rmass*rmass);
877 
878  // G4cout << "MGP Particle mass " << ParticleMass/MeV << " Tm " << Tm << G4endl;
879 
880  if(Tm > threshold) Tm = threshold;
881  beta2 = tau2/(tau1*tau1);
882 
883  // Gaussian fluctuation ?
884  if(MeanLoss >= kappa*Tm || MeanLoss <= kappa*ipotFluct)
885  {
886  G4double electronDensity = aMaterial->GetElectronDensity() ;
887  siga = std::sqrt(Tm*(1.0-0.5*beta2)*step*
888  factor*electronDensity/beta2) ;
889  do {
890  loss = G4RandGauss::shoot(MeanLoss,siga) ;
891  } while (loss < 0. || loss > 2.0*MeanLoss);
892  return loss ;
893  }
894 
895  w1 = Tm/ipotFluct;
896  w2 = std::log(2.*electron_mass_c2*tau2);
897 
898  C = MeanLoss*(1.-rateFluct)/(w2-ipotLogFluct-beta2);
899 
900  a1 = C*f1Fluct*(w2-e1LogFluct-beta2)/e1Fluct;
901  a2 = C*f2Fluct*(w2-e2LogFluct-beta2)/e2Fluct;
902  a3 = rateFluct*MeanLoss*(Tm-ipotFluct)/(ipotFluct*Tm*std::log(w1));
903 
904  suma = a1+a2+a3;
905 
906  loss = 0. ;
907 
908  if(suma < sumaLim) // very small Step
909  {
910  e0 = aMaterial->GetIonisation()->GetEnergy0fluct();
911  // G4cout << "MGP e0 = " << e0/keV << G4endl;
912 
913  if(Tm == ipotFluct)
914  {
915  a3 = MeanLoss/e0;
916 
917  if(a3>alim)
918  {
919  siga=std::sqrt(a3) ;
920  p3 = std::max(0,G4int(G4RandGauss::shoot(a3,siga)+0.5));
921  }
922  else p3 = G4Poisson(a3);
923 
924  loss = p3*e0 ;
925 
926  if(p3 > 0) loss += (1.-2.*G4UniformRand())*e0 ;
927  // G4cout << "MGP very small step " << loss/keV << G4endl;
928  }
929  else
930  {
931  // G4cout << "MGP old Tm = " << Tm << " " << ipotFluct << " " << e0 << G4endl;
932  Tm = Tm-ipotFluct+e0 ;
933 
934  // MGP ---- workaround to avoid log argument<0, TO BE CHECKED
935  if (Tm <= 0.)
936  {
937  loss = MeanLoss;
938  p3 = 0;
939  // G4cout << "MGP correction loss = MeanLoss " << loss/keV << G4endl;
940  }
941  else
942  {
943  a3 = MeanLoss*(Tm-e0)/(Tm*e0*std::log(Tm/e0));
944 
945  // G4cout << "MGP new Tm = " << Tm << " " << ipotFluct << " " << e0 << " a3= " << a3 << G4endl;
946 
947  if(a3>alim)
948  {
949  siga=std::sqrt(a3) ;
950  p3 = std::max(0,G4int(G4RandGauss::shoot(a3,siga)+0.5));
951  }
952  else
953  p3 = G4Poisson(a3);
954  //G4cout << "MGP p3 " << p3 << G4endl;
955 
956  }
957 
958  if(p3 > 0)
959  {
960  w = (Tm-e0)/Tm ;
961  if(p3 > nmaxCont2)
962  {
963  // G4cout << "MGP dp3 " << dp3 << " p3 " << p3 << " " << nmaxCont2 << G4endl;
964  dp3 = G4double(p3) ;
965  Corrfac = dp3/G4double(nmaxCont2) ;
966  p3 = nmaxCont2 ;
967  }
968  else
969  Corrfac = 1. ;
970 
971  for(G4int i=0; i<p3; i++) loss += 1./(1.-w*G4UniformRand()) ;
972  loss *= e0*Corrfac ;
973  // G4cout << "MGP Corrfac = " << Corrfac << " e0 = " << e0/keV << " loss = " << loss/keV << G4endl;
974  }
975  }
976  }
977 
978  else // not so small Step
979  {
980  // excitation type 1
981  if(a1>alim)
982  {
983  siga=std::sqrt(a1) ;
984  p1 = std::max(0,int(G4RandGauss::shoot(a1,siga)+0.5));
985  }
986  else
987  p1 = G4Poisson(a1);
988 
989  // excitation type 2
990  if(a2>alim)
991  {
992  siga=std::sqrt(a2) ;
993  p2 = std::max(0,int(G4RandGauss::shoot(a2,siga)+0.5));
994  }
995  else
996  p2 = G4Poisson(a2);
997 
998  loss = p1*e1Fluct+p2*e2Fluct;
999 
1000  // smearing to avoid unphysical peaks
1001  if(p2 > 0)
1002  loss += (1.-2.*G4UniformRand())*e2Fluct;
1003  else if (loss>0.)
1004  loss += (1.-2.*G4UniformRand())*e1Fluct;
1005 
1006  // ionisation .......................................
1007  if(a3 > 0.)
1008  {
1009  if(a3>alim)
1010  {
1011  siga=std::sqrt(a3) ;
1012  p3 = std::max(0,int(G4RandGauss::shoot(a3,siga)+0.5));
1013  }
1014  else
1015  p3 = G4Poisson(a3);
1016 
1017  lossc = 0.;
1018  if(p3 > 0)
1019  {
1020  na = 0.;
1021  alfa = 1.;
1022  if (p3 > nmaxCont2)
1023  {
1024  dp3 = G4double(p3);
1025  rfac = dp3/(G4double(nmaxCont2)+dp3);
1026  namean = G4double(p3)*rfac;
1027  sa = G4double(nmaxCont1)*rfac;
1028  na = G4RandGauss::shoot(namean,sa);
1029  if (na > 0.)
1030  {
1031  alfa = w1*G4double(nmaxCont2+p3)/(w1*G4double(nmaxCont2)+G4double(p3));
1032  alfa1 = alfa*std::log(alfa)/(alfa-1.);
1033  ea = na*ipotFluct*alfa1;
1034  sea = ipotFluct*std::sqrt(na*(alfa-alfa1*alfa1));
1035  lossc += G4RandGauss::shoot(ea,sea);
1036  }
1037  }
1038 
1039  nb = G4int(G4double(p3)-na);
1040  if (nb > 0)
1041  {
1042  w2 = alfa*ipotFluct;
1043  w = (Tm-w2)/Tm;
1044  for (G4int k=0; k<nb; k++) lossc += w2/(1.-w*G4UniformRand());
1045  }
1046  }
1047 
1048  loss += lossc;
1049  }
1050  }
1051 
1052  return loss ;
1053 }
ThreeVector shoot(const G4int Ap, const G4int Af)
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:224
G4long G4Poisson(G4double mean)
Definition: G4Poisson.hh:51
G4double GetKineticEnergy() const
G4double GetEnergy2fluct() const
G4double GetLogEnergy2fluct() const
static G4double ParticleMass
G4double GetLogMeanExcEnergy() const
int G4int
Definition: G4Types.hh:78
G4double GetEnergy0fluct() const
#define G4UniformRand()
Definition: Randomize.hh:87
G4double GetElectronDensity() const
Definition: G4Material.hh:215
float electron_mass_c2
Definition: hepunit.py:274
static G4ProductionCutsTable * GetProductionCutsTable()
G4double GetLogEnergy1fluct() const
G4double GetRateionexcfluct() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double GetMeanExcitationEnergy() const
G4double GetF2fluct() const
double G4double
Definition: G4Types.hh:76
const G4Material * lastMaterial
G4double GetF1fluct() const
const G4Material * GetMaterial() const
G4double GetEnergy1fluct() const
virtual G4double G4RDVeLowEnergyLoss::GetMeanFreePath ( const G4Track track,
G4double  previousStepSize,
G4ForceCondition condition 
)
pure virtual
virtual G4VParticleChange* G4RDVeLowEnergyLoss::PostStepDoIt ( const G4Track track,
const G4Step Step 
)
pure virtual
void G4RDVeLowEnergyLoss::SetEnlossFluc ( G4bool  value)
static

Definition at line 114 of file G4RDVeLowEnergyLoss.cc.

References EnlossFlucFlag.

115 {
117 }
const XML_Char int const XML_Char * value
void G4RDVeLowEnergyLoss::SetRndmStep ( G4bool  value)
static

Definition at line 109 of file G4RDVeLowEnergyLoss.cc.

References rndmStepFlag.

110 {
112 }
const XML_Char int const XML_Char * value
void G4RDVeLowEnergyLoss::SetStepFunction ( G4double  c1,
G4double  c2 
)
static

Definition at line 119 of file G4RDVeLowEnergyLoss.cc.

References plottest35::c1, c1lim, c2lim, c3lim, dRoverRange, and finalRange.

120 {
121  dRoverRange = c1;
122  finalRange = c2;
126 }
static G4double finalRange
static G4double dRoverRange
tuple c1
Definition: plottest35.py:14

Field Documentation

G4double G4RDVeLowEnergyLoss::c1lim = dRoverRange
staticprotected

Definition at line 238 of file G4RDVeLowEnergyLoss.hh.

Referenced by SetStepFunction().

G4double G4RDVeLowEnergyLoss::c2lim = 2.*(1.-dRoverRange)*finalRange
staticprotected

Definition at line 238 of file G4RDVeLowEnergyLoss.hh.

Referenced by SetStepFunction().

G4double G4RDVeLowEnergyLoss::c3lim = -(1.-dRoverRange)*finalRange*finalRange
staticprotected

Definition at line 238 of file G4RDVeLowEnergyLoss.hh.

Referenced by SetStepFunction().

G4double G4RDVeLowEnergyLoss::dRoverRange = 20*perCent
staticprotected

Definition at line 235 of file G4RDVeLowEnergyLoss.hh.

Referenced by SetStepFunction().

G4double G4RDVeLowEnergyLoss::e1Fluct
protected

Definition at line 126 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::e1LogFluct
protected

Definition at line 127 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::e2Fluct
protected

Definition at line 126 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::e2LogFluct
protected

Definition at line 127 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4bool G4RDVeLowEnergyLoss::EnlossFlucFlag = true
staticprotected

Definition at line 241 of file G4RDVeLowEnergyLoss.hh.

Referenced by G4eLowEnergyLoss::AlongStepDoIt(), and SetEnlossFluc().

G4double G4RDVeLowEnergyLoss::f1Fluct
protected

Definition at line 126 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::f2Fluct
protected

Definition at line 126 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::finalRange = 200*micrometer
staticprotected

Definition at line 237 of file G4RDVeLowEnergyLoss.hh.

Referenced by SetStepFunction().

G4int G4RDVeLowEnergyLoss::imat
protected

Definition at line 125 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::ipotFluct
protected

Definition at line 126 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::ipotLogFluct
protected

Definition at line 127 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

const G4Material* G4RDVeLowEnergyLoss::lastMaterial
protected

Definition at line 124 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::ltauhigh
staticprotected

Definition at line 232 of file G4RDVeLowEnergyLoss.hh.

G4double G4RDVeLowEnergyLoss::ltaulow
staticprotected

Definition at line 232 of file G4RDVeLowEnergyLoss.hh.

const G4int G4RDVeLowEnergyLoss::nmaxCont1
protected

Definition at line 129 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

const G4int G4RDVeLowEnergyLoss::nmaxCont2
protected

Definition at line 129 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::ParticleMass
staticprotected

Definition at line 232 of file G4RDVeLowEnergyLoss.hh.

Referenced by G4eLowEnergyLoss::BuildDEDXTable(), and GetLossWithFluct().

G4double G4RDVeLowEnergyLoss::rateFluct
protected

Definition at line 126 of file G4RDVeLowEnergyLoss.hh.

Referenced by GetLossWithFluct().

G4bool G4RDVeLowEnergyLoss::rndmStepFlag = false
staticprotected

Definition at line 240 of file G4RDVeLowEnergyLoss.hh.

Referenced by SetRndmStep().

G4double G4RDVeLowEnergyLoss::tauhigh
staticprotected

Definition at line 232 of file G4RDVeLowEnergyLoss.hh.

G4double G4RDVeLowEnergyLoss::taulow
staticprotected

Definition at line 232 of file G4RDVeLowEnergyLoss.hh.


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