|
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< std::shared_ptr< const 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 400 of file FPGATrackSimOverlapRemovalTool.cxx.
402 std::vector<const FPGATrackSimHit*> hitsInTrack1;
404 if (hit.isReal()) hitsInTrack1.push_back(&hit);
407 std::vector<const FPGATrackSimHit*> hitsInTrack2;
409 if (hit.isReal()) hitsInTrack2.push_back(&hit);
415 bool goodOrder =
true;
416 if (hitsInTrack1.size() == hitsInTrack2.size()) {
423 }
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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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 182 of file FPGATrackSimOverlapRemovalTool.cxx.
185 float minChi2=100000.;
190 float t_chi2 = RMtracks.at(dup).getChi2ndof();
191 int t_nhitlayers = RMtracks.at(dup).getFPGATrackSimHits().size();
192 for(
auto& hit : RMtracks.at(dup).getFPGATrackSimHits())
200 if(t_nhitlayers>maxHitLayers)
204 RMtracks.at(prevID).setPassedOR(0);
207 maxHitLayers=t_nhitlayers;
210 else if(t_nhitlayers==maxHitLayers)
216 RMtracks.at(prevID).setPassedOR(0);
223 RMtracks.at(dup).setPassedOR(0);
228 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 327 of file FPGATrackSimOverlapRemovalTool.cxx.
332 auto hash_a =
a->getIdentifierHash();
333 auto hash_b =
b->getIdentifierHash();
334 if ( hash_a == hash_b ) {
335 auto phi_a =
a->getPhiCoord();
336 auto phi_b =
b->getPhiCoord();
337 if ( phi_a == phi_b ) {
338 auto eta_a =
a->getEtaCoord();
339 auto eta_b =
b->getEtaCoord();
340 if ( eta_a == eta_b) {
341 auto layer_a =
a->getLayer();
342 auto layer_b =
b->getLayer();
343 return layer_a < layer_b;
345 return eta_a < eta_b;
347 return phi_a < phi_b;
349 return hash_a < hash_b;
353 std::set<const FPGATrackSimHit*, HitCompare > hitsInTrack1;
355 if (hit.isReal()) hitsInTrack1.insert(&hit);
358 std::set<const FPGATrackSimHit*, HitCompare> hitsInTrack2;
360 if (hit.isReal()) hitsInTrack2.insert(&hit);
363 std::vector<const FPGATrackSimHit*> sharedHits;
365 hitsInTrack2.begin(), hitsInTrack2.end(),
366 std::back_inserter(sharedHits),
370 int nHitsInTrack1 = hitsInTrack1.size();
371 int nHitsInTrack2 = hitsInTrack2.size();
372 int nSharedHits = sharedHits.size();
375 int nonOverlappingHits =
std::min(nHitsInTrack1 - nSharedHits, nHitsInTrack2 - nSharedHits);
389 return StatusCode::FAILURE;
397 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ runOverlapRemoval() [1/2]
StatusCode FPGATrackSimOverlapRemovalTool::runOverlapRemoval |
( |
std::vector< FPGATrackSimTrack > & |
tracks | ) |
|
Definition at line 110 of file FPGATrackSimOverlapRemovalTool.cxx.
121 for(
unsigned int i=0;
i<tracks.size();
i++)
128 tracks.at(
i).setPassedOR(0);
136 for(
unsigned int j=
i+1; j<tracks.size(); j++)
145 tracks.at(j).setPassedOR(0);
152 int nOverlappingHits = 0;
164 int nNotOverlappingHits=0;
179 return StatusCode::SUCCESS;
◆ runOverlapRemoval() [2/2]
StatusCode FPGATrackSimOverlapRemovalTool::runOverlapRemoval |
( |
std::vector< std::shared_ptr< const 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.get();
90 else if (
r->getNHitLayers() ==
old->getNHitLayers() &&
r->getNHits() >
old->getNHits()) *
old = *
r.get();
98 roads.emplace_back(std::shared_ptr<const FPGATrackSimRoad>(tempPtr));
106 ATH_MSG_DEBUG(
"Input: " << in <<
" Output: " << roads.size());
107 return StatusCode::SUCCESS;
◆ runOverlapRemoval_fast()
StatusCode FPGATrackSimOverlapRemovalTool::runOverlapRemoval_fast |
( |
std::vector< FPGATrackSimTrack > & |
tracks | ) |
|
|
private |
Definition at line 431 of file FPGATrackSimOverlapRemovalTool.cxx.
446 for (
unsigned int i=0;
i < tracks.size();
i++) {
450 tracks.at(
i).setPassedOR(0);
455 for (
unsigned int j=
i+1; j< tracks.size(); j++) {
461 if (!tracks.at(
i).passedOR())
break;
464 if (tracks.at(j).getChi2ndof() >
m_minChi2) tracks.at(j).setPassedOR(0);
468 if (!tracks.at(j).passedOR())
continue;
477 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