ATLAS Offline Software
Loading...
Searching...
No Matches
ActsGeantFollowerHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ActsGeantFollowerHelper_H
6#define ActsGeantFollowerHelper_H
7
9#include "GaudiKernel/ToolHandle.h"
10#include "TrkParameters/TrackParameters.h" //typedef, can't fwd declare
12#include "G4ThreeVector.hh" //typedef, can't fwd declare
15
16#include "Acts/Surfaces/Surface.hpp"
17#include "Acts/EventData/TrackParameters.hpp"
18#include "Acts/Propagator/SurfaceCollector.hpp"
22// FIXME: header-global macro for an array size constant!
23#ifndef MAXPROBES
24#define MAXPROBES 50000
25#endif
26
27class TTree;
28
29namespace Trk {
30 class IExtrapolator;
31} // namespace Trk
32
33
34class ActsGeantFollowerHelper : public extends<AthAlgTool, IActsGeantFollowerHelper> {
35
36 public:
37 // constructor, destructor
38 ActsGeantFollowerHelper(const std::string&,const std::string&,const IInterface*);
39 virtual ~ActsGeantFollowerHelper() = default;
40
41 // Athena hooks
42 virtual StatusCode initialize() override;
43 virtual StatusCode finalize () override;
44
45 // Follower interface
46 // a) begin event - initialize follower process
47 virtual void beginEvent() override;
48 // b) track the particle
49 virtual void trackParticle(const G4ThreeVector& pos, const G4ThreeVector& mom, int pdg, double charge, float t, float X0, bool isSensitive) override;
50 // c) end event - ntuple writing
51 virtual void endEvent() override;
52
53 private:
54
55 PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"};
56
57
58 ToolHandle<Trk::IExtrapolationEngine> m_extrapolationEngine{this, "ExtrapolationEngine", ""};
59 ToolHandle<ActsTrk::IExtrapolationTool> m_actsExtrapolator{this, "ActsExtrapolator", ""};
60 Gaudi::Property<bool> m_extrapolateDirectly{this, "ExtrapolateDirectly", true};
61 Gaudi::Property<bool> m_extrapolateIncrementally{this, "ExtrapolateIncrementally", true};
62
64 std::optional<Acts::BoundTrackParameters> m_actsParameterCache{std::nullopt};
65 std::unique_ptr<std::vector<Acts::SurfaceHit>> m_actsSurfaceCache{};
66 std::vector<Acts::SurfaceHit>::iterator m_actsSurfaceIterator{};
67 // Hypothesis to pdg converter
69 float m_tX0Cache{0.f};
72 float m_tX0CacheActs{0.f};
73 float m_tX0CacheATLAS{0.f};
74
75 // put some validation code is
79
80 TTree* m_validationTree{nullptr};
85 struct TreeData {
86 float m_t_x {0};
87 float m_t_y {0};
88 float m_t_z {0};
89 float m_t_theta {0};
90 float m_t_eta {0};
91 float m_t_phi {0};
92 float m_t_p {0};
93 float m_t_charge {0};
94 int m_t_pdg {0};
96 int m_g4_steps {0};
97 float m_g4_pt[MAXPROBES] {0};
98 float m_g4_eta[MAXPROBES] {0};
100 float m_g4_phi[MAXPROBES] {0};
101 float m_g4_x[MAXPROBES] {0};
102 float m_g4_y[MAXPROBES] {0};
103 float m_g4_z[MAXPROBES] {0};
104 float m_g4_tX0[MAXPROBES] {0};
106 float m_g4_t[MAXPROBES] {0};
107 float m_g4_X0[MAXPROBES] {0};
110 float m_trk_pt[MAXPROBES] {0};
114 float m_trk_x[MAXPROBES] {0};
115 float m_trk_y[MAXPROBES] {0};
116 float m_trk_z[MAXPROBES] {0};
117 float m_trk_lx[MAXPROBES] {0};
118 float m_trk_ly[MAXPROBES] {0};
121 float m_trk_t[MAXPROBES] {0};
122 float m_trk_X0[MAXPROBES] {0};
130 float m_acts_x[MAXPROBES] {0};
131 float m_acts_y[MAXPROBES] {0};
132 float m_acts_z[MAXPROBES] {0};
135 float m_acts_t[MAXPROBES] {0};
137 };
138 std::unique_ptr<TreeData> m_treeData;
139};
140
141#endif
#define MAXPROBES
double charge(const T &p)
Definition AtlasPID.h:997
std::string m_validationTreeFolder
stream/folder to for the TTree to be written out
virtual StatusCode finalize() override
std::string m_validationTreeName
validation tree name - to be acessed by this from root
ToolHandle< ActsTrk::IExtrapolationTool > m_actsExtrapolator
Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis
std::vector< Acts::SurfaceHit >::iterator m_actsSurfaceIterator
std::string m_validationTreeDescription
validation tree description - second argument in TTree
TTree * m_validationTree
Root Validation Tree.
ToolHandle< Trk::IExtrapolationEngine > m_extrapolationEngine
virtual void trackParticle(const G4ThreeVector &pos, const G4ThreeVector &mom, int pdg, double charge, float t, float X0, bool isSensitive) override
std::unique_ptr< std::vector< Acts::SurfaceHit > > m_actsSurfaceCache
std::unique_ptr< TreeData > m_treeData
Trk::TrackParameters * m_parameterCache
Gaudi::Property< bool > m_extrapolateDirectly
virtual void endEvent() override
virtual ~ActsGeantFollowerHelper()=default
std::optional< Acts::BoundTrackParameters > m_actsParameterCache
Gaudi::Property< bool > m_extrapolateIncrementally
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
virtual void beginEvent() override
ActsGeantFollowerHelper(const std::string &, const std::string &, const IInterface *)
virtual StatusCode initialize() override
small converter from the (abs) PDG code to the particle hypothsis used in Tracking
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersBase< TrackParametersDim, Charged > TrackParameters
Ntuple variables : initial parameters Split this out into a separate, dynamically-allocated block.
int m_g4_steps
Ntuple variables : g4 step parameters.
int m_trk_status[MAXPROBES]
Ntuple variables : trk follow up parameters.
int m_acts_status[MAXPROBES]
Ntuple variables : acts follow up parameters.