ATLAS Offline Software
|
Class reconstructing tracks using basic Kalman filter. More...
#include <AFPSiDBasicKalmanTool.h>
Public Member Functions | |
AFPSiDBasicKalmanTool (const std::string &type, const std::string &name, const IInterface *parent) | |
virtual | ~AFPSiDBasicKalmanTool () override |
virtual StatusCode | initialize () override |
Read parameters from job options and print tool configuration. More... | |
virtual StatusCode | finalize () override |
Does nothing. More... | |
StatusCode | reconstructTracks (std::unique_ptr< xAOD::AFPTrackContainer > &outputContainer, const EventContext &ctx) const override |
Does actual tracks reconstruction. More... | |
const std::string & | outputContainerName () const override |
void | filterTrkCollection (std::list< AFPSiDBasicKalmanToolTrack > &reconstructedTracks) const |
Filters duplicate tracks from the list. More... | |
unsigned int | countSharedClusters (const AFPSiDBasicKalmanToolTrack &firstTrack, const AFPSiDBasicKalmanToolTrack &secondTrack) const |
Returns number of the same clusters used to reconstruct two tracks. More... | |
void | clearAllLayers (AFPLocRecoStationBasicObj &my_stationClusters) const |
clear all layers from clusters saved in #m_stationsClusters; More... | |
Private Member Functions | |
void | fillLayersWithClusters (AFPLocRecoStationBasicObj &my_stationClusters, SG::ReadHandle< xAOD::AFPSiHitsClusterContainer > &hitsClusterContainer) const |
Fills layers with clusters of hits, dividing them into stations and layers. More... | |
void | initMatrixFromVector (CLHEP::HepMatrix &matrix, const std::vector< float > &vec1D) const |
Method that initialises 2D matrix using values from the vector. More... | |
bool | checkMatrixAndVectorSize (const CLHEP::HepMatrix &matrix, const std::vector< float > &vec1D) const |
Returns true if vector size equals matrix rows times columns. More... | |
bool | areNeighbours (const xAOD::AFPSiHitsCluster *a, const xAOD::AFPSiHitsCluster *b, const double dist) const |
Checks if clusters are neighbours Compares distance between them to m_allowedDistanceBetweenClustersInSeed. More... | |
void | saveToXAOD (const AFPSiDBasicKalmanToolTrack &recoTrack, std::unique_ptr< xAOD::AFPTrackContainer > &containerToFill, SG::ReadHandle< xAOD::AFPSiHitsClusterContainer > &hitsClusterContainer) const |
Save reconstructed track to the xAOD container. More... | |
Private Attributes | |
Gaudi::Property< std::string > | m_tracksContainerName {this, "tracksContainerName", "AFPTrackContainer", "Name of the container in which tracks are saved"} |
Name of the xAOD container to which tracks will be saved; actual saving is done in AFPSIDLocRecoTool. More... | |
Gaudi::Property< int > | m_stationID {this, "stationID", 0, "ID number of station for which tracks should be reconstructed"} |
AFP station ID for which tracks will be reconstructed. More... | |
CLHEP::HepMatrix | m_observationModel |
The observation model which maps the true state space into the observed space ( \(H_{k}\)) More... | |
Gaudi::Property< std::vector< float > > | m_observationModelInit {this, "observationModel", {}, "vector used to initialise observation model matrix (2x4), the first four numbers correspond to the first row of the matrix"} |
A vector used to initialise m_observationModel matrix. More... | |
CLHEP::HepMatrix | m_observationNoise |
The observation noise matrix. More... | |
Gaudi::Property< std::vector< float > > | m_observationNoiseInit {this, "observationNoise", {}, "vector used to initialise observation noise matrix (2x2), the first two numbers correspond to the first row of the matrix"} |
A vector used to initialise m_observationNoise matrix. More... | |
CLHEP::HepMatrix | m_processNoiseCov |
The covariance matrix of process noise. More... | |
Gaudi::Property< std::vector< float > > | m_processNoiseCovInit {this, "processNoiseCov", {}, "A vector used to initialise process noise covariance matrix (4x4).The first 4 numbers correspond to the first row of the matrix."} |
A vector used to initialise m_processNoiseCov matrix. More... | |
CLHEP::HepMatrix | m_aposterioriCov |
A posteriori error covariance matrix (a measure of the estimated accuracy of the state estimate) ( \(P_{k|k}\)) More... | |
Gaudi::Property< std::vector< float > > | m_aposterioriCovInit {this, "aposterioriCov", {}, "A vector used to initialise a posteriori covariance matrix (4x4). The first 4 numbers correspond to the first row of the matrix."} |
A vector used to initialise m_aposterioriCov matrix. More... | |
Gaudi::Property< int > | m_numberOfLayersInStation {this, "numberOfLayersInStations", 4, "The size of the vector sets number of stations. Each element defines number of pixel layers in the station."} |
Number of layers used for reconstruction in station If not set in job options 4 stations, each with 4 layers are created. More... | |
SG::ReadHandleKey< xAOD::AFPSiHitsClusterContainer > | m_hitsClusterContainerKey {this, "AFPSiHitsClusterContainerKey", "AFPSiHitsClusterContainer", "Name of the container with clusters of hits from which tracks are to be reconstructed"} |
Name of the xAOD container with clusters to be used in track reconstruction. More... | |
Gaudi::Property< double > | m_maxAllowedDistance {this, "maxAllowedDistance", 10, "Maximal distance at which cluster can be joined to the track"} |
Maximal distance at which cluster can be joined to the track (Default = 100 - all clusters) More... | |
Gaudi::Property< unsigned int > | m_minClustersNumber {this, "minClustersNumber", 3, "Minimal number of clusters in track. If there are less clusters track is rejected"} |
Minimal number of clusters in track. If there are less clusters track is rejected (Default = 3) More... | |
Gaudi::Property< unsigned int > | m_maxSharedClusters {this, "maxSharedClusters", 2, "Maximal number of hits that two tracks can share. If they share more one is deleted."} |
Maximal number of hits that two tracks can share. If they share more one is deleted. More... | |
Gaudi::Property< float > | m_clusterMaxChi2 {this, "clusterMaxChi2", 3, "Maximal value of chi2 for which a cluster is added."} |
Maximal value of chi2 for which a cluster is added. More... | |
Gaudi::Property< float > | m_trackMaxChi2 {this, "trackMaxChi2", 3, "Maximal value of chi2 for the track."} |
Maximal value of chi2 for the track. More... | |
Gaudi::Property< double > | m_allowedDistanceBetweenClustersInSeed {this, "allowedDistanceBetweenClustersInSeed", 0.5, "Maximum allowed distance between clusters in a seed to be considered coming from the same proton; if the difference between clusters is 2 layers (3 layers), this distance is multiplied by 2 (3)"} |
Maximum allowed distance between clusters to be considered coming from the same proton. More... | |
Gaudi::Property< std::vector< std::pair< int, int > > > | m_layersForSeeds {this, "layersForSeeds", {{0,1}}, "Pairs of layers that are used to create seeds."} |
Vector of pairs of layers. These pairs will be used to make seeds. More... | |
ToolHandle< GenericMonitoringTool > | m_monTool {this, "MonTool", "", "Monitoring tool"} |
Monitoring. More... | |
Class reconstructing tracks using basic Kalman filter.
The idea of the reconstruction is presented in the talk https://indico.cern.ch/event/275484/contributions/1618277/attachments/499062/689421/mdyndal_2013-10-15_AFP_Gen.pdf
Definition at line 49 of file AFPSiDBasicKalmanTool.h.
AFPSiDBasicKalmanTool::AFPSiDBasicKalmanTool | ( | const std::string & | type, |
const std::string & | name, | ||
const IInterface * | parent | ||
) |
Definition at line 29 of file AFPSiDBasicKalmanTool.cxx.
|
inlineoverridevirtual |
Definition at line 57 of file AFPSiDBasicKalmanTool.h.
|
private |
Checks if clusters are neighbours Compares distance between them to m_allowedDistanceBetweenClustersInSeed.
Definition at line 215 of file AFPSiDBasicKalmanTool.cxx.
|
inlineprivate |
Returns true if vector size equals matrix rows times columns.
Definition at line 204 of file AFPSiDBasicKalmanTool.h.
|
inline |
clear all layers from clusters saved in #m_stationsClusters;
Definition at line 92 of file AFPSiDBasicKalmanTool.h.
unsigned int AFPSiDBasicKalmanTool::countSharedClusters | ( | const AFPSiDBasicKalmanToolTrack & | firstTrack, |
const AFPSiDBasicKalmanToolTrack & | secondTrack | ||
) | const |
Returns number of the same clusters used to reconstruct two tracks.
Definition at line 410 of file AFPSiDBasicKalmanTool.cxx.
|
private |
Fills layers with clusters of hits, dividing them into stations and layers.
Definition at line 199 of file AFPSiDBasicKalmanTool.cxx.
void AFPSiDBasicKalmanTool::filterTrkCollection | ( | std::list< AFPSiDBasicKalmanToolTrack > & | reconstructedTracks | ) | const |
Filters duplicate tracks from the list.
The tracks are considered duplicates if more than m_maxSharedClusters clusters are the same in both tracks. In such situation track quality is calculated according to the formula \(q = N_{clusters} + ((\chi^2_{trk, max} - \chi^2{trk})/(\chi^2_{trk, max} + 1))\). The track with smaller value of \(q\) is deleted.
Definition at line 350 of file AFPSiDBasicKalmanTool.cxx.
|
overridevirtual |
Does nothing.
Definition at line 194 of file AFPSiDBasicKalmanTool.cxx.
|
overridevirtual |
Read parameters from job options and print tool configuration.
Definition at line 36 of file AFPSiDBasicKalmanTool.cxx.
|
private |
Method that initialises 2D matrix using values from the vector.
The method checks if the matrix size agrees with the vector size (N_columns*N_rows = N_vector). If the sizes are incompatible the matrix is unchanged.
[out] | the | matrix to be initialised |
[in] | the | vector with values to be copied to the matrix |
Definition at line 424 of file AFPSiDBasicKalmanTool.cxx.
|
inlineoverride |
Definition at line 76 of file AFPSiDBasicKalmanTool.h.
|
override |
Does actual tracks reconstruction.
Definition at line 224 of file AFPSiDBasicKalmanTool.cxx.
|
private |
Save reconstructed track to the xAOD container.
Definition at line 321 of file AFPSiDBasicKalmanTool.cxx.
|
private |
Maximum allowed distance between clusters to be considered coming from the same proton.
Definition at line 185 of file AFPSiDBasicKalmanTool.h.
|
private |
A posteriori error covariance matrix (a measure of the estimated accuracy of the state estimate) ( \(P_{k|k}\))
This is 4x4 matrix. If the matrix is not defined in job options it set to 0.
Definition at line 154 of file AFPSiDBasicKalmanTool.h.
|
private |
A vector used to initialise m_aposterioriCov matrix.
The first 4 numbers correspond to the first row of the matrix.
Definition at line 159 of file AFPSiDBasicKalmanTool.h.
|
private |
Maximal value of chi2 for which a cluster is added.
Definition at line 179 of file AFPSiDBasicKalmanTool.h.
|
private |
Name of the xAOD container with clusters to be used in track reconstruction.
Definition at line 167 of file AFPSiDBasicKalmanTool.h.
|
private |
Vector of pairs of layers. These pairs will be used to make seeds.
Definition at line 188 of file AFPSiDBasicKalmanTool.h.
|
private |
Maximal distance at which cluster can be joined to the track (Default = 100 - all clusters)
Definition at line 170 of file AFPSiDBasicKalmanTool.h.
|
private |
Maximal number of hits that two tracks can share. If they share more one is deleted.
Definition at line 176 of file AFPSiDBasicKalmanTool.h.
|
private |
Minimal number of clusters in track. If there are less clusters track is rejected (Default = 3)
Definition at line 173 of file AFPSiDBasicKalmanTool.h.
|
private |
Monitoring.
Definition at line 215 of file AFPSiDBasicKalmanTool.h.
|
private |
Number of layers used for reconstruction in station If not set in job options 4 stations, each with 4 layers are created.
Definition at line 164 of file AFPSiDBasicKalmanTool.h.
|
private |
The observation model which maps the true state space into the observed space ( \(H_{k}\))
This is 2x4 matrix, where dimension 2 comes from two position variables (x, y) and dimension 4 comes from position and slope in each of the two directions. \(z_{k} = H_{k} x_{k} + v_{k}\)
If no proper observationModel array is defined in python configuration the default unit transformation is used - X and Y position are simply copied.
Definition at line 114 of file AFPSiDBasicKalmanTool.h.
|
private |
A vector used to initialise m_observationModel matrix.
The first four numbers correspond to the first row of the matrix.
Definition at line 119 of file AFPSiDBasicKalmanTool.h.
|
private |
The observation noise matrix.
( \(v_{k}\))
This is 2x2 matrix In standard Kalman it is assumed to be zero mean Gaussian white noise with covariance specified by the matrix. \(z_{k} = H_{k} x_{k} + v_{k}\)
If the matrix is not defined in job options it set to be diagonal matrix with squared sizes of pixel.
Definition at line 130 of file AFPSiDBasicKalmanTool.h.
|
private |
A vector used to initialise m_observationNoise matrix.
The first two numbers correspond to the first row of the matrix.
Definition at line 135 of file AFPSiDBasicKalmanTool.h.
|
private |
The covariance matrix of process noise.
( \(Q_{k}\))
This is 4x4 matrix. If the matrix is not defined in job options it set to 0.
Definition at line 142 of file AFPSiDBasicKalmanTool.h.
|
private |
A vector used to initialise m_processNoiseCov matrix.
The first 4 numbers correspond to the first row of the matrix.
Definition at line 147 of file AFPSiDBasicKalmanTool.h.
|
private |
AFP station ID for which tracks will be reconstructed.
Definition at line 102 of file AFPSiDBasicKalmanTool.h.
|
private |
Maximal value of chi2 for the track.
Definition at line 182 of file AFPSiDBasicKalmanTool.h.
|
private |
Name of the xAOD container to which tracks will be saved; actual saving is done in AFPSIDLocRecoTool.
Definition at line 99 of file AFPSiDBasicKalmanTool.h.