ATLAS Offline Software
FPGATrackSimLLPDoubletHoughTransformTool.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 #ifndef FPGATrackSimLLPDOUBLETHOUGHTRANSFORMTOOL_H
4 #define FPGATrackSimLLPDOUBLETHOUGHTRANSFORMTOOL_H
5 
6 
7 #include "TFile.h"
8 #include "GaudiKernel/ServiceHandle.h"
10 
11 
18 
19 
20 /*
21 Implments HoughT for d0, q/pt using hit doublets
22 Hough space x -> d0 , y -> q/pt
23 */
24 
25 class FPGATrackSimLLPDoubletHoughTransformTool : public extends <AthAlgTool, IFPGATrackSimRoadFinderTool >
26 {
27 
28 public:
29  FPGATrackSimLLPDoubletHoughTransformTool(const std::string&, const std::string&, const IInterface*);
30 
31  virtual StatusCode initialize() override;
32  virtual StatusCode finalize() override;
33 
34  virtual StatusCode getRoads(const std::vector<const FPGATrackSimHit*> & hits, std::vector<FPGATrackSimRoad*> & roads) override;
35 
36 
37 private:
38 
39  Gaudi::Property <unsigned> m_imageSize_x { this, "nBins_x", 0, ""};
40  Gaudi::Property <unsigned> m_imageSize_y { this, "nBins_y", 0, ""};
41  Gaudi::Property <int> m_threshold { this, "m_threshold", 8, "Threshold to be allied to bins of abs(d0) > 50 (mm)"};
42  Gaudi::Property <int> m_threshold50 { this, "m_threshold50", 8, "Threshold to be allied to bins of abs(d0) < (mm)"};
43  Gaudi::Property <bool> m_traceHits { this, "traceHits", true, "Trace each hit that goes in a bin. Disabling this will save memory/time since each bin doesn't have to store all its hits but the roads created won't have hits from convolution, etc."};
44  Gaudi::Property <float> m_d0_range { this, "d0_range", 120, "The d0 span: (-range, range) in mm"};
45  Gaudi::Property <float> m_qOverPt_range { this, "qOverPt_range", 0.002, "The q/pT span: (-range, range) in e/MeV"};
46  Gaudi::Property <bool> m_continuous { this, "continuous", true, "assure that there is continuity of the line (i.e. middle bins in d0 are filled when one q/pT step would result in a hole)"};
47 
48 
50  std::vector<FPGATrackSimRoad> m_roads;
51 
52  const double m_acceptedDistanceBetweenLayersMin = 200; // min R disstance for hits pair filtering
54 
55  double m_step_x = 0; // helpers (accumulator granularity)
56  double m_step_y = 0;
57 
58  StatusCode fillImage(const FPGATrackSimHit *hit1, const FPGATrackSimHit *hit2, Image& image) const;
59  bool passThreshold(Image const & image, int x, int y) const;
60  bool isLocalMaxima(Image const & image, int x, int y) const;
61 
62  FPGATrackSimRoad createRoad(std::unordered_set<const FPGATrackSimHit*> const & hits, unsigned x, unsigned y) const;
63  unsigned m_event = 0;
64  void drawImage(Image const & image) const;
65 
66  float xtod0(int x) const { return x*m_step_x - m_d0_range; }
67  float ytoqoverpt(int y) const { return y*m_step_y - m_qOverPt_range; }
70 
71 };
72 
73 #endif //
74 
75 
FPGATrackSimLLPDoubletHoughTransformTool::xtod0
float xtod0(int x) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:66
FPGATrackSimLLPDoubletHoughTransformTool::passThreshold
bool passThreshold(Image const &image, int x, int y) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:162
FPGATrackSimLLPDoubletHoughTransformTool::m_eventsProcessed
int m_eventsProcessed
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:68
FPGATrackSimLLPDoubletHoughTransformTool::m_acceptedDistanceBetweenLayersMin
const double m_acceptedDistanceBetweenLayersMin
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:52
FPGATrackSimLLPDoubletHoughTransformTool::m_continuous
Gaudi::Property< bool > m_continuous
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:46
IFPGATrackSimRoadFinderTool.h
Interface declaration for road finder tools.
FPGATrackSimLLPDoubletHoughTransformTool::ytoqoverpt
float ytoqoverpt(int y) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:67
FPGATrackSimLLPDoubletHoughTransformTool::m_imageSize_y
Gaudi::Property< unsigned > m_imageSize_y
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:40
FPGATrackSimLLPDoubletHoughTransformTool::FPGATrackSimLLPDoubletHoughTransformTool
FPGATrackSimLLPDoubletHoughTransformTool(const std::string &, const std::string &, const IInterface *)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:39
x
#define x
FPGATrackSimLLPDoubletHoughTransformTool::fillImage
StatusCode fillImage(const FPGATrackSimHit *hit1, const FPGATrackSimHit *hit2, Image &image) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:102
FPGATrackSimLLPDoubletHoughTransformTool::m_imageSize_x
Gaudi::Property< unsigned > m_imageSize_x
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:39
FPGATrackSimHit
Definition: FPGATrackSimHit.h:38
FPGATrackSimLLPDoubletHoughTransformTool::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:46
FPGATrackSimVectors.h
Defines several vector wrappers for homogenous multi-dimensional vectors, declared as 1D arrays for l...
vector2D
Definition: FPGATrackSimVectors.h:28
FPGATrackSimLLPDoubletHoughTransformTool::m_threshold
Gaudi::Property< int > m_threshold
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:41
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArG4ShowerLibProcessing.hits
hits
Definition: LArG4ShowerLibProcessing.py:136
AthAlgTool.h
FPGATrackSimLLPDoubletHoughTransformTool::m_acceptedDistanceBetweenLayersMax
const double m_acceptedDistanceBetweenLayersMax
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:53
FPGATrackSimLLPDoubletHoughTransformTool::m_roadsGenerated
int m_roadsGenerated
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:69
FPGATrackSimLLPDoubletHoughTransformTool::getRoads
virtual StatusCode getRoads(const std::vector< const FPGATrackSimHit * > &hits, std::vector< FPGATrackSimRoad * > &roads) override
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:62
FPGATrackSimLLPDoubletHoughTransformTool::m_d0_range
Gaudi::Property< float > m_d0_range
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:44
FPGATrackSimLLPDoubletHoughTransformTool::drawImage
void drawImage(Image const &image) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:182
FPGATrackSimHit.h
: FPGATrackSim-specific class to represent an hit in the detector.
FPGATrackSimLLPDoubletHoughTransformTool::Image
vector2D< std::pair< int, std::unordered_set< const FPGATrackSimHit * > > > Image
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:49
MyPlots.image
string image
Definition: MyPlots.py:43
FPGATrackSimLLPDoubletHoughTransformTool::m_event
unsigned m_event
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:63
FPGATrackSimLLPDoubletHoughTransformTool::m_threshold50
Gaudi::Property< int > m_threshold50
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:42
FPGATrackSimLLPDoubletHoughTransformTool::m_step_x
double m_step_x
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:55
FPGATrackSimLLPDoubletHoughTransformTool::finalize
virtual StatusCode finalize() override
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:57
FPGATrackSimLLPDoubletHoughTransformTool::m_qOverPt_range
Gaudi::Property< float > m_qOverPt_range
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:45
FPGATrackSimLLPDoubletHoughTransformTool::createRoad
FPGATrackSimRoad createRoad(std::unordered_set< const FPGATrackSimHit * > const &hits, unsigned x, unsigned y) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:142
y
#define y
FPGATrackSimLLPDoubletHoughTransformTool::m_roads
std::vector< FPGATrackSimRoad > m_roads
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:50
FPGATrackSimRoad.h
Defines a class for roads.
FPGATrackSimLLPDoubletHoughTransformTool
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:26
FPGATrackSimLLPDoubletHoughTransformTool::m_traceHits
Gaudi::Property< bool > m_traceHits
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:43
FPGATrackSimTypes.h
FPGATrackSimLLPDoubletHoughTransformTool::isLocalMaxima
bool isLocalMaxima(Image const &image, int x, int y) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:171
FPGATrackSimTrackPars.h
Structs that store the 5 track parameters.
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:29
FPGATrackSimLLPDoubletHoughTransformTool::m_step_y
double m_step_y
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:56