File indexing completed on 2025-01-18 09:58:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef G4Channeling_h
0029 #define G4Channeling_h 1
0030
0031 #include "G4ios.hh"
0032 #include "globals.hh"
0033 #include "G4VDiscreteProcess.hh"
0034 #include "G4ChannelingMaterialData.hh"
0035 #include "G4ExtendedMaterial.hh"
0036 #include "G4LogicalCrystalVolume.hh"
0037
0038 class G4ChannelingTrackData;
0039
0040 class G4Channeling : public G4VDiscreteProcess
0041 {
0042 public:
0043
0044 G4Channeling();
0045 virtual ~G4Channeling();
0046 virtual G4VParticleChange* PostStepDoIt(const G4Track&,
0047 const G4Step&);
0048 virtual G4bool IsApplicable(const G4ParticleDefinition& aPD){
0049 return(aPD.GetPDGCharge() != 0.);
0050 };
0051 virtual void BuildPhysicsTable(const G4ParticleDefinition&){;};
0052
0053 protected:
0054 virtual G4double GetMeanFreePath(const G4Track&,
0055 G4double,
0056 G4ForceCondition*);
0057
0058 private:
0059 G4ParticleDefinition* GetParticleDefinition(const G4Track& aTrack){
0060 return const_cast<G4ParticleDefinition*>(aTrack.GetParticleDefinition());
0061 }
0062 private:
0063 G4StepPoint* GetPre(const G4Track& aTrack){return aTrack.GetStep()->GetPreStepPoint();}
0064 G4StepPoint* GetPost(const G4Track& aTrack){return aTrack.GetStep()->GetPostStepPoint();}
0065
0066
0067 private:
0068 G4ChannelingMaterialData* GetMatData(const G4Track& aTrack){
0069 G4LogicalVolume* aLV = aTrack.GetVolume()->GetLogicalVolume();
0070 if(aLV->IsExtended() == true){
0071 G4ExtendedMaterial* aEM = (G4ExtendedMaterial*) aTrack.GetVolume()->GetLogicalVolume()->GetMaterial();
0072 return (G4ChannelingMaterialData*) aEM->RetrieveExtension("channeling");
0073 }
0074 else{
0075 return nullptr;
0076 }
0077 }
0078
0079
0080
0081
0082
0083 public:
0084 G4double GetCriticalAngle(const G4Track& aTrack){
0085 return std::sqrt(2.0*GetMatData(aTrack)->GetPot()->GetMaxMin()
0086 /GetPre(aTrack)->GetTotalEnergy());}
0087 G4double GetOscillationPeriod(const G4Track& aTrack){
0088 return (CLHEP::pi * GetMatData(aTrack)->GetPot()->GetIntSp(0)
0089 / GetCriticalAngle(aTrack));
0090 }
0091
0092
0093
0094 private:
0095 G4int fChannelingID;
0096 G4ChannelingTrackData* GetTrackData(const G4Track&);
0097
0098
0099
0100
0101
0102 private:
0103 G4bool UpdateIntegrationStep(const G4Track&,
0104 G4ThreeVector&,
0105 G4double&);
0106 G4bool UpdateParameters(const G4Track&);
0107
0108 void GetEF(const G4Track&,G4ThreeVector&,G4ThreeVector&);
0109
0110 public:
0111 void PosToLattice(G4StepPoint* step,G4ThreeVector&);
0112
0113 public:
0114 G4double GetTransverseVariationMax() {return fTransverseVariationMax;};
0115 void SetTransverseVariationMax(G4double aDouble) {fTransverseVariationMax = aDouble;};
0116
0117 G4double GetTimeStepMin() {return fTimeStepMin;};
0118 void SetTimeStepMin(G4double aDouble) {fTimeStepMin = aDouble;};
0119
0120 private:
0121 G4double fTimeStepMin;
0122 G4double fTimeStepMax;
0123
0124 G4double fTransverseVariationMax;
0125
0126 const G4ThreeVector k010;
0127 G4ThreeVector fSpin;
0128 };
0129
0130 #endif
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140