Skip to content

Commit ec8e117

Browse files
sdudi123sandeep dudi
andauthored
[PWGLF] collision index is changed to prevent error while MC run (#14240)
Co-authored-by: sandeep dudi <sandeep.dudi@cern.ch>
1 parent 53c6339 commit ec8e117

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

PWGLF/Utils/svPoolCreator.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
#include "DCAFitter/DCAFitterN.h"
2323
#include "Framework/AnalysisDataModel.h"
2424

25-
using namespace o2;
26-
using namespace o2::constants;
27-
using namespace o2::framework;
28-
using namespace o2::framework::expressions;
29-
using std::array;
3025
using CollBracket = o2::math_utils::Bracket<int>;
3126

3227
constexpr uint64_t bOffsetMax = 241; // track compatibility can never go beyond 6 mus (ITS)
@@ -89,7 +84,7 @@ class svPoolCreator
8984
void appendTrackCand(const T& trackCand, const C& collisions, int pdgHypo, o2::aod::AmbiguousTracks const& ambiTracks, BC const&)
9085
{
9186
if (pdgHypo != track0Pdg && pdgHypo != track1Pdg) {
92-
LOG(debug) << "Wrong pdg hypothesis";
87+
LOGP(debug, "Wrong pdg hypothesis");
9388
return;
9489
}
9590
bool isDau0 = pdgHypo == track0Pdg;
@@ -134,12 +129,12 @@ class svPoolCreator
134129
}
135130

136131
// now loop over all the collisions to make the pool
137-
for (int i = firstCollIdx; i < collisions.size(); i++) {
138-
const auto& collision = collisions.rawIteratorAt(i);
132+
for (int collIdx = firstCollIdx; collIdx < collisions.size(); collIdx++) {
133+
const auto& collision = collisions.rawIteratorAt(collIdx);
139134
float collTime = collision.collisionTime();
140135
float collTimeRes2 = collision.collisionTimeRes() * collision.collisionTimeRes();
141136
uint64_t collBC = collision.template bc_as<BC>().globalBC();
142-
int collIdx = collision.globalIndex();
137+
// int collIdx = collision.globalIndex();
143138
int64_t bcOffset = globalBC - static_cast<int64_t>(collBC);
144139
if (static_cast<uint64_t>(std::abs(bcOffset)) > bOffsetMax) {
145140
if (bcOffset < 0) {
@@ -153,13 +148,13 @@ class svPoolCreator
153148
float trackTimeRes{0.};
154149
if (trackCand.isPVContributor()) {
155150
trackTime = trackCand.template collision_as<C>().collisionTime(); // if PV contributor, we assume the time to be the one of the collision
156-
trackTimeRes = constants::lhc::LHCBunchSpacingNS; // 1 BC
151+
trackTimeRes = o2::constants::lhc::LHCBunchSpacingNS; // 1 BC
157152
} else {
158153
trackTime = trackCand.trackTime();
159154
trackTimeRes = trackCand.trackTimeRes();
160155
}
161156

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

165160
float thresholdTime = 0.;

0 commit comments

Comments
 (0)