Skip to content
Open
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
14 changes: 5 additions & 9 deletions PWGLF/Utils/svPoolCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
#include "DCAFitter/DCAFitterN.h"
#include "Framework/AnalysisDataModel.h"

using namespace o2;
using namespace o2::constants;
using namespace o2::framework;
using namespace o2::framework::expressions;
using std::array;
using CollBracket = o2::math_utils::Bracket<int>;

constexpr uint64_t bOffsetMax = 241; // track compatibility can never go beyond 6 mus (ITS)
Expand Down Expand Up @@ -59,7 +54,7 @@

void clearPools()
{
for (auto& pool : trackCandPool) {

Check failure on line 57 in PWGLF/Utils/svPoolCreator.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
pool.clear();
}
tmap.clear();
Expand Down Expand Up @@ -89,7 +84,7 @@
void appendTrackCand(const T& trackCand, const C& collisions, int pdgHypo, o2::aod::AmbiguousTracks const& ambiTracks, BC const&)
{
if (pdgHypo != track0Pdg && pdgHypo != track1Pdg) {
LOG(debug) << "Wrong pdg hypothesis";
LOGP(debug, "Wrong pdg hypothesis");
return;
}
bool isDau0 = pdgHypo == track0Pdg;
Expand Down Expand Up @@ -139,7 +134,8 @@
float collTime = collision.collisionTime();
float collTimeRes2 = collision.collisionTimeRes() * collision.collisionTimeRes();
uint64_t collBC = collision.template bc_as<BC>().globalBC();
int collIdx = collision.globalIndex();
// int collIdx = collision.globalIndex();
int collIdx = i;
int64_t bcOffset = globalBC - static_cast<int64_t>(collBC);
if (static_cast<uint64_t>(std::abs(bcOffset)) > bOffsetMax) {
if (bcOffset < 0) {
Expand All @@ -153,13 +149,13 @@
float trackTimeRes{0.};
if (trackCand.isPVContributor()) {
trackTime = trackCand.template collision_as<C>().collisionTime(); // if PV contributor, we assume the time to be the one of the collision
trackTimeRes = constants::lhc::LHCBunchSpacingNS; // 1 BC
trackTimeRes = o2::constants::lhc::LHCBunchSpacingNS; // 1 BC
} else {
trackTime = trackCand.trackTime();
trackTimeRes = trackCand.trackTimeRes();
}

const float deltaTime = trackTime - collTime + bcOffset * constants::lhc::LHCBunchSpacingNS;
const float deltaTime = trackTime - collTime + bcOffset * o2::constants::lhc::LHCBunchSpacingNS;
float sigmaTimeRes2 = collTimeRes2 + trackTimeRes * trackTimeRes;

float thresholdTime = 0.;
Expand Down Expand Up @@ -202,12 +198,12 @@
gsl::span<std::vector<TrackCand>> track1Pool{trackCandPool.data() + 2, 2};
std::array<std::vector<int>, 2> mVtxTrack0{}; // 1st pos. and neg. track of the kink pool for each vertex

for (int i = 0; i < 2; i++) {

Check failure on line 201 in PWGLF/Utils/svPoolCreator.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
mVtxTrack0[i].clear();
mVtxTrack0[i].resize(collisions.size(), -1);
}

for (int pn = 0; pn < 2; pn++) {

Check failure on line 206 in PWGLF/Utils/svPoolCreator.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
auto& vtxFirstT = mVtxTrack0[pn];
const auto& signTrack0Pool = track0Pool[pn];
for (unsigned i = 0; i < signTrack0Pool.size(); i++) {
Expand Down
Loading