Geant4-11
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes
G4ParticleChangeForTransport Class Reference

#include <G4ParticleChangeForTransport.hh>

Inheritance diagram for G4ParticleChangeForTransport:
G4ParticleChange G4VParticleChange

Public Member Functions

void AddSecondary (G4DynamicParticle *aSecondary, G4bool IsGoodForTracking=false)
 
void AddSecondary (G4DynamicParticle *aSecondary, G4double time, G4bool IsGoodForTracking=false)
 
void AddSecondary (G4DynamicParticle *aSecondary, G4ThreeVector position, G4bool IsGoodForTracking=false)
 
void AddSecondary (G4Track *aSecondary)
 
G4ThreeVector CalcMomentum (G4double energy, G4ThreeVector direction, G4double mass) const
 
virtual G4bool CheckIt (const G4Track &)
 
void Clear ()
 
void ClearDebugFlag ()
 
virtual void DumpInfo () const
 
 G4ParticleChangeForTransport ()
 
G4double GetCharge () const
 
G4bool GetDebugFlag () const
 
G4double GetEnergy () const
 
G4bool GetFirstStepInVolume () const
 
G4ThreeVector GetGlobalPosition (const G4ThreeVector &displacement) const
 
G4double GetGlobalTime (G4double timeDelay=0.0) const
 
G4bool GetLastStepInVolume () const
 
G4double GetLocalEnergyDeposit () const
 
G4double GetLocalTime (G4double timeDelay=0.0) const
 
G4double GetMagneticMoment () const
 
G4double GetMass () const
 
const G4MaterialCutsCoupleGetMaterialCutsCoupleInTouchable () const
 
G4MaterialGetMaterialInTouchable () const
 
G4bool GetMomentumChanged () const
 
const G4ThreeVectorGetMomentumDirection () const
 
G4double GetNonIonizingEnergyDeposit () const
 
G4int GetNumberOfSecondaries () const
 
G4double GetParentWeight () const
 
std::vector< G4ThreeVector > * GetPointerToVectorOfAuxiliaryPoints () const
 
const G4ThreeVectorGetPolarization () const
 
const G4ThreeVectorGetPosition () const
 
G4double GetProperTime () const
 
G4TrackGetSecondary (G4int anIndex) const
 
G4VSensitiveDetectorGetSensitiveDetectorInTouchable () const
 
G4SteppingControl GetSteppingControl () const
 
const G4TouchableHandleGetTouchableHandle () const
 
G4TrackStatus GetTrackStatus () const
 
G4double GetTrueStepLength () const
 
G4double GetVelocity () const
 
G4int GetVerboseLevel () const
 
G4double GetWeight () const
 
virtual void Initialize (const G4Track &)
 
G4bool IsParentWeightSetByProcess () const
 
G4bool IsSecondaryWeightSetByProcess () const
 
G4bool operator!= (const G4ParticleChange &right) const
 
G4bool operator!= (const G4VParticleChange &right) const
 
G4bool operator== (const G4ParticleChange &right) const
 
G4bool operator== (const G4VParticleChange &right) const
 
void ProposeCharge (G4double finalCharge)
 
void ProposeEnergy (G4double finalEnergy)
 
void ProposeFirstStepInVolume (G4bool flag)
 
void ProposeGlobalTime (G4double t)
 
void ProposeLastStepInVolume (G4bool flag)
 
void ProposeLocalEnergyDeposit (G4double anEnergyPart)
 
void ProposeLocalTime (G4double t)
 
void ProposeMagneticMoment (G4double finalMagneticMoment)
 
void ProposeMass (G4double finalMass)
 
void ProposeMomentumDirection (const G4ThreeVector &Pfinal)
 
void ProposeMomentumDirection (G4double Px, G4double Py, G4double Pz)
 
void ProposeNonIonizingEnergyDeposit (G4double anEnergyPart)
 
void ProposeParentWeight (G4double finalWeight)
 
void ProposePolarization (const G4ThreeVector &finalPoralization)
 
void ProposePolarization (G4double Px, G4double Py, G4double Pz)
 
void ProposePosition (const G4ThreeVector &finalPosition)
 
void ProposePosition (G4double x, G4double y, G4double z)
 
void ProposeProperTime (G4double finalProperTime)
 
void ProposeSteppingControl (G4SteppingControl StepControlFlag)
 
void ProposeTrackStatus (G4TrackStatus status)
 
void ProposeTrueStepLength (G4double truePathLength)
 
void ProposeVelocity (G4double finalVelocity)
 
void ProposeWeight (G4double finalWeight)
 
void SetDebugFlag ()
 
void SetMaterialCutsCoupleInTouchable (const G4MaterialCutsCouple *fMaterialCutsCouple)
 
void SetMaterialInTouchable (G4Material *fMaterial)
 
void SetMomentumChanged (G4bool b)
 
void SetNumberOfSecondaries (G4int totSecondaries)
 
void SetParentWeightByProcess (G4bool)
 
void SetPointerToVectorOfAuxiliaryPoints (std::vector< G4ThreeVector > *vec)
 
void SetSecondaryWeightByProcess (G4bool)
 
void SetSensitiveDetectorInTouchable (G4VSensitiveDetector *fSensitiveDetector)
 
void SetTouchableHandle (const G4TouchableHandle &fTouchable)
 
void SetVerboseLevel (G4int vLevel)
 
virtual G4StepUpdateStepForAlongStep (G4Step *Step)
 
virtual G4StepUpdateStepForAtRest (G4Step *Step)
 
virtual G4StepUpdateStepForPostStep (G4Step *Step)
 
virtual ~G4ParticleChangeForTransport ()
 

Protected Member Functions

G4bool CheckSecondary (G4Track &)
 
 G4ParticleChangeForTransport (const G4ParticleChangeForTransport &right)
 
G4double GetAccuracyForException () const
 
G4double GetAccuracyForWarning () const
 
void InitializeLocalEnergyDeposit (const G4Track &)
 
void InitializeParentGlobalTime (const G4Track &)
 
void InitializeParentWeight (const G4Track &)
 
void InitializeSecondaries (const G4Track &)
 
void InitializeStatusChange (const G4Track &)
 
void InitializeStepInVolumeFlags (const G4Track &)
 
void InitializeSteppingControl (const G4Track &)
 
void InitializeTrueStepLength (const G4Track &)
 
G4ParticleChangeForTransportoperator= (const G4ParticleChangeForTransport &right)
 
G4StepUpdateStepInfo (G4Step *Step)
 

Protected Attributes

G4bool debugFlag = false
 
G4bool fSetSecondaryWeightByProcess = false
 
G4bool isParentWeightProposed = false
 
G4bool isVelocityChanged = false
 
G4double theChargeChange = 0.0
 
const G4TracktheCurrentTrack = nullptr
 
G4double theEnergyChange = 0.0
 
G4bool theFirstStepInVolume = false
 
G4double theGlobalTime0 = 0.0
 
G4bool theLastStepInVolume = false
 
G4TrackFastVectortheListOfSecondaries = nullptr
 
G4double theLocalEnergyDeposit = 0.0
 
G4double theLocalTime0 = 0.0
 
G4double theMagneticMomentChange = 0.0
 
G4double theMassChange = 0.0
 
G4ThreeVector theMomentumDirectionChange
 
G4double theNonIonizingEnergyDeposit = 0.0
 
G4int theNumberOfSecondaries = 0
 
G4double theParentGlobalTime = 0.0
 
G4double theParentWeight = 1.0
 
G4ThreeVector thePolarizationChange
 
G4ThreeVector thePositionChange
 
G4double theProperTimeChange = 0.0
 
G4int theSizeOftheListOfSecondaries = 0
 
G4TrackStatus theStatusChange = fAlive
 
G4SteppingControl theSteppingControlFlag = NormalCondition
 
G4double theTimeChange = 0.0
 
G4TouchableHandle theTouchableHandle
 
G4double theTrueStepLength = 0.0
 
G4double theVelocityChange = 0.0
 
G4int verboseLevel = 1
 

Static Protected Attributes

static const G4double accuracyForException = 0.001
 
static const G4double accuracyForWarning = 1.0e-9
 

Private Attributes

std::vector< G4ThreeVector > * fpVectorOfAuxiliaryPointsPointer = nullptr
 
G4bool isMomentumChanged = false
 
G4MaterialtheMaterialChange = nullptr
 
const G4MaterialCutsCoupletheMaterialCutsCoupleChange = nullptr
 
G4VSensitiveDetectortheSensitiveDetectorChange = nullptr
 

Detailed Description

Definition at line 45 of file G4ParticleChangeForTransport.hh.

Constructor & Destructor Documentation

◆ G4ParticleChangeForTransport() [1/2]

G4ParticleChangeForTransport::G4ParticleChangeForTransport ( )

