ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimMappingSvc.h
Go to the documentation of this file.
1// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3#ifndef TRIGFPGATrackSimMAPPINGSVC_H
4#define TRIGFPGATrackSimMAPPINGSVC_H
5
7
13
14#include <iostream>
15#include <fstream>
16#include <string>
17
19
20class FPGATrackSimMappingSvc : public extends<AthService, IFPGATrackSimMappingSvc>
21{
22 public:
23
24 FPGATrackSimMappingSvc(const std::string& name, ISvcLocator* svc);
25 virtual ~FPGATrackSimMappingSvc() = default;
26
27 virtual StatusCode initialize() override;
28
29 virtual const FPGATrackSimPlaneMap* PlaneMap_1st(int slice) const override { return m_pmap_vector_1st.at(slice).get(); }
30 virtual const FPGATrackSimPlaneMap* PlaneMap_2nd(int slice) const override { return m_pmap_vector_2nd.at(slice).get(); }
31 virtual const FPGATrackSimRegionMap* RegionMap_1st() const override { return m_rmap_1st.get(); }
32 virtual const FPGATrackSimRegionMap* RegionMap_2nd() const override { return m_rmap_2nd.get(); }
33 virtual const FPGATrackSimRegionMap* SubRegionMap() const override { return m_subrmap.get(); }
34 virtual const FPGATrackSimRegionMap* SubRegionMap_2nd() const override { return m_subrmap_2nd.get(); }
35 virtual std::string getFakeNNMapString() const override;
36 virtual std::string getFakeNNMap2ndString() const override;
37 virtual std::string getExtensionNNHitMapString() const override;
38 virtual std::string getExtensionNNVolMapString() const override;
39 virtual std::string getParamNNMapString() const override;
40 virtual std::string getParamNNMap2ndString() const override;
41 virtual std::string getGNNModuleMapString() const override;
42
43 private:
44
45 // Configuration
46 Gaudi::Property<unsigned int> m_regionID { this, "regionID", 0, "current region under processing"}; // Current region of interest
47 Gaudi::Property<std::string> m_mappingType {this, "mappingType", "FILE", "for now should be FILE only, DB for the future"};
48 Gaudi::Property<std::string> m_rmap_path {this, "rmap", "", "path of the region-map file"};
49 Gaudi::Property<std::string> m_subrmap_path {this, "subrmap", "", "path of the region-map file for subregions"};
50 Gaudi::Property<std::string> m_pmap_path {this, "pmap", "", "path of the PMAP file"};
51 Gaudi::Property<std::string> m_modulelut_path {this, "modulemap", "", "path of the ModuleLUT file"};
52 Gaudi::Property<std::string> m_NNmap_path_fake {this, "FakeNNonnx1st", "", "path of the NN weighting file for 1st stage"};
53 Gaudi::Property<std::string> m_NNmap2nd_path_fake {this, "FakeNNonnx2nd", "", "path of the NN weighting file for 2nd stage"};
54 Gaudi::Property<std::string> m_NNmap_path_extension_vol {this, "ExtensionNNVolonnx", "", "path of the NN weighting file"};
55 Gaudi::Property<std::string> m_NNmap_path_extension_hit {this, "ExtensionNNHitonnx", "", "path of the NN weighting file"};
56 Gaudi::Property<std::string> m_NNmap_path_param {this, "ParamNNonnx1st", "", "path of the NN weighting file for 1st stage"};
57 Gaudi::Property<std::string> m_NNmap2nd_path_param {this, "ParamNNonnx2nd", "", "path of the NN weighting file for 2nd stage"};
58 Gaudi::Property<std::string> m_GNNmap_path_moduleMap {this, "GNNModuleMap", "", "path of the GNN Module Map file"};
59 Gaudi::Property<std::string> m_radii_path {this, "radiiFile", "", "path of the average radius file" };
60 Gaudi::Property<std::string> m_radii2nd_path {this, "radiiFile2nd", "", "path of the average radius file for 2nd stage" };
61 Gaudi::Property<std::vector <int> > m_layerOverrides {this, "layerOverride", {}, "Overrides the selection of the 1st stage logical layers in the plane map. Each entry declares a detector layer to use as a logical layer. Specify a detector layer with { SiliconTech * 1000 + DetectorZone * 100 + PhysicalLayer }"};
62 Gaudi::Property<bool> m_loadRadii {this, "loadRadii", true, "Whether or not to attempt to read in the idealized radii files" };
63 Gaudi::Property<bool> m_loadRegionMap {this, "loadRegionMap", true, "Whether or not to attempt to loda the region maps; if false, isInRegion will always return true" };
64 Gaudi::Property<bool> m_doGNNTrack {this, "DoGNNTrack", false, "flag to do NN tracking models for GNN tracking" };
65
66 // Map unique pointers
67 //vector of pmaps
68 std::vector<std::unique_ptr<FPGATrackSimPlaneMap>> m_pmap_vector_1st; // pointer to the pmap object for 1st stage
69 std::vector<std::unique_ptr<FPGATrackSimPlaneMap>> m_pmap_vector_2nd; // pointer to the pmap object for 2nd stage
70 virtual size_t GetPlaneMap_1stSliceSize() const override {return m_pmap_vector_1st.size();}
71 virtual size_t GetPlaneMap_2ndSliceSize() const override {return m_pmap_vector_2nd.size();}
72 std::unique_ptr<FPGATrackSimRegionMap> m_rmap_1st = nullptr; // pointer to the RMAP object using 1st stage plane map
73 std::unique_ptr<FPGATrackSimRegionMap> m_rmap_2nd = nullptr; // pointer to the RMAP object using 2nd stage plane map
74 std::unique_ptr<FPGATrackSimRegionMap> m_subrmap = nullptr;
75 std::unique_ptr<FPGATrackSimRegionMap> m_subrmap_2nd = nullptr;
76 std::unique_ptr<FPGATrackSimNNMap> m_NNmap_fake = nullptr;
77 std::unique_ptr<FPGATrackSimNNMap> m_NNmap_param = nullptr;
78 std::unique_ptr<FPGATrackSimNNMap> m_NNmap2nd_fake = nullptr;
79 std::unique_ptr<FPGATrackSimNNMap> m_NNmap2nd_param = nullptr;
80 std::unique_ptr<FPGATrackSimNNMap> m_NNmap_extension_vol = nullptr;
81 std::unique_ptr<FPGATrackSimNNMap> m_NNmap_extension_hit = nullptr;
82 std::unique_ptr<FPGATrackSimNNMap> m_GNNmap_moduleMap = nullptr;
83
84
85 size_t m_numberOfPmaps = 0;
86 // Helpers
87 int readPmapSize(std::ifstream& fileIn);
88 int countPmapSize(std::ifstream& fileIn);
89
90 StatusCode checkInputs();
91 StatusCode checkAllocs();
92};
93
94#endif // TRIGFPGATrackSimMAPPINGSVC_H
Map for NN tracking.
Maps physical layers to logical layers.
Maps ITK module indices to FPGATrackSim regions.
std::vector< std::unique_ptr< FPGATrackSimPlaneMap > > m_pmap_vector_1st
Gaudi::Property< bool > m_loadRegionMap
std::unique_ptr< FPGATrackSimNNMap > m_NNmap2nd_param
virtual std::string getExtensionNNVolMapString() const override
Gaudi::Property< std::string > m_NNmap_path_fake
std::unique_ptr< FPGATrackSimNNMap > m_GNNmap_moduleMap
Gaudi::Property< bool > m_loadRadii
virtual const FPGATrackSimRegionMap * SubRegionMap() const override
Gaudi::Property< std::string > m_NNmap2nd_path_param
virtual const FPGATrackSimRegionMap * SubRegionMap_2nd() const override
virtual std::string getFakeNNMap2ndString() const override
Gaudi::Property< std::string > m_rmap_path
Gaudi::Property< std::string > m_radii_path
virtual size_t GetPlaneMap_2ndSliceSize() const override
std::unique_ptr< FPGATrackSimRegionMap > m_subrmap
std::unique_ptr< FPGATrackSimNNMap > m_NNmap_fake
virtual size_t GetPlaneMap_1stSliceSize() const override
Gaudi::Property< std::string > m_NNmap2nd_path_fake
std::unique_ptr< FPGATrackSimNNMap > m_NNmap_param
Gaudi::Property< std::string > m_modulelut_path
virtual std::string getParamNNMapString() const override
Gaudi::Property< std::string > m_mappingType
virtual const FPGATrackSimPlaneMap * PlaneMap_1st(int slice) const override
virtual std::string getGNNModuleMapString() const override
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_subrmap_path
std::unique_ptr< FPGATrackSimNNMap > m_NNmap_extension_hit
std::unique_ptr< FPGATrackSimRegionMap > m_rmap_2nd
virtual const FPGATrackSimRegionMap * RegionMap_1st() const override
virtual std::string getParamNNMap2ndString() const override
virtual const FPGATrackSimPlaneMap * PlaneMap_2nd(int slice) const override
virtual ~FPGATrackSimMappingSvc()=default
std::unique_ptr< FPGATrackSimRegionMap > m_subrmap_2nd
Gaudi::Property< std::string > m_GNNmap_path_moduleMap
FPGATrackSimMappingSvc(const std::string &name, ISvcLocator *svc)
Gaudi::Property< std::string > m_NNmap_path_extension_vol
int readPmapSize(std::ifstream &fileIn)
Gaudi::Property< std::string > m_NNmap_path_param
int countPmapSize(std::ifstream &fileIn)
Gaudi::Property< std::string > m_pmap_path
std::unique_ptr< FPGATrackSimRegionMap > m_rmap_1st
Gaudi::Property< std::string > m_NNmap_path_extension_hit
Gaudi::Property< std::vector< int > > m_layerOverrides
Gaudi::Property< bool > m_doGNNTrack
virtual std::string getFakeNNMapString() const override
std::unique_ptr< FPGATrackSimNNMap > m_NNmap_extension_vol
std::vector< std::unique_ptr< FPGATrackSimPlaneMap > > m_pmap_vector_2nd
Gaudi::Property< unsigned int > m_regionID
virtual const FPGATrackSimRegionMap * RegionMap_2nd() const override
virtual std::string getExtensionNNHitMapString() const override
Gaudi::Property< std::string > m_radii2nd_path
std::unique_ptr< FPGATrackSimNNMap > m_NNmap2nd_fake