ATLAS Offline Software
FPGATrackSimSpacePointsTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef FPGATrackSimSPACEPOINTSTOOL_H
6 #define FPGATrackSimSPACEPOINTSTOOL_H
7 
8 #include <array>
9 #include <vector>
10 #include <map>
11 
16 
17 class TH1I;
18 
19 class FPGATrackSimSpacePointsTool : public extends<AthAlgTool, FPGATrackSimSpacePointsToolI> {
20  public:
21  FPGATrackSimSpacePointsTool(const std::string &, const std::string &, const IInterface *);
23 
24  virtual StatusCode initialize() override;
25  virtual StatusCode finalize() override;
26 
27  virtual StatusCode DoSpacePoints(FPGATrackSimLogicalEventInputHeader &, std::vector<FPGATrackSimCluster> &) override;
28 
29  private:
30  StatusCode fillMaps(std::vector<FPGATrackSimHit>& hits);
31  StatusCode makeSpacePoints(FPGATrackSimTowerInputHeader &tower, std::vector<FPGATrackSimCluster> &spacepoints);
32  void calcPosition(FPGATrackSimHit &hit_in, FPGATrackSimHit &hit_out, float &x, float &y, float &z);
33  bool searchForMatch(FPGATrackSimHit& hit_in,std::vector<FPGATrackSimHit>& hits_outer,FPGATrackSimTowerInputHeader &tower, std::vector<FPGATrackSimCluster> &spacepoints);
34  void addSpacePoints(FPGATrackSimHit hit_in, FPGATrackSimHit hit_out ,FPGATrackSimTowerInputHeader &tower, std::vector<FPGATrackSimCluster> &spacepoints);
36 
37  //----------------------
38  // Working Memory
39  std::map<std::vector<int>,std::pair<std::vector<FPGATrackSimHit>,std::vector<FPGATrackSimHit>>> m_map;
40  std::vector<FPGATrackSimHit> m_pixel;
41 
42  Gaudi::Property<float> m_phiwindow { this, "PhiWindow", 0.008, "Distance in phi to consider two hits for making a space-point" };
43  Gaudi::Property<bool> m_duplicate { this, "Duplication", false, "Duplicate spacepoints to layer on the other side of the stave" };
44  Gaudi::Property<bool> m_filter { this, "Filtering", false, "Filter out incomplete spacepoints" };
45  Gaudi::Property<bool> m_filterClose { this, "FilteringClosePoints", false, "Filter out single hits cloes to spacepoints" };
46  Gaudi::Property<bool> m_sameModulesOnly { this, "SameModulesOnly", false, "Only use hits on the same physical (eta) module" };
47  Gaudi::Property<bool> m_boundsCheck { this, "BoundsCheck", false, "Perform a module bounds check in the endcaps" };
48  Gaudi::Property<bool> m_reduceCoordPrecision {this, "ReduceCoordPrecision", false, "flag to enable reduc ing the precision of global coordinates" };
49  Gaudi::Property<float> m_coordRPrecision {this, "CoordRPrecision", 1./64., "fixed point precision of r coordinate" };
50  Gaudi::Property<float> m_coordPhiPrecision {this, "CoordPhiPrecision", 1./8192., "fixed point precision of phi coordinate" };
51  Gaudi::Property<float> m_coordZPrecision {this, "CoordZPrecision", 1./32., "fixed point precision of z coordinate" };
52 
53  // self monitoring
54  unsigned m_inputhits = 0;
55  unsigned m_spacepts = 0;
56  unsigned m_filteredhits = 0;
57  unsigned m_adjacent_eta_sp = 0;
58  unsigned m_adjacent_phi_sp = 0;
59  unsigned m_diagonal_sp = 0;
60  TH1I* m_spacepts_per_hit = nullptr;
61 
62 };
63 
64 #endif // FPGATrackSimSPACEPOINTSTOOL_H
FPGATrackSimSpacePointsTool::fillMaps
StatusCode fillMaps(std::vector< FPGATrackSimHit > &hits)
Definition: FPGATrackSimSpacePointsTool.cxx:65
FPGATrackSimSpacePointsTool::m_spacepts
unsigned m_spacepts
Definition: FPGATrackSimSpacePointsTool.h:55
FPGATrackSimSpacePointsTool::m_coordPhiPrecision
Gaudi::Property< float > m_coordPhiPrecision
Definition: FPGATrackSimSpacePointsTool.h:50
FPGATrackSimLogicalEventInputHeader
Definition: FPGATrackSimLogicalEventInputHeader.h:21
FPGATrackSimSpacePointsTool::makeSpacePoints
StatusCode makeSpacePoints(FPGATrackSimTowerInputHeader &tower, std::vector< FPGATrackSimCluster > &spacepoints)
Definition: FPGATrackSimSpacePointsTool.cxx:100
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
FPGATrackSimSpacePointsTool::m_phiwindow
Gaudi::Property< float > m_phiwindow
Definition: FPGATrackSimSpacePointsTool.h:42
FPGATrackSimSpacePointsTool
Definition: FPGATrackSimSpacePointsTool.h:19
FPGATrackSimSpacePointsTool::m_map
std::map< std::vector< int >, std::pair< std::vector< FPGATrackSimHit >, std::vector< FPGATrackSimHit > > > m_map
Definition: FPGATrackSimSpacePointsTool.h:39
FPGATrackSimSpacePointsTool::m_duplicate
Gaudi::Property< bool > m_duplicate
Definition: FPGATrackSimSpacePointsTool.h:43
FPGATrackSimSpacePointsTool::DoSpacePoints
virtual StatusCode DoSpacePoints(FPGATrackSimLogicalEventInputHeader &, std::vector< FPGATrackSimCluster > &) override
Definition: FPGATrackSimSpacePointsTool.cxx:48
x
#define x
FPGATrackSimHit
Definition: FPGATrackSimHit.h:41
FPGATrackSimSpacePointsTool::FPGATrackSimSpacePointsTool
FPGATrackSimSpacePointsTool(const std::string &, const std::string &, const IInterface *)
Definition: FPGATrackSimSpacePointsTool.cxx:14
FPGATrackSimSpacePointsTool::searchForMatch
bool searchForMatch(FPGATrackSimHit &hit_in, std::vector< FPGATrackSimHit > &hits_outer, FPGATrackSimTowerInputHeader &tower, std::vector< FPGATrackSimCluster > &spacepoints)
Definition: FPGATrackSimSpacePointsTool.cxx:243
FPGATrackSimSpacePointsTool::m_pixel
std::vector< FPGATrackSimHit > m_pixel
Definition: FPGATrackSimSpacePointsTool.h:40
z
#define z
FPGATrackSimSpacePointsTool::finalize
virtual StatusCode finalize() override
Definition: FPGATrackSimSpacePointsTool.cxx:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FPGATrackSimSpacePointsTool::m_reduceCoordPrecision
Gaudi::Property< bool > m_reduceCoordPrecision
Definition: FPGATrackSimSpacePointsTool.h:48
FPGATrackSimSpacePointsTool::m_boundsCheck
Gaudi::Property< bool > m_boundsCheck
Definition: FPGATrackSimSpacePointsTool.h:47
AthAlgTool.h
FPGATrackSimSpacePointsTool::m_coordZPrecision
Gaudi::Property< float > m_coordZPrecision
Definition: FPGATrackSimSpacePointsTool.h:51
FPGATrackSimSpacePointsTool::reduceGlobalCoordPrecision
void reduceGlobalCoordPrecision(FPGATrackSimHit &hit) const
Definition: FPGATrackSimSpacePointsTool.cxx:383
FPGATrackSimSpacePointsTool::m_filteredhits
unsigned m_filteredhits
Definition: FPGATrackSimSpacePointsTool.h:56
FPGATrackSimSpacePointsTool::m_spacepts_per_hit
TH1I * m_spacepts_per_hit
Definition: FPGATrackSimSpacePointsTool.h:60
FPGATrackSimSpacePointsTool::m_inputhits
unsigned m_inputhits
Definition: FPGATrackSimSpacePointsTool.h:54
FPGATrackSimSpacePointsTool::m_filter
Gaudi::Property< bool > m_filter
Definition: FPGATrackSimSpacePointsTool.h:44
FPGATrackSimHit.h
: FPGATrackSim-specific class to represent an hit in the detector.
FPGATrackSimSpacePointsTool::m_coordRPrecision
Gaudi::Property< float > m_coordRPrecision
Definition: FPGATrackSimSpacePointsTool.h:49
FPGATrackSimSpacePointsToolI.h
Declares an abstract class that implements an interface for spacepoint formation. This class is imple...
y
#define y
FPGATrackSimSpacePointsTool::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimSpacePointsTool.cxx:21
FPGATrackSimSpacePointsTool::calcPosition
void calcPosition(FPGATrackSimHit &hit_in, FPGATrackSimHit &hit_out, float &x, float &y, float &z)
Definition: FPGATrackSimSpacePointsTool.cxx:333
FPGATrackSimSpacePointsTool::m_adjacent_phi_sp
unsigned m_adjacent_phi_sp
Definition: FPGATrackSimSpacePointsTool.h:58
FPGATrackSimSpacePointsTool::addSpacePoints
void addSpacePoints(FPGATrackSimHit hit_in, FPGATrackSimHit hit_out, FPGATrackSimTowerInputHeader &tower, std::vector< FPGATrackSimCluster > &spacepoints)
Definition: FPGATrackSimSpacePointsTool.cxx:257
FPGATrackSimTowerInputHeader
Definition: FPGATrackSimTowerInputHeader.h:18
FPGATrackSimSpacePointsTool::m_diagonal_sp
unsigned m_diagonal_sp
Definition: FPGATrackSimSpacePointsTool.h:59
FPGATrackSimSpacePointsTool::m_sameModulesOnly
Gaudi::Property< bool > m_sameModulesOnly
Definition: FPGATrackSimSpacePointsTool.h:46
FPGATrackSimSpacePointsTool::m_filterClose
Gaudi::Property< bool > m_filterClose
Definition: FPGATrackSimSpacePointsTool.h:45
FPGATrackSimSpacePointsTool::~FPGATrackSimSpacePointsTool
virtual ~FPGATrackSimSpacePointsTool()
Definition: FPGATrackSimSpacePointsTool.h:22
FPGATrackSimCluster.h
FPGATrackSimSpacePointsTool::m_adjacent_eta_sp
unsigned m_adjacent_eta_sp
Definition: FPGATrackSimSpacePointsTool.h:57