Skip to content

Commit

Permalink
Add vertices in both rofs
Browse files Browse the repository at this point in the history
  • Loading branch information
mconcas committed Jul 12, 2024
1 parent 5c3f627 commit 4f1e9eb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
23 changes: 16 additions & 7 deletions Detectors/ITSMFT/ITS/tracking/src/ClusterLines.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,24 @@ bool ClusterLines::operator==(const ClusterLines& rhs) const

GPUhdi() void ClusterLines::updateROFPoll(const Line& line)
{
// Boyer-Moore voting for rof label
if (mROFWeight == 0) {
// option 1: Boyer-Moore voting for rof label
// if (mROFWeight == 0) {
// mROF = line.getMinROF();
// mROFWeight = 1;
// } else {
// if (mROF == line.getMinROF()) {
// mROFWeight++;
// } else {
// mROFWeight--;
// }
// }

// option 2
if (mROF == -1) {
mROF = line.getMinROF();
mROFWeight = 1;
} else {
if (mROF == line.getMinROF()) {
mROFWeight++;
} else {
mROFWeight--;
if (line.getMinROF() < mROF) {
mROF = line.getMinROF();
}
}
}
Expand Down
21 changes: 17 additions & 4 deletions Detectors/ITSMFT/ITS/tracking/src/TimeFrame.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,30 @@ void TimeFrame::addPrimaryVertices(const std::vector<Vertex>& vertices, const in

void TimeFrame::addPrimaryVertices(const gsl::span<const Vertex>& vertices, const int rofId)
{
// auto rofId = mROFramesPV.size();
std::vector<Vertex> futureVertices;
for (const auto& vertex : vertices) {
mPrimaryVertices.emplace_back(vertex);
if (!isBeamPositionOverridden) {
if (vertex.getTimeStamp().getTimeStamp() < rofId) { // put a copy in the past
insertLateVertex(vertex);
} else {
if (vertex.getTimeStamp().getTimeStamp() > rofId) { // or put a copy in the future
futureVertices.emplace_back(vertex);
}
}
mPrimaryVertices.emplace_back(vertex); // put a copy in the present
if (!isBeamPositionOverridden) { // beam position is updated only at first occurrence of the vertex. A bit sketchy if we have past/future vertices, it should not impact too much.
const int w{vertex.getNContributors()};
mBeamPos[0] = (mBeamPos[0] * mBeamPosWeight + vertex.getX() * w) / (mBeamPosWeight + w);
mBeamPos[1] = (mBeamPos[1] * mBeamPosWeight + vertex.getY() * w) / (mBeamPosWeight + w);
mBeamPosWeight += w;
}
mROFramesPV.push_back(mPrimaryVertices.size()); // current rof must have number of vertices up to present

if (futureVertices.size() > 0) { // append future vertices. In the last rofId we cannot have ones from the next, so we are never here.
for (auto& vertex : futureVertices) {
mPrimaryVertices.emplace_back(vertex);
}
}
}
mROFramesPV.push_back(mPrimaryVertices.size());
}

// void TimeFrame::addPrimaryVertices(const std::vector<lightVertex>& lVertices)
Expand Down

0 comments on commit 4f1e9eb

Please sign in to comment.