Skip to content

Commit 1bf1392

Browse files
committed
Adapt ITS3 tracker to work with 4th layer
1 parent dbff102 commit 1bf1392

9 files changed

Lines changed: 58 additions & 13 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class IndexTableUtils
4848
int mNzBins = 0;
4949
int mNphiBins = 0;
5050
float mInversePhiBinSize = 0.f;
51-
float mLayerZ[7] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f};
52-
float mInverseZBinSize[7] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f};
51+
std::vector<float> mLayerZ = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f};
52+
std::vector<float> mInverseZBinSize = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f};
5353
};
5454

5555
template <class T>
@@ -58,6 +58,10 @@ inline void IndexTableUtils::setTrackingParameters(const T& params)
5858
mInversePhiBinSize = params.PhiBins / constants::math::TwoPi;
5959
mNzBins = params.ZBins;
6060
mNphiBins = params.PhiBins;
61+
if (params.LayerZ.size() > 7) {
62+
mLayerZ.resize(params.LayerZ.size());
63+
mInverseZBinSize.resize(params.LayerZ.size());
64+
}
6165
for (int iLayer{0}; iLayer < params.LayerZ.size(); ++iLayer) {
6266
mLayerZ[iLayer] = params.LayerZ[iLayer];
6367
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ class TimeFrame
202202
void addTrackingFrameInfoToLayer(int layer, T&&... args);
203203
void addClusterExternalIndexToLayer(int layer, const int idx);
204204

205+
void resizeVectors(int nLayers);
206+
205207
/// Debug and printing
206208
void checkTrackletLUTs();
207209
void printROFoffsets();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ inline const int4 TrackerTraits::getBinsRect(const Cluster& currentCluster, int
136136

137137
inline void TrackerTraits::initialiseTimeFrame(const int iteration)
138138
{
139-
mTimeFrame->initialise(iteration, mTrkParams[iteration], 7);
139+
mTimeFrame->initialise(iteration, mTrkParams[iteration], mTrkParams[iteration].NLayers);
140140
setIsGPU(false);
141141
}
142142

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,20 @@ void TimeFrame::checkTrackletLUTs()
455455
}
456456
}
457457

