ATLAS Offline Software
Loading...
Searching...
No Matches
GeantFollowerHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// GeantFollowerHelper.h, (c) ATLAS Detector software
8#ifndef GeantFollowerHelper_H
9#define GeantFollowerHelper_H
10
12#include "GaudiKernel/ToolHandle.h"
13#include "TrkParameters/TrackParameters.h" //typedef, can't fwd declare
15#include "G4ThreeVector.hh" //typedef, can't fwd declare
16
17class TTree;
18
19namespace Trk
20{
21
22 class IExtrapolator;
23
24 class GeantFollowerHelper : public extends<AthAlgTool, IGeantFollowerHelper>
25 {
26
27 public:
28
29 static constexpr int MAXPROBES{50000};
30
31 // constructor, destructor
32 GeantFollowerHelper(const std::string&,const std::string&,const IInterface*);
34
35 // Athena hooks
36 virtual StatusCode initialize() override;
37 virtual StatusCode finalize () override;
38
39 // Follower interface
40 // a) begin event - initialize follower process
41 virtual void beginEvent() override;
42 // b) track the particle
43 virtual void trackParticle(const G4ThreeVector& pos, const G4ThreeVector& mom, int pdg, double charge, float t, float X0) override;
44 // c) end event - ntuple writing
45 virtual void endEvent() override;
46
47 private:
48
49 ToolHandle<IExtrapolator> m_extrapolator;
52
55
56 // put some validation code is
60
66 struct TreeData {
67 float m_t_x {0};
68 float m_t_y {0};
69 float m_t_z {0};
70 float m_t_theta {0};
71 float m_t_eta {0};
72 float m_t_phi {0};
73 float m_t_p {0};
74 float m_t_charge {0};
75 int m_t_pdg {0};
77 int m_g4_steps {0};
78 float m_g4_p[MAXPROBES] {0};
79 float m_g4_eta[MAXPROBES] {0};
81 float m_g4_phi[MAXPROBES] {0};
82 float m_g4_x[MAXPROBES] {0};
83 float m_g4_y[MAXPROBES] {0};
84 float m_g4_z[MAXPROBES] {0};
85 float m_g4_tX0[MAXPROBES] {0};
86 float m_g4_t[MAXPROBES] {0};
87 float m_g4_X0[MAXPROBES] {0};
90 float m_trk_p[MAXPROBES] {0};
91 float m_trk_eta[MAXPROBES] {0};
93 float m_trk_phi[MAXPROBES] {0};
94 float m_trk_x[MAXPROBES] {0};
95 float m_trk_y[MAXPROBES] {0};
96 float m_trk_z[MAXPROBES] {0};
97 float m_trk_lx[MAXPROBES] {0};
98 float m_trk_ly[MAXPROBES] {0};
99 };
100 std::unique_ptr<TreeData> m_treeData;
101 };
102
103}
104
105#endif
double charge(const T &p)
Definition AtlasPID.h:997
static constexpr int MAXPROBES
virtual void beginEvent() override
std::string m_validationTreeName
validation tree name - to be acessed by this from root
virtual StatusCode initialize() override
GeantFollowerHelper(const std::string &, const std::string &, const IInterface *)
virtual void trackParticle(const G4ThreeVector &pos, const G4ThreeVector &mom, int pdg, double charge, float t, float X0) override
virtual void endEvent() override
virtual StatusCode finalize() override
std::unique_ptr< TreeData > m_treeData
TTree * m_validationTree
Root Validation Tree.
const TrackParameters * m_parameterCache
std::string m_validationTreeFolder
stream/folder to for the TTree to be written out
ToolHandle< IExtrapolator > m_extrapolator
std::string m_validationTreeDescription
validation tree description - second argument in TTree
Interface class for the extrapolation AlgTool, it inherits from IAlgTool Detailed information about p...
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_trk_status[MAXPROBES]
Ntuple variables : trk follow up parameters.
int m_g4_steps
Ntuple variables : g4 step parameters.