Skip to content

Commit 7d159ea

Browse files
committed
Modify CA async opts, possible set from config.param
Print selected setthigs only once from the 1st pipeline. Rescale pT cutoffs by actual/nominal B-field. For this reason CA ITSTrackingInterface::initialise is moved inside ITSTrackingInterface::updateTimeDependentParams 1st call (during 1st TF processing).
1 parent 28d9c76 commit 7d159ea

File tree

8 files changed

+85
-9
lines changed

8 files changed

+85
-9
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct TrackingParameters {
6363
int CellMinimumLevel();
6464
int CellsPerRoad() const { return NLayers - 2; }
6565
int TrackletsPerRoad() const { return NLayers - 1; }
66+
std::string asString() const;
6667

6768
int NLayers = 7;
6869
int DeltaROF = 0;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@ struct VertexerParamConfig : public o2::conf::ConfigurableParamHelper<VertexerPa
5555

5656
struct TrackerParamConfig : public o2::conf::ConfigurableParamHelper<TrackerParamConfig> {
5757
// Use TGeo for mat. budget
58+
static const int MaxIter = 4;
59+
static const int MinTrackLenght = 4;
60+
static const int MaxTrackLenght = 7;
5861
bool useMatCorrTGeo = false; // use full geometry to corect for material budget accounting in the fits. Default is to use the material budget LUT.
5962
bool useFastMaterial = false; // use faster material approximation for material budget accounting in the fits.
6063
int deltaRof = 0; // configure the width of the window in ROFs to be considered for the tracking.
64+
int minTrackLgtIter[MaxIter] = {}; // minimum track length at each iteration, used only if >0, otherwise use code defaults
65+
float minPtIterLgt[MaxIter * (MaxTrackLenght - MinTrackLenght + 1)] = {}; // min.pT for given track length at this iteration, used only if >0, otherwise use code defaults
6166
float sysErrY2[7] = {0}; // systematic error^2 in Y per layer
6267
float sysErrZ2[7] = {0}; // systematic error^2 in Z per layer
6368
float maxChi2ClusterAttachment = -1.f;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class ITSTrackingInterface
7070
mMode = mode;
7171
}
7272

73+
auto getTracker() const { return mTracker.get(); }
74+
auto getVertexer() const { return mVertexer.get(); }
75+
7376
TimeFrame* mTimeFrame = nullptr;
7477

7578
protected:

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,31 @@ std::string asString(TrackingMode mode)
2828
return "unknown";
2929
}
3030

