ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimClusteringTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef FPGATrackSimCLUSTERINGTOOL_H
6#define FPGATrackSimCLUSTERINGTOOL_H
7
8/*
9 * httClustering
10 * ---------------
11 *
12 * Routines to perform clustering in the pixels, based on FPGATrackSim
13 *
14 */
15
21#include <vector>
22#include <memory>
23
25 void attachTruth(std::vector<FPGATrackSimHit> &);
26 bool updatePixelCluster(FPGATrackSimCluster &currentCluster, FPGATrackSimHit &incomingHit, bool newCluster, bool digitalClustering);
27 bool updateStripCluster(FPGATrackSimCluster &currentCluster, FPGATrackSimHit &incomingHit, bool newCluster, bool digitalClustering);
28 bool updateClusterContents(FPGATrackSimCluster &currentCluster, int &clusterRow, int &clusterRowWidth, int &clusterCol, int &clusterColWidth, FPGATrackSimHit &incomingHit, bool digitalClustering);
29 bool sortITkInputEta(const std::unique_ptr<FPGATrackSimHit>& hitA, const std::unique_ptr<FPGATrackSimHit>& hitB);
30 bool sortITkInputPhi(const std::unique_ptr<FPGATrackSimHit>& hitA, const std::unique_ptr<FPGATrackSimHit>& HitB);
31}
32
33class FPGATrackSimClusteringTool : public extends <AthAlgTool,FPGATrackSimClusteringToolI> {
34public:
35
36 FPGATrackSimClusteringTool(const std::string&, const std::string&, const IInterface*);
37
38 virtual ~FPGATrackSimClusteringTool() = default;
39 virtual StatusCode initialize() override;
40
41 virtual StatusCode DoClustering(FPGATrackSimLogicalEventInputHeader &, std::vector<FPGATrackSimCluster> &) const override;
42
43 private:
44
45 Gaudi::Property<bool> m_digitalClustering {this, "DigitalClustering", true, "flag to enable digital clustering instead of ToT weighted position calculation" };
46 Gaudi::Property<bool> m_reduceCoordPrecision {this, "ReduceCoordPrecision", false, "flag to enable reducing the precision of global coordinates" };
47 Gaudi::Property<float> m_coordRPrecision {this, "CoordRPrecision", 1./64., "fixed point precision of r coordinate" };
48 Gaudi::Property<float> m_coordPhiPrecision {this, "CoordPhiPrecision", 1./8192., "fixed point precision of phi coordinate" };
49 Gaudi::Property<float> m_coordZPrecision {this, "CoordZPrecision", 1./32., "fixed point precision of z coordinate" };
50 Gaudi::Property<int> m_LorentzAngleShift { this, "LorentzAngleShift", -1, "flag for Lorentz angle shift. -1 means off, 0 means full corrections from first version, 1 means smaller LUT, 2 means very small LUT" };
51
52 ToolHandle<FPGATrackSim::LorentzAngleTool> m_lorentzAngleTool {this, "LorentzAngleTool", "", "FPGATrackSim tool to retrieve Lorentz angle"};
53
54 using HitPtrCollection = std::vector<std::unique_ptr<FPGATrackSimHit>>;
55 using HitPtrContainer = std::vector<HitPtrCollection>;
56
57 //FPGATrackSim pixel clustering using the FPGATrackSim objects
58 void SortedClustering(HitPtrContainer&& sorted_hits, std::vector<FPGATrackSimCluster> &) const;
59 void Clustering(HitPtrCollection&&, std::vector<FPGATrackSimCluster> &) const;
60
61 // Other helper functions
64 void splitAndSortHits(HitPtrCollection&& hits, HitPtrContainer& hitsPerModule, int& eta_phi) const;
65 void splitAndSortHits(HitPtrCollection&& hits, HitPtrContainer& hitsPerModule) const;
66 void splitHitsToModules(HitPtrCollection&& hits, HitPtrContainer& hitsPerModule) const;
67 void normaliseClusters(std::vector<FPGATrackSimCluster> &clusters) const;
68 void sortHitsOnModules(HitPtrContainer& hitsPerModule, int& eta_phi) const;
69 void sortHitsOnModules(HitPtrContainer& hitsPerModule) const;
70 bool etaOrPhi(const FPGATrackSimHit& hit) const;
71 bool sortIBLInput(const std::unique_ptr<FPGATrackSimHit>& i, const std::unique_ptr<FPGATrackSimHit>& j) const;
72 bool sortPixelInput(const std::unique_ptr<FPGATrackSimHit>& i, const std::unique_ptr<FPGATrackSimHit>& j) const;
73 void SetMinMaxIndicies(FPGATrackSimCluster &cluster) const;
74
75};
76
77#endif // FPGATrackSimCLUSTERINGTOOL_H
Declares an abstract class that implements an interface for pixel clustering. This class is implement...
: FPGATrackSim-specific class to represent an hit in the detector.
Gaudi::Property< float > m_coordRPrecision
FPGATrackSimClusteringTool(const std::string &, const std::string &, const IInterface *)
Gaudi::Property< int > m_LorentzAngleShift
void sortHitsOnModules(HitPtrContainer &hitsPerModule, int &eta_phi) const
void reduceGlobalCoordPrecision(FPGATrackSimCluster &cluster) const
void SetMinMaxIndicies(FPGATrackSimCluster &cluster) const
void splitAndSortHits(HitPtrCollection &&hits, HitPtrContainer &hitsPerModule, int &eta_phi) const
Gaudi::Property< bool > m_reduceCoordPrecision
Gaudi::Property< float > m_coordZPrecision
bool sortIBLInput(const std::unique_ptr< FPGATrackSimHit > &i, const std::unique_ptr< FPGATrackSimHit > &j) const
void splitHitsToModules(HitPtrCollection &&hits, HitPtrContainer &hitsPerModule) const
void normaliseClusters(std::vector< FPGATrackSimCluster > &clusters) const
std::vector< std::unique_ptr< FPGATrackSimHit > > HitPtrCollection
void Clustering(HitPtrCollection &&, std::vector< FPGATrackSimCluster > &) const
virtual StatusCode initialize() override
ToolHandle< FPGATrackSim::LorentzAngleTool > m_lorentzAngleTool
Gaudi::Property< float > m_coordPhiPrecision
virtual ~FPGATrackSimClusteringTool()=default
std::vector< HitPtrCollection > HitPtrContainer
bool etaOrPhi(const FPGATrackSimHit &hit) const
bool sortPixelInput(const std::unique_ptr< FPGATrackSimHit > &i, const std::unique_ptr< FPGATrackSimHit > &j) const
void SortedClustering(HitPtrContainer &&sorted_hits, std::vector< FPGATrackSimCluster > &) const
virtual StatusCode DoClustering(FPGATrackSimLogicalEventInputHeader &, std::vector< FPGATrackSimCluster > &) const override
Gaudi::Property< bool > m_digitalClustering
bool sortITkInputEta(const std::unique_ptr< FPGATrackSimHit > &hitA, const std::unique_ptr< FPGATrackSimHit > &hitB)
bool sortITkInputPhi(const std::unique_ptr< FPGATrackSimHit > &hitA, const std::unique_ptr< FPGATrackSimHit > &HitB)
bool updatePixelCluster(FPGATrackSimCluster &currentCluster, FPGATrackSimHit &incomingHit, bool newCluster, bool digitalClustering)
bool updateStripCluster(FPGATrackSimCluster &currentCluster, FPGATrackSimHit &incomingHit, bool newCluster, bool digitalClustering)
bool updateClusterContents(FPGATrackSimCluster &currentCluster, int &clusterRow, int &clusterRowWidth, int &clusterCol, int &clusterColWidth, FPGATrackSimHit &incomingHit, bool digitalClustering)
void attachTruth(std::vector< FPGATrackSimHit > &)