Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Common/TableProducer/multiplicityTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ struct MultiplicityTableTaskIndexed {
ccdb->setURL("http://alice-ccdb.cern.ch");
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
ccdb->setFatalWhenNull(false); //don't fatal, please - exception is caught explicitly (as it should)
}

void processRun2(aod::Run2MatchedSparse::iterator const& collision, soa::Join<aod::Tracks, aod::TracksExtra> const& tracksExtra, aod::BCs const&, aod::Zdcs const&, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::FT0s const& ft0s)
Expand Down
19 changes: 17 additions & 2 deletions PWGLF/TableProducer/cascadebuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "DetectorsBase/Propagator.h"
#include "DetectorsBase/GeometryManager.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include <CCDB/BasicCCDBManager.h>

#include <TFile.h>
Expand Down Expand Up @@ -93,6 +94,8 @@ struct cascadeBuilder {
Configurable<float> dcabachtopv{"dcabachtopv", .1, "DCA Bach To PV"};
Configurable<bool> tpcrefit{"tpcrefit", false, "demand TPC refit"};
Configurable<double> v0radius{"v0radius", 0.9, "v0radius"};
Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};

int mRunNumber;
float d_bz;
Expand All @@ -110,6 +113,7 @@ struct cascadeBuilder {
ccdb->setURL("http://alice-ccdb.cern.ch");
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
ccdb->setFatalWhenNull(false);

auto lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>("GLO/Param/MatLUT"));

Expand All @@ -119,8 +123,19 @@ struct cascadeBuilder {
/* but what happens if the run changes while doing the processing? */
constexpr long run3grp_timestamp = (1619781650000 + 1619781529000) / 2;

o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp<o2::parameters::GRPObject>("GLO/GRP/GRP", run3grp_timestamp);
o2::base::Propagator::initFieldFromGRP(grpo);
o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp<o2::parameters::GRPObject>(grpPath, run3grp_timestamp);
o2::parameters::GRPMagField* grpmag = 0x0;
if (!grpo) {
grpmag = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(grpmagPath, run3grp_timestamp);
if (!grpmag) {
LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp;
}
}
if (grpo) {
o2::base::Propagator::initFieldFromGRP(grpo);
} else {
o2::base::Propagator::initFieldFromGRP(grpmag);
}
o2::base::Propagator::Instance()->setMatLUT(lut);
}
}
Expand Down
19 changes: 17 additions & 2 deletions PWGLF/TableProducer/lambdakzerobuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "DetectorsBase/Propagator.h"
#include "DetectorsBase/GeometryManager.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include <CCDB/BasicCCDBManager.h>

#include <TFile.h>
Expand Down Expand Up @@ -129,6 +130,8 @@ struct lambdakzeroBuilder {
Configurable<float> v0radius{"v0radius", 5.0, "v0radius"};
Configurable<int> useMatCorrType{"useMatCorrType", 0, "0: none, 1: TGeo, 2: LUT"};
Configurable<int> rejDiffCollTracks{"rejDiffCollTracks", 0, "rejDiffCollTracks"};
Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};

// for debugging
#ifdef MY_DEBUG
Expand All @@ -147,6 +150,7 @@ struct lambdakzeroBuilder {
ccdb->setURL("http://alice-ccdb.cern.ch");
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
ccdb->setFatalWhenNull(false);

auto lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>("GLO/Param/MatLUT"));

Expand All @@ -156,8 +160,19 @@ struct lambdakzeroBuilder {
/* but what happens if the run changes while doing the processing? */
constexpr long run3grp_timestamp = (1619781650000 + 1619781529000) / 2;

o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp<o2::parameters::GRPObject>("GLO/GRP/GRP", run3grp_timestamp);
o2::base::Propagator::initFieldFromGRP(grpo);
o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp<o2::parameters::GRPObject>(grpPath, run3grp_timestamp);
o2::parameters::GRPMagField* grpmag = 0x0;
if (!grpo) {
grpmag = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(grpmagPath, run3grp_timestamp);
if (!grpmag) {
LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp;
}
}
if (grpo) {
o2::base::Propagator::initFieldFromGRP(grpo);
} else {
o2::base::Propagator::initFieldFromGRP(grpmag);
}
o2::base::Propagator::Instance()->setMatLUT(lut);
}

Expand Down