ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimHoughRootOutputTool.h
Go to the documentation of this file.
1// Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3#ifndef FPGATrackSimHOUGHROOTOUTPUTTOOL_H
4#define FPGATrackSimHOUGHROOTOUTPUTTOOL_H
5
13
14#include "GaudiKernel/ServiceHandle.h"
16
23
24#include "GaudiKernel/ITHistSvc.h"
25
30
31#include "TTree.h"
32
33#include "GaudiKernel/ToolHandle.h"
35
38
39
40
42{
43 public:
44
46 // AthAlgTool
47
48 FPGATrackSimHoughRootOutputTool(const std::string&, const std::string&, const IInterface*);
49
50 virtual StatusCode initialize() override;
51 StatusCode fillTree(const std::vector<std::shared_ptr<const FPGATrackSimRoad>> &roads, const std::vector<FPGATrackSimTruthTrack> &truthTracks, const std::vector<FPGATrackSimOfflineTrack> &offlineTracks, const std::vector<std::shared_ptr<const FPGATrackSimHit>> &hits_2nd, const bool writeOutNonSPStripHits, const float minChi2, const int maxOverlappingHits, const bool roadsAreSecondStage);
52 StatusCode fillTree(const std::vector<FPGATrackSimTrack> &track_cands, const std::vector<FPGATrackSimTruthTrack> &truthTracks, const std::vector<FPGATrackSimOfflineTrack> &offlineTracks, const std::vector<std::shared_ptr<const FPGATrackSimHit>> &hits_2nd, const bool writeOutNonSPStripHits, const bool roadsAreSecondStage);
53
54
55
56 private:
57
58 StatusCode bookTree();
59
60 void ResetVectors();
61
62 ServiceHandle<IFPGATrackSimEventSelectionSvc> m_EvtSel {this, "FPGATrackSimEventSelectionSvc", "FPGATrackSimEventSelectionSvc"};
64 ServiceHandle<ITHistSvc> m_tHistSvc {this, "THistSvc", "THistSvc"};
65 Gaudi::Property <std::string> m_algorithm { this, "ORAlgo", "Normal", "Overlap removal algorithm"};
66 Gaudi::Property <std::string> m_region { this, "OutputRegion", "", "region ID"};
67
68 ORAlgo m_algo{ORAlgo::Normal}; // Internal ORAlgo enum for faster compare
69
72
73 ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool", "", "Monitoring tool"};
74
75 TTree *m_tree = nullptr; // output tree
76 std::vector<float> m_x; // x position of hit in road
77 std::vector<float> m_y; // y pos
78 std::vector<float> m_z; // z pos
79 std::vector<int> m_volumeID; // custom volume ID
80 std::vector<int> m_custom_layerID; // custom layer ID
81 std::vector<int> m_layerID;
82 std::vector<int> m_etaID;
83 std::vector<float> m_gphi;
84 std::vector<float> m_zIdeal; // idealized z
85 std::vector<float> m_gphiIdeal; // idealized gphi
86 std::vector<float> m_barcodefrac; // truth barcode fraction for the hit
87 std::vector<unsigned long> m_barcode; // truth barcode for the hit
88 std::vector<int> m_eventindex; // event index for the hit
89 std::vector<unsigned int> m_isPixel; // is hit pixel? if 0 it is strip
90 std::vector<unsigned int> m_layer; // layer ID
91 std::vector<unsigned int> m_isBarrel; // is hit in barrel? if 0 it is endcap
92 std::vector<unsigned int> m_etawidth;
93 std::vector<unsigned int> m_phiwidth;
94 std::vector<unsigned int> m_etamodule;
95 std::vector<unsigned int> m_phimodule;
96 std::vector<unsigned int> m_ID; // ID hash for hit
97 std::vector<unsigned int> m_diskLayer;
98 std::vector<unsigned int> m_passesOR;
99 std::vector<float> m_roadChi2;
100 std::vector<float> m_roadChi2ndof;
101 std::vector<float> m_roadNCoords;
102 std::vector<float> m_nMissingHits;
103 std::vector<bool> m_mapped;
104 std::vector<bool> m_realHit;
105 std::vector<bool> m_isSP;
106
108
109
110 float m_phi = 0.0F; // phi pre-estimate from the 2d hough
111 float m_invpt = 0.0F; // invpt pre-estimate from the 2d hough
112 unsigned int m_subregion = 0; // subregion of road
114
115 // quantities for the track matched to truth, not per hit
119 unsigned int m_fakelabel = 0; // label for fake tracks. 1 if track candidate's barcodefrac is < 0.5, 0 else
126
127 // track number in the event, since the request is to store this per road
128 // naively vectors of vectors and one entry per event makes more sense but this was the
129 // request from the ML people
131
132 // this is the tree index used to connect to the truth information
133 int m_treeindex = 0;
134
135 // road number separates information from each road;
137
138 // Separate tree with truth track information
139 TTree *m_truthtree = nullptr; // output tree
140
141 std::vector<float> m_truth_d0;
142 std::vector<float> m_truth_z0;
143 std::vector<float> m_truth_pt;
144 std::vector<float> m_truth_eta;
145 std::vector<float> m_truth_phi;
146 std::vector<float> m_truth_pdg;
147 std::vector<int> m_truth_q;
148 std::vector<int> m_truth_barcode;
149 std::vector<int> m_truth_eventindex;
150 std::vector<bool> m_has_strip_nonspacepoint;
151 std::vector<std::vector<float>> m_track_hit_x;
152 std::vector<std::vector<float>> m_track_hit_y;
153 std::vector<std::vector<float>> m_track_hit_z;
154 std::vector<std::vector<float>> m_track_hit_R;
155 std::vector<std::vector<float>> m_track_hit_eta;
156 std::vector<std::vector<float>> m_track_hit_phi;
157 std::vector<std::vector<int>> m_track_hit_layer_disk;
158 std::vector<std::vector<bool>> m_track_hit_isPixel;
159 std::vector<std::vector<bool>> m_track_hit_isStrip;
160 std::vector<std::vector<bool>> m_track_hit_isClustered;
161 std::vector<std::vector<bool>> m_track_hit_isSpacepoint;
162 std::vector<std::vector<bool>> m_track_hit_isMapped;
163 std::vector<std::vector<int>> m_track_hit_barcode;
164 std::vector<std::vector<float>> m_track_hit_barcodefrac;
165 std::vector<std::vector<float>> m_track_hit_zIdeal;
166 std::vector<std::vector<float>> m_track_hit_gphiIdeal;
167 std::vector<std::vector<long>> m_track_hit_fineID;
168 std::vector<std::vector<int>> m_track_hit_volumeID;
169
170 // And now the offline information
171 TTree *m_offlinetree = nullptr;
172 std::vector<int> m_offline_n_holes;
173 std::vector<int> m_offline_n_measurement;
175 std::vector<int> m_offline_n_brempoint;
176 std::vector<int> m_offline_n_scatterer;
177 std::vector<int> m_offline_n_perigee;
178 std::vector<int> m_offline_n_outlier;
179 std::vector<int> m_offline_n_other;
180
181 std::vector<float> m_offline_d0;
182 std::vector<float> m_offline_z0;
183 std::vector<float> m_offline_pt;
184 std::vector<float> m_offline_eta;
185 std::vector<float> m_offline_phi;
186 std::vector<int> m_offline_q;
187 std::vector<int> m_offline_barcode;
188 std::vector<float> m_offline_barcodefrac;
189};
190
191
192#endif // FPGATrackSimHOUGHROOTOUTPUTTOOL_H
: FPGATrackSim-specific class to represent an hit in the detector.
Maps physical layers to logical layers.
Maps ITK module indices to FPGATrackSim regions.
Defines a class for roads.
TrackCorrType
Header file to be included by clients of the Monitored infrastructure.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
std::vector< std::vector< float > > m_track_hit_R
std::vector< std::vector< float > > m_track_hit_x
std::vector< std::vector< bool > > m_track_hit_isStrip
std::vector< std::vector< float > > m_track_hit_zIdeal
std::vector< std::vector< float > > m_track_hit_z
std::vector< std::vector< bool > > m_track_hit_isClustered
std::vector< std::vector< bool > > m_track_hit_isSpacepoint
std::vector< std::vector< bool > > m_track_hit_isPixel
std::vector< std::vector< float > > m_track_hit_eta
FPGATrackSimHoughRootOutputTool(const std::string &, const std::string &, const IInterface *)
std::vector< std::vector< long > > m_track_hit_fineID
std::vector< std::vector< int > > m_track_hit_barcode
std::vector< std::vector< float > > m_track_hit_barcodefrac
std::vector< std::vector< int > > m_track_hit_volumeID
std::vector< std::vector< int > > m_track_hit_layer_disk
std::vector< std::vector< float > > m_track_hit_phi
StatusCode fillTree(const std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads, const std::vector< FPGATrackSimTruthTrack > &truthTracks, const std::vector< FPGATrackSimOfflineTrack > &offlineTracks, const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits_2nd, const bool writeOutNonSPStripHits, const float minChi2, const int maxOverlappingHits, const bool roadsAreSecondStage)
std::vector< std::vector< float > > m_track_hit_gphiIdeal
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
std::vector< std::vector< float > > m_track_hit_y
std::vector< std::vector< bool > > m_track_hit_isMapped
ToolHandle< GenericMonitoringTool > m_monTool