Definition at line 39 of file G4ParticleChangeForTransport.cc.

41{
42 // Disable flag that is enabled in G4VParticleChange if G4VERBOSE.
43 debugFlag = false;
44}

References G4VParticleChange::debugFlag.

◆ ~G4ParticleChangeForTransport()

G4ParticleChangeForTransport::~G4ParticleChangeForTransport ( )
virtual

Definition at line 47 of file G4ParticleChangeForTransport.cc.

48{
49}

◆ G4ParticleChangeForTransport() [2/2]

G4ParticleChangeForTransport::G4ParticleChangeForTransport ( const G4ParticleChangeForTransport right)
protected

Definition at line 52 of file G4ParticleChangeForTransport.cc.

55{
56 theTouchableHandle = r.theTouchableHandle;
57 isMomentumChanged = r.isMomentumChanged;
58 theMaterialChange = r.theMaterialChange;
59 theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange;
60 theSensitiveDetectorChange = r.theSensitiveDetectorChange;
61}
const G4MaterialCutsCouple * theMaterialCutsCoupleChange
G4VSensitiveDetector * theSensitiveDetectorChange

References isMomentumChanged, theMaterialChange, theMaterialCutsCoupleChange, theSensitiveDetectorChange, and theTouchableHandle.

Member Function Documentation

◆ AddSecondary() [1/4]

void G4ParticleChange::AddSecondary ( G4DynamicParticle aSecondary,
G4bool  IsGoodForTracking = false 
)
inherited

Definition at line 132 of file G4ParticleChange.cc.

134{
135 // create track
136 G4Track* aTrack = new G4Track(aParticle, GetGlobalTime(), thePositionChange);
137
138 // set IsGoodGorTrackingFlag
139 if(IsGoodForTracking)
140 aTrack->SetGoodForTrackingFlag();
141
142 // touchable handle is copied to keep the pointer
144
145 // add a secondary
147}
G4ThreeVector thePositionChange
const G4Track * theCurrentTrack
G4double GetGlobalTime(G4double timeDelay=0.0) const
void SetTouchableHandle(const G4TouchableHandle &apValue)
const G4TouchableHandle & GetTouchableHandle() const
void SetGoodForTrackingFlag(G4bool value=true)
void AddSecondary(G4Track *aSecondary)

References G4VParticleChange::AddSecondary(), G4ParticleChange::GetGlobalTime(), G4Track::GetTouchableHandle(), G4Track::SetGoodForTrackingFlag(), G4Track::SetTouchableHandle(), G4ParticleChange::theCurrentTrack, and G4ParticleChange::thePositionChange.

◆ AddSecondary() [2/4]

void G4ParticleChange::AddSecondary ( G4DynamicParticle aSecondary,
G4double  time,
G4bool  IsGoodForTracking = false 
)
inherited

Definition at line 169 of file G4ParticleChange.cc.

171{
172 // create track
173 G4Track* aTrack = new G4Track(aParticle, newTime, thePositionChange);
174
175 // set IsGoodGorTrackingFlag
176 if(IsGoodForTracking)
177 aTrack->SetGoodForTrackingFlag();
178
179 // touchable handle is copied to keep the pointer
181
182 // add a secondary
184}

References G4VParticleChange::AddSecondary(), G4Track::GetTouchableHandle(), G4Track::SetGoodForTrackingFlag(), G4Track::SetTouchableHandle(), G4ParticleChange::theCurrentTrack, and G4ParticleChange::thePositionChange.

◆ AddSecondary() [3/4]

void G4ParticleChange::AddSecondary ( G4DynamicParticle aSecondary,
G4ThreeVector  position,
G4bool  IsGoodForTracking = false 
)
inherited

Definition at line 150 of file G4ParticleChange.cc.

153{
154 // create track
155 G4Track* aTrack = new G4Track(aParticle, GetGlobalTime(), newPosition);
156
157 // set IsGoodGorTrackingFlag
158 if(IsGoodForTracking)
159 aTrack->SetGoodForTrackingFlag();
160
161 // touchable is a temporary object, so you cannot keep the pointer
162 aTrack->SetTouchableHandle(nullptr);
163
164 // add a secondary
166}

References G4VParticleChange::AddSecondary(), G4ParticleChange::GetGlobalTime(), G4Track::SetGoodForTrackingFlag(), and G4Track::SetTouchableHandle().

◆ AddSecondary() [4/4]

void G4ParticleChange::AddSecondary ( G4Track aSecondary)
inherited

Definition at line 187 of file G4ParticleChange.cc.

188{
189 // add a secondary
191}

References G4VParticleChange::AddSecondary().

Referenced by G4BOptnLeadingParticle::ApplyFinalStateBiasing(), G4HadronStoppingProcess::AtRestDoIt(), G4MuonMinusAtomicCapture::AtRestDoIt(), G4MuonicAtomDecay::DecayIt(), G4HadronicProcess::FillResult(), G4MuonicAtomDecay::FillResult(), G4BOptnCloning::GenerateBiasingFinalState(), G4PhononDownconversion::MakeLTSecondaries(), G4PhononDownconversion::MakeTTSecondaries(), G4PhononScattering::PostStepDoIt(), G4AdjointForcedInteractionForGamma::PostStepDoIt(), G4NeutrinoElectronProcess::PostStepDoIt(), G4AnnihiToMuPair::PostStepDoIt(), G4GammaConversionToMuons::PostStepDoIt(), G4Cerenkov::PostStepDoIt(), G4ForwardXrayTR::PostStepDoIt(), G4Scintillation::PostStepDoIt(), G4VXTRenergyLoss::PostStepDoIt(), G4ElNeutrinoNucleusProcess::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4MuNeutrinoNucleusProcess::PostStepDoIt(), G4OpWLS::PostStepDoIt(), G4OpWLS2::PostStepDoIt(), G4hImpactIonisation::PostStepDoIt(), G4SynchrotronRadiation::PostStepDoIt(), G4SynchrotronRadiationInMat::PostStepDoIt(), G4AdjointBremsstrahlungModel::RapidSampleSecondaries(), G4AdjointComptonModel::RapidSampleSecondaries(), G4AdjointhIonisationModel::RapidSampleSecondaries(), G4AdjointBremsstrahlungModel::SampleSecondaries(), G4AdjointComptonModel::SampleSecondaries(), G4AdjointeIonisationModel::SampleSecondaries(), G4AdjointhIonisationModel::SampleSecondaries(), G4AdjointIonIonisationModel::SampleSecondaries(), G4AdjointPhotoElectricModel::SampleSecondaries(), and G4SamplingPostStepAction::Split().

◆ CalcMomentum()

G4ThreeVector G4ParticleChange::CalcMomentum ( G4double  energy,
G4ThreeVector  direction,
G4double  mass 
) const
inherited

◆ CheckIt()

G4bool G4ParticleChange::CheckIt ( const G4Track aTrack)
virtualinherited

Reimplemented from G4VParticleChange.

Definition at line 467 of file G4ParticleChange.cc.

