Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
G4FastStep Class Reference

#include <G4FastStep.hh>

Inheritance diagram for G4FastStep:
G4VParticleChange

Public Member Functions

void KillPrimaryTrack ()
 
void ProposePrimaryTrackFinalPosition (const G4ThreeVector &, G4bool localCoordinates=true)
 
void SetPrimaryTrackFinalPosition (const G4ThreeVector &, G4bool localCoordinates=true)
 
void ProposePrimaryTrackFinalTime (G4double)
 
void SetPrimaryTrackFinalTime (G4double)
 
void ProposePrimaryTrackFinalProperTime (G4double)
 
void SetPrimaryTrackFinalProperTime (G4double)
 
void ProposePrimaryTrackFinalMomentumDirection (const G4ThreeVector &, G4bool localCoordinates=true)
 
void SetPrimaryTrackFinalMomentum (const G4ThreeVector &, G4bool localCoordinates=true)
 
void ProposePrimaryTrackFinalKineticEnergy (G4double)
 
void SetPrimaryTrackFinalKineticEnergy (G4double)
 
void ProposePrimaryTrackFinalKineticEnergyAndDirection (G4double, const G4ThreeVector &, G4bool localCoordinates=true)
 
void SetPrimaryTrackFinalKineticEnergyAndDirection (G4double, const G4ThreeVector &, G4bool localCoordinates=true)
 
void ProposePrimaryTrackFinalPolarization (const G4ThreeVector &, G4bool localCoordinates=true)
 
void SetPrimaryTrackFinalPolarization (const G4ThreeVector &, G4bool localCoordinates=true)
 
void ProposePrimaryTrackPathLength (G4double)
 
void SetPrimaryTrackPathLength (G4double)
 
void ProposePrimaryTrackFinalEventBiasingWeight (G4double)
 
void SetPrimaryTrackFinalEventBiasingWeight (G4double)
 
void SetNumberOfSecondaryTracks (G4int)
 
G4int GetNumberOfSecondaryTracks ()
 
G4TrackCreateSecondaryTrack (const G4DynamicParticle &, G4ThreeVector, G4ThreeVector, G4double, G4bool localCoordinates=true)
 
G4TrackCreateSecondaryTrack (const G4DynamicParticle &, G4ThreeVector, G4double, G4bool localCoordinates=true)
 
G4TrackGetSecondaryTrack (G4int)
 
void ProposeTotalEnergyDeposited (G4double anEnergyPart)
 
void SetTotalEnergyDeposited (G4double anEnergyPart)
 
G4double GetTotalEnergyDeposited () const
 
void ForceSteppingHitInvocation ()
 
 G4FastStep ()
 
virtual ~G4FastStep ()
 
G4bool operator== (const G4FastStep &right) const
 
G4bool operator!= (const G4FastStep &right) const
 
G4StepUpdateStepForAtRest (G4Step *Step)
 
G4StepUpdateStepForPostStep (G4Step *Step)
 
void Initialize (const G4FastTrack &)
 
void DumpInfo () const
 
G4bool CheckIt (const G4Track &)
 
- Public Member Functions inherited from G4VParticleChange
 G4VParticleChange ()
 
virtual ~G4VParticleChange ()
 
G4bool operator== (const G4VParticleChange &right) const
 
G4bool operator!= (const G4VParticleChange &right) const
 
virtual G4StepUpdateStepForAlongStep (G4Step *Step)
 
G4double GetTrueStepLength () const
 
void ProposeTrueStepLength (G4double truePathLength)
 
G4double GetLocalEnergyDeposit () const
 
void ProposeLocalEnergyDeposit (G4double anEnergyPart)
 
G4double GetNonIonizingEnergyDeposit () const
 
void ProposeNonIonizingEnergyDeposit (G4double anEnergyPart)
 
G4TrackStatus GetTrackStatus () const
 
void ProposeTrackStatus (G4TrackStatus status)
 
G4SteppingControl GetSteppingControl () const
 
void ProposeSteppingControl (G4SteppingControl StepControlFlag)
 
G4bool GetFirstStepInVolume () const
 
G4bool GetLastStepInVolume () const
 
void ProposeFirstStepInVolume (G4bool flag)
 
void ProposeLastStepInVolume (G4bool flag)
 
void Clear ()
 
void SetNumberOfSecondaries (G4int totSecondaries)
 
