Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Par02FastSimModelTracker Class Reference

Shortcut to the ordinary tracking for tracking detectors. More...

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par02FastSimModelTracker:
G4VFastSimulationModel

Public Member Functions

 Par02FastSimModelTracker (G4String aModelName, G4Region *aEnvelope, Par02DetectorParametrisation::Parametrisation aParamType)
 A constructor.
 
 Par02FastSimModelTracker (G4String aModelName, G4Region *aEnvelope)
 A constructor.
 
 Par02FastSimModelTracker (G4String aModelName)
 A constructor.
 
 ~Par02FastSimModelTracker ()
 
virtual G4bool IsApplicable (const G4ParticleDefinition &aParticle)
 Checks if this model should be applied to this particle type.
 
virtual G4bool ModelTrigger (const G4FastTrack &aFastTrack)
 Checks if the model should be applied taking into account the kinematics of a track.
 
virtual void DoIt (const G4FastTrack &aFastTrack, G4FastStep &aFastStep)
 Calculates the final position (at the outer boundary of the tracking detector) of a particle with the momentum at the entrance of the tracking detector.
 

Private Attributes

Par02DetectorParametrisationfCalculateParametrisation
 A pointer to Par02DetectorParametrisation used to get the efficiency and resolution of the tracking detector for a given particle and parametrisation type.
 
Par02DetectorParametrisation::Parametrisation fParametrisation
 A parametrisation type.
 

Detailed Description

Shortcut to the ordinary tracking for tracking detectors.

The fast simulation model describes what should be done instead of a normal tracking. Instead of the ordinary tracking, a particle momentum at the entrance of the tracking detector is smeared (by Par02Smearer::SmearMomentum()) and the particle is placed at the tracking detector exit, at the place it would reach without the change of its momentum. Based on G4 examples/extended/parametrisations/Par01/include/Par01EMShowerModel.hh .

Author
Anna Zaborowska

Definition at line 43 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par02FastSimModelTracker() [1/3]

Par02FastSimModelTracker::Par02FastSimModelTracker ( G4String  aModelName,
G4Region aEnvelope,
Par02DetectorParametrisation::Parametrisation  aParamType 
)

A constructor.

Parameters
aModelNameA name of the fast simulation model.
aEnvelopeA region where the model can take over the ordinary tracking.
aParamTypeA parametrisation type.

Definition at line 54 of file Par02FastSimModelTracker.cc.

55 :
56 G4VFastSimulationModel( aModelName, aEnvelope ), fCalculateParametrisation(),
57 fParametrisation( aType ) {}
Par02DetectorParametrisation * fCalculateParametrisation
A pointer to Par02DetectorParametrisation used to get the efficiency and resolution of the tracking d...
Par02DetectorParametrisation::Parametrisation fParametrisation
A parametrisation type.

◆ Par02FastSimModelTracker() [2/3]

Par02FastSimModelTracker::Par02FastSimModelTracker ( G4String  aModelName,
G4Region aEnvelope 
)

A constructor.

Parameters
aModelNameA name of the fast simulation model.
aEnvelopeA region where the model can take over the ordinary tracking.

Definition at line 61 of file Par02FastSimModelTracker.cc.

◆ Par02FastSimModelTracker() [3/3]

Par02FastSimModelTracker::Par02FastSimModelTracker ( G4String  aModelName)

A constructor.

Parameters
aModelNameA name of the fast simulation model.

Definition at line 68 of file Par02FastSimModelTracker.cc.

◆ ~Par02FastSimModelTracker()

Par02FastSimModelTracker::~Par02FastSimModelTracker ( )
default

Member Function Documentation

◆ IsApplicable()

G4bool Par02FastSimModelTracker::IsApplicable ( const G4ParticleDefinition aParticle)
virtual

Checks if this model should be applied to this particle type.

Parameters
aParticleA particle definition (type).

Definition at line 78 of file Par02FastSimModelTracker.cc.

79 {
80 return aParticleType.GetPDGCharge() != 0; // Applicable for all charged particles
81}

◆ ModelTrigger()

G4bool Par02FastSimModelTracker::ModelTrigger ( const G4FastTrack aFastTrack)
virtual

Checks if the model should be applied taking into account the kinematics of a track.

Parameters
aFastTrackA track.