458+
void TimeFrame::resizeVectors(int nLayers)
459+
{
460+
mMinR.resize(nLayers, 10000.);
461+
mMaxR.resize(nLayers, -1.);
462+
mClusters.resize(nLayers);
463+
mUnsortedClusters.resize(nLayers);
464+
mTrackingFrameInfo.resize(nLayers);
465+
mClusterExternalIndices.resize(nLayers);
466+
mUsedClusters.resize(nLayers);
467+
mROframesClusters.resize(nLayers, {0});
468+
mNClustersPerROF.resize(nLayers);
469+
mTrackletsIndexROf.resize(2, {0});
470+
}
471+
458472
void TimeFrame::printTrackletLUTonLayer(int i)
459473
{
460474
std::cout << "--------" << std::endl

Detectors/Upgrades/ITS3/macros/test/CheckClustersITS3.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ void CheckClustersITS3(std::string clusfile = "o2clus_it3.root", std::string hit
181181
auto chipID = cluster.getSensorID();
182182
if (pattID == o2::its3::CompCluster::InvalidPatternID || dict.isGroup(pattID)) {
183183
o2::itsmft::ClusterPattern patt(pattIt);
184-
locC = dict.getClusterCoordinates(cluster, patt, false, gman->getNumberOfLayers());
184+
locC = dict.getClusterCoordinates(cluster, patt, false, segs.size());
185185
LOGP(info, "I am invalid and I am on chip {}", chipID);
186186
} else {
187-
locC = dict.getClusterCoordinates(cluster, gman->getNumberOfLayers());
187+
locC = dict.getClusterCoordinates(cluster, segs.size());
188188
errX = dict.getErrX(pattID);
189189
errZ = dict.getErrZ(pattID);
190190
if (chipID >= segs.size()) {

Detectors/Upgrades/ITS3/macros/test/CheckTracksITS3.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void CheckTracksITS3(std::string tracfile = "o2trac_its3.root",
7373
std::string clusfile = "o2clus_it3.root",
7474
std::string kinefile = "o2sim_Kine.root",
7575
std::string magfile = "o2sim_grp.root",
76+
std::string inputGeom = "o2sim_geometry.root",
7677
bool batch = true)
7778
{
7879

@@ -94,7 +95,7 @@ void CheckTracksITS3(std::string tracfile = "o2trac_its3.root",
9495
double orig[3] = {0., 0., 0.};
9596
float bz = field->getBz(orig);
9697
// Geometry
97-
o2::base::GeometryManager::loadGeometry();
98+
o2::base::GeometryManager::loadGeometry(inputGeom);
9899
auto gman = o2::its::GeometryTGeo::Instance();
99100

100101
// MC tracks

Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,40 @@ int loadROFrameDataITS3(its::TimeFrame* tf,
3838

3939
std::vector<o2::its3::SegmentationSuperAlpide> segITS3;
4040
for (int iLayer{0}; iLayer < geom->getNumberOfLayers() - 4; ++iLayer) {
41-
segITS3.push_back(SegmentationSuperAlpide(iLayer));
41+
for (int iChip{0}; iChip < geom->getNumberOfChipsPerLayer(iLayer); ++iChip) {
42+
segITS3.push_back(SegmentationSuperAlpide(iLayer));
43+
}
4244
}
45+
int nChipsITS3 = segITS3.size();
4346

4447
tf->mNrof = 0;
4548
for (auto& rof : rofs) {
4649
for (int clusterId{rof.getFirstEntry()}; clusterId < rof.getFirstEntry() + rof.getNEntries(); ++clusterId) {
4750
auto& c = clusters[clusterId];
48-
4951
auto sensorID = c.getSensorID();
5052
int layer = layer = geom->getLayer(sensorID);
5153

5254
auto pattID = c.getPatternID();
5355
o2::math_utils::Point3D<float> locXYZ;
5456
float sigmaY2 = o2::its::ioutils::DefClusError2Row, sigmaZ2 = o2::its::ioutils::DefClusError2Col, sigmaYZ = 0; // Dummy COG errors (about half pixel size)
55-
float pitchRow = ((layer < geom->getNumberOfLayers() - 4) ? segITS3[layer].mPitchRow : o2::itsmft::SegmentationAlpide::PitchRow);
56-
float pitchCol = ((layer < geom->getNumberOfLayers() - 4) ? segITS3[layer].mPitchCol : o2::itsmft::SegmentationAlpide::PitchCol);
57+
float pitchRow = ((sensorID < nChipsITS3) ? segITS3[sensorID].mPitchRow : o2::itsmft::SegmentationAlpide::PitchRow);
58+
float pitchCol = ((sensorID < nChipsITS3) ? segITS3[sensorID].mPitchCol : o2::itsmft::SegmentationAlpide::PitchCol);
5759
if (pattID != its3::CompCluster::InvalidPatternID) {
5860
sigmaY2 = dict->getErr2X(pattID) * pitchRow * pitchRow;
5961
sigmaZ2 = dict->getErr2Z(pattID) * pitchCol * pitchCol;
6062
if (!dict->isGroup(pattID)) {
61-
locXYZ = dict->getClusterCoordinates(c, segITS3.size());
63+
locXYZ = dict->getClusterCoordinates(c, nChipsITS3);
6264
} else {
6365
o2::itsmft::ClusterPattern patt(pattIt);
64-
locXYZ = dict->getClusterCoordinates(c, patt, segITS3.size());
66+
locXYZ = dict->getClusterCoordinates(c, patt, nChipsITS3);
6567
sigmaY2 = patt.getRowSpan() * patt.getRowSpan() * pitchRow * pitchRow / 12.;
6668
sigmaZ2 = patt.getColumnSpan() * patt.getColumnSpan() * pitchCol * pitchCol / 12.;
6769
}
6870
} else {
6971
o2::itsmft::ClusterPattern patt(pattIt);
7072
sigmaY2 = patt.getRowSpan() * patt.getRowSpan() * pitchRow * pitchRow / 12.;
7173
sigmaZ2 = patt.getColumnSpan() * patt.getColumnSpan() * pitchCol * pitchCol / 12.;
72-
locXYZ = dict->getClusterCoordinates(c, patt, false, segITS3.size());
74+
locXYZ = dict->getClusterCoordinates(c, patt, false, nChipsITS3);
7375
}
7476

7577
// Transformation to the local --> global

Detectors/Upgrades/ITS3/workflow/include/ITS3Workflow/TrackerSpec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class TrackerDPL : public framework::Task
5656
bool mRunVertexer = true;
5757
bool mCosmicsProcessing = false;
5858
int mUseTriggers = 0;
59+
int mNLayers = 7;
5960
std::string mMode = "sync";
6061
std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
6162
const o2::its3::TopologyDictionary* mDict = nullptr;

Detectors/Upgrades/ITS3/workflow/src/TrackerSpec.cxx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "DataFormatsTRD/TriggerRecord.h"
3131
#include <ITS3Reconstruction/IOUtils.h>
3232
#include "ITSReconstruction/FastMultEstConfig.h"
33+
#include "ITS3Base/DescriptorInnerBarrelITS3Param.h"
3334
// #include "ITS3Reconstruction/FastMultEst.h"
3435

3536
namespace o2
@@ -57,6 +58,11 @@ void TrackerDPL::init(InitContext& ic)
5758
mTimer.Stop();
5859
mTimer.Reset();
5960
o2::base::GRPGeomHelper::instance().setRequest(mGGCCDBRequest);
61+
auto& paramGeom = DescriptorInnerBarrelITS3Param::Instance();
62+
if (paramGeom.getITS3LayerConfigString() == "FourLayers") {
63+
mNLayers = 8;
64+
}
65+
6066
mChainITS.reset(mRecChain->AddChain<o2::gpu::GPUChainITS>());
6167
mVertexer = std::make_unique<Vertexer>(mChainITS->GetITSVertexerTraits());
6268
mTracker = std::make_unique<Tracker>(mChainITS->GetITSTrackerTraits());
@@ -120,7 +126,21 @@ void TrackerDPL::init(InitContext& ic)
120126

121127
for (auto& params : trackParams) {
122128
params.CorrType = o2::base::PropagatorImpl<float>::MatCorrType::USEMatCorrLUT;
129+
params.NLayers = mNLayers;
130+
if (params.NLayers > 7) { // shift by one position OB radii and lengths
131+
params.LayerZ.resize(params.NLayers);
132+
params.LayerRadii.resize(params.NLayers);
133+
for (int iLayer{params.NLayers - 1}; iLayer >= params.NLayers - 4; iLayer--) {
134+
params.LayerZ[iLayer] = params.LayerZ[iLayer - 1];
135+
params.LayerRadii[iLayer] = params.LayerRadii[iLayer - 1];
136+
}
137+
}
138+
for (int iLayer{0}; iLayer < params.NLayers - 4; ++iLayer) { // initialise ITS3 radii and lengths
139+
params.LayerZ[iLayer] = paramGeom.mLength;
140+
params.LayerRadii[iLayer] = paramGeom.mRadii[iLayer];
141+
}
123142
}
143+
124144
mTracker->setParameters(trackParams);
125145
}
126146

@@ -181,6 +201,7 @@ void TrackerDPL::run(ProcessingContext& pc)
181201
auto& vertices = pc.outputs().make<std::vector<Vertex>>(Output{"IT3", "VERTICES", 0, Lifetime::Timeframe});
182202

183203
TimeFrame* timeFrame = mChainITS->GetITSTimeframe();
204+
timeFrame->resizeVectors(mNLayers);
184205
mTracker->adoptTimeFrame(*timeFrame);
185206

186207
mTracker->setBz(o2::base::Propagator::Instance()->getNominalBz());

0 commit comments

Comments
 (0)