Belle II Software development
TrackingAction.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <mdst/dataobjects/MCParticleGraph.h>
12#include <simulation/dataobjects/MCParticleTrajectory.h>
13#include <framework/datastore/StoreArray.h>
14#include <framework/datastore/RelationArray.h>
15
16#include <G4UserTrackingAction.hh>
17
18namespace Belle2 {
23
24 namespace Simulation {
25
29 class TrackingAction : public G4UserTrackingAction {
30
31 public:
32
37 explicit TrackingAction(MCParticleGraph& mcParticleGraph);
38
42 virtual ~TrackingAction();
43
50 void PreUserTrackingAction(const G4Track* track);
51
57 void PostUserTrackingAction(const G4Track* track);
58
64 void setIgnoreOpticalPhotons(bool ignore = true) {m_ignoreOpticalPhotons = ignore;}
65
71 void setIgnoreSecondaries(bool ignore = true) {m_ignoreSecondaries = ignore;}
72
77 void setSecondariesEnergyCut(double cut_MeV) {m_secondariesEnergyCut = cut_MeV;}
78
86
92
99 void setIgnorePairConversions(bool ignore = true) {m_ignorePairConversions = ignore;}
100
106
108 void setRegionZBackward(double z) { m_regionZBackward = z; }
110 void setRegionZForward(double z) { m_regionZForward = z; }
112 void setRegionRho(double rho) { m_regionRho = rho; }
114 void setKineticEnergyThreshold(double threshold) { m_kineticEnergyThreshold = threshold; }
116 void setDistanceThreshold(double threshold) { m_distanceThreshold = threshold; }
120 void setDoNotStoreNuclei(bool value) { m_doNotStoreNuclei = value; }
122 void setUseSeenInECL(bool use) { m_useSeenInECL = use; }
125
127 void setStoreTrajectories(int store, double distanceTolerance);
128
129
130 protected:
131
133
141
144 double m_regionRho;
151
152
155
160 };
161
162 } // end namespace Simulation
164} // end namespace Belle2
Class to build, validate and sort a particle decay chain.
Low-level class to create/modify relations between StoreArrays.
void setIgnorePairConversions(bool ignore=true)
Set ignore flag for e+ or e- coming from gamma conversions into a pair if set to true,...
double m_regionZBackward
Region backward z limit.
void setIgnoreBremsstrahlungPhotons(bool ignore=true)
Set ignore flag for low energy breamsstrahlung photons if set to true, breamsstrahlung photons with k...
bool m_ignoreSecondaries
do not store secondaries in MCParticles
bool m_doNotStoreNuclei
use is Nuclei check
MCParticleGraph & m_mcParticleGraph
Reference to the MCParticle graph which is updated by the tracking action.
void setUseSeenInECL(bool use)
Set whether to check if particle is seen in ECL for ignoring secondaries.
bool m_doNotStoreEMParticles
use is EM check
void setDistanceThreshold(double threshold)
Set the distance threshold for ignoring secondaries.
void setRegionZForward(double z)
Set the forward z limit for improved matching region.
void setKineticEnergyThreshold(double threshold)
Set the kinetic energy threshold for ignoring secondaries.
TrackingAction(MCParticleGraph &mcParticleGraph)
Constructor.
double m_distanceThreshold
distance threshold
double m_pairConversionsEnergyCut
kinetic energy cut for stored e+ or e- from pair conversions [MeV]
void setSecondariesEnergyCut(double cut_MeV)
Set kinetic energy cut for secondaries.
void setStoreTrajectories(int store, double distanceTolerance)
Sets the trajectory option to enable storing of the simulated particle trajectories.
RelationArray m_relMCTrajectories
RelationArry for the relation between MCParticles and Trajectories.
bool m_useDetailedParticleMatching
use detailed particle matching logic to filter secondaries
void setBremsstrahlungPhotonsEnergyCut(double cut_MeV)
Set kinetic energy cut for bremsstrahlung photons.
void setRegionRho(double rho)
Set the rho limit for improved matching region.
bool m_useSeenInECL
use seen in ECL check
StoreArray< MCParticleTrajectory > m_storeMCTrajectories
Store array for the Trajectories.
double m_distanceTolerance
distance tolerance to merge trajectory points
void setUseDetailedParticleMatching(bool use)
Set whether to use detailed particle matching.
void PreUserTrackingAction(const G4Track *track)
Checks if the particle associated to the track is already in the MCParticle list.
void setRegionZBackward(double z)
Set the backward z limit for improved matching region.
double m_secondariesEnergyCut
kinetic energy cut for stored secondaries [MeV]
double m_kineticEnergyThreshold
kinetic energy threshold
void setPairConversionsEnergyCut(double cut_MeV)
Set kinetic energy cut for e+ e- pair conversions.
void setIgnoreSecondaries(bool ignore=true)
Set ignore flag for low energy Geant-produced secondary particles if set to true, secondaries with ki...
double m_regionRho
Region rho limit.
void setDoNotStoreNuclei(bool value)
Set whether to check if particle is Nuclei for ignoring secondaries.
void setDoNotStoreEMParticles(bool value)
Set whether to check if particle is EM for ignoring secondaries.
void PostUserTrackingAction(const G4Track *track)
Updates the data of the MCParticle associated with the Geant4 track.
bool m_ignorePairConversions
do not store e+ or e- from pair conversions in MCparticles
bool m_ignoreBremsstrahlungPhotons
do not store bremsstrahlung photons in MCParticles
bool m_ignoreOpticalPhotons
do not store optical photons in MCParticles
void setIgnoreOpticalPhotons(bool ignore=true)
Set ignore flag for optical photons if set to true, optical photons will not be stored in MCParticles...
double m_bremsstrahlungPhotonsEnergyCut
kinetic energy cut for stored bremsstrahlung photons [MeV]
double m_regionZForward
Region forward z limit.
int m_storeTrajectories
Store trajectories for 0=none, 1=primary or 2=all particles.
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Abstract base class for different kinds of events.