Skip to content

Commit 401ffcb

Browse files
committed
Fixes in Prim.vertexer
1 parent 3dc11a1 commit 401ffcb

5 files changed

Lines changed: 24 additions & 6 deletions

File tree

Detectors/GlobalTrackingWorkflow/src/PrimaryVertexReaderSpec.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void PrimaryVertexReader::run(ProcessingContext& pc)
3939

4040
pc.outputs().snapshot(Output{"GLO", "PVTX", 0, Lifetime::Timeframe}, mVertices);
4141
pc.outputs().snapshot(Output{"GLO", "PVTX_TRMTC", 0, Lifetime::Timeframe}, mPV2MatchIdx);
42-
pc.outputs().snapshot(Output{"GLO", "PVTX_TRMTCREF", 0, Lifetime::Timeframe}, mPV2MatchIdxRef);
42+
pc.outputs().snapshot(Output{"GLO", "PVTX_TRMTCREFS", 0, Lifetime::Timeframe}, mPV2MatchIdxRef);
4343

4444
if (mUseMC) {
4545
pc.outputs().snapshot(Output{"GLO", "PVTX_MCTR", 0, Lifetime::Timeframe}, mLabels);
@@ -108,7 +108,7 @@ DataProcessorSpec getPrimaryVertexReaderSpec(bool useMC)
108108
std::vector<OutputSpec> outputs;
109109
outputs.emplace_back("GLO", "PVTX", 0, Lifetime::Timeframe);
110110
outputs.emplace_back("GLO", "PVTX_TRMTC", 0, Lifetime::Timeframe);
111-
outputs.emplace_back("GLO", "PVTX_TRMTCREF", 0, Lifetime::Timeframe);
111+
outputs.emplace_back("GLO", "PVTX_TRMTCREFS", 0, Lifetime::Timeframe);
112112

113113
if (useMC) {
114114
outputs.emplace_back("GLO", "PVTX_MCTR", 0, Lifetime::Timeframe);

Detectors/GlobalTrackingWorkflow/src/PrimaryVertexingSpec.cxx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@
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

2124
using namespace o2::framework;
2225

@@ -28,7 +31,18 @@ namespace vertexing
2831
void 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

Detectors/GlobalTrackingWorkflow/src/primary-vertexing-workflow.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
6565
}
6666
specs.emplace_back(o2::vertexing::getPrimaryVertexingSpec(validateWithFT0, useMC));
6767

68-
if (!disableMatching) {
68+
if (!disableMatching && !disableRootInp) {
6969
specs.emplace_back(o2::its::getITSTrackReaderSpec(false));
7070
specs.emplace_back(o2::tpc::getTPCTrackReaderSpec(false));
7171
specs.emplace_back(o2::vertexing::getVertexTrackMatcherSpec());

Detectors/Vertexing/src/PVertexer.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "DetectorsVertexing/PVertexer.h"
1616
#include "ReconstructionDataFormats/DCA.h"
17+
#include "DetectorsBase/Propagator.h"
1718
#include "Math/SMatrix.h"
1819
#include "Math/SVector.h"
1920
#include <numeric>
@@ -87,7 +88,7 @@ int PVertexer::process(gsl::span<const o2d::TrackTPCITS> tracksITSTPC, gsl::span
8788
int it = v2tRefsLoc[i].getFirstEntry(), itEnd = it + v2tRefsLoc[i].getEntries(), dest0 = vertexTrackIDs.size();
8889
for (; it < itEnd; it++) {
8990
auto& gid = vertexTrackIDs.emplace_back(vertexTrackIDsLoc[it], GIndex::TPCITS);
90-
gid.setBit(GIndex::Contributor);
91+
gid.setPVContributor();
9192
}
9293
v2tRefs.emplace_back(dest0, v2tRefsLoc[i].getEntries());
9394
LOG(DEBUG) << "#" << count++ << " " << vertices.back() << " | " << v2tRefs.back().getEntries() << " indices from " << v2tRefs.back().getFirstEntry(); // RS REM
@@ -429,6 +430,9 @@ void PVertexer::init()
429430
mFT0Params = &o2::ft0::InteractionTag::Instance();
430431
setTukey(mPVParams->tukey);
431432
initMeanVertexConstraint();
433+
434+
auto* prop = o2::base::Propagator::Instance();
435+
setBz(prop->getNominalBz());
432436
}
433437

434438
//___________________________________________________________________

Detectors/Vertexing/src/VertexTrackMatcher.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void VertexTrackMatcher::process(const gsl::span<const PVertex>& vertices,
134134
}
135135
auto& gid = trackIndex.emplace_back(gid0);
136136
if ((*vptr[src])[gid.getIndex()] > 1) {
137-
gid.setBit(GIndex::Ambiguous);
137+
gid.setAmbiguous();
138138
}
139139
}
140140

0 commit comments

Comments
 (0)