468{
469 G4bool exitWithError = false;
470 G4double accuracy;
471 static G4ThreadLocal G4int nError = 0;
472#ifdef G4VERBOSE
473 const G4int maxError = 30;
474#endif
475
476 // no check in case of "fStopAndKill"
478 return G4VParticleChange::CheckIt(aTrack);
479
480 // MomentumDirection should be unit vector
481 G4bool itsOKforMomentum = true;
482 if(theEnergyChange > 0.)
483 {
484 accuracy = std::fabs(theMomentumDirectionChange.mag2() - 1.0);
485 if(accuracy > accuracyForWarning)
486 {
487 itsOKforMomentum = false;
488 nError += 1;
489 exitWithError = exitWithError || (accuracy > accuracyForException);
490#ifdef G4VERBOSE
491 if(nError < maxError)
492 {
493 G4cout << " G4ParticleChange::CheckIt : ";
494 G4cout << "the Momentum Change is not unit vector !!"
495 << " Difference: " << accuracy << G4endl;
497 << " E=" << aTrack.GetKineticEnergy() / MeV
498 << " pos=" << aTrack.GetPosition().x() / m << ", "
499 << aTrack.GetPosition().y() / m << ", "
500 << aTrack.GetPosition().z() / m << G4endl;
501 }
502#endif
503 }
504 }
505
506 // both global and proper time should not go back
507 G4bool itsOKforGlobalTime = true;
508 accuracy = (aTrack.GetLocalTime() - theTimeChange) / ns;
509 if(accuracy > accuracyForWarning)
510 {
511 itsOKforGlobalTime = false;
512 nError += 1;
513 exitWithError = exitWithError || (accuracy > accuracyForException);
514#ifdef G4VERBOSE
515 if(nError < maxError)
516 {
517 G4cout << " G4ParticleChange::CheckIt : ";
518 G4cout << "the local time goes back !!"
519 << " Difference: " << accuracy << "[ns] " << G4endl;
521 << " E=" << aTrack.GetKineticEnergy() / MeV
522 << " pos=" << aTrack.GetPosition().x() / m << ", "
523 << aTrack.GetPosition().y() / m << ", "
524 << aTrack.GetPosition().z() / m
525 << " global time=" << aTrack.GetGlobalTime() / ns
526 << " local time=" << aTrack.GetLocalTime() / ns
527 << " proper time=" << aTrack.GetProperTime() / ns << G4endl;
528 }
529#endif
530 }
531
532 G4bool itsOKforProperTime = true;
533 accuracy = (aTrack.GetProperTime() - theProperTimeChange) / ns;
534 if(accuracy > accuracyForWarning)
535 {
536 itsOKforProperTime = false;
537 nError += 1;
538 exitWithError = exitWithError || (accuracy > accuracyForException);
539#ifdef G4VERBOSE
540 if(nError < maxError)
541 {
542 G4cout << " G4ParticleChange::CheckIt : ";
543 G4cout << "the proper time goes back !!"
544 << " Difference: " << accuracy << "[ns] " << G4endl;
546 << " E=" << aTrack.GetKineticEnergy() / MeV
547 << " pos=" << aTrack.GetPosition().x() / m << ", "
548 << aTrack.GetPosition().y() / m << ", "
549 << aTrack.GetPosition().z() / m
550 << " global time=" << aTrack.GetGlobalTime() / ns
551 << " local time=" << aTrack.GetLocalTime() / ns
552 << " proper time=" << aTrack.GetProperTime() / ns << G4endl;
553 }
554#endif
555 }
556
557 // kinetic Energy should not be negative
558 G4bool itsOKforEnergy = true;
559 accuracy = -1.0 * theEnergyChange / MeV;
560 if(accuracy > accuracyForWarning)
561 {
562 itsOKforEnergy = false;
563 nError += 1;
564 exitWithError = exitWithError || (accuracy > accuracyForException);
565#ifdef G4VERBOSE
566 if(nError < maxError)
567 {
568 G4cout << " G4ParticleChange::CheckIt : ";
569 G4cout << "the kinetic energy is negative !!"
570 << " Difference: " << accuracy << "[MeV] " << G4endl;
572 << " E=" << aTrack.GetKineticEnergy() / MeV
573 << " pos=" << aTrack.GetPosition().x() / m << ", "
574 << aTrack.GetPosition().y() / m << ", "
575 << aTrack.GetPosition().z() / m << G4endl;
576 }
577#endif
578 }
579
580 // velocity should not be less than c_light
581 G4bool itsOKforVelocity = true;
582 if(theVelocityChange < 0.)
583 {
584 itsOKforVelocity = false;
585 nError += 1;
586 exitWithError = true;
587#ifdef G4VERBOSE
588 if(nError < maxError)
589 {
590 G4cout << " G4ParticleChange::CheckIt : ";
591 G4cout << "the velocity is negative !!"
592 << " Velocity: " << theVelocityChange / c_light << G4endl;
594 << " E=" << aTrack.GetKineticEnergy() / MeV
595 << " pos=" << aTrack.GetPosition().x() / m << ", "
596 << aTrack.GetPosition().y() / m << ", "
597 << aTrack.GetPosition().z() / m << G4endl;
598 }
599#endif
600 }
601
602 accuracy = theVelocityChange / c_light - 1.0;
603 if(accuracy > accuracyForWarning)
604 {
605 itsOKforVelocity = false;
606 nError += 1;
607 exitWithError = exitWithError || (accuracy > accuracyForException);
608#ifdef G4VERBOSE
609 if(nError < maxError)
610 {
611 G4cout << " G4ParticleChange::CheckIt : ";
612 G4cout << "the velocity is greater than c_light !!" << G4endl;
613 G4cout << " Velocity: " << theVelocityChange / c_light << G4endl;
615 << " E=" << aTrack.GetKineticEnergy() / MeV
616 << " pos=" << aTrack.GetPosition().x() / m << ", "
617 << aTrack.GetPosition().y() / m << ", "
618 << aTrack.GetPosition().z() / m << G4endl;
619 }
620#endif
621 }
622
623 G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforVelocity &&
624 itsOKforProperTime && itsOKforGlobalTime;
625 // dump out information of this particle change
626#ifdef G4VERBOSE
627 if(!itsOK)
628 {
629 DumpInfo();
630 }
631#endif
632
633 // Exit with error
634 if(exitWithError)
635 {
636 G4Exception("G4ParticleChange::CheckIt()", "TRACK003", EventMustBeAborted,
637 "momentum, energy, and/or time was illegal");
638 }
639 // correction
640 if(!itsOKforMomentum)
641 {
644 }
645 if(!itsOKforGlobalTime)
646 {
647 theTimeChange = aTrack.GetLocalTime();
648 }
649 if(!itsOKforProperTime)
650 {
652 }
653 if(!itsOKforEnergy)
654 {
655 theEnergyChange = 0.0;
656 }
657 if(!itsOKforVelocity)
658 {
660 }
661
662 itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
663 return itsOK;
664}
@ EventMustBeAborted
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
static constexpr double m
Definition: G4SIunits.hh:109
static constexpr double MeV
Definition: G4SIunits.hh:200
@ fStopAndKill
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
double z() const
double x() const
double mag2() const
double y() const
double mag() const
virtual void DumpInfo() const
G4ThreeVector theMomentumDirectionChange
G4double theProperTimeChange
const G4String & GetParticleName() const
const G4ThreeVector & GetPosition() const
G4double GetGlobalTime() const
G4double GetProperTime() const
G4double GetLocalTime() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
virtual G4bool CheckIt(const G4Track &)
static const G4double accuracyForException
static const G4double accuracyForWarning
G4TrackStatus GetTrackStatus() const
float c_light
Definition: hepunit.py:256
#define G4ThreadLocal
Definition: tls.hh:77
#define ns
Definition: xmlparse.cc:614

References G4VParticleChange::accuracyForException, G4VParticleChange::accuracyForWarning, source.hepunit::c_light, G4VParticleChange::CheckIt(), G4ParticleChange::DumpInfo(), EventMustBeAborted, fStopAndKill, G4cout, G4endl, G4Exception(), G4ThreadLocal, G4Track::GetDefinition(), G4Track::GetGlobalTime(), G4Track::GetKineticEnergy(), G4Track::GetLocalTime(), G4ParticleDefinition::GetParticleName(), G4Track::GetPosition(), G4Track::GetProperTime(), G4VParticleChange::GetTrackStatus(), m, CLHEP::Hep3Vector::mag(), CLHEP::Hep3Vector::mag2(), MeV, ns, G4ParticleChange::theEnergyChange, G4ParticleChange::theMomentumDirectionChange, G4ParticleChange::theProperTimeChange, G4ParticleChange::theTimeChange, G4ParticleChange::theVelocityChange, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by G4ParticleChange::UpdateStepForAlongStep(), UpdateStepForAlongStep(), G4ParticleChange::UpdateStepForAtRest(), and G4ParticleChange::UpdateStepForPostStep().

◆ CheckSecondary()

G4bool G4VParticleChange::CheckSecondary ( G4Track aTrack)
protectedinherited

Definition at line 385 of file G4VParticleChange.cc.

