Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions Common/TableProducer/propagationServiceRun2.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/propagationServiceRun2.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 @@ -91,6 +91,7 @@
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
ccdb->setURL(ccdburl.value);
ccdb->setFatalWhenNull(false);

// task-specific
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext);
Expand Down
32 changes: 22 additions & 10 deletions Common/Tools/StandardCCDBLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
// ConfigurableGroup with locations
struct StandardCCDBLoaderConfigurables : o2::framework::ConfigurableGroup {
std::string prefix = "ccdb";
o2::framework::Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 43 in Common/Tools/StandardCCDBLoader.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
o2::framework::Configurable<std::string> lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"};
o2::framework::Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
o2::framework::Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
o2::framework::Configurable<std::string> mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"};
};

Expand Down Expand Up @@ -81,25 +82,36 @@
return;
}

grpmag = ccdb->template getForRun<o2::parameters::GRPMagField>(cGroup.grpmagPath.value, currentRunNumber);
if (grpmag) {
LOG(info) << "Setting global propagator magnetic field to current " << grpmag->getL3Current() << " A for run " << currentRunNumber << " from its GRPMagField CCDB object";
o2::base::Propagator::initFieldFromGRP(grpmag);
} else {
LOGF(info, "GRPMagField object returned nullptr, will attempt alternate method");

o2::parameters::GRPObject* grpo = 0x0;
grpo = ccdb->template getForRun<o2::parameters::GRPObject>(cGroup.grpPath.value, currentRunNumber);
if (!grpo) {
LOG(fatal) << "Alternate path failed! Got nullptr from CCDB for path " << cGroup.grpPath << " of object GRPObject for run " << currentRunNumber;
}
o2::base::Propagator::initFieldFromGRP(grpo);
}
if (getMeanVertex) {
// only try this if explicitly requested
mMeanVtx = ccdb->template getForRun<o2::dataformats::MeanVertexObject>(cGroup.mVtxPath.value, currentRunNumber);
} else {
mMeanVtx = nullptr;
}

// load matLUT for this timestamp
if (!lut) {
LOG(info) << "Loading material look-up table for timestamp: " << currentRunNumber;
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->template getForRun<o2::base::MatLayerCylSet>(cGroup.lutPath.value, currentRunNumber));
} else {
LOG(info) << "Material look-up table already in place. Not reloading.";
}

grpmag = ccdb->template getForRun<o2::parameters::GRPMagField>(cGroup.grpmagPath.value, currentRunNumber);
LOG(info) << "Setting global propagator magnetic field to current " << grpmag->getL3Current() << " A for run " << currentRunNumber << " from its GRPMagField CCDB object";
o2::base::Propagator::initFieldFromGRP(grpmag);
LOG(info) << "Setting global propagator material propagation LUT";
o2::base::Propagator::Instance()->setMatLUT(lut);
if (getMeanVertex) {
// only try this if explicitly requested
mMeanVtx = ccdb->template getForRun<o2::dataformats::MeanVertexObject>(cGroup.mVtxPath.value, currentRunNumber);
} else {
mMeanVtx = nullptr;
}

runNumber = currentRunNumber;
}
Expand Down
Loading