ATLAS Offline Software
FPGATrackSimOverlapRemovalTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef FPGATrackSimOVERLAPREMOVALTOOL_H
13 #define FPGATrackSimOVERLAPREMOVALTOOL_H
14 
16 #include "GaudiKernel/ServiceHandle.h"
17 
22 
23 
24 #include <string>
25 #include <vector>
26 #include <ostream>
27 
34 public:
35 
36  FPGATrackSimOverlapRemovalTool (const std::string&, const std::string&, const IInterface*);
38 
39  StatusCode initialize() override;
40 
41  StatusCode runOverlapRemoval(std::vector<std::shared_ptr<const FPGATrackSimRoad>>& roads);
42 
43  // Original Overlap Removal function
44  // Compare chi2 and common number of hits
45  StatusCode runOverlapRemoval(std::vector<FPGATrackSimTrack>& tracks);
46 
47  void setDoSecondStage(bool v) { m_do2ndStage = v; }
48  bool getDoSecondStage() const { return m_do2ndStage; }
49  ORAlgo getAlgorithm() const {return m_algo;}
50  // Find the one track from the duplicate group with the minium Chi2 and maximum # of hits
51 
53  static bool compareTrackQuality(const FPGATrackSimTrack & track1, const FPGATrackSimTrack & track2);
54 
55 private:
56 
57 
58  Gaudi::Property <bool> m_do2ndStage { this, "DoSecondStage", false, "Do second stage of not?"};
59  Gaudi::Property <int> m_NumOfHitPerGrouping { this, "NumOfHitPerGrouping", 5, "Number of hits pre grouping"};
60  Gaudi::Property <float> m_minChi2 { this, "MinChi2", 40, "Minimum chi2 requirement for tracks being considered in OR"};
61  Gaudi::Property <bool> m_roadSliceOR { this, "roadSliceOR", true, "Do slice-wise overlap removal for roads (Hough-only)"};
62  Gaudi::Property <int> m_localMaxWindowSize { this, "localMaxWindowSize", 0, "Only create roads that are a local maximum within this window size. Set this to 0 to turn off local max filtering"};
63  Gaudi::Property <unsigned> m_imageSize_x { this, "nBins_x", 0, "number of bins in, eg, phi_track"};
64  Gaudi::Property <unsigned> m_imageSize_y { this, "nBins_y", 0, "number of bins in, eg, q/pT"};
65  Gaudi::Property <std::string> m_algorithm { this, "ORAlgo", "Normal", "Overlap removal algorithm"};
66  Gaudi::Property <bool> m_doFastOR { this, "doFastOR", false, "Use fast overlap removal algorithm instead of default"};
67 
68  int m_totLayers = 0; // Total number of layers used for a track
69  ORAlgo m_algo{ORAlgo::Normal}; // Internal ORAlgo enum for faster compare
70 
71 
72  StatusCode runOverlapRemoval_fast(std::vector<FPGATrackSimTrack>& tracks);
73 
74  // ServiceHandle
75  ServiceHandle<IFPGATrackSimMappingSvc> m_FPGATrackSimMapping{this,"FPGATrackSimMappingSvc","FPGATrackSimMappingSvc"}; // Get the number of layer through map
76 
77 };
78 
79 #endif // FPGATrackSimOverlapRemovalTool_h
FPGATrackSimOverlapRemovalTool::m_NumOfHitPerGrouping
Gaudi::Property< int > m_NumOfHitPerGrouping
Definition: FPGATrackSimOverlapRemovalTool.h:59
FPGATrackSimOverlapRemovalTool::m_do2ndStage
Gaudi::Property< bool > m_do2ndStage
Definition: FPGATrackSimOverlapRemovalTool.h:58
FPGATrackSimTrack
Definition: FPGATrackSimTrack.h:18
FPGATrackSimHoughFunctions.h
IFPGATrackSimMappingSvc.h
ORAlgo
ORAlgo
Definition: FPGATrackSimHoughFunctions.h:17
FPGATrackSimOverlapRemovalTool::FPGATrackSimOverlapRemovalTool
FPGATrackSimOverlapRemovalTool()=delete
FPGATrackSimOverlapRemovalTool::getAlgorithm
ORAlgo getAlgorithm() const
Definition: FPGATrackSimOverlapRemovalTool.h:49
ORAlgo::Normal
@ Normal
FPGATrackSimOverlapRemovalTool::m_doFastOR
Gaudi::Property< bool > m_doFastOR
Definition: FPGATrackSimOverlapRemovalTool.h:66
FPGATrackSimOverlapRemovalTool::setDoSecondStage
void setDoSecondStage(bool v)
Definition: FPGATrackSimOverlapRemovalTool.h:47
FPGATrackSimOverlapRemovalTool::m_imageSize_x
Gaudi::Property< unsigned > m_imageSize_x
Definition: FPGATrackSimOverlapRemovalTool.h:63
FPGATrackSimOverlapRemovalTool::m_imageSize_y
Gaudi::Property< unsigned > m_imageSize_y
Definition: FPGATrackSimOverlapRemovalTool.h:64
FPGATrackSimOverlapRemovalTool::m_roadSliceOR
Gaudi::Property< bool > m_roadSliceOR
Definition: FPGATrackSimOverlapRemovalTool.h:61
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FPGATrackSimOverlapRemovalTool::m_algorithm
Gaudi::Property< std::string > m_algorithm
Definition: FPGATrackSimOverlapRemovalTool.h:65
AthAlgTool.h
FPGATrackSimOverlapRemovalTool::m_totLayers
int m_totLayers
Definition: FPGATrackSimOverlapRemovalTool.h:68
FPGATrackSimOverlapRemovalTool::m_minChi2
Gaudi::Property< float > m_minChi2
Definition: FPGATrackSimOverlapRemovalTool.h:60
FPGATrackSimOverlapRemovalTool::m_localMaxWindowSize
Gaudi::Property< int > m_localMaxWindowSize
Definition: FPGATrackSimOverlapRemovalTool.h:62
FPGATrackSimOverlapRemovalTool::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimOverlapRemovalTool.h:75
FPGATrackSimOverlapRemovalTool::m_algo
ORAlgo m_algo
Definition: FPGATrackSimOverlapRemovalTool.h:69
FPGATrackSimOverlapRemovalTool::compareTrackQuality
static bool compareTrackQuality(const FPGATrackSimTrack &track1, const FPGATrackSimTrack &track2)
Definition: FPGATrackSimOverlapRemovalTool.cxx:196
FPGATrackSimOverlapRemovalTool::runOverlapRemoval_fast
StatusCode runOverlapRemoval_fast(std::vector< FPGATrackSimTrack > &tracks)
Definition: FPGATrackSimOverlapRemovalTool.cxx:227
FPGATrackSimOverlapRemovalTool::getDoSecondStage
bool getDoSecondStage() const
Definition: FPGATrackSimOverlapRemovalTool.h:48
python.PyAthena.v
v
Definition: PyAthena.py:154
FPGATrackSimOverlapRemovalTool::removeOverlapping
StatusCode removeOverlapping(FPGATrackSimTrack &track1, FPGATrackSimTrack &track2)
Definition: FPGATrackSimOverlapRemovalTool.cxx:123
FPGATrackSimOverlapRemovalTool::initialize
StatusCode initialize() override
Definition: FPGATrackSimOverlapRemovalTool.cxx:19
FPGATrackSimRoad.h
Defines a class for roads.
AthAlgTool
Definition: AthAlgTool.h:26
FPGATrackSimTrack.h
FPGATrackSimOverlapRemovalTool
Remove (mark) duplicate tracks This tool takes FPGATrackSimTrack as input and mark their status of pa...
Definition: FPGATrackSimOverlapRemovalTool.h:33
ServiceHandle< IFPGATrackSimMappingSvc >
FPGATrackSimOverlapRemovalTool::runOverlapRemoval
StatusCode runOverlapRemoval(std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads)
Definition: FPGATrackSimOverlapRemovalTool.cxx:74