386{
387 G4bool exitWithError = false;
388 G4double accuracy;
389 static G4ThreadLocal G4int nError = 0;
390#ifdef G4VERBOSE
391 const G4int maxError = 30;
392#endif
393
394 // MomentumDirection should be unit vector
395 G4bool itsOKforMomentum = true;
396 if(aTrack.GetKineticEnergy() > 0.)
397 {
398 accuracy = std::fabs((aTrack.GetMomentumDirection()).mag2() - 1.0);
399 if(accuracy > accuracyForWarning)
400 {
401 itsOKforMomentum = false;
402 nError += 1;
403 exitWithError = exitWithError || (accuracy > accuracyForException);
404#ifdef G4VERBOSE
405 if(nError < maxError)
406 {
407 G4cout << " G4VParticleChange::CheckSecondary : ";
408 G4cout << "the Momentum direction is not unit vector !! "
409 << " Difference: " << accuracy << G4endl;
411 << " E=" << aTrack.GetKineticEnergy() / MeV
412 << " pos=" << aTrack.GetPosition().x() / m << ", "
413 << aTrack.GetPosition().y() / m << ", "
414 << aTrack.GetPosition().z() / m << G4endl;
415 }
416#endif
417 }
418 }
419
420 // Kinetic Energy should not be negative
421 G4bool itsOKforEnergy = true;
422 accuracy = -1.0 * (aTrack.GetKineticEnergy()) / MeV;
423 if(accuracy > accuracyForWarning)
424 {
425 itsOKforEnergy = false;
426 nError += 1;
427 exitWithError = exitWithError || (accuracy > accuracyForException);
428#ifdef G4VERBOSE
429 if(nError < maxError)
430 {
431 G4cout << " G4VParticleChange::CheckSecondary : ";
432 G4cout << "the kinetic energy is negative !!"
433 << " Difference: " << accuracy << "[MeV] " << G4endl;
434 G4cout << " G4VParticleChange::CheckSecondary : ";
435 G4cout << "the global time of secondary is earlier than the parent !!"
436 << " Difference: " << accuracy << "[ns] " << G4endl;
438 << " E=" << aTrack.GetKineticEnergy() / MeV
439 << " pos=" << aTrack.GetPosition().x() / m << ", "
440 << aTrack.GetPosition().y() / m << ", "
441 << aTrack.GetPosition().z() / m << G4endl;
442 }
443#endif
444 }
445 // Check timing of secondaries
446 G4bool itsOKforTiming = true;
447
448 accuracy = (theParentGlobalTime - aTrack.GetGlobalTime()) / ns;
449 if(accuracy > accuracyForWarning)
450 {
451 itsOKforTiming = false;
452 nError += 1;
453 exitWithError = (accuracy > accuracyForException);
454#ifdef G4VERBOSE
455 if(nError < maxError)
456 {
457 G4cout << " G4VParticleChange::CheckSecondary : ";
458 G4cout
459 << "the global time of secondary goes back comapared to the parent !!"
460 << " Difference: " << accuracy << "[ns] " << G4endl;
462 << " E=" << aTrack.GetKineticEnergy() / MeV
463 << " pos=" << aTrack.GetPosition().x() / m << ", "
464 << aTrack.GetPosition().y() / m << ", "
465 << aTrack.GetPosition().z() / m
466 << " time=" << aTrack.GetGlobalTime() / ns
467 << " parent time=" << theParentGlobalTime / ns << G4endl;
468 }
469#endif
470 }
471
472 // Exit with error
473 if(exitWithError)
474 {
475 G4Exception("G4VParticleChange::CheckSecondary()", "TRACK001",
476 EventMustBeAborted, "Secondary with illegal energy/momentum ");
477 }
478
479 G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforTiming;
480
481 // correction
482 if(!itsOKforMomentum)
483 {
484 G4double vmag = (aTrack.GetMomentumDirection()).mag();
485 aTrack.SetMomentumDirection((1. / vmag) * aTrack.GetMomentumDirection());
486 }
487 if(!itsOKforEnergy)
488 {
489 aTrack.SetKineticEnergy(0.0);
490 }
491
492 if(!itsOK)
493 {
494 this->DumpInfo();
495 }
496
497 return itsOK;
498}
const G4ThreeVector & GetMomentumDirection() const
void SetKineticEnergy(const G4double aValue)
void SetMomentumDirection(const G4ThreeVector &aValue)
virtual void DumpInfo() const

References G4VParticleChange::accuracyForException, G4VParticleChange::accuracyForWarning, G4VParticleChange::DumpInfo(), EventMustBeAborted, G4cout, G4endl, G4Exception(), G4ThreadLocal, G4Track::GetDefinition(), G4Track::GetGlobalTime(), G4Track::GetKineticEnergy(), G4Track::GetMomentumDirection(), G4ParticleDefinition::GetParticleName(), G4Track::GetPosition(), m, MeV, ns, G4Track::SetKineticEnergy(), G4Track::SetMomentumDirection(), G4VParticleChange::theParentGlobalTime, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by G4VParticleChange::AddSecondary().

◆ Clear()

void G4VParticleChange::Clear ( )
inherited

◆ ClearDebugFlag()

void G4VParticleChange::ClearDebugFlag ( )
inherited

◆ DumpInfo()

void G4ParticleChangeForTransport::DumpInfo ( ) const
virtual

Reimplemented from G4ParticleChange.

Definition at line 224 of file G4ParticleChangeForTransport.cc.

225{
226 // use base-class DumpInfo
228
229 G4int oldprc = G4cout.precision(3);
230 G4cout << " Touchable (pointer) : " << std::setw(20)
232 G4cout.precision(oldprc);
233}

References G4ParticleChange::DumpInfo(), G4cout, G4endl, and theTouchableHandle.

◆ GetAccuracyForException()

G4double G4VParticleChange::GetAccuracyForException ( ) const
protectedinherited

Definition at line 507 of file G4VParticleChange.cc.

508{
510}

References G4VParticleChange::accuracyForException.

Referenced by G4FastStep::CheckIt().

◆ GetAccuracyForWarning()

G4double G4VParticleChange::GetAccuracyForWarning ( ) const
protectedinherited

Definition at line 501 of file G4VParticleChange.cc.

502{
503 return accuracyForWarning;
504}

References G4VParticleChange::accuracyForWarning.

Referenced by G4FastStep::CheckIt().

◆ GetCharge()

G4double G4ParticleChange::GetCharge ( ) const
inherited

◆ GetDebugFlag()

G4bool G4VParticleChange::GetDebugFlag ( ) const
inherited

◆ GetEnergy()

G4double G4ParticleChange::GetEnergy ( ) const
inherited

◆ GetFirstStepInVolume()

G4bool G4VParticleChange::GetFirstStepInVolume ( ) const
inherited

Referenced by UpdateStepForPostStep().

◆ GetGlobalPosition()

G4ThreeVector G4ParticleChange::GetGlobalPosition ( const G4ThreeVector displacement) const
inherited

◆ GetGlobalTime()

G4double G4ParticleChange::GetGlobalTime ( G4double  timeDelay = 0.0) const
inherited

◆ GetLastStepInVolume()

G4bool G4VParticleChange::GetLastStepInVolume ( ) const
inherited

Referenced by UpdateStepForPostStep().

◆ GetLocalEnergyDeposit()

G4double G4VParticleChange::GetLocalEnergyDeposit ( ) const
inherited

◆ GetLocalTime()

G4double G4ParticleChange::GetLocalTime ( G4double  timeDelay = 0.0) const
inherited

◆ GetMagneticMoment()

G4double G4ParticleChange::GetMagneticMoment ( ) const
inherited

◆ GetMass()

G4double G4ParticleChange::GetMass ( ) const
inherited

◆ GetMaterialCutsCoupleInTouchable()

const G4MaterialCutsCouple * G4ParticleChangeForTransport::GetMaterialCutsCoupleInTouchable ( ) const

◆ GetMaterialInTouchable()

G4Material * G4ParticleChangeForTransport::GetMaterialInTouchable ( ) const

◆ GetMomentumChanged()

G4bool G4ParticleChangeForTransport::GetMomentumChanged ( ) const

◆ GetMomentumDirection()

const G4ThreeVector * G4ParticleChange::GetMomentumDirection ( ) const
inherited

◆ GetNonIonizingEnergyDeposit()

G4double G4VParticleChange::GetNonIonizingEnergyDeposit ( ) const
inherited

◆ GetNumberOfSecondaries()

G4int G4VParticleChange::GetNumberOfSecondaries ( ) const
inherited

◆ GetParentWeight()

G4double G4VParticleChange::GetParentWeight ( ) const
inherited

◆ GetPointerToVectorOfAuxiliaryPoints()

std::vector< G4ThreeVector > * G4ParticleChangeForTransport::GetPointerToVectorOfAuxiliaryPoints ( ) const
inline

◆ GetPolarization()

const G4ThreeVector * G4ParticleChange::GetPolarization ( ) const
inherited

◆ GetPosition()

const G4ThreeVector * G4ParticleChange::GetPosition ( ) const
inherited

◆ GetProperTime()

G4double G4ParticleChange::GetProperTime ( ) const
inherited

◆ GetSecondary()

G4Track * G4VParticleChange::GetSecondary ( G4int  anIndex) const
inherited

◆ GetSensitiveDetectorInTouchable()

G4VSensitiveDetector * G4ParticleChangeForTransport::GetSensitiveDetectorInTouchable ( ) const

◆ GetSteppingControl()

G4SteppingControl G4VParticleChange::GetSteppingControl ( ) const
inherited

◆ GetTouchableHandle()

const G4TouchableHandle & G4ParticleChangeForTransport::GetTouchableHandle ( ) const

◆ GetTrackStatus()

G4TrackStatus G4VParticleChange::GetTrackStatus ( ) const
inherited

◆ GetTrueStepLength()

G4double G4VParticleChange::GetTrueStepLength ( ) const
inherited

◆ GetVelocity()

G4double G4ParticleChange::GetVelocity ( ) const
inherited

◆ GetVerboseLevel()