G4int GetNumberOfSecondaries () const
 
G4TrackGetSecondary (G4int anIndex) const
 
void AddSecondary (G4Track *aSecondary)
 
G4double GetWeight () const
 
G4double GetParentWeight () const
 
void ProposeWeight (G4double finalWeight)
 
void ProposeParentWeight (G4double finalWeight)
 
void SetSecondaryWeightByProcess (G4bool)
 
G4bool IsSecondaryWeightSetByProcess () const
 
void SetParentWeightByProcess (G4bool)
 
G4bool IsParentWeightSetByProcess () const
 
void SetVerboseLevel (G4int vLevel)
 
G4int GetVerboseLevel () const
 
void ClearDebugFlag ()
 
void SetDebugFlag ()
 
G4bool GetDebugFlag () const
 

Protected Member Functions

 G4FastStep (const G4FastStep &right)
 
G4FastStepoperator= (const G4FastStep &right)
 
- Protected Member Functions inherited from G4VParticleChange
 G4VParticleChange (const G4VParticleChange &right)
 
G4VParticleChangeoperator= (const G4VParticleChange &right)
 
G4StepUpdateStepInfo (G4Step *Step)
 
void InitializeTrueStepLength (const G4Track &)
 
void InitializeLocalEnergyDeposit (const G4Track &)
 
void InitializeSteppingControl (const G4Track &)
 
void InitializeParentWeight (const G4Track &)
 
void InitializeParentGlobalTime (const G4Track &)
 
void InitializeStatusChange (const G4Track &)
 
void InitializeSecondaries (const G4Track &)
 
void InitializeStepInVolumeFlags (const G4Track &)
 
G4bool CheckSecondary (G4Track &)
 
G4double GetAccuracyForWarning () const
 
G4double GetAccuracyForException () const
 

Additional Inherited Members

- Protected Attributes inherited from G4VParticleChange
G4TrackFastVectortheListOfSecondaries
 
G4int theNumberOfSecondaries
 
G4int theSizeOftheListOfSecondaries
 
G4TrackStatus theStatusChange
 
G4SteppingControl theSteppingControlFlag
 
G4double theLocalEnergyDeposit
 
G4double theNonIonizingEnergyDeposit
 
G4double theTrueStepLength
 
G4bool theFirstStepInVolume
 
G4bool theLastStepInVolume
 
G4double theParentWeight
 
G4bool isParentWeightProposed
 
G4bool fSetSecondaryWeightByProcess
 
G4double theParentGlobalTime
 
G4int verboseLevel
 
G4bool debugFlag
 
- Static Protected Attributes inherited from G4VParticleChange
static const G4double accuracyForWarning = 1.0e-9
 
static const G4double accuracyForException = 0.001
 

Detailed Description

Definition at line 91 of file G4FastStep.hh.

Constructor & Destructor Documentation

G4FastStep::G4FastStep ( )

Definition at line 297 of file G4FastStep.cc.

References G4cerr, G4endl, and G4VParticleChange::verboseLevel.

299 {
300  if (verboseLevel>2)
301  {
302  G4cerr << "G4FastStep::G4FastStep() " << G4endl;
303  }
304 }
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
G4FastStep::~G4FastStep ( )
virtual

Definition at line 306 of file G4FastStep.cc.

References G4cerr, G4endl, and G4VParticleChange::verboseLevel.

307 {
308  if (verboseLevel>2)
309  {
310  G4cerr << "G4FastStep::~G4FastStep() " << G4endl;
311  }
312 }
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
G4FastStep::G4FastStep ( const G4FastStep right)
protected

Definition at line 315 of file G4FastStep.cc.

References right.

317 {
318  *this = right;
319 }

Member Function Documentation

G4bool G4FastStep::CheckIt ( const G4Track aTrack)
virtual

Reimplemented from G4VParticleChange.

Definition at line 479 of file G4FastStep.cc.

References G4VParticleChange::CheckIt(), DumpInfo(), FatalException, G4cout, G4endl, G4Exception(), G4VParticleChange::GetAccuracyForException(), G4VParticleChange::GetAccuracyForWarning(), G4Track::GetGlobalTime(), G4Track::GetKineticEnergy(), G4Track::GetProperTime(), JustWarning, CLHEP::Hep3Vector::mag(), CLHEP::Hep3Vector::mag2(), python.hepunit::MeV, and ns.

