Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ad0805b
Time frame based ITS tracking
mpuccio Apr 10, 2021
6b71673
Hide MCCompLabel from CUDA, they hate each other
mpuccio Apr 10, 2021
b1c2c2e
Do the ROF loop internally
mpuccio Apr 11, 2021
92718a2
Fix cluster reading
mpuccio Apr 11, 2021
f4e5b14
Reset cluster counters for every layer
mpuccio Apr 12, 2021
89678f6
Fix index getter
mpuccio Apr 12, 2021
f46d737
Use continuous dynamic lookup tables
mpuccio Apr 23, 2021
2626502
Revert "Hide MCCompLabel from CUDA, they hate each other"
mpuccio Apr 23, 2021
ba52e12
First working version, one crash to be checked
mpuccio Apr 26, 2021
396f40b
Additional touches to the rebase
mpuccio Apr 26, 2021
bf78123
Fix cluster reading and LUT management
mpuccio May 11, 2021
1535554
Please consider the following formatting changes
alibuild May 11, 2021
7a40ff7
Fix vertices span and lut filling
mpuccio May 13, 2021
95c4ac6
Fix rof - primary vertex association
mpuccio May 19, 2021
eb84185
Group tracks per ROF in the output
mpuccio May 31, 2021
15f18ba
Integrated sync efficiency back to 72%
mpuccio Jun 16, 2021
9f688e8
Re-enable async in the macro: it works
mpuccio Jun 16, 2021
70edfa3
Uniform macro and TrackerSpec interfaces
mpuccio Jun 17, 2021
b88e3e7
Workflow adapted to the new 3+1D tracking
mpuccio Jun 18, 2021
3206e73
Please consider the following formatting changes
alibuild Jun 18, 2021
aaf34a6
Remove bogus std::cout
mpuccio Jun 18, 2021
dfa42ec
Debug variable should be protected
mpuccio Jun 21, 2021
dd56f6e
uint32_t -> unsigned int to fix nvcc compilation
mpuccio Jun 21, 2021
73e01bb
Bring back IRframe filling in the TrackerSpec
mpuccio Jun 21, 2021
014be7d
Use logger lambda function
mpuccio Jun 21, 2021
d4d1f60
Please consider the following formatting changes
alibuild Jun 21, 2021
28fe46a
Store full vertices in the TF, fix ALICE3 macros
mpuccio Jun 21, 2021
d091786
Fix primary vertex finder macro
mpuccio Jun 21, 2021
523f061
Fix bug for tracks in the first ROF
mpuccio Jun 23, 2021
b618de4
Properly deal with pileup vertices, fix efficiency
mpuccio Jun 24, 2021
359ab57
Better cluster LUT in the TimeFrame
mpuccio Jun 24, 2021
c203a5a
Include cstdint to fix CUDA compilation
mpuccio Jun 24, 2021
e4f6b8b
Fix includes for CUDA, reprise
mpuccio Jun 25, 2021
608c865
Allow to switch off multi rof reco
mpuccio Jun 28, 2021
1210690
Please consider the following formatting changes
alibuild Jun 28, 2021
3fbaa6a
Fix VertexerHIP compilation
mpuccio Jun 28, 2021
3a7dcc5
Fix constructors for GPU compilation
davidrohr Jun 29, 2021
1c44905
Fix tracklet LUT filling with multiROF
mpuccio Jul 20, 2021
e306453
Fix clang format
mpuccio Jul 20, 2021
2d39e6c
Add double ROF bit in the ITS track
mpuccio Aug 11, 2021
85fd5a6
Make cuda compilation work
mpuccio Aug 24, 2021
35978b2
"Optimised" async selections and better QA macro
mpuccio Aug 30, 2021
a41e49f
Fix ocl compilation complaints
mpuccio Aug 31, 2021
2096128
Make clang-tidy happy
mpuccio Sep 1, 2021
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 @@ -18,6 +18,7 @@

#include <vector>

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

Expand All @@ -33,20 +34,24 @@ namespace its