31+
std::string TrackingParameters::asString() const
32+
{
33+
std::string str = fmt::format("NZb:{} NPhB:{} NROFIt:{} PerVtx:{} DropFail:{} ClSh:{} TtklMinPt:{:.2f} MinCl:{}",
34+
ZBins, PhiBins, nROFsPerIterations, PerPrimaryVertexProcessing, DropTFUponFailure, ClusterSharing, TrackletMinPt, MinTrackLength);
35+
bool first = true;
36+
for (int il = NLayers; il >= MinTrackLength; il--) {
37+
int slot = NLayers - il;
38+
if (slot < (int)MinPt.size() && MinPt[slot] > 0) {
39+
if (first) {
40+
first = false;
41+
str += " MinPt: ";
42+
}
43+
str += fmt::format("L{}:{:.2f} ", il, MinPt[slot]);
44+
}
45+
}
46+
str += " SystErrY/Z:";
47+
for (size_t i = 0; i < SystErrorY2.size(); i++) {
48+
str += fmt::format("{:.2e}/{:.2e} ", SystErrorY2[i], SystErrorZ2[i]);
49+
}
50+
return str;
51+
}
52+
3153
std::ostream& operator<<(std::ostream& os, TrackingMode v)
3254
{
3355
os << asString(v);
3456
return os;
3557
}
36-
} // namespace o2::its
58+
} // namespace o2::its

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ void Tracker::rectifyClusterIndices()
481481
void Tracker::getGlobalConfiguration()
482482
{
483483
auto& tc = o2::its::TrackerParamConfig::Instance();
484-
tc.printKeyValues(true, true);
485484
if (tc.useMatCorrTGeo) {
486485
mTraits->setCorrType(o2::base::PropagatorImpl<float>::MatCorrType::USEMatCorrTGeo);
487486
} else if (tc.useFastMaterial) {

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

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "CommonDataFormat/IRFrame.h"
2424
#include "DetectorsBase/GRPGeomHelper.h"
2525
#include "ITStracking/TrackingConfigParam.h"
26+
#include "Framework/DeviceSpec.h"
2627

2728
namespace o2
2829
{
@@ -35,31 +36,55 @@ void ITSTrackingInterface::initialise()
3536
mCosmicsProcessing = false;
3637
std::vector<VertexingParameters> vertParams;
3738
std::vector<TrackingParameters> trackParams;
39+
const auto& trackConf = o2::its::TrackerParamConfig::Instance();
40+
float bFactor = std::abs(o2::base::Propagator::Instance()->getNominalBz()) / 5.0066791;
3841
if (mMode == TrackingMode::Unset) {
39-
mMode = (TrackingMode)(o2::its::TrackerParamConfig::Instance().trackingMode);
42+
mMode = (TrackingMode)(trackConf.trackingMode);
4043
LOGP(info, "Tracking mode not set, trying to fetch it from configurable params to: {}", asString(mMode));
4144
}
4245
if (mMode == TrackingMode::Async) {
43-
trackParams.resize(o2::its::TrackerParamConfig::Instance().doUPCIteration ? 4 : 3);
46+
trackParams.resize(trackConf.doUPCIteration ? 4 : 3);
4447
vertParams.resize(2); // The number of actual iterations will be set as a configKeyVal to allow for pp/PbPb choice
4548
trackParams[1].TrackletMinPt = 0.2f;
4649
trackParams[1].CellDeltaTanLambdaSigma *= 2.;
4750
trackParams[2].TrackletMinPt = 0.1f;
4851
trackParams[2].CellDeltaTanLambdaSigma *= 4.;
52+
53+
trackParams[0].MinPt[0] = 1.f / 12; // 7cl
54+
55+
trackParams[1].MinPt[0] = 1.f / 12; // 7cl
56+
4957
trackParams[2].MinTrackLength = 4;
50-
trackParams[2].MinPt[3] = 0.2f;
58+
trackParams[2].MinPt[0] = 1.f / 12; // 7cl
59+
trackParams[2].MinPt[1] = 1.f / 5; // 6cl
60+
trackParams[2].MinPt[2] = 1.f / 1; // 5cl
61+
trackParams[2].MinPt[3] = 1.f / 6; // 4cl
62+
5163
trackParams[2].StartLayerMask = (1 << 6) + (1 << 3);
5264
if (o2::its::TrackerParamConfig::Instance().doUPCIteration) {
65+
trackParams[3].MinTrackLength = 4;
5366
trackParams[3].TrackletMinPt = 0.1f;
5467
trackParams[3].CellDeltaTanLambdaSigma *= 4.;
55-
trackParams[3].MinTrackLength = 4;
5668
trackParams[3].DeltaROF = 0; // UPC specific setting
5769
}
58-
for (auto& param : trackParams) {
70+
for (size_t ip = 0; ip < trackParams.size(); ip++) {
71+
auto& param = trackParams[ip];
5972
param.ZBins = 64;
6073
param.PhiBins = 32;
6174
param.CellsPerClusterLimit = 1.e3f;
6275
param.TrackletsPerClusterLimit = 1.e3f;
76+
// check if something was overridden via configurable params
77+
if (ip < trackConf.MaxIter) {
78+
if (trackConf.minTrackLgtIter[ip] > 0) {
79+
param.MinTrackLength = trackConf.minTrackLgtIter[ip];
80+
}
81+
for (int ilg = trackConf.MaxTrackLenght; ilg >= trackConf.MinTrackLenght; ilg--) {
82+
int lslot0 = (trackConf.MaxTrackLenght - ilg), lslot = lslot0 + ip * (trackConf.MaxTrackLenght - trackConf.MinTrackLenght + 1);
83+
if (trackConf.minPtIterLgt[lslot] > 0.) {
84+
param.MinPt[lslot0] = trackConf.minPtIterLgt[lslot];
85+
}
86+
}
87+
}
6388
}
6489
LOGP(info, "Initializing tracker in async. phase reconstruction with {} passes for tracking and {}/{} for vertexing", trackParams.size(), o2::its::VertexerParamConfig::Instance().nIterations, vertParams.size());
6590
vertParams[1].phiCut = 0.015f;
@@ -95,6 +120,17 @@ void ITSTrackingInterface::initialise()
95120
for (auto& params : trackParams) {
96121
params.CorrType = o2::base::PropagatorImpl<float>::MatCorrType::USEMatCorrLUT;
97122
}
123+
124+
// adjust pT settings to actual mag. field
125+
for (size_t ip = 0; ip < trackParams.size(); ip++) {
126+
auto& param = trackParams[ip];
127+
for (int ilg = trackConf.MaxTrackLenght; ilg >= trackConf.MinTrackLenght; ilg--) {
128+
int lslot = trackConf.MaxTrackLenght - ilg;
129+
param.MinPt[lslot] *= bFactor;
130+
param.TrackletMinPt *= bFactor;
131+
}
132+
}
133+
98134
mTracker->setParameters(trackParams);
99135
mVertexer->setParameters(vertParams);
100136
}
@@ -345,7 +381,18 @@ void ITSTrackingInterface::updateTimeDependentParams(framework::ProcessingContex
345381
}
346382
GeometryTGeo* geom = GeometryTGeo::Instance();
347383
geom->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L, o2::math_utils::TransformType::T2GRot, o2::math_utils::TransformType::T2G));
384+
initialise();
348385
getConfiguration(pc);
386+
//
387+
if (pc.services().get<const o2::framework::DeviceSpec>().inputTimesliceId == 0) { // print settings only for the 1st pipeling
388+
o2::its::VertexerParamConfig::Instance().printKeyValues();
389+
o2::its::TrackerParamConfig::Instance().printKeyValues();
390+
const auto& trParams = mTracker->getParameters();
391+
for (size_t it = 0; it < trParams.size(); it++) {
392+
const auto& par = trParams[it];
393+
LOGP(info, "recoIter#{} : {}", it, par.asString());
394+
}
395+
}
349396
}
350397
}
351398

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ float Vertexer::clustersToVerticesHybrid(std::function<void(std::string s)> logg
103103
void Vertexer::getGlobalConfiguration()
104104
{
105105
auto& vc = o2::its::VertexerParamConfig::Instance();
106-
vc.printKeyValues(true, true);
107106
auto& grc = o2::its::ITSGpuTrackingParamConfig::Instance();
108107

109108
// This is odd: we override only the parameters for the first iteration.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void TrackerDPL::init(InitContext& ic)
4444
mITSTrackingInterface.setTraitsFromProvider(mChainITS->GetITSVertexerTraits(),
4545
mChainITS->GetITSTrackerTraits(),
4646
mChainITS->GetITSTimeframe());
47-
mITSTrackingInterface.initialise();
47+
// mITSTrackingInterface.initialise() will be called from the ITSTrackingInterface::updateTimeDependentParams at 1st initialization since it needs some run conditions
4848
}
4949

5050
void TrackerDPL::stop()

0 commit comments

Comments
 (0)