G4int G4VParticleChange::GetVerboseLevel ( ) const
inherited

◆ GetWeight()

G4double G4VParticleChange::GetWeight ( ) const
inherited

◆ Initialize()

virtual void G4ParticleChangeForTransport::Initialize ( const G4Track )
virtual

◆ InitializeLocalEnergyDeposit()

void G4VParticleChange::InitializeLocalEnergyDeposit ( const G4Track )
protectedinherited

◆ InitializeParentGlobalTime()

void G4VParticleChange::InitializeParentGlobalTime ( const G4Track )
protectedinherited

◆ InitializeParentWeight()

void G4VParticleChange::InitializeParentWeight ( const G4Track )
protectedinherited

◆ InitializeSecondaries()

void G4VParticleChange::InitializeSecondaries ( const G4Track )
protectedinherited

◆ InitializeStatusChange()

void G4VParticleChange::InitializeStatusChange ( const G4Track )
protectedinherited

◆ InitializeStepInVolumeFlags()

void G4VParticleChange::InitializeStepInVolumeFlags ( const G4Track )
protectedinherited

◆ InitializeSteppingControl()

void G4VParticleChange::InitializeSteppingControl ( const G4Track )
protectedinherited

◆ InitializeTrueStepLength()

void G4VParticleChange::InitializeTrueStepLength ( const G4Track )
protectedinherited

◆ IsParentWeightSetByProcess()

G4bool G4VParticleChange::IsParentWeightSetByProcess ( ) const
inherited

Definition at line 516 of file G4VParticleChange.cc.

516{ return true; }

◆ IsSecondaryWeightSetByProcess()

G4bool G4VParticleChange::IsSecondaryWeightSetByProcess ( ) const
inherited

◆ operator!=() [1/2]

G4bool G4ParticleChange::operator!= ( const G4ParticleChange right) const
inherited

Definition at line 126 of file G4ParticleChange.cc.

127{
128 return ((G4VParticleChange*) this != (G4VParticleChange*) &right);
129}

◆ operator!=() [2/2]

G4bool G4VParticleChange::operator!= ( const G4VParticleChange right) const
inherited

Definition at line 140 of file G4VParticleChange.cc.

141{
142 return (this != (G4VParticleChange*) &right);
143}

◆ operator=()

G4ParticleChangeForTransport & G4ParticleChangeForTransport::operator= ( const G4ParticleChangeForTransport right)
protected

Definition at line 65 of file G4ParticleChangeForTransport.cc.

66{
67 if(this != &r)
68 {
69 theListOfSecondaries = r.theListOfSecondaries;
70 theSizeOftheListOfSecondaries = r.theSizeOftheListOfSecondaries;
71 theNumberOfSecondaries = r.theNumberOfSecondaries;
72 theStatusChange = r.theStatusChange;
73 theTouchableHandle = r.theTouchableHandle;
74 theMaterialChange = r.theMaterialChange;
75 theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange;
76 theSensitiveDetectorChange = r.theSensitiveDetectorChange;
77 theMomentumDirectionChange = r.theMomentumDirectionChange;
78 thePolarizationChange = r.thePolarizationChange;
79 thePositionChange = r.thePositionChange;
80 theTimeChange = r.theTimeChange;
81 theEnergyChange = r.theEnergyChange;
82 theVelocityChange = r.theVelocityChange;
83 theTrueStepLength = r.theTrueStepLength;
84 theLocalEnergyDeposit = r.theLocalEnergyDeposit;
85 theSteppingControlFlag = r.theSteppingControlFlag;
86 }
87 return *this;
88}
G4ThreeVector thePolarizationChange
G4TrackStatus theStatusChange
G4TrackFastVector * theListOfSecondaries
G4SteppingControl theSteppingControlFlag

References G4ParticleChange::theEnergyChange, G4VParticleChange::theListOfSecondaries, G4VParticleChange::theLocalEnergyDeposit, theMaterialChange, theMaterialCutsCoupleChange, G4ParticleChange::theMomentumDirectionChange, G4VParticleChange::theNumberOfSecondaries, G4ParticleChange::thePolarizationChange, G4ParticleChange::thePositionChange, theSensitiveDetectorChange, G4VParticleChange::theSizeOftheListOfSecondaries, G4VParticleChange::theStatusChange, G4VParticleChange::theSteppingControlFlag, G4ParticleChange::theTimeChange, theTouchableHandle, G4VParticleChange::theTrueStepLength, and G4ParticleChange::theVelocityChange.

◆ operator==() [1/2]

G4bool G4ParticleChange::operator== ( const G4ParticleChange right) const
inherited

Definition at line 120 of file G4ParticleChange.cc.

121{
122 return ((G4VParticleChange*) this == (G4VParticleChange*) &right);
123}

◆ operator==() [2/2]

G4bool G4VParticleChange::operator== ( const G4VParticleChange right) const
inherited

Definition at line 134 of file G4VParticleChange.cc.

135{
136 return (this == (G4VParticleChange*) &right);
137}

◆ ProposeCharge()

void G4ParticleChange::ProposeCharge ( G4double  finalCharge)
inherited

◆ ProposeEnergy()

void G4ParticleChange::ProposeEnergy ( G4double  finalEnergy)
inherited

◆ ProposeFirstStepInVolume()

void G4VParticleChange::ProposeFirstStepInVolume ( G4bool  flag)
inherited

◆ ProposeGlobalTime()

void G4ParticleChange::ProposeGlobalTime ( G4double  t)
inherited

◆ ProposeLastStepInVolume()

void G4VParticleChange::ProposeLastStepInVolume ( G4bool  flag)
inherited

◆ ProposeLocalEnergyDeposit()

void G4VParticleChange::ProposeLocalEnergyDeposit ( G4double  anEnergyPart)
inherited

Referenced by G4VEnergyLossProcess::AlongStepDoIt(), G4ErrorEnergyLoss::AlongStepDoIt(), G4NuclearStopping::AlongStepDoIt(), G4hImpactIonisation::AlongStepDoIt(), G4HadronStoppingProcess::AtRestDoIt(), G4MuonMinusAtomicCapture::AtRestDoIt(), G4eplusAnnihilation::AtRestDoIt(), G4RadioactiveDecay::DecayAnalog(), G4DNAMolecularDissociation::DecayIt(), G4Decay::DecayIt(), G4UnknownDecay::DecayIt(), G4Radioactivation::DecayIt(), G4RadioactiveDecay::DecayIt(), G4MuonicAtomDecay::DecayIt(), G4OpBoundaryProcess::DoAbsorption(), G4HadronicProcess::FillResult(), G4MuonicAtomDecay::FillResult(), G4SpecialCuts::PostStepDoIt(), G4UserSpecialCuts::PostStepDoIt(), G4LowECapture::PostStepDoIt(), G4VEmProcess::PostStepDoIt(), G4VEnergyLossProcess::PostStepDoIt(), G4NeutrinoElectronProcess::PostStepDoIt(), G4UCNBoundaryProcess::PostStepDoIt(), G4ElNeutrinoNucleusProcess::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4MuNeutrinoNucleusProcess::PostStepDoIt(), G4OpAbsorption::PostStepDoIt(), G4OpBoundaryProcess::PostStepDoIt(), G4hImpactIonisation::PostStepDoIt(), G4SynchrotronRadiationInMat::PostStepDoIt(), G4DNABornExcitationModel1::SampleSecondaries(), G4DNABornExcitationModel2::SampleSecondaries(), G4DNABornIonisationModel1::SampleSecondaries(), G4DNABornIonisationModel2::SampleSecondaries(), G4DNACPA100ElasticModel::SampleSecondaries(), G4DNACPA100ExcitationModel::SampleSecondaries(), G4DNACPA100IonisationModel::SampleSecondaries(), G4DNADingfelderChargeDecreaseModel::SampleSecondaries(), G4DNADingfelderChargeIncreaseModel::SampleSecondaries(), G4DNADiracRMatrixExcitationModel::SampleSecondaries(), G4DNAELSEPAElasticModel::SampleSecondaries(), G4DNAEmfietzoglouExcitationModel::SampleSecondaries(), G4DNAEmfietzoglouIonisationModel::SampleSecondaries(), G4DNAIonElasticModel::SampleSecondaries(), G4DNAMeltonAttachmentModel::SampleSecondaries(), G4DNAMillerGreenExcitationModel::SampleSecondaries(), G4DNAQuinnPlasmonExcitationModel::SampleSecondaries(), G4DNARelativisticIonisationModel::SampleSecondaries(), G4DNARuddIonisationExtendedModel::SampleSecondaries(), G4DNARuddIonisationModel::SampleSecondaries(), G4DNASancheExcitationModel::SampleSecondaries(), G4DNATransformElectronModel::SampleSecondaries(), G4BoldyshevTripletModel::SampleSecondaries(), G4eSingleCoulombScatteringModel::SampleSecondaries(), G4IonCoulombScatteringModel::SampleSecondaries(), G4PAIPhotModel::SampleSecondaries(), G4JAEAElasticScatteringModel::SampleSecondaries(), G4JAEAPolarizedElasticScatteringModel::SampleSecondaries(), G4LivermoreComptonModel::SampleSecondaries(), G4LivermoreIonisationModel::SampleSecondaries(), G4LivermorePhotoElectricModel::SampleSecondaries(), G4LivermorePolarizedComptonModel::SampleSecondaries(), G4LivermorePolarizedRayleighModel::SampleSecondaries(), G4LowEPComptonModel::SampleSecondaries(), G4LowEPPolarizedComptonModel::SampleSecondaries(), G4MicroElecElasticModel::SampleSecondaries(), G4MicroElecElasticModel_new::SampleSecondaries(), G4MicroElecInelasticModel::SampleSecondaries(), G4MicroElecInelasticModel_new::SampleSecondaries(), G4PenelopeBremsstrahlungModel::SampleSecondaries(), G4PenelopeComptonModel::SampleSecondaries(), G4PenelopeGammaConversionModel::SampleSecondaries(), G4PenelopeIonisationModel::SampleSecondaries(), G4PenelopePhotoElectricModel::SampleSecondaries(), G4PenelopeRayleighModel::SampleSecondaries(), G4PenelopeRayleighModelMI::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), G4eCoulombScatteringModel::SampleSecondaries(), G4hCoulombScatteringModel::SampleSecondaries(), G4KleinNishinaCompton::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4PEEffectFluoModel::SampleSecondaries(), G4LEPTSAttachmentModel::SampleSecondaries(), G4LEPTSDissociationModel::SampleSecondaries(), G4LEPTSElasticModel::SampleSecondaries(), G4LEPTSExcitationModel::SampleSecondaries(), G4LEPTSIonisationModel::SampleSecondaries(), G4LEPTSPositroniumModel::SampleSecondaries(), G4LEPTSRotExcitationModel::SampleSecondaries(), G4LEPTSVibExcitationModel::SampleSecondaries(), G4DNAPTBElasticModel::SampleSecondaries(), G4DNAPTBExcitationModel::SampleSecondaries(), and G4DNAPTBIonisationModel::SampleSecondaries().

