Skip to content

Commit bab583b

Browse files
committed
feat(kinkBuilder): use aod::BCs instead of aod::BCsWithTimestamps
The changes in this commit update the usage of the aod::BCsWithTimestamps data source to the more generic aod::BCs data source. This simplifies the code and removes the need for the specific BCsWithTimestamps data source, which is no longer required. The changes ensure that the kinkBuilder functionality continues to work with the updated data source.
1 parent 382d872 commit bab583b

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

PWGLF/TableProducer/Common/kinkBuilder.cxx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ struct kinkBuilder {
247247
}
248248

249249
template <class Tcolls, class Ttracks>
250-
void fillCandidateData(const Tcolls& collisions, const Ttracks& tracks, aod::AmbiguousTracks const& ambiguousTracks, aod::BCsWithTimestamps const& bcs)
250+
void fillCandidateData(const Tcolls& collisions, const Ttracks& tracks, aod::AmbiguousTracks const& ambiguousTracks, aod::BCs const& bcs)
251251
{
252252
svCreator.clearPools();
253253
svCreator.fillBC2Coll(collisions, bcs);
@@ -274,7 +274,7 @@ struct kinkBuilder {
274274
auto trackDaug = tracks.rawIteratorAt(svCand.tr1Idx);
275275

276276
auto const& collision = trackMoth.template collision_as<Tcolls>();
277-
auto const& bc = collision.template bc_as<aod::BCsWithTimestamps>();
277+
auto const& bc = collision.template bc_as<aod::BCs>();
278278
initCCDB(bc);
279279

280280
o2::dataformats::VertexBase primaryVertex;
@@ -401,34 +401,34 @@ struct kinkBuilder {
401401
}
402402
}
403403

404-
void initCCDB(aod::BCsWithTimestamps::iterator const& bc)
404+
void initCCDB(aod::BCs::iterator const& bc)
405405
{
406406
if (mRunNumber == bc.runNumber()) {
407407
return;
408408
}
409-
auto run3grp_timestamp = bc.timestamp();
409+
mRunNumber = bc.runNumber();
410410

411-
o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp<o2::parameters::GRPObject>(grpPath, run3grp_timestamp);
411+
o2::parameters::GRPObject* grpo = ccdb->getForRun<o2::parameters::GRPObject>(grpPath, mRunNumber);
412412
o2::parameters::GRPMagField* grpmag = 0x0;
413413
if (grpo) {
414414
o2::base::Propagator::initFieldFromGRP(grpo);
415415
if (inputBz < -990) {
416416
// Fetch magnetic field from ccdb for current collision
417417
mBz = grpo->getNominalL3Field();
418-
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << mBz << " kZG";
418+
LOG(info) << "Retrieved GRP for run " << mRunNumber << " with magnetic field of " << mBz << " kZG";
419419
} else {
420420
mBz = inputBz;
421421
}
422422
} else {
423-
grpmag = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(grpmagPath, run3grp_timestamp);
423+
grpmag = ccdb->getForRun<o2::parameters::GRPMagField>(grpmagPath, mRunNumber);
424424
if (!grpmag) {
425-
LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp;
425+
LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for run " << mRunNumber;
426426
}
427427
o2::base::Propagator::initFieldFromGRP(grpmag);
428428
if (inputBz < -990) {
429429
// Fetch magnetic field from ccdb for current collision
430430
mBz = std::lround(5.f * grpmag->getL3Current() / 30000.f);
431-
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << mBz << " kZG";
431+
LOG(info) << "Retrieved GRP for run " << mRunNumber << " with magnetic field of " << mBz << " kZG";
432432
} else {
433433
mBz = inputBz;
434434
}
@@ -440,12 +440,11 @@ struct kinkBuilder {
440440
mBBparamsDaug[5] = cfgBetheBlochParams->get("Daughter", "resolution");
441441

442442
fitter.setBz(mBz);
443-
mRunNumber = bc.runNumber();
444443
o2::base::Propagator::Instance()->setMatLUT(lut);
445444
LOG(info) << "Task initialized for run " << mRunNumber << " with magnetic field " << mBz << " kZG";
446445
}
447446

448-
void process(aod::Collisions const& collisions, TracksFull const& tracks, aod::AmbiguousTracks const& ambiTracks, aod::BCsWithTimestamps const& bcs)
447+
void process(aod::Collisions const& collisions, TracksFull const& tracks, aod::AmbiguousTracks const& ambiTracks, aod::BCs const& bcs)
449448
{
450449

451450
kinkCandidates.clear();

0 commit comments

Comments
 (0)