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

#include <G4Cerenkov.hh>

Inheritance diagram for G4Cerenkov:
G4VProcess

Public Member Functions

 G4Cerenkov (const G4String &processName="Cerenkov", G4ProcessType type=fElectromagnetic)
 
 ~G4Cerenkov ()
 
 G4Cerenkov (const G4Cerenkov &right)
 
G4bool IsApplicable (const G4ParticleDefinition &aParticleType)
 
void BuildPhysicsTable (const G4ParticleDefinition &aParticleType)
 
G4double GetMeanFreePath (const G4Track &aTrack, G4double, G4ForceCondition *)
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &aTrack, G4double, G4ForceCondition *)
 
G4VParticleChangePostStepDoIt (const G4Track &aTrack, const G4Step &aStep)
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &, const G4Step &)
 
G4bool GetTrackSecondariesFirst () const
 
G4double GetMaxBetaChangePerStep () const
 
G4int GetMaxNumPhotonsPerStep () const
 
G4PhysicsTableGetPhysicsTable () const
 
void DumpPhysicsTable () const
 
- 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 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 SetTrackSecondariesFirst (const G4bool state)
 
static void SetMaxBetaChangePerStep (const G4double d)
 
static void SetMaxNumPhotonsPerStep (const G4int NumPhotons)
 
- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 

Protected Attributes

G4PhysicsTablethePhysicsTable
 
- 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

- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double previousStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 

Detailed Description

Definition at line 81 of file G4Cerenkov.hh.

Constructor & Destructor Documentation

G4Cerenkov::G4Cerenkov ( const G4String processName = "Cerenkov",
G4ProcessType  type = fElectromagnetic 
)

Definition at line 100 of file G4Cerenkov.cc.

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

