Skip to content

Commit

Permalink
dals
Browse files Browse the repository at this point in the history
  • Loading branch information
f3sch committed Oct 26, 2023
1 parent 9e246af commit 854c628
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
17 changes: 16 additions & 1 deletion Common/DCAFitter/include/DCAFitter/DCAFitterN.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ class DCAFitterN
using vf = std::vector<float>;

public:
o2::track::TrackParCov mSeedP, mSeedN;
vf vChi2, vDist, vRsum, vDistXY, vDistZ;
std::vector<std::pair<o2::track::TrackParCov, o2::track::TrackParCov>> vChi2Trks, vDistTrks, vDistZTrks;
void printStats() const
{
LOGP(info, "+-+_+_+_+_+_+__+_+_+_+_+_+_+_++__++__+++_+_+_+__++_+_");
Expand Down Expand Up @@ -220,17 +222,28 @@ class DCAFitterN
float getMasStep() const { return mMaxStep; }
float getMinXSeed() const { return mMinXSeed; }

void setDebug(int curId, bool shutup)
bool bDistZ, bChi2;
void setDebug(int curId, bool shutup, o2::track::TrackParCov const& seedP, o2::track::TrackParCov const& seedN)
{
mSeedP = seedP;
mSeedN = seedN;
mDebug = true;
mShutup = shutup;
LOG_IF(info, mDebug && !mShutup) << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Current failed Track = " << mCurID;
mCurID = curId;
bDistZ = bChi2 = false;
mCrossings.setDebug(shutup);
}
void unsetDebug()
{
LOG_IF(info, mDebug && !mShutup) << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
if (mCrossings.bDistXY) {
vDistTrks.emplace_back(mSeedP, mSeedN);
} else if (bChi2) {
vChi2Trks.emplace_back(mSeedP, mSeedN);
} else if (bDistZ) {
vDistZTrks.emplace_back(mSeedP, mSeedN);
}
mDebug = false;
mCrossings.unsetDebug();
}
Expand Down Expand Up @@ -1056,6 +1069,7 @@ bool DCAFitterN<N, Args...>::minimizeChi2NoErr()
if (!ret && mDebug) {
++nChi2;
vChi2.push_back(mChi2[mCurHyp]);
bChi2 = true;
}
return ret;
}
Expand All @@ -1072,6 +1086,7 @@ bool DCAFitterN<N, Args...>::roughDZCut()
if (zdist > mMaxDZIni) {
if (mDebug) {
vDistZ.push_back(zdist);
bDistZ = true;
}
LOG_IF(info, mDebug && !mShutup) << " i=" << i << " j=" << j << " ~~~~> zCut failed: " << zdist;
accept = false;
Expand Down
18 changes: 13 additions & 5 deletions Detectors/Vertexing/src/SVertexer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,27 @@ void SVertexer::process(const o2::globaltracking::RecoContainer& recoData, o2::f
LOG_IF(info, mUseDebug) << "Thread = " << i;
const auto& f = mFitterV0[i];
f.printStats();
for (const auto& e : f.vChi2) {
for (int j{0}; j < f.vChi2.size(); ++j) {
mDebugStream << "pChi2"
<< "chi2=" << e << "\n";
<< "chi2=" << f.vChi2[j]
<< "seedP=" << f.vChi2Trks[j].first
<< "seedN=" << f.vChi2Trks[j].second
<< "\n";
}
for (const auto& e : f.vDistZ) {
for (int j{0}; j < f.vDistZ.size(); ++j) {
mDebugStream << "pDistZ"
<< "z=" << e << "\n";
<< "z=" << f.vDistZ[j]
<< "seedP=" << f.vDistZTrks[j].first
<< "seedN=" << f.vDistZTrks[j].second
<< "\n";
}
for (int j{0}; j < f.vDist.size(); ++j) {
mDebugStream << "pDist"
<< "xy=" << f.vDistXY[j]
<< "rsum=" << f.vRsum[j]
<< "dist=" << f.vDist[j]
<< "seedP=" << f.vDistTrks[j].first
<< "seedN=" << f.vDistTrks[j].second
<< "\n";
}
}
Expand Down Expand Up @@ -591,7 +599,7 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
int nCand = fitterV0.process(seedP, seedN);
if (nCand == 0) { // discard this pair
if (check) {
fitterV0.setDebug(nProcess++, true);
fitterV0.setDebug(nProcess++, true, seedP, seedN);
// LOGP(info, "Label: 0");
// seedP.gid.print();
// lbl0.print();
Expand Down

0 comments on commit 854c628

Please sign in to comment.