Skip to content

Commit e6485fc

Browse files
DCA information never filled fix and protection implemented
1 parent 8861008 commit e6485fc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Common/TableProducer/trackextension.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ struct TrackExtensionTask {
4444
{
4545
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
4646
if ((cfgDcaMethod == 1) or (cfgDcaMethod == 2)) {
47-
o2::base::GeometryManager::loadGeometry();
48-
o2::base::Propagator::initFieldFromGRP();
49-
if (cfgDcaMethod == 2) {
47+
if (!o2::base::GeometryManager::isGeometryLoaded()) {
48+
o2::base::GeometryManager::loadGeometry();
49+
o2::base::Propagator::initFieldFromGRP();
5050
auto matLUTFile = o2::base::NameConf::getMatLUTFileName();
5151
if (o2::utils::Str::pathExists(matLUTFile)) {
5252
auto* lut = o2::base::MatLayerCylSet::loadFromFile(matLUTFile);
@@ -65,10 +65,10 @@ struct TrackExtensionTask {
6565
if (cfgDcaMethod == 1) {
6666
trackPar.propagateParamToDCA({collision.posX(), collision.posY(), collision.posZ()}, o2::base::Propagator::Instance()->getNominalBz(), &dca);
6767
} else if (cfgDcaMethod == 2) {
68-
o2::dataformats::DCA dcaInfo;
69-
if (o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackPar, 2., matCorr, &dca)) {
70-
dca[0] = dcaInfo.getY();
71-
dca[1] = dcaInfo.getZ();
68+
gpu::gpustd::array<float, 2> dcaInfo;
69+
if (o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackPar, 2.f, matCorr, &dcaInfo)) {
70+
dca[0] = dcaInfo[0];
71+
dca[1] = dcaInfo[1];
7272
}
7373
} else {
7474
float magField = 5.0; // in kG (FIXME: get this from CCDB)

0 commit comments

Comments
 (0)