13#include <TMatrixTSym.h>
14#include <TMatrixTUtils.h>
26 : TNamed(
"Vertex",
"Global")
35 for (int32_t i = 0; i < 6; i++)
51 for (int32_t i = 0; i < 6; i++)
59 int32_t nTracks,
const TMatrixFSym& covMat)
69 if ((covMat.GetNrows() != 3) && (covMat.GetNcols() != 3)) {
70 LOG(error) <<
"Wrong dimension of passed covariance matrix. Clear the "
72 for (int32_t i = 0; i < 6; i++)
77 for (int32_t i = 0; i < 3; i++) {
78 for (int32_t j = i; j < 3; j++)
79 fCovMatrix[index++] = covMat[i][j];
98 LOG(info) <<
"Vertex coord. (" <<
fX <<
"," <<
fY <<
"," <<
fZ <<
") cm, "
99 <<
"chi2/ndf = " << chi2ndf <<
", " <<
fNTracks <<
" tracks used";
108 for (
int i = 0; i < 3; i++) {
109 for (
int j = i; j < 3; j++) {
122 TMatrixFSym* mat =
new TMatrixFSym(3);
124 double element = (*mat)[i][j];
133 const TMatrixFSym& covMat)
141 if ((covMat.GetNrows() != 3) && (covMat.GetNcols() != 3)) {
142 LOG(error) <<
"Wrong dimension of passed covariance matrix. Clear the "
143 "covariance matrix.";
144 for (int32_t i = 0; i < 6; i++)
149 for (int32_t i = 0; i < 3; i++) {
150 for (int32_t j = i; j < 3; j++)
163 for (int32_t i = 0; i < 6; i++)
175 ss <<
"Vertex: position (" << fixed << setprecision(4) <<
fX <<
", " <<
fY <<
", " <<
fZ
176 <<
") cm, chi2/ndf = " << chi2ndf <<
", tracks used: " <<
fNTracks;
184 if (iTrack < 0 || iTrack >=
fNTracks) {
185 LOG(warning) << GetName() <<
"::GetTrackIndex(" << iTrack <<
") : outside range.";
188 if (!
fTrkIdx.size() ||
size_t(iTrack) >=
fTrkIdx.size())
return -1;
196 auto idx = find_if(
fTrkIdx.begin(),
fTrkIdx.end(), [iTrack](uint32_t p) { return p == iTrack; });
197 if (idx !=
fTrkIdx.end())
return true;
211 LOG(error) << GetName()
212 <<
"::SetTracks() : fNTracks does not match fTrkIdx info. This might point to a problem !";
ClassImp(CbmConverterManager)
bool SetTracks(std::vector< uint32_t > &indexVector)
std::vector< uint32_t > fTrkIdx
virtual std::string ToString() const
bool FindTrackByIndex(uint32_t iTrack) const
Accessors to the Global track array. Check if track with global index iTrack was actually used for ve...
void CovMatrix(TMatrixFSym &covMat) const
int32_t GetTrackIndex(int32_t iTrack) const
Accessors to the Global track array. Retrieve the tracks being actually used for vertex fit by entry ...
double GetCovariance(int32_t i, int32_t j) const
void SetVertex(double x, double y, double z, double chi2, int32_t ndf, int32_t nTracks, const TMatrixFSym &covMat)
virtual void Print(Option_t *opt="") const