Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a5a8469
ITS: staggered tracking
f3sch Mar 3, 2026
724ab6a
ITS: various fixes also for GPU
f3sch Mar 3, 2026
9026690
ITS: fix vertexer and move new types
f3sch Mar 5, 2026
28c8f1e
ITS: format
f3sch Mar 5, 2026
ac5e647
ITS: account for layer ROF bias in tracker
f3sch Mar 10, 2026
5ac4d54
ITS: sort tracks in time by lower edge
f3sch Mar 11, 2026
3dbfb76
ITS: ensure mc labels are nullptr
f3sch Mar 11, 2026
03d5582
ITSMFT: account for possible delay of received ROFs
f3sch Mar 11, 2026
d15f4bd
ITS: staggered STF decoder
f3sch Mar 11, 2026
a283dad
ITS: fix track time-assignment
f3sch Mar 12, 2026
37c9905
ITS: output vertices
f3sch Mar 13, 2026
5941b66
ITS: add macro to check staggering in data
f3sch Mar 13, 2026
00fde1d
Adapt ITS/MFT CTF machinery to staggered data
shahor02 Mar 14, 2026
36eba63
Fix compilation of ALICE3 tracking with staggering
mpuccio Mar 3, 2026
8de4135
Merge pull request #51 from shahor02/its_stag
f3sch Mar 16, 2026
6cecb46
Merge pull request #53 from mpuccio/its/trk/stag
f3sch Mar 16, 2026
7e038b4
ITS: modify staggering macro
f3sch Mar 16, 2026
00e49d9
ITSMFT: runtime staggering option
f3sch Mar 16, 2026
46dbe6b
ITSMFT: fix instantiation in namespace
f3sch Mar 16, 2026
cea6567
ITS3: fix compilation
f3sch Mar 16, 2026
a4501d5
Raw,CTF: add option to specify base cache dir for remote files
f3sch Mar 17, 2026
7606e68
ITS: tracking same as dev
f3sch Mar 17, 2026
f7ecc2d
ITS: add back datastreams
f3sch Mar 17, 2026
678b002
ITSMFT: improve logging
f3sch Mar 18, 2026
2e80fb9
ITS: add rofs for vertices back
f3sch Mar 18, 2026
10e66c2
add copyright to macro
f3sch Mar 18, 2026
928c399
ITS: hide print functions for device code
f3sch Mar 18, 2026
e00107b
ITSMFT: add shim file for alpide param
f3sch Mar 18, 2026
cc0d527
try to fix macro compilation
f3sch Mar 18, 2026
e714bcf
Avoid wildcarded subspecs in Digit/ClusterWriter
shahor02 Mar 18, 2026
103e115
Merge pull request #54 from shahor02/its_stag
f3sch Mar 18, 2026
3af5787
ITS: fix rof lut to work properly with added errors
f3sch Mar 18, 2026
7dec001
Fix/add some staggering options
shahor02 Mar 18, 2026
436ad9a
Add ITS/MFT staggering options to dpl-workflow.sh
shahor02 Mar 18, 2026
3ca055f
ITS: try fix for QC
f3sch Mar 19, 2026
1807af3
ITS: fix ROFLookpTables warning
f3sch Mar 19, 2026
e302f5e
ITS: fix tracklet formatting
f3sch Mar 19, 2026
c9517f4
ITS: set BCData properly for ROFs
f3sch Mar 19, 2026
f308c7b
ITS: remove deprecated settings
f3sch Mar 19, 2026
a4587e8
ITS: fix cluster label access for non-staggered
f3sch Mar 19, 2026
31c8b5c
Merge pull request #55 from shahor02/its_stag
f3sch Mar 19, 2026
83e4ed3
ITSMFT: fix staggering wfx option for digit-writer-workflow
f3sch Mar 19, 2026
6a27708
Fix loop condition for ITS tracking layers
f3sch Mar 19, 2026
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 @@ -34,7 +34,7 @@
#include "ReconstructionDataFormats/TrackMCHMID.h"
#include "DataFormatsITSMFT/TrkClusRef.h"
#include "DataFormatsITSMFT/TopologyDictionary.h"
#include "ITSMFTBase/DPLAlpideParam.h"
#include "DataFormatsITSMFT/DPLAlpideParam.h"
// FIXME: ideally, the data formats definition should be independent of the framework
// collectData is using the input of ProcessingContext to extract the first valid
// header and the TF orbit from it
Expand Down
6 changes: 5 additions & 1 deletion DataFormats/Detectors/ITSMFT/ITS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@

o2_add_library(DataFormatsITS
SOURCES src/TrackITS.cxx
src/TimeEstBC.cxx
PUBLIC_LINK_LIBRARIES O2::ReconstructionDataFormats
O2::SimulationDataFormat
O2::DataFormatsITSMFT)

