Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Channeling Class Reference

#include <G4Channeling.hh>

+ Inheritance diagram for G4Channeling:

Public Member Functions

 G4Channeling ()
 
virtual ~G4Channeling ()
 
virtual G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &)
 
virtual G4bool IsApplicable (const G4ParticleDefinition &aPD)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
G4double GetCriticalAngle (const G4Track &aTrack)
 
G4double GetOscillationPeriod (const G4Track &aTrack)
 
void PosToLattice (G4StepPoint *step, G4ThreeVector &)
 
G4double GetTransverseVariationMax ()
 
void SetTransverseVariationMax (G4double aDouble)
 
G4double GetTimeStepMin ()
 
void SetTimeStepMin (G4double aDouble)
 
- Public Member Functions inherited from G4VDiscreteProcess
 G4VDiscreteProcess (const G4String &aName, G4ProcessType aType=fNotDefined)
 
 G4VDiscreteProcess (G4VDiscreteProcess &)
 
virtual ~G4VDiscreteProcess ()
 
G4VDiscreteProcessoperator= (const G4VDiscreteProcess &)=delete
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &)
 
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 &)
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4VProcessoperator= (const G4VProcess &)=delete
 
G4bool operator== (const G4VProcess &right) const
 
G4bool operator!= (const G4VProcess &right) const
 
virtual G4VParticleChangePostStepDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)=0
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &track, G4ForceCondition *condition)=0
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)=0
 
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
 
virtual void ProcessDescription (std::ostream &outfile) 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 G4double GetMeanFreePath (const G4Track &, G4double, G4ForceCondition *)
 
virtual G4double GetMeanFreePath (const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)=0
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double prevStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager = nullptr
 
G4VParticleChangepParticleChange = nullptr
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft = -1.0
 
G4double currentInteractionLength = -1.0
 
G4double theInitialNumberOfInteractionLength = -1.0
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType = fNotDefined
 
G4int theProcessSubType = -1
 
G4double thePILfactor = 1.0
 
G4int verboseLevel = 0
 
G4bool enableAtRestDoIt = true
 
G4bool enableAlongStepDoIt = true
 
G4bool enablePostStepDoIt = true
 

Detailed Description

Definition at line 40 of file G4Channeling.hh.

Constructor & Destructor Documentation

◆ G4Channeling()

G4Channeling::G4Channeling ( )

Definition at line 36 of file G4Channeling.cc.

36 :
37G4VDiscreteProcess("channeling"),
38fChannelingID(-1),
39fTimeStepMin(0.),
40fTimeStepMax(0.),
41fTransverseVariationMax(2.E-2 * CLHEP::angstrom),
42k010(G4ThreeVector(0.,1.,0.)){
43 fChannelingID = G4PhysicsModelCatalog::GetIndex("channeling");
44 if(fChannelingID == -1){
45 fChannelingID = G4PhysicsModelCatalog::Register("channeling");
46 }
47 fSpin = G4ThreeVector(0.,0.,0.);
48}
CLHEP::Hep3Vector G4ThreeVector
static G4int GetIndex(const G4String &)
static G4int Register(const G4String &)

◆ ~G4Channeling()

G4Channeling::~G4Channeling ( )
virtual

Definition at line 52 of file G4Channeling.cc.

52{;}

Member Function Documentation

◆ BuildPhysicsTable()

virtual void G4Channeling::BuildPhysicsTable ( const G4ParticleDefinition )
inlinevirtual

Reimplemented from G4VProcess.

Definition at line 51 of file G4Channeling.hh.

51{;};

◆ GetCriticalAngle()

G4double G4Channeling::GetCriticalAngle ( const G4Track aTrack)
inline

Definition at line 84 of file G4Channeling.hh.

84 {
85 return std::sqrt(2.0*GetMatData(aTrack)->GetPot()->GetMaxMin()
86 /GetPre(aTrack)->GetTotalEnergy());}

Referenced by GetOscillationPeriod().

◆ GetMeanFreePath()

G4double G4Channeling::GetMeanFreePath ( const G4Track aTrack,
G4double  ,
G4ForceCondition condition 
)
protectedvirtual

Implements G4VDiscreteProcess.

Definition at line 299 of file G4Channeling.cc.

302 {
303
304 //----------------------------------------
305 // the condition is forced to check if
306 // the volume has a lattice at each step.
307 // if it hasn't, return DBL_MAX
308 //----------------------------------------
309
310 *condition = Forced;
311
312 G4LogicalVolume* aLV = aTrack.GetVolume()->GetLogicalVolume();
314
315 if(G4LogicalCrystalVolume::IsLattice(aLV) == true &&
317 G4double osc_per = GetOscillationPeriod(aTrack);
318 fTimeStepMin = osc_per * 2.E-4;
319 return osc_per * 0.01;
320 }
321 else{
322 GetTrackData(aTrack)->Reset();
323 return DBL_MAX;
324 }
325}
G4double condition(const G4ErrorSymMatrix &m)
@ Forced
double G4double
Definition: G4Types.hh:83
G4double GetOscillationPeriod(const G4Track &aTrack)
Definition: G4Channeling.hh:87
static G4bool IsLattice(G4LogicalVolume *aLV)
G4VPhysicalVolume * GetVolume() const
G4VPhysicalVolume * GetNextVolume() const
G4LogicalVolume * GetLogicalVolume() const
#define DBL_MAX
Definition: templates.hh:62

