Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TrackITS : public o2::track::TrackParCov

public:
using o2::track::TrackParCov::TrackParCov; // inherit base constructors
static constexpr int MaxClusters = 7;
static constexpr int MaxClusters = 16;

TrackITS() = default;
TrackITS(const TrackITS& t) = default;
Expand Down Expand Up @@ -87,15 +87,15 @@ class TrackITS : public o2::track::TrackParCov
o2::track::TrackParCov& getParamOut() { return mParamOut; }
const o2::track::TrackParCov& getParamOut() const { return mParamOut; }

void setPattern(uint8_t p) { mPattern = p; }
void setPattern(uint16_t p) { mPattern = p; }
int getPattern() const { return mPattern; }
bool hasHitOnLayer(int i) { return mPattern & (0x1 << i); }

private:
o2::track::TrackParCov mParamOut; ///< parameter at largest radius
ClusRefs mClusRef; ///< references on clusters
float mChi2 = 0.; ///< Chi2 for this track
uint8_t mPattern = 0; ///< layers pattern
uint16_t mPattern = 0; ///< layers pattern

ClassDefNV(TrackITS, 4);
};
Expand All @@ -104,7 +104,7 @@ class TrackITSExt : public TrackITS
{
///< heavy version of TrackITS, with clusters embedded
public:
static constexpr int MaxClusters = 7;
static constexpr int MaxClusters = 16; /// Prepare for overlaps and new detector configurations
using TrackITS::TrackITS; // inherit base constructors

TrackITSExt(o2::track::TrackParCov&& parCov, short ncl, float chi2,
Expand Down Expand Up @@ -132,7 +132,7 @@ class TrackITSExt : public TrackITS
}

private:
std::array<int, MaxClusters> mIndex = {-1}; ///< Indices of associated clusters
std::array<int, MaxClusters> mIndex = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; ///< Indices of associated clusters
ClassDefNV(TrackITSExt, 2);
};
} // namespace its
Expand Down
2 changes: 1 addition & 1 deletion Detectors/ITSMFT/ITS/tracking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ o2_add_library(ITStracking
src/Label.cxx
src/PrimaryVertexContext.cxx
src/Road.cxx
src/StandaloneDebugger.cxx
# src/StandaloneDebugger.cxx
src/Tracker.cxx
src/TrackerTraitsCPU.cxx
src/TrackingConfigParam.cxx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace o2
{
namespace its
{

namespace GPU
{

Expand All @@ -38,83 +39,83 @@ class DeviceStoreNV final
DeviceStoreNV();

UniquePointer<DeviceStoreNV> initialise(const float3&,
const std::array<std::vector<Cluster>, constants::its::LayersNumber>&,
const std::array<std::vector<Tracklet>, constants::its::TrackletsPerRoad>&,
const std::array<std::vector<Cell>, constants::its::CellsPerRoad>&,
const std::array<std::vector<int>, constants::its::CellsPerRoad - 1>&,
const std::array<float, constants::its::LayersNumber>&,
const std::array<float, constants::its::LayersNumber>&);
const std::array<std::vector<Cluster>, constants::its2::LayersNumber>&,
const std::array<std::vector<Tracklet>, constants::its2::TrackletsPerRoad>&,
const std::array<std::vector<Cell>, constants::its2::CellsPerRoad>&,
const std::array<std::vector<int>, constants::its2::CellsPerRoad - 1>&,
const std::array<float, constants::its2::LayersNumber>&,
const std::array<float, constants::its2::LayersNumber>&);
GPU_DEVICE const float3& getPrimaryVertex();
GPU_HOST_DEVICE Array<Vector<Cluster>, constants::its::LayersNumber>& getClusters();
GPU_DEVICE Array<Array<int, constants::index_table::ZBins * constants::index_table::PhiBins + 1>,
constants::its::TrackletsPerRoad>&
GPU_HOST_DEVICE Array<Vector<Cluster>, constants::its2::LayersNumber>& getClusters();
GPU_DEVICE Array<Array<int, constants::its2::ZBins * constants::its2::PhiBins + 1>,
constants::its2::TrackletsPerRoad>&
getIndexTables();
GPU_HOST_DEVICE Array<Vector<Tracklet>, constants::its::TrackletsPerRoad>& getTracklets();
GPU_HOST_DEVICE Array<Vector<int>, constants::its::CellsPerRoad>& getTrackletsLookupTable();
GPU_HOST_DEVICE Array<Vector<int>, constants::its::CellsPerRoad>& getTrackletsPerClusterTable();
GPU_HOST_DEVICE Array<Vector<Cell>, constants::its::CellsPerRoad>& getCells();
GPU_HOST_DEVICE Array<Vector<int>, constants::its::CellsPerRoad - 1>& getCellsLookupTable();
GPU_HOST_DEVICE Array<Vector<int>, constants::its::CellsPerRoad - 1>& getCellsPerTrackletTable();
Array<Vector<int>, constants::its::CellsPerRoad>& getTempTableArray();
GPU_HOST_DEVICE Array<Vector<Tracklet>, constants::its2::TrackletsPerRoad>& getTracklets();
GPU_HOST_DEVICE Array<Vector<int>, constants::its2::CellsPerRoad>& getTrackletsLookupTable();
GPU_HOST_DEVICE Array<Vector<int>, constants::its2::CellsPerRoad>& getTrackletsPerClusterTable();
GPU_HOST_DEVICE Array<Vector<Cell>, constants::its2::CellsPerRoad>& getCells();
GPU_HOST_DEVICE Array<Vector<int>, constants::its2::CellsPerRoad - 1>& getCellsLookupTable();
GPU_HOST_DEVICE Array<Vector<int>, constants::its2::CellsPerRoad - 1>& getCellsPerTrackletTable();
Array<Vector<int>, constants::its2::CellsPerRoad>& getTempTableArray();

GPU_HOST_DEVICE float getRmin(int layer);
GPU_HOST_DEVICE float getRmax(int layer);

private:
UniquePointer<float3> mPrimaryVertex;
Array<Vector<Cluster>, constants::its::LayersNumber> mClusters;
Array<float, constants::its::LayersNumber> mRmin;
Array<float, constants::its::LayersNumber> mRmax;
Array<Array<int, constants::index_table::ZBins * constants::index_table::PhiBins + 1>, constants::its::TrackletsPerRoad>
Array<Vector<Cluster>, constants::its2::LayersNumber> mClusters;
Array<float, constants::its2::LayersNumber> mRmin;
Array<float, constants::its2::LayersNumber> mRmax;
Array<Array<int, constants::its2::ZBins * constants::its2::PhiBins + 1>, constants::its2::TrackletsPerRoad>
mIndexTables;
Array<Vector<Tracklet>, constants::its::TrackletsPerRoad> mTracklets;
Array<Vector<int>, constants::its::CellsPerRoad> mTrackletsLookupTable;
Array<Vector<int>, constants::its::CellsPerRoad> mTrackletsPerClusterTable;
Array<Vector<Cell>, constants::its::CellsPerRoad> mCells;
Array<Vector<int>, constants::its::CellsPerRoad - 1> mCellsLookupTable;
Array<Vector<int>, constants::its::CellsPerRoad - 1> mCellsPerTrackletTable;
Array<Vector<Tracklet>, constants::its2::TrackletsPerRoad> mTracklets;
Array<Vector<int>, constants::its2::CellsPerRoad> mTrackletsLookupTable;
Array<Vector<int>, constants::its2::CellsPerRoad> mTrackletsPerClusterTable;
Array<Vector<Cell>, constants::its2::CellsPerRoad> mCells;
Array<Vector<int>, constants::its2::CellsPerRoad - 1> mCellsLookupTable;
Array<Vector<int>, constants::its2::CellsPerRoad - 1> mCellsPerTrackletTable;
};

GPU_DEVICE inline const float3& DeviceStoreNV::getPrimaryVertex() { return *mPrimaryVertex; }

GPU_HOST_DEVICE inline Array<Vector<Cluster>, constants::its::LayersNumber>& DeviceStoreNV::getClusters()
GPU_HOST_DEVICE inline Array<Vector<Cluster>, constants::its2::LayersNumber>& DeviceStoreNV::getClusters()
{
return mClusters;
}

GPU_DEVICE inline Array<Array<int, constants::index_table::ZBins * constants::index_table::PhiBins + 1>,
constants::its::TrackletsPerRoad>&
GPU_DEVICE inline Array<Array<int, constants::its2::ZBins * constants::its2::PhiBins + 1>,
constants::its2::TrackletsPerRoad>&
DeviceStoreNV::getIndexTables()
{
return mIndexTables;
}

GPU_DEVICE inline Array<Vector<Tracklet>, constants::its::TrackletsPerRoad>& DeviceStoreNV::getTracklets()
GPU_DEVICE inline Array<Vector<Tracklet>, constants::its2::TrackletsPerRoad>& DeviceStoreNV::getTracklets()
{
return mTracklets;
}

GPU_DEVICE inline Array<Vector<int>, constants::its::CellsPerRoad>& DeviceStoreNV::getTrackletsLookupTable()
GPU_DEVICE inline Array<Vector<int>, constants::its2::CellsPerRoad>& DeviceStoreNV::getTrackletsLookupTable()
{
return mTrackletsLookupTable;
}

GPU_DEVICE inline Array<Vector<int>, constants::its::CellsPerRoad>& DeviceStoreNV::getTrackletsPerClusterTable()
GPU_DEVICE inline Array<Vector<int>, constants::its2::CellsPerRoad>& DeviceStoreNV::getTrackletsPerClusterTable()
{
return mTrackletsPerClusterTable;
}

GPU_HOST_DEVICE inline Array<Vector<Cell>, constants::its::CellsPerRoad>& DeviceStoreNV::getCells()
GPU_HOST_DEVICE inline Array<Vector<Cell>, constants::its2::CellsPerRoad>& DeviceStoreNV::getCells()
{
return mCells;
}

GPU_HOST_DEVICE inline Array<Vector<int>, constants::its::CellsPerRoad - 1>& DeviceStoreNV::getCellsLookupTable()
GPU_HOST_DEVICE inline Array<Vector<int>, constants::its2::CellsPerRoad - 1>& DeviceStoreNV::getCellsLookupTable()
{
return mCellsLookupTable;
}

GPU_HOST_DEVICE inline Array<Vector<int>, constants::its::CellsPerRoad - 1>&
GPU_HOST_DEVICE inline Array<Vector<int>, constants::its2::CellsPerRoad - 1>&
DeviceStoreNV::getCellsPerTrackletTable()
{
return mCellsPerTrackletTable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class DeviceStoreVertexerGPU final
~DeviceStoreVertexerGPU() = default;

UniquePointer<DeviceStoreVertexerGPU> initialise(const std::array<std::vector<Cluster>, constants::its::LayersNumberVertexer>&,
const std::array<std::array<int, constants::index_table::ZBins * constants::index_table::PhiBins + 1>,
const std::array<std::array<int, constants::its2::ZBins * constants::its2::PhiBins + 1>,
constants::its::LayersNumberVertexer>&);

// RO APIs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,83 +38,83 @@ class PrimaryVertexContextNV final : public PrimaryVertexContext
PrimaryVertexContextNV() = default;
virtual ~PrimaryVertexContextNV() = default;

virtual void initialise(const MemoryParameters& memParam, const std::array<std::vector<Cluster>, constants::its::LayersNumber>& cl,
const std::array<float, 3>& pv, const int iteration);
void initialise(const MemoryParameters& memParam, const std::array<std::vector<Cluster>, constants::its2::LayersNumber>& cl,
const std::array<float, 3>& pv, const int iteration);

GPU::DeviceStoreNV& getDeviceContext();
GPU::Array<GPU::Vector<Cluster>, constants::its::LayersNumber>& getDeviceClusters();
GPU::Array<GPU::Vector<Tracklet>, constants::its::TrackletsPerRoad>& getDeviceTracklets();
GPU::Array<GPU::Vector<int>, constants::its::CellsPerRoad>& getDeviceTrackletsLookupTable();
GPU::Array<GPU::Vector<int>, constants::its::CellsPerRoad>& getDeviceTrackletsPerClustersTable();
GPU::Array<GPU::Vector<Cell>, constants::its::CellsPerRoad>& getDeviceCells();
GPU::Array<GPU::Vector<int>, constants::its::CellsPerRoad - 1>& getDeviceCellsLookupTable();
GPU::Array<GPU::Vector<int>, constants::its::CellsPerRoad - 1>& getDeviceCellsPerTrackletTable();
std::array<GPU::Vector<int>, constants::its::CellsPerRoad>& getTempTableArray();
std::array<GPU::Vector<Tracklet>, constants::its::CellsPerRoad>& getTempTrackletArray();
std::array<GPU::Vector<Cell>, constants::its::CellsPerRoad - 1>& getTempCellArray();
GPU::Array<GPU::Vector<Cluster>, constants::its2::LayersNumber>& getDeviceClusters();
GPU::Array<GPU::Vector<Tracklet>, constants::its2::TrackletsPerRoad>& getDeviceTracklets();
GPU::Array<GPU::Vector<int>, constants::its2::CellsPerRoad>& getDeviceTrackletsLookupTable();
GPU::Array<GPU::Vector<int>, constants::its2::CellsPerRoad>& getDeviceTrackletsPerClustersTable();
GPU::Array<GPU::Vector<Cell>, constants::its2::CellsPerRoad>& getDeviceCells();
GPU::Array<GPU::Vector<int>, constants::its2::CellsPerRoad - 1>& getDeviceCellsLookupTable();
GPU::Array<GPU::Vector<int>, constants::its2::CellsPerRoad - 1>& getDeviceCellsPerTrackletTable();
std::array<GPU::Vector<int>, constants::its2::CellsPerRoad>& getTempTableArray();
std::array<GPU::Vector<Tracklet>, constants::its2::CellsPerRoad>& getTempTrackletArray();
std::array<GPU::Vector<Cell>, constants::its2::CellsPerRoad - 1>& getTempCellArray();
void updateDeviceContext();

private:
GPU::DeviceStoreNV mGPUContext;
GPU::UniquePointer<GPU::DeviceStoreNV> mGPUContextDevicePointer;
std::array<GPU::Vector<int>, constants::its::CellsPerRoad> mTempTableArray;
std::array<GPU::Vector<Tracklet>, constants::its::CellsPerRoad> mTempTrackletArray;
std::array<GPU::Vector<Cell>, constants::its::CellsPerRoad - 1> mTempCellArray;
std::array<GPU::Vector<int>, constants::its2::CellsPerRoad> mTempTableArray;
std::array<GPU::Vector<Tracklet>, constants::its2::CellsPerRoad> mTempTrackletArray;
std::array<GPU::Vector<Cell>, constants::its2::CellsPerRoad - 1> mTempCellArray;
};

inline GPU::DeviceStoreNV& PrimaryVertexContextNV::getDeviceContext()
{
return *mGPUContextDevicePointer;
}

inline GPU::Array<GPU::Vector<Cluster>, constants::its::LayersNumber>& PrimaryVertexContextNV::getDeviceClusters()
inline GPU::Array<GPU::Vector<Cluster>, constants::its2::LayersNumber>& PrimaryVertexContextNV::getDeviceClusters()
{
return mGPUContext.getClusters();
}

inline GPU::Array<GPU::Vector<Tracklet>, constants::its::TrackletsPerRoad>& PrimaryVertexContextNV::getDeviceTracklets()
inline GPU::Array<GPU::Vector<Tracklet>, constants::its2::TrackletsPerRoad>& PrimaryVertexContextNV::getDeviceTracklets()
{
return mGPUContext.getTracklets();
}

inline GPU::Array<GPU::Vector<int>, constants::its::CellsPerRoad>& PrimaryVertexContextNV::getDeviceTrackletsLookupTable()
inline GPU::Array<GPU::Vector<int>, constants::its2::CellsPerRoad>& PrimaryVertexContextNV::getDeviceTrackletsLookupTable()
{
return mGPUContext.getTrackletsLookupTable();
}

inline GPU::Array<GPU::Vector<int>, constants::its::CellsPerRoad>&
inline GPU::Array<GPU::Vector<int>, constants::its2::CellsPerRoad>&
PrimaryVertexContextNV::getDeviceTrackletsPerClustersTable()
{
return mGPUContext.getTrackletsPerClusterTable();
}

inline GPU::Array<GPU::Vector<Cell>, constants::its::CellsPerRoad>& PrimaryVertexContextNV::getDeviceCells()
inline GPU::Array<GPU::Vector<Cell>, constants::its2::CellsPerRoad>& PrimaryVertexContextNV::getDeviceCells()
{
return mGPUContext.getCells();
}

inline GPU::Array<GPU::Vector<int>, constants::its::CellsPerRoad - 1>& PrimaryVertexContextNV::getDeviceCellsLookupTable()
inline GPU::Array<GPU::Vector<int>, constants::its2::CellsPerRoad - 1>& PrimaryVertexContextNV::getDeviceCellsLookupTable()
{
return mGPUContext.getCellsLookupTable();
}

inline GPU::Array<GPU::Vector<int>, constants::its::CellsPerRoad - 1>&
inline GPU::Array<GPU::Vector<int>, constants::its2::CellsPerRoad - 1>&
PrimaryVertexContextNV::getDeviceCellsPerTrackletTable()
{
return mGPUContext.getCellsPerTrackletTable();
}

inline std::array<GPU::Vector<int>, constants::its::CellsPerRoad>& PrimaryVertexContextNV::getTempTableArray()
inline std::array<GPU::Vector<int>, constants::its2::CellsPerRoad>& PrimaryVertexContextNV::getTempTableArray()
{
return mTempTableArray;
}

inline std::array<GPU::Vector<Tracklet>, constants::its::CellsPerRoad>& PrimaryVertexContextNV::getTempTrackletArray()
inline std::array<GPU::Vector<Tracklet>, constants::its2::CellsPerRoad>& PrimaryVertexContextNV::getTempTrackletArray()
{
return mTempTrackletArray;
}

inline std::array<GPU::Vector<Cell>, constants::its::CellsPerRoad - 1>& PrimaryVertexContextNV::getTempCellArray()
inline std::array<GPU::Vector<Cell>, constants::its2::CellsPerRoad - 1>& PrimaryVertexContextNV::getTempCellArray()
{
return mTempCellArray;
}
Expand All @@ -124,11 +124,12 @@ inline void PrimaryVertexContextNV::updateDeviceContext()
mGPUContextDevicePointer = GPU::UniquePointer<GPU::DeviceStoreNV>{mGPUContext};
}

inline void PrimaryVertexContextNV::initialise(const MemoryParameters& memParam, const std::array<std::vector<Cluster>, constants::its::LayersNumber>& cl,
inline void PrimaryVertexContextNV::initialise(const MemoryParameters& memParam, const std::array<std::vector<Cluster>, constants::its2::LayersNumber>& cl,
const std::array<float, 3>& pv, const int iteration)
{
this->PrimaryVertexContext::initialise(memParam, cl, pv, iteration);
mGPUContextDevicePointer = mGPUContext.initialise(mPrimaryVertex, mClusters, mTracklets, mCells, mCellsLookupTable, mMinR, mMaxR);
///TODO: to be re-enabled in the future
// this->PrimaryVertexContext::initialise(memParam, cl, pv, iteration);
// mGPUContextDevicePointer = mGPUContext.initialise(mPrimaryVertex, mClusters, mTracklets, mCells, mCellsLookupTable, mMinR, mMaxR);
}

} // namespace its
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TrackerTraitsNV : public TrackerTraits

void computeLayerCells() final;
void computeLayerTracklets() final;
void refitTracks(const std::array<std::vector<TrackingFrameInfo>, 7>& tf, std::vector<TrackITSExt>& tracks) final;
void refitTracks(const std::array<std::vector<TrackingFrameInfo>, 7>& tf, std::vector<TrackITSExt>& tracks);
};

extern "C" TrackerTraits* createTrackerTraitsNV();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace its
{
class ROframe;

using constants::index_table::InversePhiBinSize;
using constants::its2::InversePhiBinSize;

class VertexerTraitsGPU : public VertexerTraits
{
Expand Down Expand Up @@ -69,7 +69,7 @@ class VertexerTraitsGPU : public VertexerTraits
inline GPUd() const int2 VertexerTraitsGPU::getBinsPhiRectWindow(const Cluster& currentCluster, float phiCut)
{
// This function returns the lowest PhiBin and the number of phi bins to be spanned, In the form int2{phiBinLow, PhiBinSpan}
const int phiBinMin{index_table_utils::getPhiBinIndex(
const int phiBinMin{constants::its2::getPhiBinIndex(
math_utils::getNormalizedPhiCoordinate(currentCluster.phiCoordinate - phiCut))};
const int phiBinSpan{static_cast<int>(MATH_CEIL(phiCut * InversePhiBinSize))};
return int2{phiBinMin, phiBinSpan};
Expand Down
Loading