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

Shortcut to the ordinary tracking for electromagnetic calorimeters. More...

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par02FastSimModelEMCal:
G4VFastSimulationModel

Public Member Functions

 Par02FastSimModelEMCal (G4String aModelName, G4Region *aEnvelope, Par02DetectorParametrisation::Parametrisation aParamType)
 A constructor.
 
 Par02FastSimModelEMCal (G4String aModelName, G4Region *aEnvelope)
 A constructor.
 
 Par02FastSimModelEMCal (G4String aModelName)
 A constructor.
 
 ~Par02FastSimModelEMCal ()
 
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)
 Smears the energy deposit and saves it, together with the position of the deposit, the electromagnetic calorimeter resolution and efficiency to the Par02PrimaryParticleInformation.
 

Private Attributes

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

Detailed Description

Shortcut to the ordinary tracking for electromagnetic calorimeters.

The fast simulation model describes what should be done instead of a normal tracking. Instead of the ordinary tracking, a particle deposits its energy at the entrance to the electromagnetic calorimeter and its value is smeared (by Par02Smearer::SmearMomentum()). Based on G4 examples/extended/parametrisations/Par01/include/Par01EMShowerModel.hh .

Author
Anna Zaborowska

Definition at line 41 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par02FastSimModelEMCal() [1/3]

Par02FastSimModelEMCal::Par02FastSimModelEMCal ( 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 50 of file Par02FastSimModelEMCal.cc.

51 :
52 G4VFastSimulationModel( aModelName, aEnvelope ), fCalculateParametrisation(),
53 fParametrisation( aType ) {}
Par02DetectorParametrisation::Parametrisation fParametrisation
A parametrisation type.
Par02DetectorParametrisation * fCalculateParametrisation
A pointer to Par02DetectorParametrisation used to get the efficiency and resolution of the detector f...

◆ Par02FastSimModelEMCal() [2/3]

Par02FastSimModelEMCal::Par02FastSimModelEMCal ( 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 57 of file Par02FastSimModelEMCal.cc.

◆ Par02FastSimModelEMCal() [3/3]

Par02FastSimModelEMCal::Par02FastSimModelEMCal ( G4String  aModelName)

A constructor.

Parameters
aModelNameA name of the fast simulation model.

Definition at line 64 of file Par02FastSimModelEMCal.cc.

◆ ~Par02FastSimModelEMCal()

Par02FastSimModelEMCal::~Par02FastSimModelEMCal ( )
default

Member Function Documentation

◆ IsApplicable()

G4bool Par02FastSimModelEMCal::IsApplicable ( const G4ParticleDefinition aParticle)
virtual

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

Parameters
aParticleA particle definition (type).

Definition at line 74 of file Par02FastSimModelEMCal.cc.

75 {
76 // Applicable for electrons, positrons, and gammas
77 return &aParticleType == G4Electron::Definition() ||
78 &aParticleType == G4Positron::Definition() ||
79 &aParticleType == G4Gamma::Definition();
80}

◆ ModelTrigger()

G4bool Par02FastSimModelEMCal::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 84 of file Par02FastSimModelEMCal.cc.

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

◆ DoIt()

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

Smears the energy deposit and saves it, together with the position of the deposit, the electromagnetic calorimeter resolution and efficiency to the Par02PrimaryParticleInformation.

Parameters
aFastTrackA track.
aFastStepA step.

Definition at line 90 of file Par02FastSimModelEMCal.cc.

91 {
92 //G4cout << " ________EMCal model triggered _________" << G4endl;
93
94 // Kill the parameterised particle at the entrance of the electromagnetic calorimeter
95 aFastStep.KillPrimaryTrack();
96 aFastStep.ProposePrimaryTrackPathLength( 0.0 );
97 G4double Edep = aFastTrack.GetPrimaryTrack()->GetKineticEnergy();
98
99 // Consider only primary tracks (do nothing else for secondary e-, e+, gammas)
100 G4ThreeVector Pos = aFastTrack.GetPrimaryTrack()->GetPosition();
101 if ( ! aFastTrack.GetPrimaryTrack()->GetParentID() ) {
102 auto info = (Par02EventInformation*)
103 G4EventManager::GetEventManager()->GetUserInformation();
104 if ( info->GetDoSmearing() ) {
105 // Smearing according to the electromagnetic calorimeter resolution
106 G4ThreeVector Porg = aFastTrack.GetPrimaryTrack()->GetMomentum();
111 G4double Esm;
112 Esm = std::abs( Par02Smearer::Instance()->
113 SmearEnergy( aFastTrack.GetPrimaryTrack(), res ) );
114 Par02Output::Instance()->FillHistogram( 1, (Esm/MeV) / (Edep/MeV) );
115 // Setting the values of Pos, Esm, res and eff
117 ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
118 GetUserInformation() ) )->SetEMCalPosition( Pos );
120 ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
121 GetUserInformation() ) )->SetEMCalEnergy( Esm );
123 ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
124 GetUserInformation() ) )->SetEMCalResolution( res );
126 ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
127 GetUserInformation() ) )->SetEMCalEfficiency( eff );
128 // The (smeared) energy of the particle is deposited in the step
129 // (which corresponds to the entrance of the electromagnetic calorimeter)
130 aFastStep.ProposeTotalEnergyDeposited( Esm );
131 } else {
132 // No smearing: simply setting the value of Edep
134 ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
135 GetUserInformation() ) )->SetEMCalEnergy( Edep );
136 // The (initial) energy of the particle is deposited in the step
137 // (which corresponds to the entrance of the electromagnetic calorimeter)
138 aFastStep.ProposeTotalEnergyDeposited( Edep );
139 }
140 }
141}
G4double GetEfficiency(Detector aDetector, Parametrisation aParametrisation, G4double aMomentum)
Gets the efficiency of a detector for a given particle.
G4double GetResolution(Detector aDetector, Parametrisation aParametrisation, G4double aMomentum)
Gets the resolution of a detector for a given particle.
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* Par02FastSimModelEMCal::fCalculateParametrisation
private

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

Definition at line 87 of file Par02FastSimModelEMCal.hh.

◆ fParametrisation

Par02DetectorParametrisation::Parametrisation Par02FastSimModelEMCal::fParametrisation
private

A parametrisation type.

Definition at line 90 of file Par02FastSimModelEMCal.hh.


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

Applications | User Support | Publications | Collaboration