Skip to content

Commit 08e4039

Browse files
committed
Prepare settings and cleanup interface
1 parent 2208b8d commit 08e4039

File tree

10 files changed

+32
-52
lines changed

10 files changed

+32
-52
lines changed

Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackingInterface.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ class ITSTrackingInterface
3434
public:
3535
ITSTrackingInterface(bool isMC,
3636
int trgType,
37-
const TrackingMode trMode,
3837
const bool overrBeamEst)
3938
: mIsMC{isMC},
4039
mUseTriggers{trgType},
41-
mMode{trMode},
4240
mOverrideBeamEstimation{overrBeamEst}
4341
{
4442
}
@@ -47,6 +45,7 @@ class ITSTrackingInterface
4745
void setMeanVertex(const o2::dataformats::MeanVertexObject* v)
4846
{
4947
if (!v) {
48+
LOGP(error, "Mean Vertex Object is nullptr");
5049
return;
5150
}
5251
mMeanVertex = v;
@@ -61,6 +60,13 @@ class ITSTrackingInterface
6160

6261
// Custom
6362
void setTraitsFromProvider(VertexerTraits*, TrackerTraits*, TimeFrame*);
63+
void setTrackingMode(TrackingMode mode = TrackingMode::Unset)
64+
{
65+
if (mode == TrackingMode::Unset) {
66+
LOGP(fatal, "ITS Tracking mode Unset is meant to be a default. Specify the mode");
67+
}
68+
mMode = mode;
69+
}
6470

6571
private:
6672
bool mIsMC = false;

Detectors/ITSMFT/ITS/tracking/src/Tracker.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ void Tracker::rectifyClusterIndices()
455455
void Tracker::getGlobalConfiguration()
456456
{
457457
auto& tc = o2::its::TrackerParamConfig::Instance();
458+
tc.printKeyValues(true, true);
458459
if (tc.useMatCorrTGeo) {
459460
mTraits->setCorrType(o2::base::PropagatorImpl<float>::MatCorrType::USEMatCorrTGeo);
460461
} else if (tc.useFastMaterial) {

Detectors/ITSMFT/ITS/tracking/src/TrackingInterface.cxx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "DataFormatsTRD/TriggerRecord.h"
2323
#include "CommonDataFormat/IRFrame.h"
2424
#include "DetectorsBase/GRPGeomHelper.h"
25+
#include "ITStracking/TrackingConfigParam.h"
2526

2627
namespace o2
2728
{
@@ -33,9 +34,11 @@ void ITSTrackingInterface::initialise()
3334
mRunVertexer = true;
3435
mCosmicsProcessing = false;
3536
std::vector<TrackingParameters> trackParams;
36-
37+
if (mMode == TrackingMode::Unset) {
38+
mMode = (TrackingMode)(o2::its::TrackerParamConfig::Instance().trackingMode);
39+
LOGP(info, "Tracking mode not set, trying to fetch it from configurable params to: {}", asString(mMode));
40+
}
3741
if (mMode == TrackingMode::Async) {
38-
3942
trackParams.resize(3);
4043
for (auto& param : trackParams) {
4144
param.ZBins = 64;
@@ -49,7 +52,6 @@ void ITSTrackingInterface::initialise()
4952
trackParams[2].CellDeltaTanLambdaSigma *= 4.;
5053
trackParams[2].MinTrackLength = 4;
5154
LOG(info) << "Initializing tracker in async. phase reconstruction with " << trackParams.size() << " passes";
52-
5355
} else if (mMode == TrackingMode::Sync) {
5456
trackParams.resize(1);
5557
trackParams[0].ZBins = 64;
@@ -322,7 +324,7 @@ void ITSTrackingInterface::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
322324
return;
323325
}
324326
if (matcher == ConcreteDataMatcher("GLO", "MEANVERTEX", 0)) {
325-
LOGP(info, "mean vertex acquired");
327+
LOGP(info, "Mean vertex acquired");
326328
setMeanVertex((const o2::dataformats::MeanVertexObject*)obj);
327329
return;
328330
}

Detectors/ITSMFT/ITS/tracking/src/Vertexer.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ float Vertexer::clustersToVerticesHybrid(std::function<void(std::string s)> logg
6767
void Vertexer::getGlobalConfiguration()
6868
{
6969
auto& vc = o2::its::VertexerParamConfig::Instance();
70+
vc.printKeyValues(true, true);
7071
auto& grc = o2::its::GpuRecoParamConfig::Instance();
7172

7273
VertexingParameters verPar;
@@ -90,8 +91,7 @@ void Vertexer::getGlobalConfiguration()
9091
verPar.PhiBins = vc.PhiBins;
9192

9293
TimeFrameGPUParameters tfGPUpar;
93-
tfGPUpar.maxGPUMemoryGB = grc.maxGPUMemoryGB;
94-
tfGPUpar.maxVerticesCapacity = grc.maxVerticesCapacity;
94+
tfGPUpar.nROFsPerChunk = grc.nROFsPerChunk;
9595

9696
mTraits->updateVertexingParameters(verPar, tfGPUpar);
9797
}

Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/TrackerSpec.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@
2323

2424
#include "ITStracking/TrackingInterface.h"
2525

26-
#include "GPUO2Interface.h"
27-
#include "GPUReconstruction.h"
28-
#include "GPUChainITS.h"
29-
#include "CommonUtils/StringUtils.h"
30-
#include "TStopwatch.h"
26+
#include "GPUDataTypes.h"
3127
#include "DetectorsBase/GRPGeomHelper.h"
3228

29+
#include "TStopwatch.h"
30+
3331
namespace o2
3432
{
3533
namespace its
@@ -41,9 +39,9 @@ class TrackerDPL : public framework::Task
4139
TrackerDPL(std::shared_ptr<o2::base::GRPGeomRequest> gr,
4240
bool isMC,
4341
int trgType,
44-
const TrackingMode& trMode,
42+
const TrackingMode& trMode = TrackingMode::Unset,
4543
const bool overrBeamEst = false,
46-
o2::gpu::GPUDataTypes::DeviceType dType = o2::gpu::GPUDataTypes::DeviceType::CPU);
44+
gpu::GPUDataTypes::DeviceType dType = gpu::GPUDataTypes::DeviceType::CPU);
4745
~TrackerDPL() override = default;
4846
void init(framework::InitContext& ic) final;
4947
void run(framework::ProcessingContext& pc) final;
@@ -60,7 +58,8 @@ class TrackerDPL : public framework::Task
6058
TStopwatch mTimer;
6159
};
6260

63-
framework::DataProcessorSpec getTrackerSpec(bool useMC, bool useGeom, int useTrig, const std::string& trModeS, const bool overrBeamEst, o2::gpu::GPUDataTypes::DeviceType dType);
61+
using o2::its::TrackingMode;
62+
framework::DataProcessorSpec getTrackerSpec(bool useMC, bool useGeom, int useTrig, const std::string& trMode, const bool overrBeamEst = false, gpu::GPUDataTypes::DeviceType dType = gpu::GPUDataTypes::DeviceType::CPU);
6463

6564
} // namespace its
6665
} // namespace o2

Detectors/ITSMFT/ITS/workflow/src/RecoWorkflow.cxx

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ namespace o2
3131
{
3232
namespace its
3333
{
34-
// using ITSTrackReconstruction::TrackingMode;
35-
3634
namespace reco_workflow
3735
{
3836

@@ -60,36 +58,7 @@ framework::WorkflowSpec getWorkflow(bool useMC,
6058
}
6159
if (!trmode.empty()) {
6260
if (useCAtracker) {
63-
if (useGPUWF) {
64-
o2::gpu::GPURecoWorkflowSpec::Config cfg;
65-
cfg.runITSTracking = true;
66-
cfg.itsTriggerType = useTrig;
67-
cfg.itsOverrBeamEst = overrideBeamPosition;
68-
cfg.itsTrackingMode = trmode == "sync" ? (int)TrackingMode::Sync : (trmode == "async" ? (int)TrackingMode::Async : (int)TrackingMode::Cosmics);
69-
70-
Inputs ggInputs;
71-
auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, true, false, true, true,
72-
useGeom ? o2::base::GRPGeomRequest::Aligned : o2::base::GRPGeomRequest::None,
73-
ggInputs, true);
74-
if (!useGeom) {
75-
ggRequest->addInput({"itsTGeo", "ITS", "GEOMTGEO", 0, Lifetime::Condition, framework::ccdbParamSpec("ITS/Config/Geometry")}, ggInputs);
76-
}
77-
78-
auto task = std::make_shared<o2::gpu::GPURecoWorkflowSpec>(&gPolicyData, cfg, std::vector<int>(), 0, ggRequest);
79-
gTask = task;
80-
Inputs taskInputs = task->inputs();
81-
Options taskOptions = task->options();
82-
std::move(ggInputs.begin(), ggInputs.end(), std::back_inserter(taskInputs));
83-
84-
specs.emplace_back(DataProcessorSpec{
85-
"its-tracker",
86-
taskInputs,
87-
task->outputs(),
88-
AlgorithmSpec{adoptTask<o2::gpu::GPURecoWorkflowSpec>(task)},
89-
taskOptions});
90-
} else {
91-
specs.emplace_back(o2::its::getTrackerSpec(useMC, useGeom, useTrig, trmode, overrideBeamPosition, dtype));
92-
}
61+
specs.emplace_back(o2::its::getTrackerSpec(useMC, useGeom, useTrig, trmode, overrideBeamPosition, dtype));
9362
} else {
9463
specs.emplace_back(o2::its::getCookedTrackerSpec(useMC, useGeom, useTrig, trmode));
9564
}

Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ TrackerDPL::TrackerDPL(std::shared_ptr<o2::base::GRPGeomRequest> gr,
3030
const bool overrBeamEst,
3131
o2::gpu::GPUDataTypes::DeviceType dType) : mGGCCDBRequest(gr),
3232
mRecChain{o2::gpu::GPUReconstruction::CreateInstance(dType, true)},
33-
mITSTrackingInterface{isMC, trgType, trMode, overrBeamEst}
33+
mITSTrackingInterface{isMC, trgType, overrBeamEst}
3434
{
35+
mITSTrackingInterface.setTrackingMode(trMode);
3536
}
3637

3738
void TrackerDPL::init(InitContext& ic)

GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ class GPURecoWorkflowSpec : public o2::framework::Task
127127
int lumiScaleType = 0; // 0=off, 1=CTP, 2=TPC scalers
128128
bool outputErrorQA = false;
129129
bool runITSTracking = false;
130-
int itsTrackingMode = 0; // 0=sync, 1=async, 2=cosmics
131130
bool itsOverrBeamEst = false;
132131
bool tpcTriggerHandling = false;
133132
};

GPU/Workflow/src/GPUWorkflowITS.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ void GPURecoWorkflowSpec::initFunctionITS(o2::framework::InitContext& ic)
3737
o2::its::TrackerTraits* trkTraits = nullptr;
3838
mITSTrackingInterface = std::make_unique<o2::its::ITSTrackingInterface>(mSpecConfig.processMC,
3939
mSpecConfig.itsTriggerType,
40-
static_cast<o2::its::TrackingMode>(mSpecConfig.itsTrackingMode),
4140
mSpecConfig.itsOverrBeamEst);
4241
mGPUReco->GetITSTraits(trkTraits, vtxTraits, mITSTimeFrame);
4342
mITSTrackingInterface->setTraitsFromProvider(vtxTraits, trkTraits, mITSTimeFrame);

GPU/Workflow/src/gpu-reco-workflow.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ enum struct ioType { Digits,
107107
SendClustersPerSector,
108108
ITSClusters,
109109
ITSTracks,
110+
MeanVertex,
110111
TPCTriggers };
111112

112113
static const std::unordered_map<std::string, ioType> InputMap{
@@ -117,7 +118,9 @@ static const std::unordered_map<std::string, ioType> InputMap{
117118
{"compressed-clusters-root", ioType::CompClustROOT},
118119
{"compressed-clusters-ctf", ioType::CompClustCTF},
119120
{"trd-tracklets", ioType::TRDTracklets},
120-
{"its-clusters", ioType::ITSClusters}};
121+
{"its-clusters", ioType::ITSClusters},
122+
{"its-mean-vertex", ioType::MeanVertex},
123+
};
121124

122125
static const std::unordered_map<std::string, ioType> OutputMap{
123126
{"clusters", ioType::Clusters},
@@ -183,6 +186,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
183186
cfg.enableDoublePipeline = cfgc.options().get<bool>("enableDoublePipeline");
184187
cfg.tpcDeadMapSources = cfgc.options().get<int>("tpc-deadMap-sources");
185188
cfg.runITSTracking = isEnabled(outputTypes, ioType::ITSTracks);
189+
cfg.itsOverrBeamEst = isEnabled(inputTypes, ioType::MeanVertex);
186190

187191
Inputs ggInputs;
188192
auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, true, false, true, true, o2::base::GRPGeomRequest::Aligned, ggInputs, true);

0 commit comments

Comments
 (0)