Skip to content

Commit c985746

Browse files
authored
[ALICE3] Allow ACTS tracker in O2 (#15854)
1 parent 49f7d68 commit c985746

10 files changed

Lines changed: 1381 additions & 246 deletions

File tree

‎Detectors/Upgrades/ALICE3/ACTS/interface/src/MagneticFieldAdapter.cxx‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ MagneticFieldAdapter::MagneticFieldAdapter(o2::field::MagneticField* field) : mF
4646
"GRPGeomRequest of the workflow, or initialise the field explicitly with "
4747
"o2::base::Propagator::initFieldFromGRP().");
4848
}
49-
LOG(info) << "ACTS magnetic field adapter bound to O2 field '" << mField->GetName() << "'";
49+
LOG(debug) << "ACTS magnetic field adapter bound to O2 field '" << mField->GetName() << "'";
5050
}
5151

5252
Acts::MagneticFieldProvider::Cache MagneticFieldAdapter::makeCache(const Acts::MagneticFieldContext& /*mctx*/) const
@@ -59,14 +59,10 @@ Acts::MagneticFieldProvider::Cache MagneticFieldAdapter::makeCache(const Acts::M
5959
Acts::Result<Acts::Vector3> MagneticFieldAdapter::getField(const Acts::Vector3& position,
6060
Cache& /*cache*/) const
6161
{
62-
const double xyz[3] = {position[0] / Acts::UnitConstants::cm,
63-
position[1] / Acts::UnitConstants::cm,
64-
position[2] / Acts::UnitConstants::cm};
62+
const double xyz[3] = {position[0] / Acts::UnitConstants::cm, position[1] / Acts::UnitConstants::cm, position[2] / Acts::UnitConstants::cm};
6563
double bxyz[3] = {0., 0., 0.};
6664
mField->Field(xyz, bxyz);
67-
68-
return Acts::Result<Acts::Vector3>::success(
69-
Acts::Vector3{bxyz[0] * kGaussToActs, bxyz[1] * kGaussToActs, bxyz[2] * kGaussToActs});
65+
return Acts::Result<Acts::Vector3>::success(Acts::Vector3{bxyz[0] * kGaussToActs, bxyz[1] * kGaussToActs, bxyz[2] * kGaussToActs});
7066
}
7167

7268
} // namespace o2::acts

‎Detectors/Upgrades/ALICE3/GlobalReconstruction/reconstruction/CMakeLists.txt‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@
1010
# or submit itself to any jurisdiction.
1111

1212
if(Acts_FOUND)
13-
set(actsTarget Acts::Core)
13+
set(actsSources src/TrackerACTS.cxx)
14+
set(actsTarget
15+
Acts::Core
16+
O2::ACTSInterface
17+
O2::ALICE3ACTS
18+
ROOT::Tree
19+
ROOT::RIO)
1420
endif()
1521

1622
o2_add_library(ALICE3GlobalReconstruction
1723
TARGETVARNAME targetName
18-
SOURCES src/TimeFrame.cxx
24+
SOURCES src/TimeFrame.cxx ${actsSources}
1925
PUBLIC_LINK_LIBRARIES
2026
O2::ITStracking
2127
O2::GPUCommon

‎Detectors/Upgrades/ALICE3/GlobalReconstruction/reconstruction/include/ALICE3GlobalReconstruction/TimeFrameMixin.h‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ class TimeFrameMixin : public Base
7171
void deriveAndInitTiming(const std::array<gsl::span<const o2::trkft3::ROFRecord>, nLayers>& layerROFs);
7272

7373
const o2::InteractionRecord& getTFAnchorIR() const noexcept { return mTFAnchorIR; }
74+
const auto& getClusterSensorIDs() const noexcept { return mClusterSensorIDs; }
7475

7576
protected:
7677
void initTimingTables(const std::array<o2::its::LayerTiming, nLayers>& timings);
7778
void updateHostROFVertexLookupTable();
78-
79+
std::array<std::vector<int>, nLayers> mClusterSensorIDs;
7980
bool mTimingTablesInitialised{false};
8081
o2::InteractionRecord mTFAnchorIR{0, 0};
8182
};
@@ -205,6 +206,7 @@ int TimeFrameMixin<nLayers, Base>::loadROFsFromHitTree(TTree* hitsTree, Geometry
205206
this->mUnsortedClusters[iLayer].clear();
206207
this->mTrackingFrameInfo[iLayer].clear();
207208
this->mClusterExternalIndices[iLayer].clear();
209+
mClusterSensorIDs[iLayer].clear();
208210
this->mClusterSize[iLayer].clear();
209211
}
210212

