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
25 changes: 14 additions & 11 deletions Common/TableProducer/propagationServiceV2.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in Common/TableProducer/propagationServiceV2.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -109,26 +109,29 @@
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext);
}

// Load MatLUT once (needs rectifyPtrFromFile, kept manual), set B-field per run from
// GRPMagField CCDB column, and refresh mMeanVtx pointer every call (pointer into current
// BC table, valid only for the duration of this process() invocation).
// Load MatLUT once (needs rectifyPtrFromFile, kept manual), set B-field and mean vertex
// once per run from GRPMagField/MeanVertex CCDB columns.
template <typename TBC>
void initCCDB(TBC const& bc0)
{
if (ccdbLoader.runNumber != bc0.runNumber()) {
LOG(info) << "Setting B-field to current " << bc0.grpMagField().getL3Current() << " A for run " << bc0.runNumber() << " from GRPMagField CCDB column";
o2::base::Propagator::initFieldFromGRP(&bc0.grpMagField());
ccdbLoader.mMeanVtx = &bc0.meanVertex();
ccdbLoader.runNumber = bc0.runNumber();
} else {
// Verify the CCDB column buffer has not been replaced mid-run.
// The deserialised pointer must be stable for the lifetime of a run.
if (&bc0.meanVertex() != ccdbLoader.mMeanVtx) {
LOG(fatal) << "MeanVertex CCDB column pointer changed within run " << bc0.runNumber() << " — unexpected buffer replacement";
}
}
if (!ccdbLoader.lut) {
LOG(info) << "Loading material look-up table for run: " << bc0.runNumber();
ccdbLoader.lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(
ccdb->template getForRun<o2::base::MatLayerCylSet>(standardCCDBLoaderConfigurables.lutPath.value, bc0.runNumber()));
o2::base::Propagator::Instance()->setMatLUT(ccdbLoader.lut);
}
// Always refresh: pointer into current BC table, invalidated after process() returns
ccdbLoader.mMeanVtx = &bc0.meanVertex();
if (ccdbLoader.runNumber != bc0.runNumber()) {
const auto& grpmag = bc0.grpMagField(); // from declarative CCDB column
LOG(info) << "Setting B-field to current " << grpmag.getL3Current() << " A for run " << bc0.runNumber() << " from GRPMagField CCDB column";
o2::base::Propagator::initFieldFromGRP(&grpmag);
ccdbLoader.runNumber = bc0.runNumber();
}
}

void processRealData(soa::Join<aod::Collisions, aod::EvSels> const& collisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtIU const& tracks, BCsWithCCDB const& bcs)
Expand Down
Loading