Definition at line 85 of file Par02FastSimModelTracker.cc.

85 {
86 return true; // No kinematical restrictions to apply the parametrisation
87}

◆ DoIt()

void Par02FastSimModelTracker::DoIt ( const G4FastTrack aFastTrack,
G4FastStep aFastStep 
)
virtual

Calculates the final position (at the outer boundary of the tracking detector) of a particle with the momentum at the entrance of the tracking detector.

Smears the particle momentum and saves it, together with the tracking detector resolution and efficiency to the Par02PrimaryParticleInformation.

Parameters
aFastTrackA track.
aFastStepA step.

Definition at line 91 of file Par02FastSimModelTracker.cc.

92 {
93
94 G4cout << " ________Tracker model triggered _________" << G4endl;
95
96 // Calculate the final position (at the outer boundary of the tracking detector)
97 // of the particle with the momentum at the entrance of the tracking detector.
98
99 G4Track track = * aFastTrack.GetPrimaryTrack();
100 G4FieldTrack aFieldTrack( '0' );
101 G4FieldTrackUpdator::Update( &aFieldTrack, &track );
102
103 G4double retSafety = -1.0;
104 ELimited retStepLimited;
105 G4FieldTrack endTrack( 'a' );
106 G4double currentMinimumStep = 10.0*m; // Temporary: change that to sth connected
107 // to particle momentum.
108 G4PathFinder* fPathFinder = G4PathFinder::GetInstance();
109 /*G4double lengthAlongCurve = */
110 fPathFinder->ComputeStep( aFieldTrack,
111 currentMinimumStep,
112 0,
113 aFastTrack.GetPrimaryTrack()->GetCurrentStepNumber(),
114 retSafety,
115 retStepLimited,
116 endTrack,
117 aFastTrack.GetPrimaryTrack()->GetVolume() );
118
119 // Place the particle at the tracking detector exit
120 // (at the place it would reach without the change of its momentum).
121 aFastStep.ProposePrimaryTrackFinalPosition( endTrack.GetPosition() );
122
123 // Consider only primary tracks (do nothing else for secondary charged particles)
124 G4ThreeVector Porg = aFastTrack.GetPrimaryTrack()->GetMomentum();
125 if ( ! aFastTrack.GetPrimaryTrack()->GetParentID() ) {
126 auto info = (Par02EventInformation*)
127 G4EventManager::GetEventManager()->GetUserInformation();
128 if ( info->GetDoSmearing() ) {
129 // Smearing according to the tracking detector resolution
130 G4double res = fCalculateParametrisation->
132 fParametrisation, Porg.mag() );
133 G4double eff = fCalculateParametrisation->
135 fParametrisation, Porg.mag() );
136 G4ThreeVector Psm;
137 Psm = Par02Smearer::Instance()->
138 SmearMomentum( aFastTrack.GetPrimaryTrack(), res );
139 Par02Output::Instance()->FillHistogram( 0, ((Psm.mag()/MeV) / (Porg.mag()/MeV)) );
140 // Setting the values of Psm, res and eff
142 ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
143 GetUserInformation() ) )->SetTrackerMomentum( Psm );
145 ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
146 GetUserInformation() ) )->SetTrackerResolution( res );
148 ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
149 GetUserInformation() ) )->SetTrackerEfficiency( eff );
150 } else {
151 // No smearing: simply setting the value of Porg
153 ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
154 GetUserInformation() ) )->SetTrackerMomentum( Porg );
155 }
156 }
157}
void FillHistogram(G4int HNo, G4double value) const
Fills the histogram.
static Par02Output * Instance()
Allows the access to the unique Par02Output object.
static Par02Smearer * Instance()
Allows the access to the unique Par02Smearer class object.

Member Data Documentation

◆ fCalculateParametrisation

Par02DetectorParametrisation* Par02FastSimModelTracker::fCalculateParametrisation
private

A pointer to Par02DetectorParametrisation used to get the efficiency and resolution of the tracking detector for a given particle and parametrisation type.

Definition at line 92 of file Par02FastSimModelTracker.hh.

◆ fParametrisation

Par02DetectorParametrisation::Parametrisation Par02FastSimModelTracker::fParametrisation
private

A parametrisation type.

Definition at line 95 of file Par02FastSimModelTracker.hh.


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

Applications | User Support | Publications | Collaboration