Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional syst.error on tracks Y,Z covariance + extra debug output #8653

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Detectors/Vertexing/include/DetectorsVertexing/PVertexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class PVertexer
void dbscan_clusterize();
void doDBScanDump(const VertexingInput& input, gsl::span<const o2::MCCompLabel> lblTracks);
void doVtxDump(std::vector<PVertex>& vertices, std::vector<uint32_t> trackIDsLoc, std::vector<V2TRef>& v2tRefsLoc, gsl::span<const o2::MCCompLabel> lblTracks);
void doDBGPoolDump(gsl::span<const o2::MCCompLabel> lblTracks);

o2::BunchFilling mBunchFilling;
std::array<int16_t, o2::constants::lhc::LHCMaxBunches> mClosestBunchAbove; // closest filled bunch from above
Expand Down Expand Up @@ -168,6 +169,7 @@ class PVertexer
#ifdef _PV_DEBUG_TREE_
std::unique_ptr<TFile> mDebugDumpFile;
std::unique_ptr<TTree> mDebugDBScanTree;
std::unique_ptr<TTree> mDebugPoolTree;
std::unique_ptr<TTree> mDebugVtxTree;
std::unique_ptr<TTree> mDebugVtxCompTree;

Expand Down Expand Up @@ -231,6 +233,8 @@ void PVertexer::createTracksPool(const TR& tracks, gsl::span<const o2d::GlobalTr
for (uint32_t i = 0; i < ntGlo; i++) {
int id = sortedTrackID[i];
o2::track::TrackParCov trc = tracks[id];
trc.updateCov(mPVParams->sysErrY2, o2::track::kSigY2);
trc.updateCov(mPVParams->sysErrZ2, o2::track::kSigZ2);
if (!relateTrackToMeanVertex(trc, vtxErr2)) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ namespace vertexing
struct PVertexerParams : public o2::conf::ConfigurableParamHelper<PVertexerParams> {
static constexpr float kDefTukey = 5.0f; ///< def.value for tukey constant

float sysErrY2 = 0.; ///< systematic error on track Y error
float sysErrZ2 = 0.; ///< systematic error on track Z error

// DBSCAN clustering settings
float dbscanMaxDist2 = 9.; ///< distance^2 cut (eps^2).
float dbscanDeltaT = 10.; ///< abs. time difference cut, should be >= ITS ROF duration if ITS SA tracks used
Expand Down
31 changes: 30 additions & 1 deletion Detectors/Vertexing/src/PVertexer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ int PVertexer::runVertexing(const gsl::span<o2d::GlobalTrackID> gids, const gsl:
std::vector<PVertex>& vertices, std::vector<o2d::VtxTrackIndex>& vertexTrackIDs, std::vector<V2TRef>& v2tRefs,
gsl::span<const o2::MCCompLabel> lblTracks, std::vector<o2::MCEventLabel>& lblVtx)
{
#ifdef _PV_DEBUG_TREE_
doDBGPoolDump(lblTracks);
#endif
dbscan_clusterize();
std::vector<PVertex> verticesLoc;
std::vector<uint32_t> trackIDs;
Expand All @@ -49,7 +52,6 @@ int PVertexer::runVertexing(const gsl::span<o2d::GlobalTrackID> gids, const gsl:
#endif
findVertices(inp, verticesLoc, trackIDs, v2tRefsLoc);
}

// sort in time
std::vector<int> vtTimeSortID(verticesLoc.size());
std::iota(vtTimeSortID.begin(), vtTimeSortID.end(), 0);
Expand Down Expand Up @@ -633,6 +635,12 @@ void PVertexer::init()

#ifdef _PV_DEBUG_TREE_
mDebugDumpFile = std::make_unique<TFile>("pvtxDebug.root", "recreate");

mDebugPoolTree = std::make_unique<TTree>("pvtxTrackPool", "PVertexer tracks pool debug output");
mDebugPoolTree->Branch("trc", &mDebugDumpDBSTrc);
mDebugPoolTree->Branch("gid", &mDebugDumpDBSGID);
mDebugPoolTree->Branch("mc", &mDebugDumpDBSTrcMC);

mDebugDBScanTree = std::make_unique<TTree>("pvtxDBScan", "PVertexer DBScan debug output");
mDebugDBScanTree->Branch("trc", &mDebugDumpDBSTrc);
mDebugDBScanTree->Branch("gid", &mDebugDumpDBSGID);
Expand All @@ -655,10 +663,12 @@ void PVertexer::init()
void PVertexer::end()
{
#ifdef _PV_DEBUG_TREE_
mDebugPoolTree->Write();
mDebugDBScanTree->Write();
mDebugVtxCompTree->Write();
mDebugVtxTree->Write();
mDebugDBScanTree.reset();
mDebugDBScanTree.reset();
mDebugVtxCompTree.reset();
mDebugDumpFile->Close();
mDebugDumpFile.reset();
Expand Down Expand Up @@ -1018,6 +1028,25 @@ void PVertexer::doDBScanDump(const VertexingInput& input, gsl::span<const o2::MC
#endif
}

//______________________________________________
void PVertexer::doDBGPoolDump(gsl::span<const o2::MCCompLabel> lblTracks)
{
// dump tracks of the pool
#ifdef _PV_DEBUG_TREE_
for (const auto& trc : mTracksPool) {
mDebugDumpDBSTrc.emplace_back(TrackVFDump{trc.z, trc.sig2ZI, trc.timeEst.getTimeStamp(), trc.timeEst.getTimeStampError(), trc.wghHisto});
mDebugDumpDBSGID.push_back(trc.gid);
if (lblTracks.size()) {
mDebugDumpDBSTrcMC.push_back(lblTracks[trc.entry]);
}
}
mDebugPoolTree->Fill();
mDebugDumpDBSTrc.clear();
mDebugDumpDBSGID.clear();
mDebugDumpDBSTrcMC.clear();
#endif
}

//______________________________________________
void PVertexer::doVtxDump(std::vector<PVertex>& vertices, std::vector<uint32_t> trackIDsLoc, std::vector<V2TRef>& v2tRefsLoc,
gsl::span<const o2::MCCompLabel> lblTracks)
Expand Down