◆ ProposeLocalTime()

void G4ParticleChange::ProposeLocalTime ( G4double  t)
inherited

◆ ProposeMagneticMoment()

void G4ParticleChange::ProposeMagneticMoment ( G4double  finalMagneticMoment)
inherited

◆ ProposeMass()

void G4ParticleChange::ProposeMass ( G4double  finalMass)
inherited

◆ ProposeMomentumDirection() [1/2]

void G4ParticleChange::ProposeMomentumDirection ( const G4ThreeVector Pfinal)
inherited

◆ ProposeMomentumDirection() [2/2]

void G4ParticleChange::ProposeMomentumDirection ( G4double  Px,
G4double  Py,
G4double  Pz 
)
inherited

◆ ProposeNonIonizingEnergyDeposit()

void G4VParticleChange::ProposeNonIonizingEnergyDeposit ( G4double  anEnergyPart)
inherited

◆ ProposeParentWeight()

void G4VParticleChange::ProposeParentWeight ( G4double  finalWeight)
inherited

◆ ProposePolarization() [1/2]

void G4ParticleChange::ProposePolarization ( const G4ThreeVector finalPoralization)
inherited

◆ ProposePolarization() [2/2]

void G4ParticleChange::ProposePolarization ( G4double  Px,
G4double  Py,
G4double  Pz 
)
inherited

◆ ProposePosition() [1/2]

void G4ParticleChange::ProposePosition ( const G4ThreeVector finalPosition)
inherited

◆ ProposePosition() [2/2]

void G4ParticleChange::ProposePosition ( G4double  x,
G4double  y,
G4double  z 
)
inherited

◆ ProposeProperTime()

void G4ParticleChange::ProposeProperTime ( G4double  finalProperTime)
inherited

◆ ProposeSteppingControl()

void G4VParticleChange::ProposeSteppingControl ( G4SteppingControl  StepControlFlag)
inherited

◆ ProposeTrackStatus()

void G4VParticleChange::ProposeTrackStatus ( G4TrackStatus  status)
inherited

Referenced by G4BiasingProcessInterface::AlongStepDoIt(), G4ITTransportation::AlongStepDoIt(), G4CoupledTransportation::AlongStepDoIt(), G4Transportation::AlongStepDoIt(), G4hImpactIonisation::AlongStepDoIt(), G4BOptnLeadingParticle::ApplyFinalStateBiasing(), G4HadronStoppingProcess::AtRestDoIt(), G4MuonMinusAtomicCapture::AtRestDoIt(), G4RadioactiveDecay::DecayAnalog(), G4DNAMolecularDissociation::DecayIt(), G4Decay::DecayIt(), G4UnknownDecay::DecayIt(), G4Radioactivation::DecayIt(), G4RadioactiveDecay::DecayIt(), G4MuonicAtomDecay::DecayIt(), G4DNABrownianTransportation::Diffusion(), G4OpBoundaryProcess::DoAbsorption(), G4HadronicProcess::FillResult(), G4MuonicAtomDecay::FillResult(), G4FastStep::KillPrimaryTrack(), G4ImportanceProcess::KillTrack(), G4WeightWindowProcess::KillTrack(), G4DNAElectronHoleRecombination::MakeReaction(), G4SpecialCuts::PostStepDoIt(), G4WeightCutOffProcess::PostStepDoIt(), G4DNASecondOrderReaction::PostStepDoIt(), G4FastSimulationManagerProcess::PostStepDoIt(), G4PhononDownconversion::PostStepDoIt(), G4PhononReflection::PostStepDoIt(), G4PhononScattering::PostStepDoIt(), G4NeutronKiller::PostStepDoIt(), G4UserSpecialCuts::PostStepDoIt(), G4DNAScavengerProcess::PostStepDoIt(), G4LowECapture::PostStepDoIt(), G4VEmProcess::PostStepDoIt(), G4VEnergyLossProcess::PostStepDoIt(), G4NeutrinoElectronProcess::PostStepDoIt(), G4UCNAbsorption::PostStepDoIt(), G4UCNBoundaryProcess::PostStepDoIt(), G4UCNLoss::PostStepDoIt(), G4AnnihiToMuPair::PostStepDoIt(), G4GammaConversionToMuons::PostStepDoIt(), G4Cerenkov::PostStepDoIt(), G4Scintillation::PostStepDoIt(), G4ElNeutrinoNucleusProcess::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4MuNeutrinoNucleusProcess::PostStepDoIt(), G4OpAbsorption::PostStepDoIt(), G4OpBoundaryProcess::PostStepDoIt(), G4OpWLS::PostStepDoIt(), G4OpWLS2::PostStepDoIt(), G4ITTransportation::PostStepDoIt(), G4BiasingProcessInterface::PostStepDoIt(), G4hImpactIonisation::PostStepDoIt(), G4SynchrotronRadiationInMat::PostStepDoIt(), G4CoupledTransportation::PostStepDoIt(), G4Transportation::PostStepDoIt(), G4AdjointBremsstrahlungModel::RapidSampleSecondaries(), G4AdjointComptonModel::RapidSampleSecondaries(), G4AdjointhIonisationModel::RapidSampleSecondaries(), G4AdjointBremsstrahlungModel::SampleSecondaries(), G4AdjointComptonModel::SampleSecondaries(), G4AdjointeIonisationModel::SampleSecondaries(), G4AdjointhIonisationModel::SampleSecondaries(), G4AdjointIonIonisationModel::SampleSecondaries(), G4AdjointPhotoElectricModel::SampleSecondaries(), G4LivermoreBremsstrahlungModel::SampleSecondaries(), G4eBremParametrizedModel::SampleSecondaries(), G4eBremsstrahlungRelModel::SampleSecondaries(), G4SeltzerBergerModel::SampleSecondaries(), G4DNADingfelderChargeDecreaseModel::SampleSecondaries(), G4DNADingfelderChargeIncreaseModel::SampleSecondaries(), G4DNAELSEPAElasticModel::SampleSecondaries(), G4DNAIonElasticModel::SampleSecondaries(), G4DNAMeltonAttachmentModel::SampleSecondaries(), G4DNARuddIonisationExtendedModel::SampleSecondaries(), G4DNARuddIonisationModel::SampleSecondaries(), G4DNATransformElectronModel::SampleSecondaries(), G4BoldyshevTripletModel::SampleSecondaries(), G4PolarizedAnnihilationModel::SampleSecondaries(), G4JAEAElasticScatteringModel::SampleSecondaries(), G4JAEAPolarizedElasticScatteringModel::SampleSecondaries(), G4LivermoreComptonModel::SampleSecondaries(), G4LivermoreNuclearGammaConversionModel::SampleSecondaries(), G4LivermorePhotoElectricModel::SampleSecondaries(), G4LivermorePolarizedComptonModel::SampleSecondaries(), G4LivermorePolarizedGammaConversionModel::SampleSecondaries(), G4LivermorePolarizedRayleighModel::SampleSecondaries(), G4LowEPComptonModel::SampleSecondaries(), G4LowEPPolarizedComptonModel::SampleSecondaries(), G4MicroElecElasticModel::SampleSecondaries(), G4MicroElecElasticModel_new::SampleSecondaries(), G4PenelopeAnnihilationModel::SampleSecondaries(), G4PenelopeComptonModel::SampleSecondaries(), G4PenelopeGammaConversionModel::SampleSecondaries(), G4PenelopePhotoElectricModel::SampleSecondaries(), G4PenelopeRayleighModel::SampleSecondaries(), G4PenelopeRayleighModelMI::SampleSecondaries(), G4MuBremsstrahlungModel::SampleSecondaries(), G4MuPairProductionModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), G4BetheHeitlerModel::SampleSecondaries(), G4eeToTwoGammaModel::SampleSecondaries(), G4KleinNishinaCompton::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4PairProductionRelModel::SampleSecondaries(), G4PEEffectFluoModel::SampleSecondaries(), G4eplusTo2GammaOKVIModel::SampleSecondaries(), G4eplusTo3GammaOKVIModel::SampleSecondaries(), G4eeToHadronsMultiModel::SampleSecondaries(), G4LEPTSAttachmentModel::SampleSecondaries(), G4LEPTSElasticModel::SampleSecondaries(), G4LEPTSPositroniumModel::SampleSecondaries(), G4DNAPTBElasticModel::SampleSecondaries(), and G4BetheHeitler5DModel::SampleSecondaries().