o2_target_root_dictionary(DataFormatsITS
HEADERS include/DataFormatsITS/TrackITS.h)
HEADERS include/DataFormatsITS/TrackITS.h
include/DataFormatsITS/Vertex.h
include/DataFormatsITS/TimeEstBC.h)
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef O2_TRACKINGITS_TIMEESTBC_H_
#define O2_TRACKINGITS_TIMEESTBC_H_

#include <limits>
#include <cstdint>
#include "CommonDataFormat/TimeStamp.h"
#include "GPUCommonRtypes.h"
#include "GPUCommonDef.h"
#include "GPUCommonMath.h"

namespace o2::its
{
// Time estimates are given in BC
// error needs to cover maximum 1 orbit
// this is an symmetric time error [t0-tE, t0+tE)
using TimeStampType = uint32_t;
using TimeStampErrorType = uint16_t;
class TimeEstBC : public o2::dataformats::TimeStampWithError<TimeStampType, TimeStampErrorType>
{
public:
using Base = o2::dataformats::TimeStampWithError<TimeStampType, TimeStampErrorType>;
GPUhdDefault() TimeEstBC() = default;
GPUhdi() TimeEstBC(TimeStampType t, TimeStampErrorType e) : Base(t, e) {}

// check if timestamps overlap within their interval
GPUhdi() bool isCompatible(const TimeEstBC& o) const noexcept
{
return !(upper() <= o.lower() || o.upper() <= lower());
}

GPUhdi() TimeEstBC& operator+=(const TimeEstBC& o) noexcept
{
add(o);
return *this;
}

GPUhdi() TimeEstBC operator+(const TimeEstBC& o) const noexcept
{
TimeEstBC res = *this;
res += o;
return res;
}

GPUhdi() TimeStampType upper() const noexcept
{
TimeStampType t = this->getTimeStamp();
TimeStampType e = this->getTimeStampError();
constexpr TimeStampType max = std::numeric_limits<TimeStampType>::max();
return (t > (max - e)) ? max : t + e;
}

GPUhdi() TimeStampType lower() const noexcept
{
TimeStampType t = this->getTimeStamp();
TimeStampType e = this->getTimeStampError();
return (t > e) ? (t - e) : 0u;
}

private:
// add the other timestmap to this one
// this assumes already that both overlap
GPUhdi() void add(const TimeEstBC& o) noexcept
{
const TimeStampType lo = o2::gpu::CAMath::Max(lower(), o.lower());
const TimeStampType hi = o2::gpu::CAMath::Min(upper(), o.upper());
const TimeStampType half = (hi - lo) / 2u;
this->setTimeStamp(lo + half);
this->setTimeStampError(static_cast<TimeStampErrorType>(half));
}

ClassDefNV(TimeEstBC, 1);
};
} // namespace o2::its

#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -16,11 +16,12 @@
#ifndef ALICEO2_ITS_TRACKITS_H
#define ALICEO2_ITS_TRACKITS_H

#include <vector>
#include <cstdint>

#include "GPUCommonDef.h"
#include "ReconstructionDataFormats/Track.h"
#include "CommonDataFormat/RangeReference.h"
#include "DataFormatsITS/TimeEstBC.h"

namespace o2
{
Expand All @@ -35,8 +36,7 @@ namespace its
class TrackITS : public o2::track::TrackParCov
{
enum UserBits {
kNextROF = 1 << 28,
kSharedClusters = 1 << 29
kSharedClusters = 1 << 28
};

using Cluster = o2::itsmft::Cluster;
Expand Down Expand Up @@ -93,6 +93,9 @@ class TrackITS : public o2::track::TrackParCov

bool isBetter(const TrackITS& best, float maxChi2) const;

GPUhdi() auto& getTimeStamp() { return mTime; }
GPUhdi() const auto& getTimeStamp() const { return mTime; }

GPUhdi() o2::track::TrackParCov& getParamIn() { return *this; }
GPUhdi() const o2::track::TrackParCov& getParamIn() const { return *this; }

Expand Down Expand Up @@ -122,8 +125,6 @@ class TrackITS : public o2::track::TrackParCov
}
int getNFakeClusters() const;

void setNextROFbit(bool toggle = true) { mClusterSizes = toggle ? (mClusterSizes | kNextROF) : (mClusterSizes & ~kNextROF); }
bool hasHitInNextROF() const { return mClusterSizes & kNextROF; }
void setSharedClusters(bool toggle = true) { mClusterSizes = toggle ? (mClusterSizes | kSharedClusters) : (mClusterSizes & ~kSharedClusters); }
bool hasSharedClusters() const { return mClusterSizes & kSharedClusters; }

Expand Down Expand Up @@ -157,9 +158,10 @@ class TrackITS : public o2::track::TrackParCov
ClusRefs mClusRef; ///< references on clusters
float mChi2 = 0.; ///< Chi2 for this track
uint32_t mPattern = 0; ///< layers pattern
unsigned int mClusterSizes = 0u;
uint32_t mClusterSizes = 0u; ///< 4bit packed cluster sizes
TimeEstBC mTime; ///< track time stamp with error in BC since start of TF, symmetrical

ClassDefNV(TrackITS, 6);
ClassDefNV(TrackITS, 7);
};

