Loading...
Searching...
No Matches
Public Member Functions | List of all members
Par04DefineMeshModel Class Reference

Defince mesh for energy scoring. More...

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par04DefineMeshModel:
G4VFastSimulationModel

Public Member Functions

 Par04DefineMeshModel (G4String, G4Region *)
 
 Par04DefineMeshModel (G4String)
 
 ~Par04DefineMeshModel ()
 
virtual G4bool ModelTrigger (const G4FastTrack &) final
 Check if particle is entering the volume.
 
virtual G4bool IsApplicable (const G4ParticleDefinition &) final
 Model is applicable to all particles.
 
virtual void DoIt (const G4FastTrack &, G4FastStep &) final
 Check particle direction, entrance point, and store it in event information.
 

Detailed Description

Defince mesh for energy scoring.

Fast simulation model is used in order to define where particle enters the detector and its direction. That data is used to define the mesh used for energy scoring. TODO To make the simulation faster, this model could be attached to a very thin layer at the entrance to the calorimeter instead of attaching it to the volume of the detector.

Definition at line 78 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par04DefineMeshModel() [1/2]

Par04DefineMeshModel::Par04DefineMeshModel ( G4String  aModelName,
G4Region aEnvelope 
)

Definition at line 40 of file Par04DefineMeshModel.cc.

41 : G4VFastSimulationModel(aModelName, aEnvelope)
42{}

◆ Par04DefineMeshModel() [2/2]

Par04DefineMeshModel::Par04DefineMeshModel ( G4String  aModelName)

Definition at line 46 of file Par04DefineMeshModel.cc.

47 : G4VFastSimulationModel(aModelName)
48{}

◆ ~Par04DefineMeshModel()

Par04DefineMeshModel::~Par04DefineMeshModel ( )
default

Member Function Documentation

◆ ModelTrigger()

G4bool Par04DefineMeshModel::ModelTrigger ( const G4FastTrack )
finalvirtual

Check if particle is entering the volume.

Check particle energy. It must be no smaller than 99% of the primary particle energy. This is to ensure that in case of prior interactions, particle energy does not differ (much) from the assumed energy.

Definition at line 63 of file Par04DefineMeshModel.cc.

64{
65 auto info = dynamic_cast<Par04EventInformation*>(
66 G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetUserInformation());
67 // check if particle direction and position were already set for this event
68 if(info != nullptr)
69 return !info->GetFlag();
70 else
71 return true;
72}
G4bool GetFlag() const
Get flag.

◆ IsApplicable()

G4bool Par04DefineMeshModel::IsApplicable ( const G4ParticleDefinition )
finalvirtual

Model is applicable to all particles.

Definition at line 56 of file Par04DefineMeshModel.cc.

57{
58 return true;
59}

◆ DoIt()

void Par04DefineMeshModel::DoIt ( const G4FastTrack aFastTrack,
G4FastStep  
)
finalvirtual

Check particle direction, entrance point, and store it in event information.

Then go back to the full simulation.

Definition at line 76 of file Par04DefineMeshModel.cc.

77{
78 auto info = dynamic_cast<Par04EventInformation*>(
79 G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetUserInformation());
80 if(info == nullptr)
81 {
82 info = new Par04EventInformation();
83 G4EventManager::GetEventManager()->GetNonconstCurrentEvent()->SetUserInformation(info);
84 }
85 info->SetPosition(aFastTrack.GetPrimaryTrack()->GetPosition());
86 info->SetDirection(aFastTrack.GetPrimaryTrack()->GetMomentumDirection());
87 info->SetFlag(true);
88}

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

Applications | User Support | Publications | Collaboration