Referenced by UpdateStepForAtRest(), and UpdateStepForPostStep().

480 {
481  //
482  // In the G4FastStep::CheckIt
483  // We only check a bit
484  //
485  // If the user violates the energy,
486  // We don't care, we agree.
487  //
488  // But for theMomentumDirectionChange,
489  // We do pay attention.
490  // And if too large is its range,
491  // We issue an Exception.
492  //
493  //
494  // It means, the G4FastStep::CheckIt issues an exception only for the
495  // theMomentumDirectionChange which should be an unit vector
496  // and it corrects it because it could cause problems for the ulterior
497  // tracking.For the rest, only warning are issued.
498 
499  G4bool itsOK = true;
500  G4bool exitWithError = false;
501  G4double accuracy;
502 
503  // Energy should not be larger than the initial value
504  accuracy = ( theEnergyChange - aTrack.GetKineticEnergy())/MeV;
505  if (accuracy > GetAccuracyForWarning())
506  {
508  ed << "The energy becomes larger than the initial value, difference = " << accuracy << " MeV" << G4endl;
509  G4Exception("G4FastStep::CheckIt(const G4Track& aTrack)",
510  "FastSim006",
511  JustWarning, ed);
512  itsOK = false;
513  if (accuracy > GetAccuracyForException()) {exitWithError = true;}
514  }
515 
516  G4bool itsOKforMomentum = true;
517  if ( theEnergyChange >0.)
518  {
519  accuracy = std::abs(theMomentumChange.mag2()-1.0);
520  if (accuracy > GetAccuracyForWarning())
521  {
523  ed << "The Momentum Change is not a unit vector, difference = " << accuracy << G4endl;
524  G4Exception("G4FastStep::CheckIt(const G4Track& aTrack)",
525  "FastSim007",
526  JustWarning, ed);
527  itsOK = itsOKforMomentum = false;
528  if (accuracy > GetAccuracyForException()) {exitWithError = true;}
529  }
530  }
531 
532  accuracy = (aTrack.GetGlobalTime()- theTimeChange)/ns;
533  if (accuracy > GetAccuracyForWarning())
534  {
536  ed << "The global time is getting backward, difference = " << accuracy << " ns" << G4endl;
537  G4Exception("G4FastStep::CheckIt(const G4Track& aTrack)",
538  "FastSim008",
539  JustWarning, ed);
540  itsOK = false;
541  }
542 
543  accuracy = (aTrack.GetProperTime() - theProperTimeChange )/ns;
544  if (accuracy > GetAccuracyForWarning())
545  {
547  ed << "The proper time is getting backward, difference = " << accuracy << " ns" << G4endl;
548  G4Exception("G4FastStep::CheckIt(const G4Track& aTrack)",
549  "FastSim009",
550  JustWarning, ed);
551  itsOK = false;
552  }
553 
554  if (!itsOK)
555  {
556  G4cout << "ERROR - G4FastStep::CheckIt() " << G4endl;
557  G4cout << " Pointer : " << this << G4endl ;
558  DumpInfo();
559  }
560 
561  // Exit with error
562  if (exitWithError)
563  {
565  ed << "An inaccuracy in G4FastStep is beyond tolerance." << G4endl;
566  G4Exception("G4FastStep::CheckIt(const G4Track& aTrack)",
567  "FastSim010",
568  FatalException, ed);
569  }
570 
571  //correction for Momentum only.
572  if (!itsOKforMomentum) {
573  G4double vmag = theMomentumChange.mag();
574  theMomentumChange = (1./vmag)*theMomentumChange;
575  }
576 
577  itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
578  return itsOK;
579 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4double GetProperTime() const
void DumpInfo() const
Definition: G4FastStep.cc:435
virtual G4bool CheckIt(const G4Track &)
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4double GetGlobalTime() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double mag2() const
G4double GetAccuracyForException() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double GetAccuracyForWarning() const
double mag() const
#define ns
Definition: xmlparse.cc:597
G4Track * G4FastStep::CreateSecondaryTrack ( const G4DynamicParticle dynamics,
G4ThreeVector  polarization,
G4ThreeVector  position,
G4double  time,
G4bool  localCoordinates = true 
)

Definition at line 202 of file G4FastStep.cc.

References G4DynamicParticle::SetPolarization(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by Par01PiModel::DoIt().

207 {
208  G4DynamicParticle dummyDynamics(dynamics);
209 
210  // ------------------------------------------
211  // Add the polarization to the dummyDynamics:
212  // ------------------------------------------
213  dummyDynamics.SetPolarization(polarization.x(),
214  polarization.y(),
215  polarization.z());
216 
217  return CreateSecondaryTrack(dummyDynamics, position, time, localCoordinates);
218 }
double x() const
G4Track * CreateSecondaryTrack(const G4DynamicParticle &, G4ThreeVector, G4ThreeVector, G4double, G4bool localCoordinates=true)
Definition: G4FastStep.cc:202
double z() const
double y() const
G4Track * G4FastStep::CreateSecondaryTrack ( const G4DynamicParticle dynamics,
G4ThreeVector  position,
G4double  time,
G4bool  localCoordinates = true 
)

Definition at line 224 of file G4FastStep.cc.

References G4VParticleChange::AddSecondary(), G4FastTrack::GetInverseAffineTransformation(), G4DynamicParticle::GetPolarization(), G4DynamicParticle::SetMomentumDirection(), G4DynamicParticle::SetPolarization(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

228 {
229  // ----------------------------------------
230  // Quantities in global coordinates system.
231  //
232  // The allocated globalDynamics is deleted
233  // by the destructor of the G4Track.
234  // ----------------------------------------
235  G4DynamicParticle* globalDynamics =
236  new G4DynamicParticle(dynamics);
237  G4ThreeVector globalPosition(position);
238 
239  // -----------------------------------
240  // Convert to global system if needed:
241  // -----------------------------------
242  if (localCoordinates)
243  {
244  // -- Momentum Direction:
245  globalDynamics->SetMomentumDirection(fFastTrack->
246  GetInverseAffineTransformation()->
247  TransformAxis(globalDynamics->
248  GetMomentumDirection()));
249  // -- Polarization:
250  G4ThreeVector globalPolarization;
251  globalPolarization = fFastTrack->GetInverseAffineTransformation()->
252  TransformAxis(globalDynamics->GetPolarization());
253  globalDynamics->SetPolarization(
254  globalPolarization.x(),
255  globalPolarization.y(),
256  globalPolarization.z()
257  );
258 
259  // -- Position:
260  globalPosition = fFastTrack->GetInverseAffineTransformation()->
261  TransformPoint(globalPosition);
262  }
263 
264  //-------------------------------------
265  // Create the G4Track of the secondary:
266  //-------------------------------------
267  G4Track* secondary = new G4Track(
268  globalDynamics,
269  time,
270  globalPosition
271  );
272 
273  //-------------------------------
274  // and feed the changes:
275  //-------------------------------
276  AddSecondary(secondary);
277 
278  //--------------------------------------
279  // returns the pointer on the secondary:
280  //--------------------------------------
281  return secondary;
282 }
double x() const
const G4AffineTransform * GetInverseAffineTransformation() const
Definition: G4FastTrack.hh:238
void SetMomentumDirection(const G4ThreeVector &aDirection)
double z() const
void SetPolarization(G4double polX, G4double polY, G4double polZ)
void AddSecondary(G4Track *aSecondary)
double y() const
const G4ThreeVector & GetPolarization() const
void G4FastStep::DumpInfo ( ) const
virtual

Reimplemented from G4VParticleChange.

Definition at line 435 of file G4FastStep.cc.

References G4VParticleChange::DumpInfo(), G4cout, G4endl, python.hepunit::MeV, python.hepunit::mm, ns, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by CheckIt().

436 {
437 // use base-class DumpInfo
439 
440  G4cout.precision(3);
441  G4cout << " Position - x (mm) : "
442  << std::setw(20) << thePositionChange.x()/mm
443  << G4endl;
444  G4cout << " Position - y (mm) : "
445  << std::setw(20) << thePositionChange.y()/mm
446  << G4endl;
447  G4cout << " Position - z (mm) : "
448  << std::setw(20) << thePositionChange.z()/mm
449  << G4endl;
450  G4cout << " Time (ns) : "
451  << std::setw(20) << theTimeChange/ns
452  << G4endl;
453  G4cout << " Proper Time (ns) : "
454  << std::setw(20) << theProperTimeChange/ns
455  << G4endl;
456  G4cout << " Momentum Direct - x : "
457  << std::setw(20) << theMomentumChange.x()
458  << G4endl;
459  G4cout << " Momentum Direct - y : "
460  << std::setw(20) << theMomentumChange.y()
461  << G4endl;
462  G4cout << " Momentum Direct - z : "
463  << std::setw(20) << theMomentumChange.z()
464  << G4endl;
465  G4cout << " Kinetic Energy (MeV): "
466  << std::setw(20) << theEnergyChange/MeV
467  << G4endl;
468  G4cout << " Polarization - x : "
469  << std::setw(20) << thePolarizationChange.x()
470  << G4endl;
471  G4cout << " Polarization - y : "
472  << std::setw(20) << thePolarizationChange.y()
473  << G4endl;
474  G4cout << " Polarization - z : "
475  << std::setw(20) << thePolarizationChange.z()
476  << G4endl;
477 }
double x() const
virtual void DumpInfo() const
double z() const
G4GLOB_DLL std::ostream G4cout
double y() const
#define G4endl
Definition: G4ios.hh:61
#define ns
Definition: xmlparse.cc:597
void G4FastStep::ForceSteppingHitInvocation ( )
G4int G4FastStep::GetNumberOfSecondaryTracks ( )
G4Track* G4FastStep::GetSecondaryTrack ( G4int  )
G4double G4FastStep::GetTotalEnergyDeposited ( ) const
void G4FastStep::Initialize ( const G4FastTrack fastTrack)

Definition at line 53 of file G4FastStep.cc.

References AvoidHitInvocation, G4Track::GetDynamicParticle(), G4Track::GetGlobalTime(), G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetMomentumDirection(), G4DynamicParticle::GetPolarization(), G4Track::GetPosition(), G4FastTrack::GetPrimaryTrack(), G4DynamicParticle::GetProperTime(), G4Track::GetWeight(), G4VParticleChange::Initialize(), and G4VParticleChange::theSteppingControlFlag.

Referenced by G4FastSimulationManager::AtRestGetFastSimulationManagerTrigger(), and G4FastSimulationManager::PostStepGetFastSimulationManagerTrigger().

54 {
55  // keeps the fastTrack reference
56  fFastTrack=&fastTrack;
57 
58  // currentTrack will be used to Initialize the other data members
59  const G4Track& currentTrack = *(fFastTrack->GetPrimaryTrack());
60 
61  // use base class's method at first
62  G4VParticleChange::Initialize(currentTrack);
63 
64  // set Energy/Momentum etc. equal to those of the parent particle
65  const G4DynamicParticle* pParticle = currentTrack.GetDynamicParticle();
66  theEnergyChange = pParticle->GetKineticEnergy();
67  theMomentumChange = pParticle->GetMomentumDirection();
68  thePolarizationChange = pParticle->GetPolarization();
69  theProperTimeChange = pParticle->GetProperTime();
70 
71  // set Position/Time etc. equal to those of the parent track
72  thePositionChange = currentTrack.GetPosition();
73  theTimeChange = currentTrack.GetGlobalTime();
74 
75  // switch off stepping hit invokation by default:
77 
78  // event biasing weigth:
79  theWeightChange = currentTrack.GetWeight();
80 }
virtual void Initialize(const G4Track &)
const G4Track * GetPrimaryTrack() const
Definition: G4FastTrack.hh:208
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetProperTime() const
const G4ThreeVector & GetPosition() const
const G4ThreeVector & GetMomentumDirection() const
G4SteppingControl theSteppingControlFlag
G4double GetGlobalTime() const
const G4ThreeVector & GetPolarization() const
G4double GetWeight() const
void G4FastStep::KillPrimaryTrack ( )
G4bool G4FastStep::operator!= ( const G4FastStep right) const

Definition at line 353 of file G4FastStep.cc.

354 {
355  return ((G4VParticleChange *)this != (G4VParticleChange *) &right);
356 }
G4FastStep & G4FastStep::operator= ( const G4FastStep right)
protected

Definition at line 322 of file G4FastStep.cc.

References G4VParticleChange::operator=(), G4VParticleChange::theListOfSecondaries, G4VParticleChange::theLocalEnergyDeposit, G4VParticleChange::theNumberOfSecondaries, G4VParticleChange::theSizeOftheListOfSecondaries, G4VParticleChange::theStatusChange, G4VParticleChange::theSteppingControlFlag, and G4VParticleChange::theTrueStepLength.

323 {
324  if (this != &right)
325  {
331  theMomentumChange = right.theMomentumChange;
332  thePolarizationChange = right.thePolarizationChange;
333  thePositionChange = right.thePositionChange;
334  theTimeChange = right.theTimeChange;
335  theEnergyChange = right.theEnergyChange;
339  theWeightChange = right.theWeightChange;
340  }
341  return *this;
342 }
G4VParticleChange & operator=(const G4VParticleChange &right)
G4TrackFastVector * theListOfSecondaries
G4SteppingControl theSteppingControlFlag
G4TrackStatus theStatusChange
G4bool G4FastStep::operator== ( const G4FastStep right) const

Definition at line 348 of file G4FastStep.cc.

349 {
350  return ((G4VParticleChange *)this == (G4VParticleChange *) &right);
351 }
void G4FastStep::ProposePrimaryTrackFinalEventBiasingWeight ( G4double  )
void G4FastStep::ProposePrimaryTrackFinalKineticEnergy ( G4double  )
void G4FastStep::ProposePrimaryTrackFinalKineticEnergyAndDirection ( G4double  kineticEnergy,
const G4ThreeVector direction,
G4bool  localCoordinates = true 
)

Definition at line 150 of file G4FastStep.cc.

References G4FastTrack::GetInverseAffineTransformation(), SetPrimaryTrackFinalKineticEnergy(), and CLHEP::Hep3Vector::unit().

Referenced by SetPrimaryTrackFinalKineticEnergyAndDirection().

153 {
154  // Compute global direction if needed...
155  G4ThreeVector globalDirection = direction;
156  if (localCoordinates)
157  globalDirection =fFastTrack->GetInverseAffineTransformation()->
158  TransformAxis(direction);
159  // ...and feed the globalMomentum (ensuring unitarity)
160  SetMomentumChange(globalDirection.unit());
161  SetPrimaryTrackFinalKineticEnergy(kineticEnergy);
162 }
void SetPrimaryTrackFinalKineticEnergy(G4double)
const G4AffineTransform * GetInverseAffineTransformation() const
Definition: G4FastTrack.hh:238
Hep3Vector unit() const
void G4FastStep::ProposePrimaryTrackFinalMomentumDirection ( const G4ThreeVector momentum,
G4bool  localCoordinates = true 
)

Definition at line 124 of file G4FastStep.cc.

References G4FastTrack::GetInverseAffineTransformation(), and CLHEP::Hep3Vector::unit().

Referenced by SetPrimaryTrackFinalMomentum().

126 {
127  // Compute the momentum in global reference
128  // system if needed ...
129  G4ThreeVector globalMomentum = momentum;
130  if (localCoordinates)
131  globalMomentum = fFastTrack->GetInverseAffineTransformation()->
132  TransformAxis(momentum);
133  // ...and feed the globalMomentum (ensuring unitarity)
134  SetMomentumChange(globalMomentum.unit());
135 }
const G4AffineTransform * GetInverseAffineTransformation() const
Definition: G4FastTrack.hh:238
Hep3Vector unit() const
void G4FastStep::ProposePrimaryTrackFinalPolarization ( const G4ThreeVector polarization,
G4bool  localCoordinates = true 
)

Definition at line 178 of file G4FastStep.cc.

References G4FastTrack::GetInverseAffineTransformation().

Referenced by SetPrimaryTrackFinalPolarization().

180 {
181  // Compute polarization in global system if needed:
182  G4ThreeVector globalPolarization(polarization);
183  if (localCoordinates)
184  globalPolarization = fFastTrack->GetInverseAffineTransformation()->
185  TransformAxis(globalPolarization);
186  // Feed the particle globalPolarization:
187  thePolarizationChange = globalPolarization;
188 }
const G4AffineTransform * GetInverseAffineTransformation() const
Definition: G4FastTrack.hh:238
void G4FastStep::ProposePrimaryTrackFinalPosition ( const G4ThreeVector position,
G4bool  localCoordinates = true 
)

Definition at line 98 of file G4FastStep.cc.

References G4FastTrack::GetInverseAffineTransformation(), and position.

Referenced by Par01PiModel::DoIt(), and SetPrimaryTrackFinalPosition().

100 {
101  // Compute the position coordinate in global
102  // reference system if needed ...
103  G4ThreeVector globalPosition = position;
104  if (localCoordinates)
105  globalPosition = fFastTrack->GetInverseAffineTransformation()->
106  TransformPoint(position);
107  // ...and feed the globalPosition:
108  thePositionChange = globalPosition;
109 }
const G4AffineTransform * GetInverseAffineTransformation() const
Definition: G4FastTrack.hh:238
int position
Definition: filter.cc:7
void G4FastStep::ProposePrimaryTrackFinalProperTime ( G4double  )
void G4FastStep::ProposePrimaryTrackFinalTime ( G4double  )
void G4FastStep::ProposePrimaryTrackPathLength ( G4double  )
void G4FastStep::ProposeTotalEnergyDeposited ( G4double  anEnergyPart)
void G4FastStep::SetNumberOfSecondaryTracks ( G4int  )

Referenced by Par01PiModel::DoIt().

void G4FastStep::SetPrimaryTrackFinalEventBiasingWeight ( G4double  )
void G4FastStep::SetPrimaryTrackFinalKineticEnergy ( G4double  )
void G4FastStep::SetPrimaryTrackFinalKineticEnergyAndDirection ( G4double  kineticEnergy,
const G4ThreeVector direction,
G4bool  localCoordinates = true 
)

Definition at line 166 of file G4FastStep.cc.

References ProposePrimaryTrackFinalKineticEnergyAndDirection().

169 {
170  ProposePrimaryTrackFinalKineticEnergyAndDirection(kineticEnergy, direction, localCoordinates);
171 }
void ProposePrimaryTrackFinalKineticEnergyAndDirection(G4double, const G4ThreeVector &, G4bool localCoordinates=true)
Definition: G4FastStep.cc:150
void G4FastStep::SetPrimaryTrackFinalMomentum ( const G4ThreeVector momentum,
G4bool  localCoordinates = true 
)

Definition at line 139 of file G4FastStep.cc.

References ProposePrimaryTrackFinalMomentumDirection().

141 {
142  ProposePrimaryTrackFinalMomentumDirection(momentum, localCoordinates);
143 }
void ProposePrimaryTrackFinalMomentumDirection(const G4ThreeVector &, G4bool localCoordinates=true)
Definition: G4FastStep.cc:124
void G4FastStep::SetPrimaryTrackFinalPolarization ( const G4ThreeVector polarization,
G4bool  localCoordinates = true 
)

Definition at line 192 of file G4FastStep.cc.

References ProposePrimaryTrackFinalPolarization().

194 {
195  ProposePrimaryTrackFinalPolarization(polarization, localCoordinates);
196 }
void ProposePrimaryTrackFinalPolarization(const G4ThreeVector &, G4bool localCoordinates=true)
Definition: G4FastStep.cc:178
void G4FastStep::SetPrimaryTrackFinalPosition ( const G4ThreeVector position,
G4bool  localCoordinates = true 
)

Definition at line 113 of file G4FastStep.cc.

References ProposePrimaryTrackFinalPosition().

115 {
116  ProposePrimaryTrackFinalPosition(position, localCoordinates);
117 }
void ProposePrimaryTrackFinalPosition(const G4ThreeVector &, G4bool localCoordinates=true)
Definition: G4FastStep.cc:98
void G4FastStep::SetPrimaryTrackFinalProperTime ( G4double  )
void G4FastStep::SetPrimaryTrackFinalTime ( G4double  )
void G4FastStep::SetPrimaryTrackPathLength ( G4double  )
void G4FastStep::SetTotalEnergyDeposited ( G4double  anEnergyPart)
G4Step * G4FastStep::UpdateStepForAtRest ( G4Step Step)
virtual

Reimplemented from G4VParticleChange.

Definition at line 399 of file G4FastStep.cc.

References G4StepPoint::AddLocalTime(), CheckIt(), G4VParticleChange::debugFlag, G4Track::GetGlobalTime(), G4Step::GetPostStepPoint(), G4Step::GetTrack(), G4StepPoint::SetGlobalTime(), G4StepPoint::SetKineticEnergy(), G4StepPoint::SetMomentumDirection(), G4StepPoint::SetPolarization(), G4StepPoint::SetPosition(), G4StepPoint::SetProperTime(), G4StepPoint::SetWeight(), and G4VParticleChange::UpdateStepInfo().

400 {
401  // A physics process always calculates the final state of the particle
402 
403  // G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
404  G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
405  G4Track* aTrack = pStep->GetTrack();
406  // G4double mass = aTrack->GetDynamicParticle()->GetMass();
407 
408  // update kinetic energy and momentum direction
409  pPostStepPoint->SetMomentumDirection(theMomentumChange);
410  pPostStepPoint->SetKineticEnergy( theEnergyChange );
411 
412  // update polarization
413  pPostStepPoint->SetPolarization( thePolarizationChange );
414 
415  // update position and time
416  pPostStepPoint->SetPosition( thePositionChange );
417  pPostStepPoint->SetGlobalTime( theTimeChange );
418  pPostStepPoint->AddLocalTime( theTimeChange
419  - aTrack->GetGlobalTime());
420  pPostStepPoint->SetProperTime( theProperTimeChange );
421 
422  // update weight
423  pPostStepPoint->SetWeight( theWeightChange );
424 
425  if (debugFlag) CheckIt(*aTrack);
426 
427  // Update the G4Step specific attributes
428  return UpdateStepInfo(pStep);
429 }
void SetPosition(const G4ThreeVector &aValue)
void SetWeight(G4double aValue)
G4bool CheckIt(const G4Track &)
Definition: G4FastStep.cc:479
void AddLocalTime(const G4double aValue)
void SetGlobalTime(const G4double aValue)
void SetMomentumDirection(const G4ThreeVector &aValue)
void SetPolarization(const G4ThreeVector &aValue)
G4double GetGlobalTime() const
void SetProperTime(const G4double aValue)
G4Step * UpdateStepInfo(G4Step *Step)
void SetKineticEnergy(const G4double aValue)
G4Step * G4FastStep::UpdateStepForPostStep ( G4Step Step)
virtual

Reimplemented from G4VParticleChange.

Definition at line 362 of file G4FastStep.cc.

References G4StepPoint::AddLocalTime(), CheckIt(), G4VParticleChange::debugFlag, G4Track::GetGlobalTime(), G4Step::GetPostStepPoint(), G4Step::GetTrack(), G4StepPoint::SetGlobalTime(), G4StepPoint::SetKineticEnergy(), G4StepPoint::SetMomentumDirection(), G4StepPoint::SetPolarization(), G4StepPoint::SetPosition(), G4StepPoint::SetProperTime(), G4StepPoint::SetWeight(), and G4VParticleChange::UpdateStepInfo().

363 {
364  // A physics process always calculates the final state of the particle
365 
366  // Take note that the return type of GetMomentumChange is a
367  // pointer to G4ParticleMometum. Also it is a normalized
368  // momentum vector.
369 
370  // G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
371  G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
372  G4Track* aTrack = pStep->GetTrack();
373  // G4double mass = aTrack->GetDynamicParticle()->GetMass();
374 
375  // update kinetic energy and momentum direction
376  pPostStepPoint->SetMomentumDirection(theMomentumChange);
377  pPostStepPoint->SetKineticEnergy( theEnergyChange );
378 
379  // update polarization
380  pPostStepPoint->SetPolarization( thePolarizationChange );
381 
382  // update position and time
383  pPostStepPoint->SetPosition( thePositionChange );
384  pPostStepPoint->SetGlobalTime( theTimeChange );
385  pPostStepPoint->AddLocalTime( theTimeChange
386  - aTrack->GetGlobalTime());
387  pPostStepPoint->SetProperTime( theProperTimeChange );
388 
389  // update weight
390  pPostStepPoint->SetWeight( theWeightChange );
391 
392  if (debugFlag) CheckIt(*aTrack);
393 
394 
395  // Update the G4Step specific attributes
396  return UpdateStepInfo(pStep);
397 }
void SetPosition(const G4ThreeVector &aValue)
void SetWeight(G4double aValue)
G4bool CheckIt(const G4Track &)
Definition: G4FastStep.cc:479
void AddLocalTime(const G4double aValue)
void SetGlobalTime(const G4double aValue)
void SetMomentumDirection(const G4ThreeVector &aValue)
void SetPolarization(const G4ThreeVector &aValue)
G4double GetGlobalTime() const
void SetProperTime(const G4double aValue)
G4Step * UpdateStepInfo(G4Step *Step)
void SetKineticEnergy(const G4double aValue)

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