class TrackITSExt : public TrackITS
Expand All @@ -169,15 +171,13 @@ class TrackITSExt : public TrackITS
static constexpr int MaxClusters = 16; /// Prepare for overlaps and new detector configurations
using TrackITS::TrackITS; // inherit base constructors

GPUh() TrackITSExt(o2::track::TrackParCov&& parCov, short ncl, float chi2,
o2::track::TrackParCov&& outer, std::array<int, MaxClusters> cls)
GPUh() TrackITSExt(o2::track::TrackParCov&& parCov, short ncl, float chi2, o2::track::TrackParCov&& outer, std::array<int, MaxClusters> cls)
: TrackITS(parCov, chi2, outer), mIndex{cls}
{
setNumberOfClusters(ncl);
}

GPUh() TrackITSExt(o2::track::TrackParCov& parCov, short ncl, float chi2, std::uint32_t rof,
o2::track::TrackParCov& outer, std::array<int, MaxClusters> cls)
GPUh() TrackITSExt(o2::track::TrackParCov& parCov, short ncl, float chi2, std::uint32_t rof, o2::track::TrackParCov& outer, std::array<int, MaxClusters> cls)
: TrackITS(parCov, chi2, outer), mIndex{cls}
{
setNumberOfClusters(ncl);
Expand Down Expand Up @@ -212,7 +212,7 @@ class TrackITSExt : public TrackITS

private:
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);
ClassDefNV(TrackITSExt, 3);
};
} // namespace its
} // namespace o2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef O2_TRACKINGITS_VERTEX_H_
#define O2_TRACKINGITS_VERTEX_H_

#include "ReconstructionDataFormats/Vertex.h"
#include "SimulationDataFormat/MCCompLabel.h"
#include "DataFormatsITS/TimeEstBC.h"

namespace o2::its
{
using Vertex = o2::dataformats::Vertex<o2::its::TimeEstBC>;
using VertexLabel = std::pair<o2::MCCompLabel, float>;
} // namespace o2::its

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class o2::its::TrackITS + ;
#pragma link C++ class std::vector < o2::its::TrackITS> + ;

#pragma link C++ class o2::its::TimeEstBC + ;
#pragma link C++ class std::vector < o2::its::TimeEstBC> + ;

#pragma link C++ class o2::dataformats::Vertex < o2::its::TimeEstBC> + ;
#pragma link C++ class std::vector < o2::dataformats::Vertex < o2::its::TimeEstBC>> + ;

#endif
13 changes: 13 additions & 0 deletions DataFormats/Detectors/ITSMFT/ITS/src/TimeEstBC.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "DataFormatsITS/TimeEstBC.h"
ClassImp(o2::its::TimeEstBC);
7 changes: 6 additions & 1 deletion DataFormats/Detectors/ITSMFT/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# Copyright 2019-2026 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
Expand All @@ -20,13 +20,18 @@ o2_add_library(DataFormatsITSMFT
src/TopologyDictionary.cxx
src/TimeDeadMap.cxx
src/CTF.cxx
src/DPLAlpideParam.cxx
src/DPLAlpideParamInitializer.cxx
PUBLIC_LINK_LIBRARIES O2::ITSMFTBase
O2::DetectorsCommonDataFormats
O2::ReconstructionDataFormats
O2::CommonUtils
Microsoft.GSL::GSL)