101  : G4VProcess(processName, type)
102 {
104 
105  thePhysicsTable = NULL;
106 
107  if (verboseLevel>0) {
108  G4cout << GetProcessName() << " is created " << G4endl;
109  }
110 }
G4int verboseLevel
Definition: G4VProcess.hh:368
G4VProcess(const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
Definition: G4VProcess.cc:52
G4PhysicsTable * thePhysicsTable
Definition: G4Cerenkov.hh:210
G4GLOB_DLL std::ostream G4cout
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:432
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
G4Cerenkov::~G4Cerenkov ( )

Definition at line 120 of file G4Cerenkov.cc.

References G4PhysicsTable::clearAndDestroy(), and thePhysicsTable.

121 {
122  if (thePhysicsTable != NULL) {
124  delete thePhysicsTable;
125  }
126 }
G4PhysicsTable * thePhysicsTable
Definition: G4Cerenkov.hh:210
void clearAndDestroy()
G4Cerenkov::G4Cerenkov ( const G4Cerenkov right)

Member Function Documentation

virtual G4VParticleChange* G4Cerenkov::AlongStepDoIt ( const G4Track ,
const G4Step  
)
inlinevirtual

Implements G4VProcess.

Definition at line 153 of file G4Cerenkov.hh.

156  {return 0;};
virtual G4double G4Cerenkov::AlongStepGetPhysicalInteractionLength ( const G4Track ,
G4double  ,
G4double  ,
G4double ,
G4GPILSelection  
)
inlinevirtual

Implements G4VProcess.

Definition at line 134 of file G4Cerenkov.hh.

140  { return -1.0; };
virtual G4VParticleChange* G4Cerenkov::AtRestDoIt ( const G4Track ,
const G4Step  
)
inlinevirtual

Implements G4VProcess.

Definition at line 148 of file G4Cerenkov.hh.

151  {return 0;};
virtual G4double G4Cerenkov::AtRestGetPhysicalInteractionLength ( const G4Track ,
G4ForceCondition  
)
inlinevirtual

Implements G4VProcess.

Definition at line 142 of file G4Cerenkov.hh.

145  { return -1.0; };
void G4Cerenkov::BuildPhysicsTable ( const G4ParticleDefinition aParticleType)
virtual

Reimplemented from G4VProcess.

Definition at line 158 of file G4Cerenkov.cc.

References thePhysicsTable.

159 {
160  if (!thePhysicsTable) BuildThePhysicsTable();
161 }
G4PhysicsTable * thePhysicsTable
Definition: G4Cerenkov.hh:210
void G4Cerenkov::DumpPhysicsTable ( ) const
inline

Definition at line 245 of file G4Cerenkov.hh.

References G4PhysicsOrderedFreeVector::DumpValues(), G4PhysicsTable::entries(), thePhysicsTable, and test::v.

246 {
247  G4int PhysicsTableSize = thePhysicsTable->entries();
249 
250  for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
251  {
253  v->DumpValues();
254  }
255 }
G4PhysicsTable * thePhysicsTable
Definition: G4Cerenkov.hh:210
int G4int
Definition: G4Types.hh:78
size_t entries() const
G4double G4Cerenkov::GetMaxBetaChangePerStep ( ) const
inline

Definition at line 233 of file G4Cerenkov.hh.

234 {
235  return fMaxBetaChange;
236 }
G4int G4Cerenkov::GetMaxNumPhotonsPerStep ( ) const
inline

Definition at line 239 of file G4Cerenkov.hh.

240 {
241  return fMaxPhotons;
242 }
G4double G4Cerenkov::GetMeanFreePath ( const G4Track aTrack,
G4double  ,
G4ForceCondition  
)

Definition at line 487 of file G4Cerenkov.cc.

490 {
491  return 1.;
492 }
G4PhysicsTable * G4Cerenkov::GetPhysicsTable ( ) const
inline

Definition at line 258 of file G4Cerenkov.hh.

References thePhysicsTable.

259 {
260  return thePhysicsTable;
261 }
G4PhysicsTable * thePhysicsTable
Definition: G4Cerenkov.hh:210
G4bool G4Cerenkov::GetTrackSecondariesFirst ( ) const
inline

Definition at line 227 of file G4Cerenkov.hh.

228 {
229  return fTrackSecondariesFirst;
230 }
G4bool G4Cerenkov::IsApplicable ( const G4ParticleDefinition aParticleType)
virtual

Reimplemented from G4VProcess.

Definition at line 132 of file G4Cerenkov.cc.

References G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGMass(), and G4ParticleDefinition::IsShortLived().

Referenced by OpNovicePhysicsList::ConstructOp(), UltraPhysicsList::ConstructOp(), F04OpticalPhysics::ConstructProcess(), WLSOpticalPhysics::ConstructProcess(), and G4OpticalPhysics::ConstructProcess().

133 {
134  G4bool result = false;
135  if (aParticleType.GetPDGCharge() != 0.0 &&
136  aParticleType.GetPDGMass() != 0.0 &&
137  aParticleType.GetParticleName() != "chargedgeantino" &&
138  !aParticleType.IsShortLived() ) { result = true; }
139 
140  return result;
141 }
const G4String & GetParticleName() const
bool G4bool
Definition: G4Types.hh:79
G4double GetPDGMass() const
G4double GetPDGCharge() const
G4VParticleChange * G4Cerenkov::PostStepDoIt ( const G4Track aTrack,
const G4Step aStep 
)
virtual

Implements G4VProcess.

Definition at line 167 of file G4Cerenkov.cc.

References G4ParticleChange::AddSecondary(), G4VProcess::aParticleChange, fAlive, fSuspend, G4cout, G4endl, G4Poisson(), G4UniformRand, G4StepPoint::GetBeta(), G4DynamicParticle::GetDefinition(), G4Step::GetDeltaPosition(), G4Track::GetDynamicParticle(), G4StepPoint::GetGlobalTime(), G4Track::GetMaterial(), G4Material::GetMaterialPropertiesTable(), G4PhysicsOrderedFreeVector::GetMaxLowEdgeEnergy(), G4PhysicsOrderedFreeVector::GetMaxValue(), G4PhysicsOrderedFreeVector::GetMinLowEdgeEnergy(), G4VParticleChange::GetNumberOfSecondaries(), G4ParticleDefinition::GetPDGCharge(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4MaterialPropertiesTable::GetProperty(), G4Step::GetStepLength(), G4StepPoint::GetTouchableHandle(), G4Track::GetTrackID(), G4Track::GetTrackStatus(), G4StepPoint::GetVelocity(), G4ParticleChange::Initialize(), G4INCL::Math::max(), N, G4OpticalPhoton::OpticalPhoton(), G4VProcess::pParticleChange, G4VParticleChange::ProposeTrackStatus(), CLHEP::Hep3Vector::rotateUz(), G4DynamicParticle::SetKineticEnergy(), G4VParticleChange::SetNumberOfSecondaries(), G4Track::SetParentID(), G4DynamicParticle::SetPolarization(), G4Track::SetTouchableHandle(), python.hepunit::twopi, CLHEP::Hep3Vector::unit(), G4PhysicsVector::Value(), G4VProcess::verboseLevel, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

176 {
177  //////////////////////////////////////////////////////
178  // Should we ensure that the material is dispersive?
179  //////////////////////////////////////////////////////
180 
181  aParticleChange.Initialize(aTrack);
182 
183  const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
184  const G4Material* aMaterial = aTrack.GetMaterial();
185 
186  G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
187  G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
188 
189  G4ThreeVector x0 = pPreStepPoint->GetPosition();
190  G4ThreeVector p0 = aStep.GetDeltaPosition().unit();
191  G4double t0 = pPreStepPoint->GetGlobalTime();
192 
193  G4MaterialPropertiesTable* aMaterialPropertiesTable =
194  aMaterial->GetMaterialPropertiesTable();
195  if (!aMaterialPropertiesTable) return pParticleChange;
196 
197  G4MaterialPropertyVector* Rindex =
198  aMaterialPropertiesTable->GetProperty("RINDEX");
199  if (!Rindex) return pParticleChange;
200 
201  // particle charge
202  const G4double charge = aParticle->GetDefinition()->GetPDGCharge();
203 
204  // particle beta
205  const G4double beta = (pPreStepPoint ->GetBeta() +
206  pPostStepPoint->GetBeta())/2.;
207 
208  G4double MeanNumberOfPhotons =
209  GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
210 
211  if (MeanNumberOfPhotons <= 0.0) {
212 
213  // return unchanged particle and no secondaries
214 
216 
217  return pParticleChange;
218 
219  }
220 
221  G4double step_length;
222  step_length = aStep.GetStepLength();
223 
224  MeanNumberOfPhotons = MeanNumberOfPhotons * step_length;
225 
226  G4int NumPhotons = (G4int) G4Poisson(MeanNumberOfPhotons);
227 
228  if (NumPhotons <= 0) {
229 
230  // return unchanged particle and no secondaries
231 
233 
234  return pParticleChange;
235  }
236 
237  ////////////////////////////////////////////////////////////////
238 
240 
241  if (fTrackSecondariesFirst) {
242  if (aTrack.GetTrackStatus() == fAlive )
244  }
245 
246  ////////////////////////////////////////////////////////////////
247 
248  G4double Pmin = Rindex->GetMinLowEdgeEnergy();
249  G4double Pmax = Rindex->GetMaxLowEdgeEnergy();
250  G4double dp = Pmax - Pmin;
251 
252  G4double nMax = Rindex->GetMaxValue();
253 
254  G4double BetaInverse = 1./beta;
255 
256  G4double maxCos = BetaInverse / nMax;
257  G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
258 
259  const G4double beta1 = pPreStepPoint ->GetBeta();
260  const G4double beta2 = pPostStepPoint->GetBeta();
261 
262  G4double MeanNumberOfPhotons1 =
263  GetAverageNumberOfPhotons(charge,beta1,aMaterial,Rindex);
264  G4double MeanNumberOfPhotons2 =
265  GetAverageNumberOfPhotons(charge,beta2,aMaterial,Rindex);
266 
267  for (G4int i = 0; i < NumPhotons; i++) {
268 
269  // Determine photon energy
270 
271  G4double rand;
272  G4double sampledEnergy, sampledRI;
273  G4double cosTheta, sin2Theta;
274 
275  // sample an energy
276 
277  do {
278  rand = G4UniformRand();
279  sampledEnergy = Pmin + rand * dp;
280  sampledRI = Rindex->Value(sampledEnergy);
281  cosTheta = BetaInverse / sampledRI;
282 
283  sin2Theta = (1.0 - cosTheta)*(1.0 + cosTheta);
284  rand = G4UniformRand();
285 
286  } while (rand*maxSin2 > sin2Theta);
287 
288  // Generate random position of photon on cone surface
289  // defined by Theta
290 
291  rand = G4UniformRand();
292 
293  G4double phi = twopi*rand;
294  G4double sinPhi = std::sin(phi);
295  G4double cosPhi = std::cos(phi);
296 
297  // calculate x,y, and z components of photon energy
298  // (in coord system with primary particle direction
299  // aligned with the z axis)
300 
301  G4double sinTheta = std::sqrt(sin2Theta);
302  G4double px = sinTheta*cosPhi;
303  G4double py = sinTheta*sinPhi;
304  G4double pz = cosTheta;
305 
306  // Create photon momentum direction vector
307  // The momentum direction is still with respect
308  // to the coordinate system where the primary
309  // particle direction is aligned with the z axis
310 
311  G4ParticleMomentum photonMomentum(px, py, pz);
312 
313  // Rotate momentum direction back to global reference
314  // system
315 
316  photonMomentum.rotateUz(p0);
317 
318  // Determine polarization of new photon
319 
320  G4double sx = cosTheta*cosPhi;
321  G4double sy = cosTheta*sinPhi;
322  G4double sz = -sinTheta;
323 
324  G4ThreeVector photonPolarization(sx, sy, sz);
325 
326  // Rotate back to original coord system
327 
328  photonPolarization.rotateUz(p0);
329 
330  // Generate a new photon:
331 
332  G4DynamicParticle* aCerenkovPhoton =
334  photonMomentum);
335  aCerenkovPhoton->SetPolarization
336  (photonPolarization.x(),
337  photonPolarization.y(),
338  photonPolarization.z());
339 
340  aCerenkovPhoton->SetKineticEnergy(sampledEnergy);
341 
342  // Generate new G4Track object:
343 
344  G4double delta, NumberOfPhotons, N;
345 
346  do {
347  rand = G4UniformRand();
348  delta = rand * aStep.GetStepLength();
349  NumberOfPhotons = MeanNumberOfPhotons1 - delta *
350  (MeanNumberOfPhotons1-MeanNumberOfPhotons2)/
351  aStep.GetStepLength();
352  N = G4UniformRand() *
353  std::max(MeanNumberOfPhotons1,MeanNumberOfPhotons2);
354  } while (N > NumberOfPhotons);
355 
356  G4double deltaTime = delta /
357  ((pPreStepPoint->GetVelocity()+
358  pPostStepPoint->GetVelocity())/2.);
359 
360  G4double aSecondaryTime = t0 + deltaTime;
361 
362  G4ThreeVector aSecondaryPosition =
363  x0 + rand * aStep.GetDeltaPosition();
364 
365  G4Track* aSecondaryTrack =
366  new G4Track(aCerenkovPhoton,aSecondaryTime,aSecondaryPosition);
367 
368  aSecondaryTrack->SetTouchableHandle(
370 
371  aSecondaryTrack->SetParentID(aTrack.GetTrackID());
372 
373  aParticleChange.AddSecondary(aSecondaryTrack);
374  }
375 
376  if (verboseLevel>0) {
377  G4cout <<"\n Exiting from G4Cerenkov::DoIt -- NumberOfSecondaries = "
379  }
380 
381  return pParticleChange;
382 }
G4long G4Poisson(G4double mean)
Definition: G4Poisson.hh:51
G4int GetNumberOfSecondaries() const
G4MaterialPropertyVector * GetProperty(const char *key)
G4int verboseLevel
Definition: G4VProcess.hh:368
G4double GetStepLength() const
const G4DynamicParticle * GetDynamicParticle() const
G4TrackStatus GetTrackStatus() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4ParticleDefinition * GetDefinition() const
G4double GetVelocity() const
int G4int
Definition: G4Types.hh:78
G4StepPoint * GetPreStepPoint() const
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetPosition() const
G4int GetTrackID() const
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4double Value(G4double theEnergy, size_t &lastidx) const
void SetKineticEnergy(G4double aEnergy)
G4Material * GetMaterial() const
static G4OpticalPhoton * OpticalPhoton()
virtual void Initialize(const G4Track &)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
Definition: G4Material.hh:250
void SetNumberOfSecondaries(G4int totSecondaries)
Hep3Vector unit() const
void SetParentID(const G4int aValue)
G4StepPoint * GetPostStepPoint() const
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:289
void AddSecondary(G4Track *aSecondary)
#define G4endl
Definition: G4ios.hh:61
**D E S C R I P T I O N
G4double GetGlobalTime() const
double G4double
Definition: G4Types.hh:76
void ProposeTrackStatus(G4TrackStatus status)
G4double GetPDGCharge() const
G4ThreeVector GetDeltaPosition() const
const G4TouchableHandle & GetTouchableHandle() const
G4double GetBeta() const
G4double G4Cerenkov::PostStepGetPhysicalInteractionLength ( const G4Track aTrack,
G4double  ,
G4ForceCondition condition 
)
virtual

Implements G4VProcess.

Definition at line 494 of file G4Cerenkov.cc.

References DBL_MAX, G4DynamicParticle::GetDefinition(), G4Track::GetDynamicParticle(), G4Material::GetIndex(), G4DynamicParticle::GetKineticEnergy(), G4Track::GetMaterial(), G4Track::GetMaterialCutsCouple(), G4Material::GetMaterialPropertiesTable(), G4PhysicsOrderedFreeVector::GetMaxValue(), G4ParticleDefinition::GetPDGMass(), G4MaterialPropertiesTable::GetProperty(), G4DynamicParticle::GetTotalEnergy(), G4DynamicParticle::GetTotalMomentum(), G4LossTableManager::Instance(), NotForced, StronglyForced, and thePhysicsTable.

498 {
499  *condition = NotForced;
500  G4double StepLimit = DBL_MAX;
501 
502  const G4Material* aMaterial = aTrack.GetMaterial();
503  G4int materialIndex = aMaterial->GetIndex();
504 
505  // If Physics Vector is not defined no Cerenkov photons
506  // this check avoid string comparison below
507  if(!(*thePhysicsTable)[materialIndex]) { return StepLimit; }
508 
509  const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
510  const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();
511 
512  G4double kineticEnergy = aParticle->GetKineticEnergy();
513  const G4ParticleDefinition* particleType = aParticle->GetDefinition();
514  G4double mass = particleType->GetPDGMass();
515 
516  // particle beta
517  G4double beta = aParticle->GetTotalMomentum() /
518  aParticle->GetTotalEnergy();
519  // particle gamma
520  G4double gamma = aParticle->GetTotalEnergy()/mass;
521 
522  G4MaterialPropertiesTable* aMaterialPropertiesTable =
523  aMaterial->GetMaterialPropertiesTable();
524 
525  G4MaterialPropertyVector* Rindex = NULL;
526 
527  if (aMaterialPropertiesTable)
528  Rindex = aMaterialPropertiesTable->GetProperty("RINDEX");
529 
530  G4double nMax;
531  if (Rindex) {
532  nMax = Rindex->GetMaxValue();
533  } else {
534  return StepLimit;
535  }
536 
537  G4double BetaMin = 1./nMax;
538  if ( BetaMin >= 1. ) return StepLimit;
539 
540  G4double GammaMin = 1./std::sqrt(1.-BetaMin*BetaMin);
541 
542  if (gamma < GammaMin ) return StepLimit;
543 
544  G4double kinEmin = mass*(GammaMin-1.);
545 
547  GetRange(particleType,
548  kinEmin,
549  couple);
551  GetRange(particleType,
552  kineticEnergy,
553  couple);
554 
555  G4double Step = Range - RangeMin;
556  if (Step < 1.*um ) return StepLimit;
557 
558  if (Step > 0. && Step < StepLimit) StepLimit = Step;
559 
560  // If user has defined an average maximum number of photons to
561  // be generated in a Step, then calculate the Step length for
562  // that number of photons.
563 
564  if (fMaxPhotons > 0) {
565 
566  // particle charge
567  const G4double charge = aParticle->
568  GetDefinition()->GetPDGCharge();
569 
570  G4double MeanNumberOfPhotons =
571  GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
572 
573  Step = 0.;
574  if (MeanNumberOfPhotons > 0.0) Step = fMaxPhotons /
575  MeanNumberOfPhotons;
576 
577  if (Step > 0. && Step < StepLimit) StepLimit = Step;
578  }
579 
580  // If user has defined an maximum allowed change in beta per step
581  if (fMaxBetaChange > 0.) {
582 
584  GetDEDX(particleType,
585  kineticEnergy,
586  couple);
587 
588  G4double deltaGamma = gamma -
589  1./std::sqrt(1.-beta*beta*
590  (1.-fMaxBetaChange)*
591  (1.-fMaxBetaChange));
592 
593  Step = mass * deltaGamma / dedx;
594 
595  if (Step > 0. && Step < StepLimit) StepLimit = Step;
596 
597  }
598 
600  return StepLimit;
601 }
G4double condition(const G4ErrorSymMatrix &m)
static G4LossTableManager * Instance()
G4MaterialPropertyVector * GetProperty(const char *key)
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
size_t GetIndex() const
Definition: G4Material.hh:260
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4ParticleDefinition * GetDefinition() const
G4PhysicsTable * thePhysicsTable
Definition: G4Cerenkov.hh:210
int G4int
Definition: G4Types.hh:78
G4double GetTotalMomentum() const
G4Material * GetMaterial() const
G4double GetPDGMass() const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
Definition: G4Material.hh:250
Definition: Step.hh:41
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
void G4Cerenkov::SetMaxBetaChangePerStep ( const G4double  d)
static

Definition at line 148 of file G4Cerenkov.cc.

Referenced by G4OpticalPhysics::ConstructProcess(), OpNovicePhysicsList::OpNovicePhysicsList(), and G4OpticalPhysics::SetMaxBetaChangePerStep().

149 {
150  fMaxBetaChange = value*CLHEP::perCent;
151 }
const XML_Char int const XML_Char * value
void G4Cerenkov::SetMaxNumPhotonsPerStep ( const G4int  NumPhotons)
static
void G4Cerenkov::SetTrackSecondariesFirst ( const G4bool  state)
static

Field Documentation

G4PhysicsTable* G4Cerenkov::thePhysicsTable
protected

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