ATLAS Offline Software
FPGATrackSimMappingSvc.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2024 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 
20 class 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 getParamNNMapString() const override;
37 
38  private:
39 
40  // Handles
42 
43  // Configuration
44 
45  Gaudi::Property<std::string> m_mappingType {this, "mappingType", "FILE", "for now should be FILE only, DB for the future"};
46  Gaudi::Property<std::string> m_rmap_path {this, "rmap", "", "path of the region-map file"};
47  Gaudi::Property<std::string> m_subrmap_path {this, "subrmap", "", "path of the region-map file for subregions"};
48  Gaudi::Property<std::string> m_pmap_path {this, "pmap", "", "path of the PMAP file"};
49  Gaudi::Property<std::string> m_modulelut_path {this, "modulemap", "", "path of the ModuleLUT file"};
50  Gaudi::Property<std::string> m_NNmap_path_fake {this, "FakeNNonnx", "", "path of the NN weighting file"};
51  Gaudi::Property<std::string> m_NNmap_path_param {this, "ParamNNonnx", "", "path of the NN weighting file"};
52  Gaudi::Property<std::string> m_radii_path {this, "radiiFile", "", "path of the average radius file" };
53  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 }"};
54 
55  // Map unique pointers
56  //vector of pmaps
57  std::vector<std::unique_ptr<FPGATrackSimPlaneMap>> m_pmap_vector_1st; // pointer to the pmap object for 1st stage
58  std::vector<std::unique_ptr<FPGATrackSimPlaneMap>> m_pmap_vector_2nd; // pointer to the pmap object for 2nd stage
59  virtual size_t GetPlaneMap_1stSliceSize() const override {return m_pmap_vector_1st.size();}
60  virtual size_t GetPlaneMap_2ndSliceSize() const override {return m_pmap_vector_2nd.size();}
61  std::unique_ptr<FPGATrackSimRegionMap> m_rmap_1st = nullptr; // pointer to the RMAP object using 1st stage plane map
62  std::unique_ptr<FPGATrackSimRegionMap> m_rmap_2nd = nullptr; // pointer to the RMAP object using 2nd stage plane map
63  std::unique_ptr<FPGATrackSimRegionMap> m_subrmap = nullptr;
64  std::unique_ptr<FPGATrackSimRegionMap> m_subrmap_2nd = nullptr;
65  std::unique_ptr<FPGATrackSimNNMap> m_NNmap_fake = nullptr;
66  std::unique_ptr<FPGATrackSimNNMap> m_NNmap_param = nullptr;
67 
68  size_t m_numberOfPmaps = 0;
69  // Helpers
70  int readPmapSize(std::ifstream& fileIn);
71  int countPmapSize(std::ifstream& fileIn);
72 
75 };
76 
77 #endif // TRIGFPGATrackSimMAPPINGSVC_H
FPGATrackSimMappingSvc::m_NNmap_path_fake
Gaudi::Property< std::string > m_NNmap_path_fake
Definition: FPGATrackSimMappingSvc.h:50
FPGATrackSimMappingSvc::m_rmap_2nd
std::unique_ptr< FPGATrackSimRegionMap > m_rmap_2nd
Definition: FPGATrackSimMappingSvc.h:62
FPGATrackSimMappingSvc::FPGATrackSimMappingSvc
FPGATrackSimMappingSvc(const std::string &name, ISvcLocator *svc)
Definition: FPGATrackSimMappingSvc.cxx:7
FPGATrackSimNNMap.h
Map for NN tracking.
FPGATrackSimPlaneMap.h
Maps physical layers to logical layers.
FPGATrackSimMappingSvc::~FPGATrackSimMappingSvc
virtual ~FPGATrackSimMappingSvc()=default
IFPGATrackSimMappingSvc.h
FPGATrackSimMappingSvc::m_NNmap_fake
std::unique_ptr< FPGATrackSimNNMap > m_NNmap_fake
Definition: FPGATrackSimMappingSvc.h:65
FPGATrackSimMappingSvc::m_numberOfPmaps
size_t m_numberOfPmaps
Definition: FPGATrackSimMappingSvc.h:68
FPGATrackSimMappingSvc::m_radii_path
Gaudi::Property< std::string > m_radii_path
Definition: FPGATrackSimMappingSvc.h:52
FPGATrackSimMappingSvc::checkAllocs
StatusCode checkAllocs()
Definition: FPGATrackSimMappingSvc.cxx:29
IFPGATrackSimEventSelectionSvc
Definition: IFPGATrackSimEventSelectionSvc.h:22
FPGATrackSimMappingSvc::m_rmap_1st
std::unique_ptr< FPGATrackSimRegionMap > m_rmap_1st
Definition: FPGATrackSimMappingSvc.h:61
FPGATrackSimMappingSvc::RegionMap_2nd
virtual const FPGATrackSimRegionMap * RegionMap_2nd() const override
Definition: FPGATrackSimMappingSvc.h:32
FPGATrackSimMappingSvc::readPmapSize
int readPmapSize(std::ifstream &fileIn)
FPGATrackSimMappingSvc::GetPlaneMap_1stSliceSize
virtual size_t GetPlaneMap_1stSliceSize() const override
Definition: FPGATrackSimMappingSvc.h:59
FPGATrackSimMappingSvc
Definition: FPGATrackSimMappingSvc.h:21
FPGATrackSimRegionMap.h
Maps ITK module indices to FPGATrackSim regions.
FPGATrackSimMappingSvc::getParamNNMapString
virtual std::string getParamNNMapString() const override
Definition: FPGATrackSimMappingSvc.cxx:100
FPGATrackSimMappingSvc::m_layerOverrides
Gaudi::Property< std::vector< int > > m_layerOverrides
Definition: FPGATrackSimMappingSvc.h:53
FPGATrackSimMappingSvc::m_subrmap_2nd
std::unique_ptr< FPGATrackSimRegionMap > m_subrmap_2nd
Definition: FPGATrackSimMappingSvc.h:64
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
FPGATrackSimMappingSvc::getFakeNNMapString
virtual std::string getFakeNNMapString() const override
Definition: FPGATrackSimMappingSvc.cxx:91
FPGATrackSimMappingSvc::m_pmap_path
Gaudi::Property< std::string > m_pmap_path
Definition: FPGATrackSimMappingSvc.h:48
FPGATrackSimMappingSvc::m_EvtSel
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
Definition: FPGATrackSimMappingSvc.h:41
FPGATrackSimMappingSvc::m_modulelut_path
Gaudi::Property< std::string > m_modulelut_path
Definition: FPGATrackSimMappingSvc.h:49
FPGATrackSimMappingSvc::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimMappingSvc.cxx:129
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FPGATrackSimMappingSvc::m_NNmap_path_param
Gaudi::Property< std::string > m_NNmap_path_param
Definition: FPGATrackSimMappingSvc.h:51
FPGATrackSimMappingSvc::RegionMap_1st
virtual const FPGATrackSimRegionMap * RegionMap_1st() const override
Definition: FPGATrackSimMappingSvc.h:31
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
FPGATrackSimMappingSvc::GetPlaneMap_2ndSliceSize
virtual size_t GetPlaneMap_2ndSliceSize() const override
Definition: FPGATrackSimMappingSvc.h:60
FPGATrackSimPlaneMap
Definition: FPGATrackSimPlaneMap.h:62
FPGATrackSimMappingSvc::m_pmap_vector_1st
std::vector< std::unique_ptr< FPGATrackSimPlaneMap > > m_pmap_vector_1st
Definition: FPGATrackSimMappingSvc.h:57
FPGATrackSimMappingSvc::m_rmap_path
Gaudi::Property< std::string > m_rmap_path
Definition: FPGATrackSimMappingSvc.h:46
FPGATrackSimMappingSvc::PlaneMap_1st
virtual const FPGATrackSimPlaneMap * PlaneMap_1st(int slice) const override
Definition: FPGATrackSimMappingSvc.h:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
FPGATrackSimMappingSvc::PlaneMap_2nd
virtual const FPGATrackSimPlaneMap * PlaneMap_2nd(int slice) const override
Definition: FPGATrackSimMappingSvc.h:30
FPGATrackSimMappingSvc::m_pmap_vector_2nd
std::vector< std::unique_ptr< FPGATrackSimPlaneMap > > m_pmap_vector_2nd
Definition: FPGATrackSimMappingSvc.h:58
FPGATrackSimMappingSvc::m_mappingType
Gaudi::Property< std::string > m_mappingType
Definition: FPGATrackSimMappingSvc.h:45
FPGATrackSimMappingSvc::m_subrmap_path
Gaudi::Property< std::string > m_subrmap_path
Definition: FPGATrackSimMappingSvc.h:47
FPGATrackSimMappingSvc::SubRegionMap
virtual const FPGATrackSimRegionMap * SubRegionMap() const override
Definition: FPGATrackSimMappingSvc.h:33
IFPGATrackSimEventSelectionSvc.h
FPGATrackSimMappingSvc::m_subrmap
std::unique_ptr< FPGATrackSimRegionMap > m_subrmap
Definition: FPGATrackSimMappingSvc.h:63
FPGATrackSimMappingSvc::checkInputs
StatusCode checkInputs()
Definition: FPGATrackSimMappingSvc.cxx:14
AthService.h
FPGATrackSimRegionMap
Definition: FPGATrackSimRegionMap.h:62
FPGATrackSimMappingSvc::SubRegionMap_2nd
virtual const FPGATrackSimRegionMap * SubRegionMap_2nd() const override
Definition: FPGATrackSimMappingSvc.h:34
FPGATrackSimMappingSvc::m_NNmap_param
std::unique_ptr< FPGATrackSimNNMap > m_NNmap_param
Definition: FPGATrackSimMappingSvc.h:66
FPGATrackSimMappingSvc::countPmapSize
int countPmapSize(std::ifstream &fileIn)
Definition: FPGATrackSimMappingSvc.cxx:110
ServiceHandle< IFPGATrackSimEventSelectionSvc >