42fTransverseVariationMax(2.E-2 *
CLHEP::angstrom),
56 if(trackdata ==
nullptr){
65void G4Channeling::GetEF(
const G4Track& aTrack,
68 out =
G4ThreeVector((GetMatData(aTrack)->GetEFX()->GetEC(pos)),
69 (GetMatData(aTrack)->GetEFY()->GetEC(pos)),
79 pos = ((*theTouchable->
GetRotation()).inverse())(pos);
96 G4double integrationLimit = std::fabs(posPost.
z() - posPre.
z());
98 if(integrationLimit > 0.){
126 mom.
rotate(axis010,-posPre.
z()/GetMatData(aTrack)->
GetBR(posPre).
x());
148 G4double nud_temp =0., eld_temp =0.;
165 UpdateIntegrationStep(aTrack,mom,step);
166 if(step + stepTot > integrationLimit){
167 step = integrationLimit - stepTot;
175 GetEF(aTrack,pos,efxy);
176 posk1 = step / mom.
z() * mom;
177 momk1 = step / beta *
Z * efxy;
178 if(isBent) momk1.
setX(momk1.
x() - step * mom.
z() * beta / (GetMatData(aTrack)->GetBR(pos)).x());
180 GetEF(aTrack,pos_temp = pos + posk1 * 0.5,efxy);
181 posk2 = step / mom.
z() * (mom + momk1 * 0.5);
182 momk2 = step / beta *
Z * efxy;
183 if(isBent) momk2.
setX(momk2.
x() - step * mom.
z() * beta / (GetMatData(aTrack)->
GetBR(pos_temp)).x());
185 GetEF(aTrack,pos_temp = pos + posk2 * 0.5,efxy);
186 posk3 = step / mom.
z() * (mom + momk2 * 0.5);
187 momk3 = step / beta *
Z * efxy;
188 if(isBent) momk3.
setX(momk3.
x() - step * mom.
z() * beta / (GetMatData(aTrack)->
GetBR(pos_temp)).x());
190 GetEF(aTrack,pos_temp = pos + posk3,efxy);
191 posk4 = step / mom.
z() * (mom + momk3);
192 momk4 = step / beta *
Z * efxy;
193 if(isBent) momk4.
setX(momk4.
x() - step * mom.
z() * beta / (GetMatData(aTrack)->
GetBR(pos_temp)).x());
195 pos =
pos + oneSixth * (posk1 + 2.*posk2 + 2.*posk3 + posk4);
196 mom = mom + oneSixth * (momk1 + 2.*momk2 + 2.*momk3 + momk4);
225 nud_temp = GetMatData(aTrack)->
GetNuD()->
GetEC(pos);
226 eld_temp = GetMatData(aTrack)->
GetElD()->
GetEC(pos);
228 if(nud_temp < 0.) {nud_temp = 0.;}
229 if(eld_temp < 0.) {eld_temp = 0.;}
231 nud += (step * nud_temp);
232 eld += (step * eld_temp);
234 efx += (step * GetMatData(aTrack)->
GetEFX()->
GetEC(pos));
235 efy += (step * GetMatData(aTrack)->
GetEFY()->
GetEC(pos));
237 }
while(stepTot<integrationLimit);
242 if(nud < 1.E-10) {nud = 1.E-10;}
243 if(eld < 1.E-10) {eld = 1.E-10;}
245 GetTrackData(aTrack)->
SetNuD(nud);
246 GetTrackData(aTrack)->
SetElD(eld);
248 GetTrackData(aTrack)->
SetEFX(efx);
249 GetTrackData(aTrack)->
SetEFY(efy);
251 GetTrackData(aTrack)->
SetMomCh(mom);
252 GetTrackData(aTrack)->
SetPosCh(pos);
265UpdateIntegrationStep(
const G4Track& aTrack,
269 if(mom.
x() != 0.0 || mom.
y() != 0.0){
270 double xy2 = mom.
x() * mom.
x() + mom.
y()*mom.
y();
273 step = std::fabs(fTransverseVariationMax * GetPre(aTrack)->GetKineticEnergy() / std::pow(xy2,0.5));
274 if(step < fTimeStepMin) step = fTimeStepMin;
276 fTimeStepMax = std::sqrt( fTransverseVariationMax * GetPre(aTrack)->GetKineticEnergy()
277 / std::fabs(GetMatData(aTrack)->GetEFX()->GetMax()));
279 if(step > fTimeStepMax) step = fTimeStepMax;
315 fTimeStepMin = osc_per * 2.E-4;
316 return osc_per * 0.01;
319 GetTrackData(aTrack)->
Reset();
348 G4bool bModifiedTraj = UpdateParameters(aTrack);
350 if(bModifiedTraj==
true){
362 if(GetMatData(aTrack)->
IsBent()){
366 momCh.
rotate(axis010,posPost.
z()/GetMatData(aTrack)->
GetBR(posPost).
x());
388 GetTrackData(aTrack)->
Reset();
G4double condition(const G4ErrorSymMatrix &m)
CLHEP::Hep3Vector G4ThreeVector
Hep3Vector & rotate(double, const Hep3Vector &)
G4double GetIntSp(G4int index)
G4double GetEC(G4ThreeVector &)
G4ChannelingECHARM * GetEFY()
G4ChannelingECHARM * GetEFX()
virtual G4ThreeVector GetBR(G4ThreeVector &v3)
G4ChannelingECHARM * GetPot()
G4ChannelingECHARM * GetNuD()
G4ChannelingECHARM * GetElD()
void SetPosCh(G4ThreeVector a3vec)
void SetNuD(G4double aDouble)
void SetElD(G4double aDouble)
void SetEFY(G4double aDouble)
void SetEFX(G4double aDouble)
void SetMomCh(G4ThreeVector a3vec)
void PosToLattice(G4StepPoint *step, G4ThreeVector &)
virtual G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4double GetOscillationPeriod(const G4Track &aTrack)
const G4ThreeVector & RotateToSolid(G4ThreeVector &dir) const
static G4bool IsLattice(G4LogicalVolume *aLV)
const G4ThreeVector & RotateToLattice(G4ThreeVector &dir) const
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
void Initialize(const G4Track &) override
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetPDGCharge() const
const G4VTouchable * GetTouchable() const
G4ThreeVector GetMomentum() const
const G4ThreeVector & GetPosition() const
G4StepPoint * GetPreStepPoint() const
G4StepPoint * GetPostStepPoint() const
const G4RotationMatrix * GetRotation(G4int depth=0) const
const G4ThreeVector & GetTranslation(G4int depth=0) const
G4double GetVelocity() const
G4VPhysicalVolume * GetVolume() const
void SetAuxiliaryTrackInformation(G4int id, G4VAuxiliaryTrackInformation *info) const
G4VPhysicalVolume * GetNextVolume() const
G4VAuxiliaryTrackInformation * GetAuxiliaryTrackInformation(G4int id) const
const G4Step * GetStep() const
G4LogicalVolume * GetLogicalVolume() const
G4ParticleChange aParticleChange