◆ ProposeTrueStepLength()

void G4VParticleChange::ProposeTrueStepLength ( G4double  truePathLength)
inherited

◆ ProposeVelocity()

void G4ParticleChange::ProposeVelocity ( G4double  finalVelocity)
inherited

◆ ProposeWeight()

void G4VParticleChange::ProposeWeight ( G4double  finalWeight)
inherited

◆ SetDebugFlag()

void G4VParticleChange::SetDebugFlag ( )
inherited

◆ SetMaterialCutsCoupleInTouchable()

void G4ParticleChangeForTransport::SetMaterialCutsCoupleInTouchable ( const G4MaterialCutsCouple fMaterialCutsCouple)

◆ SetMaterialInTouchable()

void G4ParticleChangeForTransport::SetMaterialInTouchable ( G4Material fMaterial)

◆ SetMomentumChanged()

void G4ParticleChangeForTransport::SetMomentumChanged ( G4bool  b)

◆ SetNumberOfSecondaries()

void G4VParticleChange::SetNumberOfSecondaries ( G4int  totSecondaries)
inherited

◆ SetParentWeightByProcess()

void G4VParticleChange::SetParentWeightByProcess ( G4bool  )
inherited

◆ SetPointerToVectorOfAuxiliaryPoints()

void G4ParticleChangeForTransport::SetPointerToVectorOfAuxiliaryPoints ( std::vector< G4ThreeVector > *  vec)
inline

◆ SetSecondaryWeightByProcess()

void G4VParticleChange::SetSecondaryWeightByProcess ( G4bool  )
inherited

◆ SetSensitiveDetectorInTouchable()

void G4ParticleChangeForTransport::SetSensitiveDetectorInTouchable ( G4VSensitiveDetector fSensitiveDetector)

◆ SetTouchableHandle()

void G4ParticleChangeForTransport::SetTouchableHandle ( const G4TouchableHandle fTouchable)

◆ SetVerboseLevel()

void G4VParticleChange::SetVerboseLevel ( G4int  vLevel)
inherited

◆ UpdateStepForAlongStep()

G4Step * G4ParticleChangeForTransport::UpdateStepForAlongStep ( G4Step Step)
virtual

Reimplemented from G4ParticleChange.

Definition at line 98 of file G4ParticleChangeForTransport.cc.

99{
100 // Smooth curved tajectory representation: let the Step know about
101 // the auxiliary trajectory points (jacek 30/10/2002)
102 pStep->SetPointerToVectorOfAuxiliaryPoints(fpVectorOfAuxiliaryPointsPointer);
103
104 // copy of G4ParticleChange::UpdateStepForAlongStep
105 // i.e. no effect for touchable
106
107 // A physics process always calculates the final state of the
108 // particle relative to the initial state at the beginning
109 // of the Step, i.e., based on information of G4Track (or
110 // equivalently the PreStepPoint).
111 // So, the differences (delta) between these two states have to be
112 // calculated and be accumulated in PostStepPoint.
113
114 // Take note that the return type of GetMomentumChange is a
115 // pointer to G4ThreeVector. Also it is a normalized
116 // momentum vector.
117
118 G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
119 G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
120 G4Track* aTrack = pStep->GetTrack();
121 G4double mass = aTrack->GetDynamicParticle()->GetMass();
122
123 // update kinetic energy
124 // now assume that no energy change in transportation
125 // However it is not true in electric fields
126 // Case for changing energy will be implemented in future
127
128 // update momentum direction and energy
130 {
132 energy = pPostStepPoint->GetKineticEnergy() +
133 (theEnergyChange - pPreStepPoint->GetKineticEnergy());
134
135 // calculate new momentum
136 G4ThreeVector pMomentum =
137 pPostStepPoint->GetMomentum() +
139 pPreStepPoint->GetMomentum());
140 G4double tMomentum = pMomentum.mag();
141 G4ThreeVector direction(1.0, 0.0, 0.0);
142 if(tMomentum > 0.)
143 {
144 G4double inv_Momentum = 1.0 / tMomentum;
145 direction = pMomentum * inv_Momentum;
146 }
147 pPostStepPoint->SetMomentumDirection(direction);
148 pPostStepPoint->SetKineticEnergy(energy);
149 }
151 pPostStepPoint->SetVelocity(theVelocityChange);
152
153 // stop case should not occur
154 // pPostStepPoint->SetMomentumDirection(G4ThreeVector(1., 0., 0.));
155
156 // update polarization
157 pPostStepPoint->AddPolarization(thePolarizationChange -
158 pPreStepPoint->GetPolarization());
159
160 // update position and time
161 pPostStepPoint->AddPosition(thePositionChange - pPreStepPoint->GetPosition());
162 pPostStepPoint->AddGlobalTime(theTimeChange - pPreStepPoint->GetLocalTime());
163 pPostStepPoint->AddLocalTime(theTimeChange - pPreStepPoint->GetLocalTime());
164 pPostStepPoint->AddProperTime(theProperTimeChange -
165 pPreStepPoint->GetProperTime());
166
167#ifdef G4VERBOSE
168 if(debugFlag) { CheckIt(*aTrack); }
169#endif
170
171 // Update the G4Step specific attributes
172 // pStep->SetStepLength( theTrueStepLength );
173 // pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
174 pStep->SetControlFlag(theSteppingControlFlag);
175
176 return pStep;
177}
G4double GetMass() const
std::vector< G4ThreeVector > * fpVectorOfAuxiliaryPointsPointer
G4ThreeVector CalcMomentum(G4double energy, G4ThreeVector direction, G4double mass) const
virtual G4bool CheckIt(const G4Track &)
void AddPolarization(const G4ThreeVector &aValue)
void SetKineticEnergy(const G4double aValue)
G4double GetProperTime() const
void AddProperTime(const G4double aValue)
void SetVelocity(G4double v)
void AddPosition(const G4ThreeVector &aValue)
G4ThreeVector GetMomentum() const
const G4ThreeVector & GetPosition() const
void AddGlobalTime(const G4double aValue)
G4double GetLocalTime() const
const G4ThreeVector & GetPolarization() const
G4double GetKineticEnergy() const
void AddLocalTime(const G4double aValue)
void SetMomentumDirection(const G4ThreeVector &aValue)
const G4DynamicParticle * GetDynamicParticle() const
G4double energy(const ThreeVector &p, const G4double m)

