Skip to content

Commit 5ba3125

Browse files
authored
[PWGLF] Switch strangeness builders to use proper timestamps for matLUT (#9169)
1 parent be89ee4 commit 5ba3125

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

PWGLF/TableProducer/Strangeness/cascadebuilder.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,7 @@ struct cascadeBuilder {
543543
}
544544
}
545545
if (useMatCorrType == 2) {
546-
LOGF(info, "LUT correction requested, loading LUT");
547-
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>(ccdbConfigurations.lutPath));
546+
LOGF(info, "LUT correction requested, will load LUT when initializing with timestamp...");
548547
}
549548

550549
if (doprocessRun2 == false && doprocessRun3 == false && doprocessRun3withStrangenessTracking == false && doprocessRun3withKFParticle == false && doprocessFindableRun3 == false) {
@@ -756,9 +755,11 @@ struct cascadeBuilder {
756755
/// Set magnetic field for KF vertexing
757756
KFParticle::SetField(d_bz);
758757

759-
if (useMatCorrType == 2) {
758+
if (useMatCorrType == 2 && !lut) {
760759
// setMatLUT only after magfield has been initalized
761760
// (setMatLUT has implicit and problematic init field call if not)
761+
LOG(info) << "Loading material look-up table for timestamp: " << timestamp;
762+
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->getForTimeStamp<o2::base::MatLayerCylSet>(ccdbConfigurations.lutPath, timestamp));
762763
o2::base::Propagator::Instance()->setMatLUT(lut);
763764
}
764765
}

PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,7 @@ struct lambdakzeroBuilder {
543543
}
544544
}
545545
if (dcaFitterConfigurations.useMatCorrType == 2) {
546-
LOGF(info, "LUT correction requested, loading LUT");
547-
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>(ccdbConfigurations.lutPath));
548-
LOGF(info, "LUT load done!");
546+
LOGF(info, "LUT correction requested, will load LUT when initializing with timestamp...");
549547
}
550548

551549
if (doprocessRun2 == false && doprocessRun3 == false && doprocessFindableRun3 == false) {
@@ -739,9 +737,11 @@ struct lambdakzeroBuilder {
739737
// Set magnetic field value once known
740738
fitter.setBz(d_bz);
741739

742-
if (dcaFitterConfigurations.useMatCorrType == 2) {
740+
if (dcaFitterConfigurations.useMatCorrType == 2 && !lut) {
743741
// setMatLUT only after magfield has been initalized
744742
// (setMatLUT has implicit and problematic init field call if not)
743+
LOG(info) << "Loading material look-up table for timestamp: " << timestamp;
744+
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->getForTimeStamp<o2::base::MatLayerCylSet>(ccdbConfigurations.lutPath, timestamp));
745745
o2::base::Propagator::Instance()->setMatLUT(lut);
746746
}
747747
}

0 commit comments

Comments
 (0)