Analysis Software
Documentation for sPHENIX simulation software
|
#include <coresoftware/blob/master/offline/packages/trackreco/PHActsInitialVertexFinder.h>
Public Member Functions | |
PHActsInitialVertexFinder (const std::string &name="PHActsInitialVertexFinder") | |
~PHActsInitialVertexFinder () override | |
void | setMaxVertices (const int maxVertices) |
void | setSvtxVertexMapName (const std::string &name) |
void | setSvtxTrackMapName (const std::string &name) |
void | disablePtWeights (const bool weight) |
void | resetTrackCovariance (const bool initial) |
void | setCentroids (const int centroids) |
void | setIterations (const int iterations) |
void | removeSiliconSeeds (const bool removeSeeds) |
void | magFieldName (const std::string &magfield) |
void | setPCACut (const float pcaCut) |
Public Member Functions inherited from PHInitVertexing | |
PHInitVertexing (const std::string &name="PHInitVertexing") | |
~PHInitVertexing () override=default | |
int | InitRun (PHCompositeNode *topNode) override |
int | process_event (PHCompositeNode *topNode) override |
Public Member Functions inherited from SubsysReco | |
~SubsysReco () override | |
virtual int | EndRun (const int) |
Called at the end of each run. | |
virtual int | Init (PHCompositeNode *) |
virtual int | Reset (PHCompositeNode *) |
Reset. | |
void | Print (const std::string &="ALL") const override |
Public Member Functions inherited from Fun4AllBase | |
virtual | ~Fun4AllBase () |
virtual const std::string | Name () const |
Returns the name of this module. | |
virtual void | Name (const std::string &name) |
Sets the name of this module. | |
virtual void | Verbosity (const int ival) |
Sets the verbosity of this module (0 by default=quiet). | |
virtual void | Verbosity (enu_Verbosity ival) |
Sets the verbosity of this module (0 by default=quiet). | |
virtual int | Verbosity () const |
Gets the verbosity of this module. | |
Protected Member Functions | |
int | Setup (PHCompositeNode *topNode) override |
int | Process (PHCompositeNode *topNode) override |
int | ResetEvent (PHCompositeNode *topNode) override |
Clean up after each event. | |
int | End (PHCompositeNode *topNode) override |
Called at the end of all processing. | |
Private Member Functions | |
int | getNodes (PHCompositeNode *topNode) |
int | createNodes (PHCompositeNode *topNode) |
TrackParamVec | getTrackPointers (InitKeyMap &keyMap) |
Gets silicon stubs to send to Acts IVF. | |
VertexVector | findVertices (TrackParamVec &tracks) |
Calls Acts IVF. | |
void | fillVertexMap (VertexVector &vertices, InitKeyMap &keyMap) |
Creates SvtxVertexMap. | |
void | createDummyVertex (const float x, const float y, const float z) |
void | checkTrackVertexAssociation () |
Assigns silicon seed a vertex ID if it was left out of Acts IVF. | |
std::vector< SvtxTrack * > | sortTracks () |
CentroidMap | createCentroidMap (std::vector< Acts::Vector3D > ¢roids) |
Helper functions for the k-means cluster algorithm. | |
std::vector< SvtxTrack * > | getIVFTracks (CentroidMap &clusters, std::vector< Acts::Vector3D > ¢roids) |
Private Attributes | |
int | m_nCentroids = 5 |
Number of centroids for k-means clustering algorithm. | |
int | m_nIterations = 15 |
Number of times to iterate for clusters to converge. | |
int | m_maxVertices = 5 |
Max number of vertices allowed by the Acts IVF. | |
float | m_pcaCut = 0.03 |
Maximum centroid transverse PCA cut. | |
int | m_event = 0 |
Event num. | |
unsigned int | m_totVertexFits = 0 |
Diagnostic vertex numbers. | |
unsigned int | m_successFits = 0 |
unsigned int | m_seed = 0 |
std::mt19937 | m_random_number_generator |
std::string | m_svtxTrackMapName = "SvtxSiliconTrackMap" |
std::string | m_svtxVertexMapName = "SvtxVertexMap" |
std::string | m_magField = "" |
bool | m_resetTrackCovariance = true |
bool | m_disableWeights = true |
bool | m_removeSeeds = false |
SvtxTrackMap * | m_trackMap = nullptr |
SvtxVertexMap * | m_vertexMap = nullptr |
ActsTrackingGeometry * | m_tGeometry = nullptr |
Additional Inherited Members | |
Public Types inherited from Fun4AllBase | |
enum | enu_Verbosity { VERBOSITY_QUIET = 0, VERBOSITY_SOME = 1, VERBOSITY_MORE = 2, VERBOSITY_EVEN_MORE = 3, VERBOSITY_A_LOT = 4, VERBOSITY_MAX = std::numeric_limits<int>::max() - 10 } |
Protected Attributes inherited from PHInitVertexing | |
TrkrClusterContainer * | _cluster_map = nullptr |
SvtxVertexMap * | _vertex_map = nullptr |
Definition at line 31 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 31 of file PHActsInitialVertexFinder.h
PHActsInitialVertexFinder::PHActsInitialVertexFinder | ( | const std::string & | name = "PHActsInitialVertexFinder" | ) |
Definition at line 52 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 52 of file PHActsInitialVertexFinder.cc
|
inlineoverride |
Definition at line 35 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 35 of file PHActsInitialVertexFinder.h
|
private |
Assigns silicon seed a vertex ID if it was left out of Acts IVF.
If the track wasn't already given a vertex ID, it wasn't included in the initial vertex finding due to Acts not liking tracks with large transverse position. So find the closest z vertex to it and assign it
Definition at line 133 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 133 of file PHActsInitialVertexFinder.cc
References dz, m_trackMap, and m_vertexMap.
Referenced by Process().
|
private |
Helper functions for the k-means cluster algorithm.
reset the centroid-track map
Add this track to the map that associates centroids with tracks
Update pos centroids
Sets the centroid as the average value
Definition at line 574 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 574 of file PHActsInitialVertexFinder.cc
References clusters, dist(), i, m_nCentroids, m_nIterations, m_trackMap, vec, and Fun4AllBase::Verbosity().
Referenced by sortTracks().
|
private |
Makes a dummy vertex only if Acts returns 0 vertices or there are either 0 or 1 silicon seeds
If the Acts IVF finds 0 vertices or there weren't enough tracks for it to properly identify a good vertex. So just create a dummy vertex with large covariance for rest of track reconstruction to avoid seg faults
Definition at line 248 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 248 of file PHActsInitialVertexFinder.cc
References i, SvtxVertexMap::insert(), j, m_trackMap, and m_vertexMap.
Referenced by fillVertexMap(), and Process().
|
private |
Check that it is there
Get the tracking subnode
Definition at line 800 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 800 of file PHActsInitialVertexFinder.cc
References PHCompositeNode::addNode(), Fun4AllReturnCodes::EVENT_OK, PHNodeIterator::findFirst(), m_svtxVertexMapName, and m_vertexMap.
Referenced by Setup().
|
inline |
Definition at line 46 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 46 of file PHActsInitialVertexFinder.h
References m_disableWeights.
|
overrideprotectedvirtual |
Called at the end of all processing.
Reimplemented from SubsysReco.
Definition at line 123 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 123 of file PHActsInitialVertexFinder.cc
References Fun4AllReturnCodes::EVENT_OK, m_successFits, and m_totVertexFits.
|
private |
Creates SvtxVertexMap.
Create a fail safe for (e.g.) single particle events which don't return a vertex
Fill SvtxVertexMap
Give the track the appropriate vertex id
Definition at line 167 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 167 of file PHActsInitialVertexFinder.cc
References SvtxVertexMap::clear(), Acts::UnitConstants::cm, Acts::UnitConstants::cm2, createDummyVertex(), SvtxTrackMap::find(), i, SvtxVertexMap::insert(), j, m_trackMap, m_vertexMap, and Fun4AllBase::Verbosity().
Referenced by Process().
|
private |
Calls Acts IVF.
Determine the input mag field type from the initial geometry and run the vertex finding with the determined mag field
Setup aliases
Setup vertex finder now
Vertex fitter seems to have no performance difference when iterating once vs. default of 5 times. Additionally, iterating more than once causes vertices with low numbers of tracks to fail fitting, causing an error to be thrown and 0 vertices returned
Don't weight track contribution by pT, since the momentum resolution of the silicon seeds is poor
end lambda
end std::visit call
Definition at line 291 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 291 of file PHActsInitialVertexFinder.cc
References Acts::IntegrationTest::bField, filter::Config, Acts::Logging::FATAL, ckf::field, Acts::getDefaultLogger(), ActsTrackingGeometry::getGeoContext(), logger(), telescope_simulation::logLevel, m_disableWeights, m_maxVertices, m_successFits, m_tGeometry, m_totVertexFits, ActsTrackingGeometry::magField, ActsTrackingGeometry::magFieldContext, testing::internal::move(), position, physmon_track_finding_ttbar::seeder, filter::state, Acts::Logging::VERBOSE, and Fun4AllBase::Verbosity().
Referenced by Process().
|
private |
Note the centroid that has the most tracks
skip centroids that have a very small number of tracks compared to the largest centroid, as these are most likely composed of only a few (bad) stubs
Skip large transverse PCA centroids
Definition at line 460 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 460 of file PHActsInitialVertexFinder.cc
References SvtxTrackMap::erase(), i, m_nCentroids, m_pcaCut, m_removeSeeds, m_trackMap, sum(), and Fun4AllBase::Verbosity().
Referenced by sortTracks().
|
private |
Definition at line 775 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 775 of file PHActsInitialVertexFinder.cc
References Fun4AllReturnCodes::ABORTEVENT, Fun4AllReturnCodes::EVENT_OK, m_svtxTrackMapName, m_tGeometry, m_trackMap, and PHWHERE.
Referenced by Setup().
|
private |
Gets silicon stubs to send to Acts IVF.
If there are fewer tracks than centroids, just one with 1 centroid Otherwise algorithm does not converge. nCentroids should only be a handful, so this only affects small nTrack events.
Only vertex with stubs that have five clusters
The vertexing has an expectation about the field direction and associated charge. For the 3D map, to work with the required swap of the field for the silicon seeds, we need to flip the charge
Make a dummy covariance matrix for Acts that corresponds to the resolutions of the silicon seeds
Make a dummy perigee surface to bound the track to
Definition at line 675 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 675 of file PHActsInitialVertexFinder.cc
References Acts::UnitConstants::cm, Acts::Test::cov, Acts::UnitConstants::e, ActsTrackingGeometry::getGeoContext(), m_magField, m_nCentroids, m_resetTrackCovariance, m_svtxTrackMapName, m_tGeometry, m_trackMap, Acts::UnitConstants::ns, merge_hashes::p, ActsTransformations::rotateSvtxTrackCovToActs(), ActsTransformations::setVerbosity(), SvtxTrackMap::size(), sortTracks(), tracks(), Acts::Test::transform, Acts::UnitConstants::um, and Fun4AllBase::Verbosity().
Referenced by Process().
|
inline |
Definition at line 60 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 60 of file PHActsInitialVertexFinder.h
References m_magField, and G4MAGNET::magfield.
|
overrideprotectedvirtual |
process event interface for trackers, called in process_event. implemented in derived classes
Need to check that silicon stubs which may have been skipped over still have a vertex association
Implements PHInitVertexing.
Definition at line 70 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 70 of file PHActsInitialVertexFinder.cc
References checkTrackVertexAssociation(), createDummyVertex(), Fun4AllReturnCodes::EVENT_OK, fillVertexMap(), findVertices(), SvtxTrackMap::get(), getTrackPointers(), m_event, m_trackMap, PHWHERE, SvtxTrackMap::size(), Fun4AllBase::Verbosity(), and ActsExamples::HepMC3Event::vertices().
|
inline |
Definition at line 58 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 58 of file PHActsInitialVertexFinder.h
References m_removeSeeds.
|
overrideprotectedvirtual |
Clean up after each event.
Reimplemented from SubsysReco.
Definition at line 118 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 118 of file PHActsInitialVertexFinder.cc
References Fun4AllReturnCodes::EVENT_OK.
|
inline |
Definition at line 49 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 49 of file PHActsInitialVertexFinder.h
References m_resetTrackCovariance.
|
inline |
Definition at line 52 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 52 of file PHActsInitialVertexFinder.h
References m_nCentroids.
|
inline |
Definition at line 55 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 55 of file PHActsInitialVertexFinder.h
References TPC_Cluster_Drift_Animator::iterations, and m_nIterations.
|
inline |
Definition at line 37 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 37 of file PHActsInitialVertexFinder.h
References m_maxVertices.
|
inline |
Definition at line 63 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 63 of file PHActsInitialVertexFinder.h
References m_pcaCut.
|
inline |
Definition at line 43 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 43 of file PHActsInitialVertexFinder.h
References m_svtxTrackMapName, and perf_headwind::name.
|
inline |
Definition at line 40 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 40 of file PHActsInitialVertexFinder.h
References m_svtxVertexMapName, and perf_headwind::name.
|
overrideprotectedvirtual |
setup interface for trackers, called in InitRun, setup things like pointers to nodes. overrided in derived classes
Reimplemented from PHInitVertexing.
Definition at line 56 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 56 of file PHActsInitialVertexFinder.cc
References Fun4AllReturnCodes::ABORTEVENT, createNodes(), Fun4AllReturnCodes::EVENT_OK, getNodes(), m_random_number_generator, and m_seed.
|
private |
Implements a k-means cluster algorithm to identify bad seeds to remove from Acts initial vertexing
Implement a simple k-means clustering algorithm. Randomly select m_nCentroid track z PCAs (centroids), assign all tracks to a centroid based on which they are closest to, and then iterate to update clusters and centroids
Get the original centroids
This map holds the centroid index as the key and a vector of SvtxTracks that correspond to that centroid
Take the map and identified centroids and remove tracks that aren't compatible
Definition at line 415 of file PHActsInitialVertexFinder.cc.
View newest version in sPHENIX GitHub at line 415 of file PHActsInitialVertexFinder.cc
References clusters, createCentroidMap(), SvtxTrackMap::get(), SvtxTrack::get_x(), SvtxTrack::get_y(), SvtxTrack::get_z(), getIVFTracks(), index, m_nCentroids, m_random_number_generator, m_trackMap, SvtxTrackMap::size(), and Fun4AllBase::Verbosity().
Referenced by getTrackPointers().
|
private |
Definition at line 123 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 123 of file PHActsInitialVertexFinder.h
Referenced by disablePtWeights(), and findVertices().
|
private |
Event num.
Definition at line 111 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 111 of file PHActsInitialVertexFinder.h
Referenced by Process().
|
private |
Definition at line 121 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 121 of file PHActsInitialVertexFinder.h
Referenced by getTrackPointers(), and magFieldName().
|
private |
Max number of vertices allowed by the Acts IVF.
Definition at line 107 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 107 of file PHActsInitialVertexFinder.h
Referenced by findVertices(), and setMaxVertices().
|
private |
Number of centroids for k-means clustering algorithm.
Definition at line 103 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 103 of file PHActsInitialVertexFinder.h
Referenced by createCentroidMap(), getIVFTracks(), getTrackPointers(), setCentroids(), and sortTracks().
|
private |
Number of times to iterate for clusters to converge.
Definition at line 105 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 105 of file PHActsInitialVertexFinder.h
Referenced by createCentroidMap(), and setIterations().
|
private |
Maximum centroid transverse PCA cut.
Definition at line 109 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 109 of file PHActsInitialVertexFinder.h
Referenced by getIVFTracks(), and setPCACut().
|
private |
Definition at line 117 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 117 of file PHActsInitialVertexFinder.h
Referenced by Setup(), and sortTracks().
|
private |
Definition at line 124 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 124 of file PHActsInitialVertexFinder.h
Referenced by getIVFTracks(), and removeSiliconSeeds().
|
private |
Definition at line 122 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 122 of file PHActsInitialVertexFinder.h
Referenced by getTrackPointers(), and resetTrackCovariance().
|
private |
Definition at line 116 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 116 of file PHActsInitialVertexFinder.h
Referenced by Setup().
|
private |
Definition at line 114 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 114 of file PHActsInitialVertexFinder.h
Referenced by End(), and findVertices().
|
private |
Definition at line 119 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 119 of file PHActsInitialVertexFinder.h
Referenced by getNodes(), getTrackPointers(), and setSvtxTrackMapName().
|
private |
Definition at line 120 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 120 of file PHActsInitialVertexFinder.h
Referenced by createNodes(), and setSvtxVertexMapName().
|
private |
Definition at line 128 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 128 of file PHActsInitialVertexFinder.h
Referenced by findVertices(), getNodes(), and getTrackPointers().
|
private |
Diagnostic vertex numbers.
Definition at line 113 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 113 of file PHActsInitialVertexFinder.h
Referenced by End(), and findVertices().
|
private |
Definition at line 126 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 126 of file PHActsInitialVertexFinder.h
Referenced by checkTrackVertexAssociation(), createCentroidMap(), createDummyVertex(), fillVertexMap(), getIVFTracks(), getNodes(), getTrackPointers(), Process(), and sortTracks().
|
private |
Definition at line 127 of file PHActsInitialVertexFinder.h.
View newest version in sPHENIX GitHub at line 127 of file PHActsInitialVertexFinder.h
Referenced by checkTrackVertexAssociation(), createDummyVertex(), createNodes(), and fillVertexMap().