class TrackITS : public o2::track::TrackParCov
{
enum UserBits {
kNextROF = 1
};

using Cluster = o2::itsmft::Cluster;
using ClusRefs = o2::dataformats::RangeRefComp<4>;

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

TrackITS() = default;
TrackITS(const TrackITS& t) = default;
TrackITS(const o2::track::TrackParCov& parcov) : o2::track::TrackParCov{parcov} {}
TrackITS(const o2::track::TrackParCov& parCov, float chi2, const o2::track::TrackParCov& outer)
GPUdDefault() TrackITS() = default;
GPUdDefault() TrackITS(const TrackITS& t) = default;
GPUd() TrackITS(const o2::track::TrackParCov& parcov) : o2::track::TrackParCov{parcov} {}
GPUd() TrackITS(const o2::track::TrackParCov& parCov, float chi2, const o2::track::TrackParCov& outer)
: o2::track::TrackParCov{parCov}, mParamOut{outer}, mChi2{chi2} {}
TrackITS& operator=(const TrackITS& tr) = default;
~TrackITS() = default;
GPUdDefault() TrackITS& operator=(const TrackITS& tr) = default;
GPUdDefault() ~TrackITS() = default;

// These functions must be provided
bool propagate(float alpha, float x, float bz);
Expand Down Expand Up @@ -93,6 +98,9 @@ class TrackITS : public o2::track::TrackParCov
int getPattern() const { return mPattern; }
bool hasHitOnLayer(int i) { return mPattern & (0x1 << i); }

void setNextROFbit(bool toggle = true) { setUserField((getUserField() & ~kNextROF) | (-toggle & kNextROF)); }
bool hasHitInNextROF() const { return getUserField() & kNextROF; }

private:
o2::track::TrackParCov mParamOut; ///< parameter at largest radius
ClusRefs mClusRef; ///< references on clusters
Expand All @@ -109,8 +117,8 @@ class TrackITSExt : public TrackITS
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,
o2::track::TrackParCov&& outer, std::array<int, MaxClusters> cls)
GPUd() 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ class TrackParametrization
GPUd() bool isValid() const;
GPUd() void invalidate();

GPUd() uint16_t getUserField() const;
GPUd() void setUserField(uint16_t v);
GPUhd() uint16_t getUserField() const;
GPUhd() void setUserField(uint16_t v);

GPUd() void printParam() const;
#ifndef GPUCA_ALIGPUCODE
Expand Down Expand Up @@ -655,13 +655,13 @@ GPUdi() void TrackParametrization<value_T>::invalidate()
}

template <typename value_T>
GPUdi() uint16_t TrackParametrization<value_T>::getUserField() const
GPUhdi() uint16_t TrackParametrization<value_T>::getUserField() const
{
return mUserField;
}

