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:
30  using base_class::base_class;
31 
32  virtual StatusCode initialize() override;
33  virtual StatusCode finalize() override;
34 
35  virtual StatusCode getRoads(const std::vector<std::shared_ptr<const FPGATrackSimHit>> & hits, std::vector<std::shared_ptr<const FPGATrackSimRoad>> & roads) override;
36  virtual int getSubRegion() const override{return -1;}
37  //TODO mabye this should have a subRegion
38 
39 private:
40 
41  Gaudi::Property <unsigned> m_imageSize_x { this, "nBins_x", 0, ""};
42  Gaudi::Property <unsigned> m_imageSize_y { this, "nBins_y", 0, ""};
43  Gaudi::Property <int> m_threshold { this, "m_threshold", 8, "Threshold to be allied to bins of abs(d0) > 50 (mm)"};
44  Gaudi::Property <int> m_threshold50 { this, "m_threshold50", 8, "Threshold to be allied to bins of abs(d0) < (mm)"};
45  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."};
46  Gaudi::Property <float> m_d0_range { this, "d0_range", 120, "The d0 span: (-range, range) in mm"};
47  Gaudi::Property <float> m_qOverPt_range { this, "qOverPt_range", 0.002, "The q/pT span: (-range, range) in e/MeV"};
48  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)"};
49 
50 
52  std::vector<FPGATrackSimRoad> m_roads;
53 
54  const double m_acceptedDistanceBetweenLayersMin = 200; // min R disstance for hits pair filtering
56 
57  double m_step_x = 0; // helpers (accumulator granularity)
58  double m_step_y = 0;
59 
60  StatusCode fillImage(std::shared_ptr<const FPGATrackSimHit> &hit1, std::shared_ptr<const FPGATrackSimHit> &hit2, Image& image) const;
61  bool passThreshold(Image const & image, int x, int y) const;
62  bool isLocalMaxima(Image const & image, int x, int y) const;
63 
64  FPGATrackSimRoad createRoad(const std::unordered_set<std::shared_ptr<const FPGATrackSimHit>> & hits, unsigned x, unsigned y) const;
65  unsigned m_event = 0;
66  void drawImage(Image const & image) const;
67 
68  float xtod0(int x) const { return x*m_step_x - m_d0_range; }
69  float ytoqoverpt(int y) const { return y*m_step_y - m_qOverPt_range; }
72 
73 };
74 
75 #endif //
76 
77 
FPGATrackSimLLPDoubletHoughTransformTool::xtod0
float xtod0(int x) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:68
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
FPGATrackSimLLPDoubletHoughTransformTool::passThreshold
bool passThreshold(Image const &image, int x, int y) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:154
FPGATrackSimLLPDoubletHoughTransformTool::m_eventsProcessed
int m_eventsProcessed
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:70
FPGATrackSimLLPDoubletHoughTransformTool::m_acceptedDistanceBetweenLayersMin
const double m_acceptedDistanceBetweenLayersMin
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:54
FPGATrackSimLLPDoubletHoughTransformTool::Image
vector2D< std::pair< int, std::unordered_set< std::shared_ptr< const FPGATrackSimHit > > > > Image
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:51
FPGATrackSimLLPDoubletHoughTransformTool::m_continuous
Gaudi::Property< bool > m_continuous
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:48
FPGATrackSimLLPDoubletHoughTransformTool::createRoad
FPGATrackSimRoad createRoad(const std::unordered_set< std::shared_ptr< const FPGATrackSimHit >> &hits, unsigned x, unsigned y) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:134
IFPGATrackSimRoadFinderTool.h
Interface declaration for road finder tools.
FPGATrackSimLLPDoubletHoughTransformTool::ytoqoverpt
float ytoqoverpt(int y) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:69
FPGATrackSimLLPDoubletHoughTransformTool::getRoads
virtual StatusCode getRoads(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads) override
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:54
FPGATrackSimLLPDoubletHoughTransformTool::m_imageSize_y
Gaudi::Property< unsigned > m_imageSize_y
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:42
x
#define x
FPGATrackSimLLPDoubletHoughTransformTool::m_imageSize_x
Gaudi::Property< unsigned > m_imageSize_x
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:41
FPGATrackSimLLPDoubletHoughTransformTool::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:38
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:43
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
FPGATrackSimLLPDoubletHoughTransformTool::m_acceptedDistanceBetweenLayersMax
const double m_acceptedDistanceBetweenLayersMax
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:55
FPGATrackSimLLPDoubletHoughTransformTool::m_roadsGenerated
int m_roadsGenerated
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:71
FPGATrackSimLLPDoubletHoughTransformTool::m_d0_range
Gaudi::Property< float > m_d0_range
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:46
FPGATrackSimLLPDoubletHoughTransformTool::drawImage
void drawImage(Image const &image) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:174
FPGATrackSimHit.h
: FPGATrackSim-specific class to represent an hit in the detector.
MyPlots.image
string image
Definition: MyPlots.py:43
FPGATrackSimLLPDoubletHoughTransformTool::m_event
unsigned m_event
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:65
FPGATrackSimLLPDoubletHoughTransformTool::m_threshold50
Gaudi::Property< int > m_threshold50
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:44
FPGATrackSimLLPDoubletHoughTransformTool::m_step_x
double m_step_x
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:57
FPGATrackSimLLPDoubletHoughTransformTool::finalize
virtual StatusCode finalize() override
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:49
FPGATrackSimLLPDoubletHoughTransformTool::m_qOverPt_range
Gaudi::Property< float > m_qOverPt_range
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:47
y
#define y
FPGATrackSimLLPDoubletHoughTransformTool::fillImage
StatusCode fillImage(std::shared_ptr< const FPGATrackSimHit > &hit1, std::shared_ptr< const FPGATrackSimHit > &hit2, Image &image) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:94
FPGATrackSimLLPDoubletHoughTransformTool::m_roads
std::vector< FPGATrackSimRoad > m_roads
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:52
FPGATrackSimRoad.h
Defines a class for roads.
FPGATrackSimLLPDoubletHoughTransformTool
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:26
FPGATrackSimLLPDoubletHoughTransformTool::m_traceHits
Gaudi::Property< bool > m_traceHits
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:45
FPGATrackSimTypes.h
FPGATrackSimLLPDoubletHoughTransformTool::isLocalMaxima
bool isLocalMaxima(Image const &image, int x, int y) const
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:163
FPGATrackSimLLPDoubletHoughTransformTool::getSubRegion
virtual int getSubRegion() const override
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:36
FPGATrackSimTrackPars.h
Structs that store the 5 track parameters.
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:31
FPGATrackSimLLPDoubletHoughTransformTool::m_step_y
double m_step_y
Definition: FPGATrackSimLLPDoubletHoughTransformTool.h:58