ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimWindowExtensionTool.h
Go to the documentation of this file.
1// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3#ifndef FPGATrackSimWINDOWEXTENSION_H
4#define FPGATrackSimWINDOWEXTENSION_H
5
12
13#include "GaudiKernel/ServiceHandle.h"
15
16// add public header directory to algorithms for this?
18
31
32#include <vector>
33
34class FPGATrackSimWindowExtensionTool : public extends <AthAlgTool, IFPGATrackSimTrackExtensionTool>
35{
36 public:
38 using base_class::base_class;
39
40 virtual StatusCode initialize() override;
41
42 virtual StatusCode extendTracks(const std::vector<std::shared_ptr<const FPGATrackSimHit>> & hits,
43 const std::vector<std::shared_ptr<const FPGATrackSimTrack>> & tracks,
44 std::vector<std::shared_ptr<const FPGATrackSimRoad>> & roads) override;
45
46 // We don't have a "union" tool that sits in front of the extension tool, so this is needed here.
47 virtual StatusCode setupSlices(FPGATrackSimLogicalEventInputHeader *slicedHitHeader) override {
48 m_slicedHitHeader = slicedHitHeader;
49 return StatusCode::SUCCESS;
50 };
51
52 // Helper functions to extend a single track using different methods.
53 bool extendTrackSliced(std::shared_ptr<const FPGATrackSimTrack> track, std::vector<int>& numHits, layer_bitmask_t& hitLayers,
54 std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>& road_hits);
55 bool extendTrackBinned(std::shared_ptr<const FPGATrackSimTrack> track, std::vector<int>& numHits, layer_bitmask_t& hitLayers,
56 std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>& road_hits);
57
58 private:
59
60 ToolHandle<FPGATrackSimBinnedHits> m_hitBinningTool {this, "BinningTool", "FPGATrackSimBinning/FPGATrackSimBinnedHits"};
61
62 ServiceHandle<IFPGATrackSimBankSvc> m_FPGATrackSimBankSvc {this, "FPGATrackSimBankSvc", "FPGATrackSimBankSvc"};
63 ServiceHandle<IFPGATrackSimMappingSvc> m_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"};
64
65 // We'll definitely need properties, but I don't know which ones.
66 Gaudi::Property<int> m_maxMiss { this, "threshold", 2, "Maximum number of missing hits allowed on a road"};
67 Gaudi::Property<std::vector<float>> m_phiwindows {this, "phiWindow", {}, "Default window settings for phi, must be size nlayers."};
68 Gaudi::Property<std::vector<float>> m_zwindows {this, "zWindow", {}, "Default window settings for z, must be size nlayers."};
69 Gaudi::Property<std::vector<float>> m_phiwindows_barrel {this, "phiWindow_barrel", {}, "Default window settings for phi in the barrel, must be size nlayers."};
70 Gaudi::Property<std::vector<float>> m_zwindows_barrel {this, "zWindow_barrel", {}, "Default window settings for z in the barrel, must be size nlayers."};
71 Gaudi::Property<std::vector<float>> m_phiwindows_endcap {this, "phiWindow_endcap", {}, "Default window settings for phi in the endcap, must be size nlayers."};
72 Gaudi::Property<std::vector<float>> m_zwindows_endcap {this, "zWindow_endcap", {}, "Default window settings for z in the endcap, must be size nlayers."};
73 Gaudi::Property<bool> m_detectorZoneWindows {this, "detectorZoneWindows", false, "If set to true we separate windows will be used for endcap and barrel hits."};
74 Gaudi::Property<bool> m_fieldCorrection {this, "fieldCorrection", true, "Use magnetic field correction for Hough transform"};
75 Gaudi::Property<bool> m_idealGeoRoads {this, "IdealGeoRoads", true, "Do sector assignment of second stage roads"};
76 Gaudi::Property<bool> m_doBinning {this, "doBinning", false, "Use second stage binning to sort hits, not the plane map"};
77 Gaudi::Property<bool> m_addAllHits {this, "addAllHits", false, "If set to true ignore the window and just add all the hits"};
78 Gaudi::Property<std::vector<int>> m_maxHits {this, "maxHits", {}, "If set to positive number, maximum number of hits allowed per layer"};
79
80 // Options only needed for sector assignment.
81 // The eta pattern option here should probably be dropped, because we're not using it
82 // and supporting it requires having two sets of eta patterns (one for the first stage, one for the second)
83 // and then running the eta pattern filter a second time.
84 Gaudi::Property <bool> m_doRegionalMapping { this, "RegionalMapping", false, "Use the sub-region maps to define the sector"};
85 Gaudi::Property <bool> m_doEtaPatternConsts { this, "doEtaPatternConsts", false, "Whether to use the eta pattern tool for constant generation"};
86 Gaudi::Property <bool> m_useSpacePoints { this, "useSpacePoints", false, "Whether we are using spacepoints."};
87
88 // Temporary, used in the hit sorting implementation, borrowed from the NN pathfinder tool. Likely to change.
89 Gaudi::Property <double> m_phiScale {this, "phiScale", 3.15, "Phi scale used when calculating distance from predicted window position" };
90 Gaudi::Property <double> m_zScale {this, "zScale", 3000, "z scale used when calculating distance from predicted window position" };
91
92 std::vector<FPGATrackSimRoad> m_roads;
93 //This is a map(dict python equivalent) of slice IDs that have a map of layer IDs in it. That map has a vector of hits associated with it
94 std::map<unsigned, std::map<unsigned, std::vector<std::shared_ptr<const FPGATrackSimHit>>>> m_phits_atLayer;
95 unsigned m_nLayers_1stStage = 0;
96 unsigned m_nLayers_2ndStage = 0;
97 unsigned m_threshold = 0;
98
99 // Internal storage for the sliced hits (implemented as a LogicalEventInputHeader,
100 // so we can easily copy to the output ROOT file).
102
103};
104
105#endif
Binning Classes for GenScanTool.
: FPGATrackSim-specific class to represent an hit in the detector.
Utilize NN score to build track candidates.
Maps physical layers to logical layers.
Maps ITK module indices to FPGATrackSim regions.
Defines a class for roads.
uint32_t layer_bitmask_t
Interface declaration for track extension tools (tracks + hits -> roads)
Gaudi::Property< std::vector< float > > m_zwindows
bool extendTrackSliced(std::shared_ptr< const FPGATrackSimTrack > track, std::vector< int > &numHits, layer_bitmask_t &hitLayers, std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > &road_hits)
std::map< unsigned, std::map< unsigned, std::vector< std::shared_ptr< const FPGATrackSimHit > > > > m_phits_atLayer
Gaudi::Property< std::vector< float > > m_phiwindows
FPGATrackSimLogicalEventInputHeader * m_slicedHitHeader
bool extendTrackBinned(std::shared_ptr< const FPGATrackSimTrack > track, std::vector< int > &numHits, layer_bitmask_t &hitLayers, std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > &road_hits)
virtual StatusCode setupSlices(FPGATrackSimLogicalEventInputHeader *slicedHitHeader) override
ToolHandle< FPGATrackSimBinnedHits > m_hitBinningTool
Gaudi::Property< std::vector< float > > m_phiwindows_endcap
Gaudi::Property< std::vector< int > > m_maxHits
ServiceHandle< IFPGATrackSimBankSvc > m_FPGATrackSimBankSvc
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
virtual StatusCode extendTracks(const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, const std::vector< std::shared_ptr< const FPGATrackSimTrack > > &tracks, std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads) override
Gaudi::Property< std::vector< float > > m_zwindows_barrel
Gaudi::Property< std::vector< float > > m_phiwindows_barrel
Gaudi::Property< std::vector< float > > m_zwindows_endcap