1313#include < vector>
1414#include " ReconstructionDataFormats/TrackTPCITS.h"
1515#include " DetectorsBase/Propagator.h"
16+ #include " DetectorsBase/GeometryManager.h"
1617#include " GlobalTrackingWorkflow/PrimaryVertexingSpec.h"
1718#include " SimulationDataFormat/MCEventLabel.h"
1819#include " CommonDataFormat/BunchFilling.h"
1920#include " SimulationDataFormat/DigitizationContext.h"
21+ #include " DetectorsCommonDataFormats/NameConf.h"
22+ #include " Framework/ConfigParamRegistry.h"
2023
2124using namespace o2 ::framework;
2225
@@ -28,7 +31,18 @@ namespace vertexing
2831void PrimaryVertexingSpec::init (InitContext& ic)
2932{
3033 // -------- init geometry and field --------//
34+ o2::base::GeometryManager::loadGeometry ();
3135 o2::base::Propagator::initFieldFromGRP (" o2sim_grp.root" );
36+ // this is a hack to provide Mat.LUT from the local file, in general will be provided by the framework from CCDB
37+ std::string matLUTPath = ic.options ().get <std::string>(" material-lut-path" );
38+ std::string matLUTFile = o2::base::NameConf::getMatLUTFileName (matLUTPath);
39+ if (o2::base::NameConf::pathExists (matLUTFile)) {
40+ auto * lut = o2::base::MatLayerCylSet::loadFromFile (matLUTFile);
41+ o2::base::Propagator::Instance ()->setMatLUT (lut);
42+ LOG (INFO) << " Loaded material LUT from " << matLUTFile;
43+ } else {
44+ LOG (INFO) << " Material LUT " << matLUTFile << " file is absent, only TGeo can be used" ;
45+ }
3246 mTimer .Stop ();
3347 mTimer .Reset ();
3448 mVertexer .setValidateWithFT0 (mValidateWithFT0 );
@@ -108,7 +122,7 @@ DataProcessorSpec getPrimaryVertexingSpec(bool validateWithFT0, bool useMC)
108122 inputs,
109123 outputs,
110124 AlgorithmSpec{adaptFromTask<PrimaryVertexingSpec>(validateWithFT0, useMC)},
111- Options{}};
125+ Options{{ " material-lut-path " , VariantType::String, " " , { " Path of the material LUT file " }} }};
112126}
113127
114128} // namespace vertexing
0 commit comments