References G4StepPoint::AddGlobalTime(), G4StepPoint::AddLocalTime(), G4StepPoint::AddPolarization(), G4StepPoint::AddPosition(), G4StepPoint::AddProperTime(), G4ParticleChange::CalcMomentum(), G4ParticleChange::CheckIt(), G4VParticleChange::debugFlag, G4INCL::KinematicsUtils::energy(), fpVectorOfAuxiliaryPointsPointer, G4Track::GetDynamicParticle(), G4StepPoint::GetKineticEnergy(), G4StepPoint::GetLocalTime(), G4DynamicParticle::GetMass(), G4StepPoint::GetMomentum(), G4StepPoint::GetPolarization(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4StepPoint::GetProperTime(), G4Step::GetTrack(), isMomentumChanged, G4ParticleChange::isVelocityChanged, CLHEP::Hep3Vector::mag(), G4Step::SetControlFlag(), G4StepPoint::SetKineticEnergy(), G4StepPoint::SetMomentumDirection(), G4Step::SetPointerToVectorOfAuxiliaryPoints(), G4StepPoint::SetVelocity(), G4ParticleChange::theEnergyChange, G4ParticleChange::theMomentumDirectionChange, G4ParticleChange::thePolarizationChange, G4ParticleChange::thePositionChange, G4ParticleChange::theProperTimeChange, G4VParticleChange::theSteppingControlFlag, G4ParticleChange::theTimeChange, and G4ParticleChange::theVelocityChange.

◆ UpdateStepForAtRest()

G4Step * G4ParticleChangeForTransport::UpdateStepForAtRest ( G4Step Step)
virtual

Reimplemented from G4ParticleChange.

Definition at line 91 of file G4ParticleChangeForTransport.cc.

92{
93 // Update the G4Step specific attributes
94 return UpdateStepInfo(pStep);
95}
G4Step * UpdateStepInfo(G4Step *Step)

References G4ParticleChange::UpdateStepInfo().

◆ UpdateStepForPostStep()

G4Step * G4ParticleChangeForTransport::UpdateStepForPostStep ( G4Step Step)
virtual

Reimplemented from G4ParticleChange.

Definition at line 180 of file G4ParticleChangeForTransport.cc.

181{
182 // A physics process always calculates the final state of the particle
183
184 // Change volume only if some kinetic energy remains
185 G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
186 if(pPostStepPoint->GetKineticEnergy() > 0.0)
187 {
188 // update next touchable
189 // (touchable can be changed only at PostStepDoIt)
190 pPostStepPoint->SetTouchableHandle(theTouchableHandle);
191
192 pPostStepPoint->SetMaterial(theMaterialChange);
195 }
196 if(this->GetFirstStepInVolume())
197 {
198 pStep->SetFirstStepFlag();
199 }
200 else
201 {
202 pStep->ClearFirstStepFlag();
203 }
204 if(this->GetLastStepInVolume())
205 {
206 pStep->SetLastStepFlag();
207 }
208 else
209 {
210 pStep->ClearLastStepFlag();
211 }
212 // It used to call base class's method
213 // - but this would copy uninitialised data members
214 // return G4ParticleChange::UpdateStepForPostStep(pStep);
215
216 // Copying what the base class does would instead
217 // - also not useful
218 // return G4VParticleChange::UpdateStepInfo(pStep);
219
220 return pStep;
221}
void SetSensitiveDetector(G4VSensitiveDetector *)
void SetMaterial(G4Material *)
void SetTouchableHandle(const G4TouchableHandle &apValue)
void SetMaterialCutsCouple(const G4MaterialCutsCouple *)
G4bool GetFirstStepInVolume() const
G4bool GetLastStepInVolume() const

References G4Step::ClearFirstStepFlag(), G4Step::ClearLastStepFlag(), G4VParticleChange::GetFirstStepInVolume(), G4StepPoint::GetKineticEnergy(), G4VParticleChange::GetLastStepInVolume(), G4Step::GetPostStepPoint(), G4Step::SetFirstStepFlag(), G4Step::SetLastStepFlag(), G4StepPoint::SetMaterial(), G4StepPoint::SetMaterialCutsCouple(), G4StepPoint::SetSensitiveDetector(), G4StepPoint::SetTouchableHandle(), theMaterialChange, theMaterialCutsCoupleChange, theSensitiveDetectorChange, and theTouchableHandle.

◆ UpdateStepInfo()

G4Step * G4ParticleChange::UpdateStepInfo ( G4Step Step)
protectedinherited

Field Documentation

◆ accuracyForException

const G4double G4VParticleChange::accuracyForException = 0.001
staticprotectedinherited

◆ accuracyForWarning

const G4double G4VParticleChange::accuracyForWarning = 1.0e-9
staticprotectedinherited

◆ debugFlag

G4bool G4VParticleChange::debugFlag = false
protectedinherited

◆ fpVectorOfAuxiliaryPointsPointer

std::vector<G4ThreeVector>* G4ParticleChangeForTransport::fpVectorOfAuxiliaryPointsPointer = nullptr
private

Definition at line 124 of file G4ParticleChangeForTransport.hh.

Referenced by UpdateStepForAlongStep().

◆ fSetSecondaryWeightByProcess

G4bool G4VParticleChange::fSetSecondaryWeightByProcess = false
protectedinherited

◆ isMomentumChanged

G4bool G4ParticleChangeForTransport::isMomentumChanged = false
private

◆ isParentWeightProposed

G4bool G4VParticleChange::isParentWeightProposed = false
protectedinherited

◆ isVelocityChanged

G4bool G4ParticleChange::isVelocityChanged = false
protectedinherited

◆ theChargeChange

G4double G4ParticleChange::theChargeChange = 0.0
protectedinherited

◆ theCurrentTrack

const G4Track* G4ParticleChange::theCurrentTrack = nullptr
protectedinherited

◆ theEnergyChange

G4double G4ParticleChange::theEnergyChange = 0.0
protectedinherited

◆ theFirstStepInVolume

G4bool G4VParticleChange::theFirstStepInVolume = false
protectedinherited

◆ theGlobalTime0

G4double G4ParticleChange::theGlobalTime0 = 0.0
protectedinherited

◆ theLastStepInVolume

G4bool G4VParticleChange::theLastStepInVolume = false
protectedinherited

◆ theListOfSecondaries

G4TrackFastVector* G4VParticleChange::theListOfSecondaries = nullptr
protectedinherited

◆ theLocalEnergyDeposit

G4double G4VParticleChange::theLocalEnergyDeposit = 0.0
protectedinherited

◆ theLocalTime0

G4double G4ParticleChange::theLocalTime0 = 0.0
protectedinherited

◆ theMagneticMomentChange

G4double G4ParticleChange::theMagneticMomentChange = 0.0
protectedinherited

◆ theMassChange

G4double G4ParticleChange::theMassChange = 0.0
protectedinherited

◆ theMaterialChange

G4Material* G4ParticleChangeForTransport::theMaterialChange = nullptr
private

◆ theMaterialCutsCoupleChange

const G4MaterialCutsCouple* G4ParticleChangeForTransport::theMaterialCutsCoupleChange = nullptr
private

◆ theMomentumDirectionChange

G4ThreeVector G4ParticleChange::theMomentumDirectionChange
protectedinherited

◆ theNonIonizingEnergyDeposit

G4double G4VParticleChange::theNonIonizingEnergyDeposit = 0.0
protectedinherited

◆ theNumberOfSecondaries

G4int G4VParticleChange::theNumberOfSecondaries = 0
protectedinherited

◆ theParentGlobalTime

G4double G4VParticleChange::theParentGlobalTime = 0.0
protectedinherited

◆ theParentWeight

G4double G4VParticleChange::theParentWeight = 1.0
protectedinherited

◆ thePolarizationChange

G4ThreeVector G4ParticleChange::thePolarizationChange
protectedinherited

◆ thePositionChange

G4ThreeVector G4ParticleChange::thePositionChange
protectedinherited

◆ theProperTimeChange

G4double G4ParticleChange::theProperTimeChange = 0.0
protectedinherited

◆ theSensitiveDetectorChange

G4VSensitiveDetector* G4ParticleChangeForTransport::theSensitiveDetectorChange = nullptr
private

◆ theSizeOftheListOfSecondaries

G4int G4VParticleChange::theSizeOftheListOfSecondaries = 0
protectedinherited

◆ theStatusChange

G4TrackStatus G4VParticleChange::theStatusChange = fAlive
protectedinherited

◆ theSteppingControlFlag

G4SteppingControl G4VParticleChange::theSteppingControlFlag = NormalCondition
protectedinherited

◆ theTimeChange

G4double G4ParticleChange::theTimeChange = 0.0
protectedinherited

◆ theTouchableHandle

G4TouchableHandle G4ParticleChangeForTransport::theTouchableHandle
protected

◆ theTrueStepLength

G4double G4VParticleChange::theTrueStepLength = 0.0
protectedinherited

◆ theVelocityChange

G4double G4ParticleChange::theVelocityChange = 0.0
protectedinherited

◆ verboseLevel

G4int G4VParticleChange::verboseLevel = 1
protectedinherited

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