Analysis Software
Documentation for sPHENIX simulation software
|
Class for reconstruction of primary vertices. More...
#include <KFParticle/blob/master/KFParticle/KFParticlePVReconstructor.h>
Classes | |
class | KFParticleCluster |
A helper structure for reconstruction of a primary vertex. More... | |
Public Member Functions | |
KFParticlePVReconstructor () | |
~KFParticlePVReconstructor () | |
void | Init (KFPTrackVector *tracks, int nParticles) |
void | ReconstructPrimVertex () |
int | NPrimaryVertices () const |
Returns number of the found candidates for the primary vertex. | |
KFParticle & | GetPrimVertex (int iPV=0) |
Returns primary vertex candidate in KFParticle with index "iPV". | |
KFVertex & | GetPrimKFVertex (int iPV=0) |
Returns primary vertex candidate in KFVertex with index "iPV". | |
std::vector< int > & | GetPVTrackIndexArray (int iPV=0) |
Returns vector with track indices from a cluster with index "iPV". | |
KFParticle & | GetParticle (int i) |
Returns input particle with index "i". | |
void | SetBeamLine (KFParticle &p) |
Sets the beam line position and direction, sets corresponding flag to "true". | |
bool | IsBeamLine () const |
Check if the beam line is set. | |
void | AddPV (const KFVertex &pv, const std::vector< int > &tracks) |
void | AddPV (const KFVertex &pv) |
void | CleanPV () |
Clean vectors with primary vertex candidates and corresponding clusters. | |
void | SetChi2PrimaryCut (float chi2) |
Sets cut fChi2Cut on chi2-deviation of primary tracks from the vertex candidate to "chi2" and a soft preparation cut fChi2CutPreparation to "10*chi2". | |
Private Member Functions | |
KFParticlePVReconstructor & | operator= (KFParticlePVReconstructor &) |
Is not defined. Deny copying of the objects of this class. | |
KFParticlePVReconstructor (KFParticlePVReconstructor &) | |
Is not defined. Deny copying of the objects of this class. | |
void | FindPrimaryClusters (int cutNDF=1) |
Private Attributes | |
std::vector< KFParticle > | fParticles |
Array of the input particles constructed from tracks. | |
int | fNParticles |
Number of the input particles. | |
std::vector< float > | fWeight |
Vector with weights of each track, the weight is defined in KFParticlePVReconstructor::Init(). | |
KFParticle | fBeamLine |
Position and direction of the beam line. | |
bool | fIsBeamLine |
Flag showing if the beam line is set. | |
std::vector< KFParticleCluster > | fClusters |
Vector with clusters to be used for fit of a primary vertex. | |
std::vector< KFVertex > | fPrimVertices |
Vector with reconstructed candidates for a primary vertex. | |
float | fChi2CutPreparation |
A soft cut on the chi2-deviation which is used to form a cluster. | |
float | fChi2Cut |
Cut on the chi2-deviation of the tracks to the primary vertex. | |
Class for reconstruction of primary vertices.
The class is based on KFVertex. For reconstruction of primary vertices the Kalman filter mathematics is used. Allows reconstruction of multiple primary vertices.
Definition at line 45 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 45 of file KFParticlePVReconstructor.h
|
inline |
Definition at line 47 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 47 of file KFParticlePVReconstructor.h
|
inline |
Definition at line 48 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 48 of file KFParticlePVReconstructor.h
|
private |
Is not defined. Deny copying of the objects of this class.
void KFParticlePVReconstructor::AddPV | ( | const KFVertex & | pv, |
const std::vector< int > & | tracks | ||
) |
Adds externally found primary vertex to the list together with the cluster of tracks from this vertex.
[in] | pv | - external primary vertex |
[in] | tracks | - vector with indices of tracks associated with the provided primary vertex. |
Definition at line 356 of file KFParticlePVReconstructor.cxx.
View newest version in sPHENIX GitHub at line 356 of file KFParticlePVReconstructor.cxx
References fClusters, fPrimVertices, KFParticlePVReconstructor::KFParticleCluster::fTracks, and tracks().
Referenced by KFParticleTopoReconstructor::AddPV(), and KFParticleTopoReconstructor::ReconstructPrimVertex().
void KFParticlePVReconstructor::AddPV | ( | const KFVertex & | pv | ) |
Adds externally found primary vertex to the list.
[in] | pv | - external primary vertex |
Definition at line 364 of file KFParticlePVReconstructor.cxx.
View newest version in sPHENIX GitHub at line 364 of file KFParticlePVReconstructor.cxx
References fClusters, and fPrimVertices.
|
inline |
Clean vectors with primary vertex candidates and corresponding clusters.
Definition at line 73 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 73 of file KFParticlePVReconstructor.h
References fClusters, and fPrimVertices.
Referenced by KFParticleTopoReconstructor::CleanPV(), KFParticleTopoReconstructor::Clear(), and KFParticleTopoReconstructor::ReconstructPrimVertex().
|
private |
The functions searches for a set of clusters of particles - candidates for the primary vertex:
1) input particles are assumed to be transported to the beam line or target position;
2) at first, the best particle with the highest weight is selected;
3) then a cluster is formed around this particle;
4) if a beam line is set it is used for the reconstruction as an additional track, but will not be added to the resulting cluster of daughter particles;
5) the primary vertex candidate is fitted with KFVertex::ConstructPrimaryVertex() using KFParticlePVReconstructor::fChi2Cut;
6) cluster is cleaned from particles deviating more then the fChi2Cut from the fitted candidate;
7) the cluster and the vertex candidate are stored if they satisfy the provided cutNDF;
8) the procedure is repeated until not used tracks with well-defined weight are left.
[in] | cutNDF | - cut on the number of degrees of freedom (effectively - number of particles used for the reconstruction), if resulting NDF is smaller then this cut - the PV-candidate is rejected |
Definition at line 142 of file KFParticlePVReconstructor.cxx.
View newest version in sPHENIX GitHub at line 142 of file KFParticlePVReconstructor.cxx
References KFVertex::ConstructPrimaryVertex(), f, fBeamLine, KFParticlePVReconstructor::KFParticleCluster::fC, fChi2Cut, fClusters, fNParticles, KFParticlePVReconstructor::KFParticleCluster::fP, fParticles, fPrimVertices, KFParticlePVReconstructor::KFParticleCluster::fTracks, fWeight, GetDeviationFromVertex(), KFParticle::GetNDF(), IsBeamLine(), and KFParticleBase::SetConstructMethod().
Referenced by ReconstructPrimVertex().
|
inline |
Returns input particle with index "i".
Definition at line 58 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 58 of file KFParticlePVReconstructor.h
References assert, fNParticles, fParticles, and i.
|
inline |
Returns primary vertex candidate in KFVertex with index "iPV".
Definition at line 56 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 56 of file KFParticlePVReconstructor.h
References fPrimVertices.
Referenced by KFParticleTopoReconstructor::GetPrimKFVertex(), and KFParticleTopoReconstructor::ReconstructPrimVertex().
|
inline |
Returns primary vertex candidate in KFParticle with index "iPV".
Definition at line 55 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 55 of file KFParticlePVReconstructor.h
References fPrimVertices.
Referenced by KFParticleTopoReconstructor::GetPrimVertex().
|
inline |
Returns vector with track indices from a cluster with index "iPV".
Definition at line 57 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 57 of file KFParticlePVReconstructor.h
References fClusters.
Referenced by KFParticleTopoReconstructor::GetPVTrackIndexArray(), KFParticleTopoReconstructor::ReconstructPrimVertex(), and KFParticleTopoReconstructor::SortTracks().
void KFParticlePVReconstructor::Init | ( | KFPTrackVector * | tracks, |
int | nParticles | ||
) |
The function initialises an input for the search of primary vertices:
1) it receives as an input an array with tracks;
2) tracks are converted to KFParticle objects assuming pion mass;
3) the position of the primary vertex is estimated with simplified Kalman filter equations using all tracks;
4) tracks are checked to deviate from the obtained estimation within KFParticlePVReconstructor::fChi2CutPreparation;
5) from the selected tracks a more precise estimation is obtained using KFVertex::ConstructPrimaryVertex() with soft cut KFParticlePVReconstructor::fChi2CutPreparation;
6) input particles are transported to the DCA point with the obtained estimation;
7) the weight for each particle is calculated according to its errors, if errors are not defined after extrapolation or if particle 10 cm away from the {0,0,0} point the weight of -100 is assigned.
[in] | tracks | - a pointer to the KFPTrackVector with input tracks |
[in] | nParticles | - number of the input tracks |
Definition at line 28 of file KFParticlePVReconstructor.cxx.
View newest version in sPHENIX GitHub at line 28 of file KFParticlePVReconstructor.cxx
References C, f, fClusters, fNParticles, fParticles, fPrimVertices, fWeight, KFPTrackVector::GetTrack(), KFPTrack::Id(), r2, TauVsDIS_MachineLearning_Differentiation::X, and TauVsDIS_MachineLearning_Differentiation::Y.
Referenced by KFParticleTopoReconstructor::Init().
|
inline |
Check if the beam line is set.
Definition at line 61 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 61 of file KFParticlePVReconstructor.h
References fIsBeamLine.
Referenced by FindPrimaryClusters().
|
inline |
Returns number of the found candidates for the primary vertex.
Definition at line 54 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 54 of file KFParticlePVReconstructor.h
References fPrimVertices.
Referenced by KFParticleTopoReconstructor::NPrimaryVertices().
|
private |
Is not defined. Deny copying of the objects of this class.
void KFParticlePVReconstructor::ReconstructPrimVertex | ( | ) |
Reconstructs primary vertices and corresponding clusters of tracks. For this it calls KFParticlePVReconstructor::FindPrimaryClusters(), if no vertex is found empty primary vertex is used.
Definition at line 330 of file KFParticlePVReconstructor.cxx.
View newest version in sPHENIX GitHub at line 330 of file KFParticlePVReconstructor.cxx
References fClusters, FindPrimaryClusters(), fPrimVertices, KFPVertex::SetChi2(), KFPVertex::SetCovarianceMatrix(), KFPVertex::SetNContributors(), KFPVertex::SetXYZ(), TauVsDIS_MachineLearning_Differentiation::X, TauVsDIS_MachineLearning_Differentiation::Y, and SVM_v1::Z.
Referenced by KFParticleTopoReconstructor::ReconstructPrimVertex().
|
inline |
Sets the beam line position and direction, sets corresponding flag to "true".
Definition at line 60 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 60 of file KFParticlePVReconstructor.h
References fBeamLine, fIsBeamLine, and merge_hashes::p.
Referenced by KFParticleTopoReconstructor::SetBeamLine().
|
inline |
Sets cut fChi2Cut on chi2-deviation of primary tracks from the vertex candidate to "chi2" and a soft preparation cut fChi2CutPreparation to "10*chi2".
Definition at line 77 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 77 of file KFParticlePVReconstructor.h
References fChi2Cut, and fChi2CutPreparation.
Referenced by KFParticleTopoReconstructor::SetChi2PrimaryCut().
|
private |
Position and direction of the beam line.
Definition at line 90 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 90 of file KFParticlePVReconstructor.h
Referenced by FindPrimaryClusters(), and SetBeamLine().
|
private |
Cut on the chi2-deviation of the tracks to the primary vertex.
Definition at line 112 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 112 of file KFParticlePVReconstructor.h
Referenced by FindPrimaryClusters(), and SetChi2PrimaryCut().
|
private |
A soft cut on the chi2-deviation which is used to form a cluster.
Definition at line 111 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 111 of file KFParticlePVReconstructor.h
Referenced by SetChi2PrimaryCut().
|
private |
Vector with clusters to be used for fit of a primary vertex.
Definition at line 108 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 108 of file KFParticlePVReconstructor.h
Referenced by AddPV(), CleanPV(), FindPrimaryClusters(), GetPVTrackIndexArray(), Init(), and ReconstructPrimVertex().
|
private |
Flag showing if the beam line is set.
Definition at line 91 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 91 of file KFParticlePVReconstructor.h
Referenced by IsBeamLine(), and SetBeamLine().
|
private |
Number of the input particles.
Definition at line 86 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 86 of file KFParticlePVReconstructor.h
Referenced by FindPrimaryClusters(), GetParticle(), and Init().
|
private |
Array of the input particles constructed from tracks.
Definition at line 85 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 85 of file KFParticlePVReconstructor.h
Referenced by FindPrimaryClusters(), GetParticle(), and Init().
|
private |
Vector with reconstructed candidates for a primary vertex.
Definition at line 109 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 109 of file KFParticlePVReconstructor.h
Referenced by AddPV(), CleanPV(), FindPrimaryClusters(), GetPrimKFVertex(), GetPrimVertex(), Init(), NPrimaryVertices(), and ReconstructPrimVertex().
|
private |
Vector with weights of each track, the weight is defined in KFParticlePVReconstructor::Init().
Definition at line 88 of file KFParticlePVReconstructor.h.
View newest version in sPHENIX GitHub at line 88 of file KFParticlePVReconstructor.h
Referenced by FindPrimaryClusters(), and Init().