@@ -228,6 +230,7 @@ int TimeFrameMixin<nLayers, Base>::loadROFsFromHitTree(TTree* hitsTree, Geometry
228230
this->mUnsortedClusters[iLayer].reserve(clusterCountPerLayer[iLayer]);
229231
this->mTrackingFrameInfo[iLayer].reserve(clusterCountPerLayer[iLayer]);
230232
this->mClusterExternalIndices[iLayer].reserve(clusterCountPerLayer[iLayer]);
233+
mClusterSensorIDs[iLayer].reserve(clusterCountPerLayer[iLayer]);
231234
this->mClusterSize[iLayer].reserve(clusterCountPerLayer[iLayer]);
232235
}
233236

@@ -294,6 +297,7 @@ int TimeFrameMixin<nLayers, Base>::loadROFsFromHitTree(TTree* hitsTree, Geometry
294297
std::array<float, 2>{trkXYZ.y(), trkXYZ.z()},
295298
std::array<float, 3>{resolution[layer] * resolution[layer], 0., resolution[layer] * resolution[layer]});
296299
this->addClusterToLayer(layer, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(), this->mUnsortedClusters[layer].size());
300+
mClusterSensorIDs[layer].push_back(hit.GetDetectorID());
297301
const int layerHitCounter = hitCounterPerLayer[layer]++;
298302
this->addClusterExternalIndexToLayer(layer, layerHitCounter);
299303
this->mClusterSize[layer].push_back(1);
@@ -344,10 +348,12 @@ int TimeFrameMixin<nLayers, Base>::loadROFrameData(const std::array<gsl::span<co
344348
this->mUnsortedClusters[iLayer].clear();
345349
this->mTrackingFrameInfo[iLayer].clear();
346350
this->mClusterExternalIndices[iLayer].clear();
351+
mClusterSensorIDs[iLayer].clear();
347352
this->mClusterSize[iLayer].clear();
348353
this->mUnsortedClusters[iLayer].reserve(layerClusters[iLayer].size());
349354
this->mTrackingFrameInfo[iLayer].reserve(layerClusters[iLayer].size());
350355
this->mClusterExternalIndices[iLayer].reserve(layerClusters[iLayer].size());
356+
mClusterSensorIDs[iLayer].reserve(layerClusters[iLayer].size());
351357
this->mClusterSize[iLayer].reserve(layerClusters[iLayer].size());
352358
}
353359

@@ -436,6 +442,7 @@ int TimeFrameMixin<nLayers, Base>::loadROFrameData(const std::array<gsl::span<co
436442
std::array<float, 2>{trkXYZ.y(), trkXYZ.z()},
437443
std::array<float, 3>{sigmaY2, 0.f, sigmaZ2});
438444
this->addClusterToLayer(iLayer, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(), this->mUnsortedClusters[iLayer].size());
445+
mClusterSensorIDs[iLayer].push_back(c.chipID);
439446
this->addClusterExternalIndexToLayer(iLayer, clusterId);
440447
this->mClusterSize[iLayer].push_back(std::clamp(static_cast<unsigned int>(c.size), 0u, 255u));
441448
}

0 commit comments

Comments
 (0)