template <typename value_T>
GPUdi() void TrackParametrization<value_T>::setUserField(uint16_t v)
GPUhdi() void TrackParametrization<value_T>::setUserField(uint16_t v)
{
mUserField = v;
}
Expand Down
30 changes: 15 additions & 15 deletions DataFormats/simulation/include/SimulationDataFormat/MCCompLabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ namespace o2
class MCCompLabel
{
private:
static constexpr ULong64_t ul0x1 = 0x1;
static constexpr ULong64_t NotSet = 0xffffffffffffffff;
static constexpr ULong64_t Noise = 0xfffffffffffffffe;
static constexpr ULong64_t Fake = ul0x1 << 63;
static constexpr uint64_t ul0x1 = 0x1;
static constexpr uint64_t NotSet = 0xffffffffffffffff;
static constexpr uint64_t Noise = 0xfffffffffffffffe;
static constexpr uint64_t Fake = ul0x1 << 63;
static constexpr int NReservedBits = 1;

ULong64_t mLabel = NotSet; ///< MC label encoding MCtrack ID and MCevent origin
uint64_t mLabel = NotSet; ///< MC label encoding MCtrack ID and MCevent origin

public:
// number of bits reserved for MC track ID, DON'T modify this, since the
Expand All @@ -38,17 +38,17 @@ class MCCompLabel
// the rest of the bits is reserved at the moment

// check if the fields are defined consistently
static_assert(nbitsTrackID + nbitsEvID + nbitsSrcID <= sizeof(ULong64_t) * 8 - NReservedBits,
static_assert(nbitsTrackID + nbitsEvID + nbitsSrcID <= sizeof(uint64_t) * 8 - NReservedBits,
"Fields cannot be stored in 64 bits");

// mask to extract MC track ID
static constexpr ULong64_t maskTrackID = (ul0x1 << nbitsTrackID) - 1;
static constexpr uint64_t maskTrackID = (ul0x1 << nbitsTrackID) - 1;
// mask to extract MC track ID
static constexpr ULong64_t maskEvID = (ul0x1 << nbitsEvID) - 1;
static constexpr uint64_t maskEvID = (ul0x1 << nbitsEvID) - 1;
// mask to extract MC track ID
static constexpr ULong64_t maskSrcID = (ul0x1 << nbitsSrcID) - 1;
static constexpr uint64_t maskSrcID = (ul0x1 << nbitsSrcID) - 1;
// mask for all used fields
static constexpr ULong64_t maskFull = (ul0x1 << (nbitsTrackID + nbitsEvID + nbitsSrcID)) - 1;
static constexpr uint64_t maskFull = (ul0x1 << (nbitsTrackID + nbitsEvID + nbitsSrcID)) - 1;

MCCompLabel(int trackID, int evID, int srcID, bool fake = false) { set(trackID, evID, srcID, fake); }
MCCompLabel(bool noise = false)
Expand Down Expand Up @@ -88,7 +88,7 @@ class MCCompLabel
}

// allow to retrieve bare label
ULong64_t getRawValue() const { return mLabel; }
uint64_t getRawValue() const { return mLabel; }

// comparison operator, compares only label, not eventual weight or correctness info
bool operator==(const MCCompLabel& other) const { return (mLabel & maskFull) == (other.mLabel & maskFull); }
Expand All @@ -112,9 +112,9 @@ class MCCompLabel
void set(unsigned int trackID, int evID, int srcID, bool fake)
{
/// compose label: the track 1st cast to UInt32_t to preserve the sign!
mLabel = (maskTrackID & static_cast<ULong64_t>(trackID)) |
(maskEvID & static_cast<ULong64_t>(evID)) << nbitsTrackID |
(maskSrcID & static_cast<ULong64_t>(srcID)) << (nbitsTrackID + nbitsEvID);
mLabel = (maskTrackID & static_cast<uint64_t>(trackID)) |
(maskEvID & static_cast<uint64_t>(evID)) << nbitsTrackID |
(maskSrcID & static_cast<uint64_t>(srcID)) << (nbitsTrackID + nbitsEvID);
if (fake) {
setFakeFlag();
}
Expand All @@ -124,7 +124,7 @@ class MCCompLabel
int getTrackIDSigned() const { return isFake() ? -getTrackID() : getTrackID(); }
int getEventID() const { return (mLabel >> nbitsTrackID) & maskEvID; }
int getSourceID() const { return (mLabel >> (nbitsTrackID + nbitsEvID)) & maskSrcID; }
ULong64_t getTrackEventSourceID() const { return static_cast<ULong64_t>(mLabel & maskFull); }
uint64_t getTrackEventSourceID() const { return static_cast<uint64_t>(mLabel & maskFull); }
void get(int& trackID, int& evID, int& srcID, bool& fake)
{
/// parse label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct MCTruthHeaderElement {
MCTruthHeaderElement() = default; // for ROOT IO

MCTruthHeaderElement(uint32_t i) : index(i) {}
uint32_t index = -1; // the index into the actual MC track storage (-1 if invalid)
uint32_t index = (uint32_t)-1; // the index into the actual MC track storage (-1 if invalid)
ClassDefNV(MCTruthHeaderElement, 1);
};

Expand Down
7 changes: 7 additions & 0 deletions Detectors/ITSMFT/ITS/macros/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ o2_add_test_root_macro(CheckTracks.C
O2::DataFormatsITSMFT
LABELS its)

o2_add_test_root_macro(CheckTracksCA.C
PUBLIC_LINK_LIBRARIES O2::SimulationDataFormat
O2::ITSBase
O2::DataFormatsITS
O2::DataFormatsITSMFT
LABELS its)

o2_add_test_root_macro(DisplayTrack.C
PUBLIC_LINK_LIBRARIES O2::ITSBase
O2::DataFormatsITSMFT
Expand Down
4 changes: 3 additions & 1 deletion Detectors/ITSMFT/ITS/macros/test/CheckTracks.C
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,16 @@ void CheckTracks(std::string tracfile = "o2trac_its.root", std::string clusfile
if (!recTree->GetEvent(frame))
continue;
int loadedEventTracks = frame;
cout << "Number of tracks in frame " << frame << ": " << recArr->size() << std::endl;
for (unsigned int i = 0; i < recArr->size(); i++) { // Find the last MC event within this reconstructed entry
auto lab = (*trkLabArr)[i];
if (!lab.isValid()) {
const TrackITS& recTrack = (*recArr)[i];
fak->Fill(recTrack.getPt());
}
if (!lab.isValid() || lab.getSourceID() != 0 || lab.getEventID() < 0 || lab.getEventID() >= nev)
if (!lab.isValid() || lab.getSourceID() != 0 || lab.getEventID() < 0 || lab.getEventID() >= nev) {
continue;
}
trackFrames[lab.getEventID()].update(frame, i);
}
}
Expand Down
Loading