GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
Public Member Functions
GGSAcceptanceCheckAction Class Reference

An action to kill primary tracks outside acceptance. More...

#include <GGSAcceptanceCheckAction.h>

Inheritance diagram for GGSAcceptanceCheckAction:
Inheritance graph
[legend]
Collaboration diagram for GGSAcceptanceCheckAction:
Collaboration graph
[legend]

Public Member Functions

 GGSAcceptanceCheckAction ()
 Constructor.
 
 ~GGSAcceptanceCheckAction ()
 Destructor.
 
G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *track)
 Override of the ClassifyNewTrack method. More...
 
- Public Member Functions inherited from GGSUserAction
 GGSUserAction ()
 Constructor. More...
 
virtual ~GGSUserAction ()
 Destructor.
 
G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *)
 Override of the ClassifyNewTrack method. More...
 

Detailed Description

An action to kill primary tracks outside acceptance.

This action checks primary tracks before they are stacked. If they lie outside the acceptance defined in the IsInsideAcceptance method of the user-defined geometry then the track is classified as fKill and consequently it is not added to the stack. This means that the track will not be simulated and eventually the event will be killed by GGSRunManager if there is no other primary inside acceptance to be simulated. Re-simulation of killed events can be set with the datacard command /GGS/acceptanceCheck/reSimulateKilled.

Definition at line 27 of file GGSAcceptanceCheckAction.h.

Member Function Documentation

G4ClassificationOfNewTrack GGSAcceptanceCheckAction::ClassifyNewTrack ( const G4Track *  track)

Override of the ClassifyNewTrack method.

Parameters
trackThe new track
Returns
fKill if the track is outside the acceptance, G4UserStackingAction::ClassifyNewTrack otherwise.

Definition at line 36 of file GGSAcceptanceCheckAction.cpp.

36  {
37  if (track->GetParentID() == 0) {
38  GGSDetectorConstruction *detConst =
39  (GGSDetectorConstruction *)(GGSRunManager::GetRunManager()->GetUserDetectorConstruction());
40  if (detConst->GetGeometry()->IsInsideAcceptance(track->GetPosition(), track->GetMomentum().unit())) {
41  return fUrgent;
42  } else {
43  GGSPrimaryParticleInfo *userInfo =
44  (GGSPrimaryParticleInfo *)(track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation());
45  if (!userInfo)
46  userInfo = new GGSPrimaryParticleInfo;
47  userInfo->isTrackKilled = true;
48  track->GetDynamicParticle()->GetPrimaryParticle()->SetUserInformation(userInfo);
49  if (G4EventManager::GetEventManager()->GetStackManager()->GetNTotalTrack() == 0) {
51  if (_reSimulateKilled)
53  }
54  return fKill;
55  }
56  }
57  return G4UserStackingAction::ClassifyNewTrack(track);
58 }
Data class to store informations about the primary particle.
Class for GGS detector construction.
bool isTrackKilled
True if the particle&#39;s track has been killed.
void SimulateAgainKilledEvent()
Simulates again a killed event.
const GGSVGeometryConstruction * GetGeometry() const
Returns a pointer to the geometry.
static GGSRunManager * GetRunManager()
Static getter function the run manager.
void KillEvent()
Kills the current event.
virtual bool IsInsideAcceptance(const G4ThreeVector &, const G4ThreeVector &) const
Checks if a particle is inside the instrument&#39;s acceptance.

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