ATLAS Offline Software
FPGATrackSimSlicingEngineTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 
4  Implements the core logic of the "slicing engine", deciding whether hits fall
5  within region boundaries and splitting them by stage as appropriate.
6 */
7 
8 #ifndef FPGATrackSimSLICINGENGINETOOL_H
9 #define FPGATrackSimSLICINGENGINETOOL_H
10 
11 #include <array>
12 #include <vector>
13 #include <map>
14 
19 
20 class TH1I;
21 
23 public:
24  FPGATrackSimSlicingEngineTool(const std::string&, const std::string&, const IInterface*);
25  virtual ~FPGATrackSimSlicingEngineTool() = default;
26  virtual StatusCode initialize() override;
27 
28  void readLayerMap();
29 
30  void sliceHits(const std::vector<std::shared_ptr<const FPGATrackSimHit>>& hits,
31  std::vector<std::shared_ptr<const FPGATrackSimHit>>& firstHits,
32  std::vector<std::shared_ptr<const FPGATrackSimHit>>& secondHits);
33 
34  // Helper function to hook up branches for output test vector creation.
35  void setupSlices(FPGATrackSimLogicalEventInputHeader *slicedFirstPixelHeader,
36  FPGATrackSimLogicalEventInputHeader *slicedSecondPixelHeader,
37  FPGATrackSimLogicalEventInputHeader *slicedStripHeader) {
38  m_slicedFirstPixelHeader = slicedFirstPixelHeader;
39  m_slicedSecondPixelHeader = slicedSecondPixelHeader;
40  m_slicedStripHeader = slicedStripHeader;
41  };
42 
43 private:
44 
45  // Properties
46  ServiceHandle<IFPGATrackSimMappingSvc> m_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", ""};
47 
48  Gaudi::Property<bool> m_rootOutput {this, "RootOutput", true, "Wite output ROOT branches"};
49  Gaudi::Property<std::string> m_layerMap {this, "LayerMap", "", "Binning layer map file, only read if doSecondStage = true."};
50  Gaudi::Property<bool> m_doSecondStage {this, "doSecondStage", true, "Split hits between first and second stage. If set to false all hits are first stage" };
51 
52  // Internal storage for the sliced hits (implemented as a LogicalEventInputHeader,
53  // so we can easily copy to the output ROOT file).
57 
58  // Internal storage, these are the modules in the configured layer map that belong
59  // to the first stage.
60  std::set<unsigned> m_layerMapModules;
61 
62 };
63 
64 #endif // FPGATrackSimSLICINGENGINETOOL_H
FPGATrackSimLogicalEventInputHeader
Definition: FPGATrackSimLogicalEventInputHeader.h:21
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
FPGATrackSimSlicingEngineTool::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimSlicingEngineTool.h:46
FPGATrackSimSlicingEngineTool::sliceHits
void sliceHits(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, std::vector< std::shared_ptr< const FPGATrackSimHit >> &firstHits, std::vector< std::shared_ptr< const FPGATrackSimHit >> &secondHits)
Definition: FPGATrackSimSlicingEngineTool.cxx:57
FPGATrackSimSlicingEngineTool::m_slicedFirstPixelHeader
FPGATrackSimLogicalEventInputHeader * m_slicedFirstPixelHeader
Definition: FPGATrackSimSlicingEngineTool.h:54
IFPGATrackSimMappingSvc.h
FPGATrackSimSlicingEngineTool::m_layerMap
Gaudi::Property< std::string > m_layerMap
Definition: FPGATrackSimSlicingEngineTool.h:49
FPGATrackSimSlicingEngineTool::~FPGATrackSimSlicingEngineTool
virtual ~FPGATrackSimSlicingEngineTool()=default
FPGATrackSimSlicingEngineTool::m_rootOutput
Gaudi::Property< bool > m_rootOutput
Definition: FPGATrackSimSlicingEngineTool.h:48
FPGATrackSimSlicingEngineTool::FPGATrackSimSlicingEngineTool
FPGATrackSimSlicingEngineTool(const std::string &, const std::string &, const IInterface *)
Definition: FPGATrackSimSlicingEngineTool.cxx:14
FPGATrackSimSlicingEngineTool::setupSlices
void setupSlices(FPGATrackSimLogicalEventInputHeader *slicedFirstPixelHeader, FPGATrackSimLogicalEventInputHeader *slicedSecondPixelHeader, FPGATrackSimLogicalEventInputHeader *slicedStripHeader)
Definition: FPGATrackSimSlicingEngineTool.h:35
FPGATrackSimSlicingEngineTool::m_slicedStripHeader
FPGATrackSimLogicalEventInputHeader * m_slicedStripHeader
Definition: FPGATrackSimSlicingEngineTool.h:56
FPGATrackSimSlicingEngineTool::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimSlicingEngineTool.cxx:18
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
FPGATrackSimSlicingEngineTool::readLayerMap
void readLayerMap()
Definition: FPGATrackSimSlicingEngineTool.cxx:25
FPGATrackSimHit.h
: FPGATrackSim-specific class to represent an hit in the detector.
FPGATrackSimSlicingEngineTool::m_slicedSecondPixelHeader
FPGATrackSimLogicalEventInputHeader * m_slicedSecondPixelHeader
Definition: FPGATrackSimSlicingEngineTool.h:55
FPGATrackSimSlicingEngineTool
Definition: FPGATrackSimSlicingEngineTool.h:22
FPGATrackSimSlicingEngineTool::m_layerMapModules
std::set< unsigned > m_layerMapModules
Definition: FPGATrackSimSlicingEngineTool.h:60
AthAlgTool
Definition: AthAlgTool.h:26
FPGATrackSimLogicalEventInputHeader.h
FPGATrackSimSlicingEngineTool::m_doSecondStage
Gaudi::Property< bool > m_doSecondStage
Definition: FPGATrackSimSlicingEngineTool.h:50
ServiceHandle< IFPGATrackSimMappingSvc >