o2_target_root_dictionary(DataFormatsITSMFT
HEADERS include/DataFormatsITSMFT/ROFRecord.h
include/DataFormatsITSMFT/Digit.h
include/DataFormatsITSMFT/DPLAlpideParam.h
include/DataFormatsITSMFT/GBTCalibData.h
include/DataFormatsITSMFT/NoiseMap.h
include/DataFormatsITSMFT/TimeDeadMap.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ struct CTFHeader : public o2::ctf::CTFDictHeader {
uint32_t nPatternBytes = 0; /// number of bytes for explict patterns
uint32_t firstOrbit = 0; /// 1st orbit of TF
uint16_t firstBC = 0; /// 1st BC of TF
ClassDefNV(CTFHeader, 2);
uint8_t maxStreams = 1; /// Number of streams per TF (== NLayers for staggered ITS/MFT readout, 1 for non-staggered one)
uint8_t streamID = 0; /// ID of the stream (0:maxStreams-1)
ClassDefNV(CTFHeader, 3);
};

/// Compressed but not yet entropy-encoded clusters
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef ALICEO2_ITSMFTALPIDEPARAM_H_
#define ALICEO2_ITSMFTALPIDEPARAM_H_

#include "DetectorsCommonDataFormats/DetID.h"
#include "CommonUtils/ConfigurableParam.h"
#include "CommonUtils/ConfigurableParamHelper.h"
#include "CommonConstants/LHCConstants.h"
#include <string_view>

namespace o2
{
namespace itsmft
{
constexpr float DEFStrobeDelay = o2::constants::lhc::LHCBunchSpacingNS * 4; // ~100 ns delay

template <int N>
struct DPLAlpideParam : public o2::conf::ConfigurableParamHelper<DPLAlpideParam<N>> {
static constexpr int getNLayers()
{
return N == o2::detectors::DetID::ITS ? 7 : 10;
}

static constexpr std::string_view getParamName()
{
return N == o2::detectors::DetID::ITS ? ParamName[0] : ParamName[1];
}

int roFrameLengthInBC = DEFROFLengthBC(); ///< ROF length in BC for continuous mode
float roFrameLengthTrig = DEFROFLengthTrig(); ///< length of RO frame in ns for triggered mode
float strobeDelay = DEFStrobeDelay; ///< strobe start (in ns) wrt ROF start
float strobeLengthCont = -1.; ///< if < 0, full ROF length - delay
float strobeLengthTrig = 100.; ///< length of the strobe in ns (sig. over threshold checked in this window only)
int roFrameBiasInBC = DEFROFBiasInBC(); ///< bias of the start of ROF wrt orbit start: t_irof = (irof*roFrameLengthInBC + roFrameBiasInBC)*BClengthMUS
int roFrameLayerLengthInBC[getNLayers()] = {}; ///< staggering ROF length in BC for continuous mode per layer
int roFrameLayerBiasInBC[getNLayers()] = {}; ///< staggering ROF bias in BC for continuous mode per layer
int roFrameLayerDelayInBC[getNLayers()] = {}; ///< staggering ROF delay in BC for continuous mode per layer

// get ROF length for any layer
int getROFLengthInBC(int layer) const noexcept { return roFrameLayerLengthInBC[layer] ? roFrameLayerLengthInBC[layer] : roFrameLengthInBC; }
int getROFBiasInBC(int layer) const noexcept { return roFrameLayerBiasInBC[layer] ? roFrameLayerBiasInBC[layer] : roFrameBiasInBC; }
int getROFDelayInBC(int layer) const noexcept { return roFrameLayerDelayInBC[layer] ? roFrameLayerDelayInBC[layer] : 0; }

// boilerplate stuff + make principal key
O2ParamDef(DPLAlpideParam, getParamName().data());

private:
static constexpr std::string_view ParamName[2] = {"ITSAlpideParam", "MFTAlpideParam"};

static constexpr int DEFROFLengthBC()
{
// default ROF length in BC for continuous mode
// allowed values: 1,2,3,4,6,9,11,12,18,22,27,33,36
return N == o2::detectors::DetID::ITS ? o2::constants::lhc::LHCMaxBunches / 4 : o2::constants::lhc::LHCMaxBunches / 18;
}
static constexpr float DEFROFLengthTrig()
{
// length of RO frame in ns for triggered mode
return N == o2::detectors::DetID::ITS ? 6000. : 6000.;
}

static constexpr int DEFROFBiasInBC()
{
// default ROF length bias in MC, see https://github.com/AliceO2Group/AliceO2/pull/11108 for ITS
return N == o2::detectors::DetID::ITS ? 64 : 60;
}

static_assert(N == o2::detectors::DetID::ITS || N == o2::detectors::DetID::MFT, "only DetID::ITS orDetID:: MFT are allowed");
static_assert(o2::constants::lhc::LHCMaxBunches % DEFROFLengthBC() == 0); // make sure ROF length is divisor of the orbit
};

template <int N>
DPLAlpideParam<N> DPLAlpideParam<N>::sInstance;

} // namespace itsmft

namespace framework
{
template <typename T>
struct is_messageable;
template <>
struct is_messageable<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>> : std::true_type {
};
template <typename T>
struct is_messageable;
template <>
struct is_messageable<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::MFT>> : std::true_type {
};

} // namespace framework

} // namespace o2

#endif
Loading
Loading