68 G4cout<<
"\n ExExChProcessChanneling::Constructor:";
69 G4cout<<
"Geometry surface tolerance is: ";
75 fFileCharacteristicsName =
"";
100 return fPotentialEnergy;
107 fPotentialEnergy = vPotential;
113 return fElectricField;
120 fElectricField = vElectricField;
127 return fIntegratedDensity;
134 fIntegratedDensity = vIntegratedDensity;
140 return fNucleiDensity;
147 fNucleiDensity = vNucleiDensity;
153 return fElectronDensity;
160 fElectronDensity = vElectronDensity;
165 G4bool ExExChProcessChanneling::UpdateInitialParameters(
const G4Track& aTrack){
167 if(GetInfo(aTrack)->GetPositionChanneled().
x() ==
DBL_MAX){
184 if(GetInfo(aTrack)->GetMomentumChanneledInitial().
x() ==
DBL_MAX){
199 void ExExChProcessChanneling::UpdateParameters(
const G4Track& aTrack){
203 ComputeCrystalCharacteristic(aTrack);
204 G4cout <<
"ChannelingProcess::UpdatePositionMomentumDensity::";
208 if(UpdateInitialParameters(aTrack) ==
false){
210 ComputeMomentum(aTrack,
219 fHasToComputeTrajectory =
true;
221 if(vPositionPost.
y() == fPointYPost &&
222 vPositionPre.y() == fPointYPre){
223 fHasToComputeTrajectory =
false;
226 if(GetXPL(aTrack)->
IsBent()){
227 fPointYPre = vPositionPre.y();
228 fPointYPost = vPositionPost.
y();
231 fPointYPre = vPositionPre.z();
232 fPointYPost = vPositionPost.
z();
241 if(GetXPL(aTrack)->IsBent()){
242 fIntegrationPeriod = (vPositionPost.
phi() - vPositionPre.phi())*
244 fIntegrationPeriod = vPositionPost.
y() - vPositionPre.y();
247 fIntegrationPeriod = vPositionPost.
z() - vPositionPre.z();
255 if(fIntegrationPeriod>0. && fHasToComputeTrajectory==
true){
262 UpdateIntegrationStep(aTrack,fMom);
269 kPos = fTimeStep / fMom.
z();
272 kPos = fTimeStep / 1.E-20;
274 kMom = fTimeStep / kBeta;
275 kBR = fTimeStep * (fMom.
z() * kBeta);;
278 fPosHalf += (fMom * kPos * 0.5);
283 if(GetXPL(aTrack)->
IsBent()){
285 fMomHalf.
x() + kBR * 0.5 /
290 fPos += (fMomHalf * kPos);
295 if(GetXPL(aTrack)->
IsBent()){
302 fTimeStepTotal += fTimeStep;
315 }
while(fTimeStepTotal<fIntegrationPeriod);
317 vNucleiDensity /= fIntegrationPeriod;
318 vElectronDensity /= fIntegrationPeriod;
323 ResetDensity(aTrack);
333 void ExExChProcessChanneling::ResetDensity(
const G4Track& aTrack){
346 G4StepPoint* vStepVol = CheckStepPointLatticeForVolume(vStep,aTrack);
347 G4StepPoint* vStepPos = CheckStepPointLatticeForPosition(vStep,aTrack);
356 if(GetXPL(aTrack)->IsBent() ==
false){
388 && vStep == vStepPost &&
420 vStep == vStepPost &&
439 G4bool ExExChProcessChanneling::
442 if(vMom.
x() != 0.0 || vMom.
y() != 0.0){
443 double xy2 = vMom.
x() * vMom.
x() + vMom.
y()*vMom.
y();
447 std::fabs(fTransverseVariationMax *
450 if(fTimeStep < fTimeStepMin) fTimeStep = fTimeStepMin;
452 fTimeStepMax = std::sqrt( fTransverseVariationMax *
454 std::fabs(fElectricField->
GetMaximum(GetXPL(aTrack))));
456 if(fTimeStep > fTimeStepMax) fTimeStep = fTimeStepMax;
460 fTimeStep = fTimeStepMin;
463 if(fTimeStep + fTimeStepTotal > fIntegrationPeriod){
464 fTimeStep = fIntegrationPeriod - fTimeStepTotal;
470 fTimeStep = fTimeStepMin;
478 GetChannelingMeanFreePath(
const G4Track& aTrack){
484 G4double vMFP = 0.1 * ComputeOscillationPeriod(aTrack);
486 if(HasLatticeOnBoundaryPre(aTrack) ==
true){
487 vMFP = 0.001 * ComputeOscillationPeriod(aTrack);
508 if(HasLattice(aTrack)){
510 return GetChannelingMeanFreePath(aTrack);
538 if((HasLattice(aTrack) ==
true) &&
539 (HasLatticeOnBoundaryPost(aTrack) ==
false)){
540 UpdateParameters(aTrack);
557 ResetDensity(aTrack);
575 ComputeTransverseEnergy(
const G4Track& aTrack){
581 G4ThreeVector vTransverseEnergy = ComputePotentialEnergy(aTrack)
582 + ComputeKineticEnergy(aTrack);
583 return vTransverseEnergy;
588 ComputeKineticEnergy(
const G4Track& aTrack){
602 (vMom.
z() * vMom.
z()) / vTotalEnergy);
604 return vKineticEnergy;
610 ComputePotentialEnergy(
const G4Track& aTrack){
618 fPotentialEnergy->
GetEC(GetInfo(aTrack)->GetPositionChanneled(),
621 vPotentialEnergy *= GetParticleDefinition(aTrack)->
GetPDGCharge();
623 return vPotentialEnergy;
640 if(ParticleIsNegative(aTrack) &&
false){
645 if(GetXPL(aTrack)->IsBent()){
648 GetXPL(aTrack)->GetCurvatureRadius().
x(),
653 return vEnergyVariation;
665 G4ThreeVector vPosition = ComputePositionInTheCrystal(vStep,aTrack);
670 ProjectMomentumVectorFromWorldToLattice(vMomentum,vPosition);
678 ComputeCentrifugalEnergyMaximumVariation(
const G4Track& aTrack){
688 if(GetXPL(aTrack)->IsBent()){
690 GetXPL(aTrack)->ComputeInterplanarPeriod() /
691 GetXPL(aTrack)->GetCurvatureRadius().
x(),
696 return vEnergyVariation;
705 ComputeCriticalEnergyMaximum(
const G4Track& aTrack){
713 if(ParticleIsNegative(aTrack)){
715 - fPotentialEnergy->
GetMinimum(GetXPL(aTrack));
719 + fPotentialEnergy->
GetMaximum(GetXPL(aTrack));
722 vCriticalEnergy *= std::fabs(GetParticleDefinition(aTrack)->GetPDGCharge());
724 return vCriticalEnergy;
730 ComputeCriticalEnergyMinimum(
const G4Track& aTrack){
738 if(ParticleIsNegative(aTrack)){
740 - fPotentialEnergy->
GetMaximum(GetXPL(aTrack));
744 + fPotentialEnergy->
GetMinimum(GetXPL(aTrack));
747 vCriticalEnergy *= std::fabs(GetParticleDefinition(aTrack)->GetPDGCharge());
749 return vCriticalEnergy;
755 ComputeCriticalAngle(
const G4Track& aTrack){
763 G4double vCriticalAngle = std::pow( 2.0 *
764 std::fabs( ( ComputeCriticalEnergyMaximum(aTrack)
765 - ComputeCriticalEnergyMinimum(aTrack) )
766 / vTotalEnergy ) , 0.5);
767 return vCriticalAngle;
773 ComputeOscillationPeriod(
const G4Track& aTrack){
782 CLHEP::pi * vInterplanarPeriod / ComputeCriticalAngle(aTrack);
783 return vOscillationPeriod;
789 ComputeCriticalRadius(
const G4Track& aTrack){
799 if(fElectricField->
GetMaximum(GetXPL(aTrack)) != 0.){
800 vCriticalRadius = vTotalEnergy
803 return vCriticalRadius;
808 ComputePotentialWellCentre(
const G4Track& aTrack){
817 G4double vCentreX = vInterplanarPeriodHalf;
819 if(GetXPL(aTrack)->IsBent()){
824 ComputeCriticalEnergyMaximum(aTrack)
825 - (ComputeCriticalEnergyMinimum(aTrack));
827 vCentreX *= (1. - 0.5 * vTotalEnergy /
828 vPotentialWellDepth /
830 vInterplanarPeriodHalf );
880 G4bool ExExChProcessChanneling::HasLattice(
const G4Track& aTrack){
892 G4bool ExExChProcessChanneling::
893 HasLatticeOnBoundary(
const G4Track& aTrack){
894 if(HasLatticeOnBoundaryPost(aTrack) || HasLatticeOnBoundaryPre(aTrack)) {
904 G4bool ExExChProcessChanneling::
905 HasLatticeOnBoundaryPre(
const G4Track& aTrack){
907 GetPhysicalVolume()) &&
918 G4bool ExExChProcessChanneling::
919 HasLatticeOnBoundaryPost(
const G4Track& aTrack){
921 GetPostStepPoint()->GetPhysicalVolume()) &&
932 G4bool ExExChProcessChanneling::ParticleIsNegative(
const G4Track& aTrack){
933 if(GetParticleDefinition(aTrack)->GetPDGCharge() < 0.) {
945 G4bool ExExChProcessChanneling::
946 ParticleIsNotOnBoundaryPre(
const G4Track& aTrack){
957 G4bool ExExChProcessChanneling::
958 ParticleIsNotOnBoundaryPost(
const G4Track& aTrack){
969 G4bool ExExChProcessChanneling::
970 ParticleIsNotOnBoundary(
const G4Track& aTrack){
971 if(ParticleIsNotOnBoundaryPost(aTrack) ||
972 ParticleIsNotOnBoundaryPre(aTrack)){
983 GetInfo(
const G4Track& aTrack){
990 GetParticleDefinition(
const G4Track& aTrack){
996 void ExExChProcessChanneling::
997 ComputeCrystalCharacteristic(
const G4Track& aTrack){
1001 if(fFileCharacteristicsName !=
""){
1008 filename = fFileCharacteristicsName +
"_pot.txt";
1011 fPotentialEnergy->
PrintOnFile(
"temppot.dat",GetXPL(aTrack));
1013 filename = fFileCharacteristicsName +
"_efx.txt";
1016 fElectricField->
PrintOnFile(
"tempefx.dat",GetXPL(aTrack));
1018 filename = fFileCharacteristicsName +
"_atd.txt";
1022 filename = fFileCharacteristicsName +
"_eld.txt";
1025 fIntegratedDensity->
ReadFromFiles(fFileCharacteristicsName);
G4double GetTotalEnergy() const
G4double condition(const G4ErrorSymMatrix &m)
static constexpr double m
G4double GetXHalfLength() const
static XLatticeManager3 * GetXLatticeManager()
static constexpr double mm
void SetMomentumChanneledInitial(G4ThreeVector)
virtual ~ExExChProcessChanneling()
CLHEP::Hep3Vector G4ThreeVector
G4double GetVelocity() const
XVCrystalCharacteristic * GetNucleiDensity()
Definition of the XLogicalBase class.
Definition of the XLatticeManager3 class.
G4StepStatus GetStepStatus() const
G4double GetSurfaceTolerance() const
G4VSolid * GetSolid() const
ExExChProcessChanneling(const G4String &processName="ExExChProcessChanneling")
G4ThreeVector GetCurvatureRadius()
Definition of the XLogicalAtomicLatticeDiamond class.
const G4VTouchable * GetTouchable() const
const G4Step * GetStep() const
G4double GetZHalfLength() const
virtual G4double GetMinimum(XPhysicalLattice *)
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
G4VUserTrackInformation * GetUserInformation() const
G4bool HasBeenInitialized(XPhysicalLattice *)
G4StepPoint * GetPreStepPoint() const
Definition of the ExExChParticleUserInfo class.
void SetXPhysicalLattice(XPhysicalLattice *)
void SetMomentumChanneled(G4ThreeVector)
void SetInTheCrystal(G4int aInt)
G4GLOB_DLL std::ostream G4cout
XVCrystalCharacteristic * GetElectronDensity()
G4VPhysicalVolume * GetPhysicalVolume() const
const G4ThreeVector & GetPosition() const
Definition of the ExExChProcessChanneling class.
void SetPositionChanneled(G4ThreeVector)
XVCrystalCharacteristic * GetElectricField()
void SetPotential(XVCrystalCharacteristic *)
Hep3Vector & rotateZ(double)
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetYHalfLength() const
virtual void PrintOnFile(const G4String &, XPhysicalLattice *, G4double=1)=0
const G4double kCarTolerance
G4double GetStartPhiAngle() const
void SetElectronDensity(G4double)
const G4String & GetProcessName() const
static constexpr double eV
G4ThreeVector GetEC(G4ThreeVector, XPhysicalLattice *)
void SetIntegratedDensity(XCrystalIntegratedDensityHub *)
G4ThreeVector ProjectMomentumVectorFromLatticeToWorld(G4ThreeVector &, G4ThreeVector &)
G4ThreeVector GetMomentum() const
virtual void Initialize(const G4Track &)
void SetElectricField(XVCrystalCharacteristic *)
void InitializePhysicalLattice(XPhysicalLattice *)
G4LogicalVolume * GetLogicalVolume() const
XPhysicalLattice * GetXPhysicalLattice(G4VPhysicalVolume *)
virtual G4double GetMaximum(XPhysicalLattice *)
XVCrystalCharacteristic * GetPotential()
virtual G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *)
G4StepPoint * GetPostStepPoint() const
XCrystalIntegratedDensityHub * GetIntegratedDensity()
void SetNucleiDensity(XVCrystalCharacteristic *)
G4ParticleChange aParticleChange
Definition of the XLogicalAtomicLattice class.
void SetElectronDensity(XVCrystalCharacteristic *)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
const G4AffineTransform & GetTopTransform() const
const G4NavigationHistory * GetHistory() const
void ReadFromFiles(const G4String &)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void StoreDensityPreviousStep()
G4double GetPDGCharge() const
Definition of the XUnitCell class.
G4double ComputeInterplanarPeriod()
void SetPositionChanneledInitial(G4ThreeVector)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
static constexpr double pi
static G4GeometryTolerance * GetInstance()
G4ThreeVector GetPositionChanneled()
static constexpr double angstrom
void SetNucleiDensity(G4double)
virtual void ReadFromECHARM(const G4String &, G4double=1)=0
G4ThreeVector GetMomentumChanneled()
bool HasLattice(G4VPhysicalVolume *)