![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Remove (mark) duplicate tracks This tool takes FPGATrackSimTrack as input and mark their status of passing/failing the overlap removal criteria.
More...
#include <FPGATrackSimOverlapRemovalTool.h>
|
| FPGATrackSimOverlapRemovalTool (const std::string &, const std::string &, const IInterface *) |
|
| FPGATrackSimOverlapRemovalTool ()=delete |
|
StatusCode | initialize () override |
|
StatusCode | runOverlapRemoval (std::vector< FPGATrackSimRoad * > &roads) |
|
StatusCode | runOverlapRemoval (std::vector< FPGATrackSimTrack > &tracks) |
|
void | setDoSecondStage (bool v) |
|
bool | getDoSecondStage () const |
|
ORAlgo | getAlgorithm () const |
|
void | findMinChi2MaxHit (const std::vector< int > &duplicates, std::vector< FPGATrackSimTrack > &tracks) |
|
int | findNCommonHits (const FPGATrackSimTrack &, const FPGATrackSimTrack &) |
|
int | findNonOverlapHits (const FPGATrackSimTrack &, const FPGATrackSimTrack &) |
|
StatusCode | removeOverlapping (FPGATrackSimTrack &track1, FPGATrackSimTrack &track2) |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
Gaudi::Property< bool > | m_do2ndStage { this, "DoSecondStage", false, "Do second stage of not?"} |
|
Gaudi::Property< int > | m_NumOfHitPerGrouping { this, "NumOfHitPerGrouping", 5, "Number of hits pre grouping"} |
|
Gaudi::Property< float > | m_minChi2 { this, "MinChi2", 40, "Minimum chi2 requirement for tracks being considered in OR"} |
|
Gaudi::Property< bool > | m_roadSliceOR { this, "roadSliceOR", true, "Do slice-wise overlap removal for roads (Hough-only)"} |
|
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"} |
|
Gaudi::Property< unsigned > | m_imageSize_x { this, "nBins_x", 0, "number of bins in, eg, phi_track"} |
|
Gaudi::Property< unsigned > | m_imageSize_y { this, "nBins_y", 0, "number of bins in, eg, q/pT"} |
|
Gaudi::Property< std::string > | m_algorithm { this, "ORAlgo", "Normal", "Overlap removal algorithm"} |
|
Gaudi::Property< bool > | m_doFastOR { this, "doFastOR", false, "Use fast overlap removal algorithm instead of default"} |
|
int | m_totLayers = 0 |
|
ORAlgo | m_algo {ORAlgo::Normal} |
|
ServiceHandle< IFPGATrackSimMappingSvc > | m_FPGATrackSimMapping {this,"FPGATrackSimMappingSvc","FPGATrackSimMappingSvc"} |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Remove (mark) duplicate tracks This tool takes FPGATrackSimTrack as input and mark their status of passing/failing the overlap removal criteria.
Definition at line 32 of file FPGATrackSimOverlapRemovalTool.h.
◆ StoreGateSvc_t
◆ FPGATrackSimOverlapRemovalTool() [1/2]
FPGATrackSimOverlapRemovalTool::FPGATrackSimOverlapRemovalTool |
( |
const std::string & |
algname, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
ifc |
|
) |
| |
◆ FPGATrackSimOverlapRemovalTool() [2/2]
FPGATrackSimOverlapRemovalTool::FPGATrackSimOverlapRemovalTool |
( |
| ) |
|
|
delete |
◆ compareTrackQuality()
Definition at line 401 of file FPGATrackSimOverlapRemovalTool.cxx.
403 std::vector<const FPGATrackSimHit*> hitsInTrack1;
405 if (hit.isReal()) hitsInTrack1.push_back(&hit);
408 std::vector<const FPGATrackSimHit*> hitsInTrack2;
410 if (hit.isReal()) hitsInTrack2.push_back(&hit);
416 bool goodOrder =
true;
417 if (hitsInTrack1.size() == hitsInTrack2.size()) {
424 }
else if (hitsInTrack1.size() > hitsInTrack2.size()) {
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ findMinChi2MaxHit()
void FPGATrackSimOverlapRemovalTool::findMinChi2MaxHit |
( |
const std::vector< int > & |
duplicates, |
|
|
std::vector< FPGATrackSimTrack > & |
tracks |
|
) |
| |
Definition at line 183 of file FPGATrackSimOverlapRemovalTool.cxx.
186 float minChi2=100000.;
191 float t_chi2 = RMtracks.at(dup).getChi2ndof();
192 int t_nhitlayers = RMtracks.at(dup).getFPGATrackSimHits().size();
193 for(
auto& hit : RMtracks.at(dup).getFPGATrackSimHits())
201 if(t_nhitlayers>maxHitLayers)
205 RMtracks.at(prevID).setPassedOR(0);
208 maxHitLayers=t_nhitlayers;
211 else if(t_nhitlayers==maxHitLayers)
217 RMtracks.at(prevID).setPassedOR(0);
224 RMtracks.at(dup).setPassedOR(0);
229 RMtracks.at(dup).setPassedOR(0);
◆ findNCommonHits()
◆ findNonOverlapHits()
◆ getAlgorithm()
ORAlgo FPGATrackSimOverlapRemovalTool::getAlgorithm |
( |
| ) |
const |
|
inline |
◆ getDoSecondStage()
bool FPGATrackSimOverlapRemovalTool::getDoSecondStage |
( |
| ) |
const |
|
inline |
◆ initialize()
StatusCode FPGATrackSimOverlapRemovalTool::initialize |
( |
| ) |
|
|
override |
Definition at line 19 of file FPGATrackSimOverlapRemovalTool.cxx.
21 ATH_MSG_INFO(
"FPGATrackSimOverlapRemovalTool::initialize()" );
35 ATH_MSG_WARNING(
"LocalMaxOR only being run per hough slice (i.e. this tool does nothing) since roadSliceOR is turned off");
44 return StatusCode::FAILURE;
48 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ removeOverlapping()
Definition at line 328 of file FPGATrackSimOverlapRemovalTool.cxx.
333 auto hash_a =
a->getIdentifierHash();
334 auto hash_b =
b->getIdentifierHash();
335 if ( hash_a == hash_b ) {
336 auto phi_a =
a->getPhiCoord();
337 auto phi_b =
b->getPhiCoord();
338 if ( phi_a == phi_b ) {
339 auto eta_a =
a->getEtaCoord();
340 auto eta_b =
b->getEtaCoord();
341 if ( eta_a == eta_b) {
342 auto layer_a =
a->getLayer();
343 auto layer_b =
b->getLayer();
344 return layer_a < layer_b;
346 return eta_a < eta_b;
348 return phi_a < phi_b;
350 return hash_a < hash_b;
354 std::set<const FPGATrackSimHit*, HitCompare > hitsInTrack1;
356 if (hit.isReal()) hitsInTrack1.insert(&hit);
359 std::set<const FPGATrackSimHit*, HitCompare> hitsInTrack2;
361 if (hit.isReal()) hitsInTrack2.insert(&hit);
364 std::vector<const FPGATrackSimHit*> sharedHits;
366 hitsInTrack2.begin(), hitsInTrack2.end(),
367 std::back_inserter(sharedHits),
371 int nHitsInTrack1 = hitsInTrack1.size();
372 int nHitsInTrack2 = hitsInTrack2.size();
373 int nSharedHits = sharedHits.size();
376 int nonOverlappingHits =
std::min(nHitsInTrack1 - nSharedHits, nHitsInTrack2 - nSharedHits);
390 return StatusCode::FAILURE;
398 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ runOverlapRemoval() [1/2]
StatusCode FPGATrackSimOverlapRemovalTool::runOverlapRemoval |
( |
std::vector< FPGATrackSimRoad * > & |
roads | ) |
|
Definition at line 74 of file FPGATrackSimOverlapRemovalTool.cxx.
76 if (roads.empty())
return StatusCode::SUCCESS;
79 size_t in = roads.size();
89 else if (
r->getNHitLayers() >
old->getNHitLayers())
old =
r;
90 else if (
r->getNHitLayers() ==
old->getNHitLayers() &&
r->getNHits() >
old->getNHits())
old =
r;
105 roads.push_back(
acc(
y,
x));
107 ATH_MSG_DEBUG(
"Input: " << in <<
" Output: " << roads.size());
108 return StatusCode::SUCCESS;
◆ runOverlapRemoval() [2/2]
StatusCode FPGATrackSimOverlapRemovalTool::runOverlapRemoval |
( |
std::vector< FPGATrackSimTrack > & |
tracks | ) |
|
Definition at line 111 of file FPGATrackSimOverlapRemovalTool.cxx.
122 for(
unsigned int i=0;
i<tracks.size();
i++)
129 tracks.at(
i).setPassedOR(0);
137 for(
unsigned int j=
i+1; j<tracks.size(); j++)
146 tracks.at(j).setPassedOR(0);
153 int nOverlappingHits = 0;
165 int nNotOverlappingHits=0;
180 return StatusCode::SUCCESS;
◆ runOverlapRemoval_fast()
StatusCode FPGATrackSimOverlapRemovalTool::runOverlapRemoval_fast |
( |
std::vector< FPGATrackSimTrack > & |
tracks | ) |
|
|
private |
Definition at line 432 of file FPGATrackSimOverlapRemovalTool.cxx.
447 for (
unsigned int i=0;
i < tracks.size();
i++) {
451 tracks.at(
i).setPassedOR(0);
456 for (
unsigned int j=
i+1; j< tracks.size(); j++) {
462 if (!tracks.at(
i).passedOR())
break;
465 if (tracks.at(j).getChi2ndof() >
m_minChi2) tracks.at(j).setPassedOR(0);
469 if (!tracks.at(j).passedOR())
continue;
478 return StatusCode::SUCCESS;
◆ setDoSecondStage()
void FPGATrackSimOverlapRemovalTool::setDoSecondStage |
( |
bool |
v | ) |
|
|
inline |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_algo
◆ m_algorithm
Gaudi::Property<std::string> FPGATrackSimOverlapRemovalTool::m_algorithm { this, "ORAlgo", "Normal", "Overlap removal algorithm"} |
|
private |
◆ m_detStore
◆ m_do2ndStage
Gaudi::Property<bool> FPGATrackSimOverlapRemovalTool::m_do2ndStage { this, "DoSecondStage", false, "Do second stage of not?"} |
|
private |
◆ m_doFastOR
Gaudi::Property<bool> FPGATrackSimOverlapRemovalTool::m_doFastOR { this, "doFastOR", false, "Use fast overlap removal algorithm instead of default"} |
|
private |
◆ m_evtStore
◆ m_FPGATrackSimMapping
◆ m_imageSize_x
Gaudi::Property<unsigned> FPGATrackSimOverlapRemovalTool::m_imageSize_x { this, "nBins_x", 0, "number of bins in, eg, phi_track"} |
|
private |
◆ m_imageSize_y
Gaudi::Property<unsigned> FPGATrackSimOverlapRemovalTool::m_imageSize_y { this, "nBins_y", 0, "number of bins in, eg, q/pT"} |
|
private |
◆ m_localMaxWindowSize
Gaudi::Property<int> FPGATrackSimOverlapRemovalTool::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"} |
|
private |
◆ m_minChi2
Gaudi::Property<float> FPGATrackSimOverlapRemovalTool::m_minChi2 { this, "MinChi2", 40, "Minimum chi2 requirement for tracks being considered in OR"} |
|
private |
◆ m_NumOfHitPerGrouping
Gaudi::Property<int> FPGATrackSimOverlapRemovalTool::m_NumOfHitPerGrouping { this, "NumOfHitPerGrouping", 5, "Number of hits pre grouping"} |
|
private |
◆ m_roadSliceOR
Gaudi::Property<bool> FPGATrackSimOverlapRemovalTool::m_roadSliceOR { this, "roadSliceOR", true, "Do slice-wise overlap removal for roads (Hough-only)"} |
|
private |
◆ m_totLayers
int FPGATrackSimOverlapRemovalTool::m_totLayers = 0 |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
unsigned getLayer() const
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
void setPassedOR(unsigned int)
virtual void setOwner(IDataHandleHolder *o)=0
const std::vector< FPGATrackSimHit > & getFPGATrackSimHits() const
float getPhiCoord() const
float getChi2ndof() const
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
unsigned getIdentifierHash() const
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
float getEtaCoord() const
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
HitType getHitType() const