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