◆ GetOscillationPeriod()

G4double G4Channeling::GetOscillationPeriod ( const G4Track aTrack)
inline

Definition at line 87 of file G4Channeling.hh.

87 {
88 return (CLHEP::pi * GetMatData(aTrack)->GetPot()->GetIntSp(0)
89 / GetCriticalAngle(aTrack));
90 }
G4double GetCriticalAngle(const G4Track &aTrack)
Definition: G4Channeling.hh:84

Referenced by GetMeanFreePath().

◆ GetTimeStepMin()

G4double G4Channeling::GetTimeStepMin ( )
inline

Definition at line 117 of file G4Channeling.hh.

117{return fTimeStepMin;};

◆ GetTransverseVariationMax()

G4double G4Channeling::GetTransverseVariationMax ( )
inline

Definition at line 114 of file G4Channeling.hh.

114{return fTransverseVariationMax;};

◆ IsApplicable()

virtual G4bool G4Channeling::IsApplicable ( const G4ParticleDefinition aPD)
inlinevirtual

Reimplemented from G4VProcess.

Definition at line 48 of file G4Channeling.hh.

48 {
49 return(aPD.GetPDGCharge() != 0.);
50 };
G4double GetPDGCharge() const

◆ PosToLattice()

void G4Channeling::PosToLattice ( G4StepPoint step,
G4ThreeVector pos 
)

Definition at line 78 of file G4Channeling.cc.

78 {
79 G4TouchableHistory* theTouchable = (G4TouchableHistory*)(step->GetTouchable());
80
81 pos -= theTouchable->GetTranslation();
82 pos = ((*theTouchable->GetRotation()).inverse())(pos);
83}
const G4VTouchable * GetTouchable() const
const G4RotationMatrix * GetRotation(G4int depth=0) const
const G4ThreeVector & GetTranslation(G4int depth=0) const

Referenced by PostStepDoIt().

◆ PostStepDoIt()

G4VParticleChange * G4Channeling::PostStepDoIt ( const G4Track aTrack,
const G4Step  
)
virtual

Reimplemented from G4VDiscreteProcess.

Definition at line 329 of file G4Channeling.cc.

331 {
332
333 //----------------------------------------
334 // check if the volume has a lattice
335 // and if the particle is in channeling.
336 // If it is so, the particle is forced
337 // to follow the channeling plane
338 // direction. If the particle has
339 // dechanneled or exited the crystal,
340 // the outgoing angle is evaluated
341 //----------------------------------------
342
344 G4LogicalVolume* aLV = aTrack.GetVolume()->GetLogicalVolume();
346
347
348 if(G4LogicalCrystalVolume::IsLattice(aLV) == true &&
350
351 G4bool bModifiedTraj = UpdateParameters(aTrack);
352
353 if(bModifiedTraj==true){
354 //----------------------------------------
355 // Get the momentum in the reference frame
356 // solidal to the bent planes and rotate
357 // to the reference frame
358 //----------------------------------------
360 G4ThreeVector momCh = GetTrackData(aTrack)->GetMomCh();
361
362 G4StepPoint* postStepPoint = aTrack.GetStep()->GetPostStepPoint();
363 G4TouchableHistory* theTouchable = (G4TouchableHistory*)(postStepPoint->GetTouchable());
364
365 if(GetMatData(aTrack)->IsBent()){
366 G4ThreeVector posPost = postStepPoint->GetPosition();
367 PosToLattice(postStepPoint,posPost);
368 G4ThreeVector axis010 = (*theTouchable->GetRotation())(k010);
369 momCh.rotate(axis010,posPost.z()/GetMatData(aTrack)->GetBR(posPost).x());
370 }
371
372 //----------------------------------------
373 // Get the momentum in the crystal reference
374 // frame and rotate to the solid reference frame
375 //----------------------------------------
376
377 aLCV->RotateToSolid(momCh);
378
379 //----------------------------------------
380 // Get the momentum in the solid reference
381 // frame and rotate to the world reference frame
382 //----------------------------------------
383 G4ThreeVector mom = ((*theTouchable->GetRotation()).inverse())(momCh);
384
387 }
388 }
389 else{
390 // if the volume has no lattice it resets the density factors
391 GetTrackData(aTrack)->Reset();
392 }
393
394 return &aParticleChange;
395}
bool G4bool
Definition: G4Types.hh:86
double z() const
Hep3Vector unit() const
double x() const
Hep3Vector & rotate(double, const Hep3Vector &)
Definition: ThreeVectorR.cc:24
virtual G4ThreeVector GetBR(G4ThreeVector &v3)
void PosToLattice(G4StepPoint *step, G4ThreeVector &)
Definition: G4Channeling.cc:78
const G4ThreeVector & RotateToSolid(G4ThreeVector &dir) const
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
virtual void Initialize(const G4Track &)
const G4ThreeVector & GetPosition() const
G4StepPoint * GetPostStepPoint() const
const G4Step * GetStep() const
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:327

◆ SetTimeStepMin()

void G4Channeling::SetTimeStepMin ( G4double  aDouble)
inline

Definition at line 118 of file G4Channeling.hh.

118{fTimeStepMin = aDouble;};

◆ SetTransverseVariationMax()

void G4Channeling::SetTransverseVariationMax ( G4double  aDouble)
inline

Definition at line 115 of file G4Channeling.hh.

115{fTransverseVariationMax = aDouble;};

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