Skip to content
Open
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 @@ -17,6 +17,7 @@
#define ALICEO2_RECO_CONTAINER

#include "CommonDataFormat/InteractionRecord.h"
#include "CommonDataFormat/TimeStamp.h"
#include "ReconstructionDataFormats/GlobalTrackAccessor.h"
#include "CommonDataFormat/RangeReference.h"
#include "ReconstructionDataFormats/Decay3Body.h"
Expand Down Expand Up @@ -225,6 +226,7 @@ struct DataRequest {
void requestMIDTracks(bool mc);
void requestTPCTracks(bool mc);
void requestITSTPCTracks(bool mc);
void requestITSABClusterUsage();
void requestGlobalFwdTracks(bool mc);
void requestMFTMCHMatches(bool mc);
void requestMCHMIDMatches(bool mc);
Expand Down Expand Up @@ -261,6 +263,8 @@ struct DataRequest {
void requestPrimaryVerticesTMP(bool mc);
void requestSecondaryVertices(bool mc);
void requestStrangeTracks(bool mc);
void requestStrangenessTrackingExtensions(bool mc);
void requestITSShortTracks(bool mc);

void requestIRFramesITS();

Expand Down Expand Up @@ -321,6 +325,13 @@ struct RecoContainer {
enum STRKSlots {
STRACK,
STRACK_MC,
EXTSTRACK,
EXTSTRACK_MC,
EXTSTRACK_TIME,
ITSSHORT,
ITSSHORT_MC,
ITSSHORT_PV,
ITSSHORT_CLREF,
NSTRKSLOTS
};

Expand Down Expand Up @@ -442,6 +453,9 @@ struct RecoContainer {
void addSVertices(o2::framework::ProcessingContext& pc, bool);

void addStrangeTracks(o2::framework::ProcessingContext& pc, bool mc);
void addStrangenessTrackingExtensions(o2::framework::ProcessingContext& pc, bool mc);
void addITSShortTracks(o2::framework::ProcessingContext& pc, bool mc);
void addITSABClusterUsage(o2::framework::ProcessingContext& pc);

void addIRFramesITS(o2::framework::ProcessingContext& pc);

Expand Down Expand Up @@ -532,6 +546,7 @@ struct RecoContainer {
auto getITSABRefs() const { return getSpan<o2::itsmft::TrkClusRef>(GTrackID::ITSAB, TRACKREFS); }
const o2::itsmft::TrkClusRef& getITSABRef(GTrackID gid) const { return getObject<o2::itsmft::TrkClusRef>(gid, TRACKREFS); }
auto getITSABClusterRefs() const { return getSpan<int>(GTrackID::ITSAB, INDICES); }
bool hasITSABClusterUsage() const { return commonPool[GTrackID::ITSAB].isLoaded(TRACKREFS) && commonPool[GTrackID::ITSAB].isLoaded(INDICES); }
auto getITSABMCLabels() const { return getSpan<o2::MCCompLabel>(GTrackID::ITSAB, MCLABELS); }

// ITS clusters (layer is ignored unless the data was provided per layer)
Expand Down Expand Up @@ -752,6 +767,13 @@ struct RecoContainer {
auto getPV2Decays3BodyRefs() { return svtxPool.getSpan<o2::dataformats::RangeReference<int, int>>(PVTX_3BODYREFS); }

// Strangeness track
auto getExtendedStrangeTracks() const { return strkPool.getSpan<o2::dataformats::StrangeTrack>(EXTSTRACK); }
auto getExtendedStrangeTracksMCLabels() const { return strkPool.getSpan<o2::MCCompLabel>(EXTSTRACK_MC); }
auto getExtendedStrangeTrackTimes() const { return strkPool.getSpan<o2::dataformats::TimeStampWithError<float, float>>(EXTSTRACK_TIME); }
auto getITSShortTracks() const { return strkPool.getSpan<o2::its::TrackITS>(ITSSHORT); }
auto getITSShortTracksMCLabels() const { return strkPool.getSpan<o2::MCCompLabel>(ITSSHORT_MC); }
auto getITSShortTrackPVRefs() const { return strkPool.getSpan<int>(ITSSHORT_PV); }
auto getITSShortTrackClusterRefs() const { return strkPool.getSpan<int>(ITSSHORT_CLREF); }
auto getStrangeTracks() const { return strkPool.getSpan<o2::dataformats::StrangeTrack>(STRACK); }
auto getStrangeTracksMCLabels() const { return strkPool.getSpan<o2::MCCompLabel>(STRACK_MC); }
const o2::dataformats::StrangeTrack& getStrangeTrack(int i) const { return strkPool.get_as<o2::dataformats::StrangeTrack>(STRACK, i); }
Expand Down
66 changes: 66 additions & 0 deletions DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,34 @@ void DataRequest::requestTPCTracks(bool mc)
requestMap["trackTPC"] = mc;
}

void DataRequest::requestITSABClusterUsage()
{
addInput({"trackITSTPCABREFS", "GLO", "TPCITSAB_REFS", 0, Lifetime::Timeframe});
addInput({"trackITSTPCABCLID", "GLO", "TPCITSAB_CLID", 0, Lifetime::Timeframe});
requestMap["ITSABClusterUsage"] = false;
}

void DataRequest::requestStrangenessTrackingExtensions(bool mc)
{
addInput({"extendedstracks", "GLO", "EXTSTRTRACKS", 0, Lifetime::Timeframe});
addInput({"extendedstracktimes", "GLO", "EXTSTRTIMES", 0, Lifetime::Timeframe});
if (mc) {
addInput({"extendedstrack_mc", "GLO", "EXTSTRTRACKS_MC", 0, Lifetime::Timeframe});
}
requestMap["STrackerExtensions"] = mc;
}

void DataRequest::requestITSShortTracks(bool mc)
{
addInput({"itsshorttracks", "GLO", "ITSSHORTTRACKS", 0, Lifetime::Timeframe});
addInput({"itsshortpv", "GLO", "ITSSHORTPV", 0, Lifetime::Timeframe});
addInput({"itsshortclref", "GLO", "ITSSHORTCLREF", 0, Lifetime::Timeframe});
if (mc) {
addInput({"itsshort_mc", "GLO", "ITSSHORTMC", 0, Lifetime::Timeframe});
}
requestMap["ITSShortTracks"] = mc;
}

void DataRequest::requestITSTPCTracks(bool mc)
{
addInput({"trackITSTPC", "GLO", "TPCITS", 0, Lifetime::Timeframe});
Expand Down Expand Up @@ -856,6 +884,19 @@ void RecoContainer::collectData(ProcessingContext& pc, const DataRequest& reques
addSVertices(pc, req->second);
}

req = reqMap.find("ITSABClusterUsage");
if (req != reqMap.end() && reqMap.find("trackITSTPC") == reqMap.end()) {
addITSABClusterUsage(pc);
}
req = reqMap.find("STrackerExtensions");
if (req != reqMap.end()) {
addStrangenessTrackingExtensions(pc, req->second);
}
req = reqMap.find("ITSShortTracks");
if (req != reqMap.end()) {
addITSShortTracks(pc, req->second);
}

req = reqMap.find("STracker");
if (req != reqMap.end()) {
addStrangeTracks(pc, req->second);
Expand Down Expand Up @@ -899,6 +940,31 @@ void RecoContainer::addPVertices(ProcessingContext& pc, bool mc)
}

//____________________________________________________________
void RecoContainer::addITSABClusterUsage(ProcessingContext& pc)
{
commonPool[GTrackID::ITSAB].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::TrkClusRef>>("trackITSTPCABREFS"), TRACKREFS);
commonPool[GTrackID::ITSAB].registerContainer(pc.inputs().get<gsl::span<int>>("trackITSTPCABCLID"), INDICES);
}

void RecoContainer::addStrangenessTrackingExtensions(ProcessingContext& pc, bool mc)
{
strkPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::StrangeTrack>>("extendedstracks"), EXTSTRACK);
strkPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::TimeStampWithError<float, float>>>("extendedstracktimes"), EXTSTRACK_TIME);
if (mc) {
strkPool.registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("extendedstrack_mc"), EXTSTRACK_MC);
}
}

void RecoContainer::addITSShortTracks(ProcessingContext& pc, bool mc)
{
strkPool.registerContainer(pc.inputs().get<gsl::span<o2::its::TrackITS>>("itsshorttracks"), ITSSHORT);
strkPool.registerContainer(pc.inputs().get<gsl::span<int>>("itsshortpv"), ITSSHORT_PV);
strkPool.registerContainer(pc.inputs().get<gsl::span<int>>("itsshortclref"), ITSSHORT_CLREF);
if (mc) {
strkPool.registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("itsshort_mc"), ITSSHORT_MC);
}
}

void RecoContainer::addStrangeTracks(ProcessingContext& pc, bool mc)
{
strkPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::StrangeTrack>>("strangetracks"), STRACK);
Expand Down
2 changes: 2 additions & 0 deletions DataFormats/Reconstruction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ o2_add_library(ReconstructionDataFormats
src/Decay3Body.cxx
src/DecayNBodyIndex.cxx
src/StrangeTrack.cxx
src/StrangenessTrackingStats.cxx
src/GlobalTrackID.cxx
src/VtxTrackIndex.cxx
src/VtxTrackRef.cxx
Expand Down Expand Up @@ -64,6 +65,7 @@ o2_target_root_dictionary(
include/ReconstructionDataFormats/DecayNBodyIndex.h
include/ReconstructionDataFormats/Decay3Body.h
include/ReconstructionDataFormats/StrangeTrack.h
include/ReconstructionDataFormats/StrangenessTrackingStats.h
include/ReconstructionDataFormats/GlobalTrackID.h
include/ReconstructionDataFormats/VtxTrackIndex.h
include/ReconstructionDataFormats/VtxTrackRef.h
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// 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.

/// \file StrangenessTrackingStats.h
/// Per-timeframe counters for strangeness tracking.
#ifndef ALICEO2_STRANGENESSTRACKINGSTATS_H
#define ALICEO2_STRANGENESSTRACKINGSTATS_H

#include <cstdint>
#include <Rtypes.h>

namespace o2::dataformats
{
struct StrangenessTrackingStats {
uint64_t nInvalidPVTime = 0;
uint64_t nSeeds = 0;
uint64_t nUnmatched = 0;
uint64_t nPropagationFailures = 0;
uint64_t nMissingHits = 0;
uint64_t nMotherTruncated = 0;
uint64_t nTripletProposals = 0;
uint64_t nTripletTruncated = 0;
uint8_t decayFollowingEnabled = 0;
uint8_t tripletsEnabled = 0;
uint8_t tripletsDeferredZeroField = 0;
uint8_t itsOnly = 0;
uint8_t clustersPerLayer = 0;
uint8_t clusterIDEncoding = 1; // ClusterID.h composed input-slot/index encoding
float bz = 0.f;
ClassDefNV(StrangenessTrackingStats, 1);
};

} // namespace o2::dataformats
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
#pragma link C++ class o2::dataformats::Decay3Body + ;
#pragma link C++ class std::vector < o2::dataformats::Decay3Body> + ;

#pragma link C++ class o2::dataformats::StrangenessTrackingStats + ;

#pragma link C++ class o2::dataformats::StrangeTrack + ;
#pragma link C++ class std::vector < o2::dataformats::StrangeTrack> + ;

Expand Down
14 changes: 14 additions & 0 deletions DataFormats/Reconstruction/src/StrangenessTrackingStats.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// 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 "ReconstructionDataFormats/StrangenessTrackingStats.h"

ClassImp(o2::dataformats::StrangenessTrackingStats);
1 change: 1 addition & 0 deletions DataFormats/common/src/CommonDataFormatLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#pragma link C++ class o2::dataformats::TimeStamp < Float16_t> + ;
#pragma link C++ class o2::dataformats::TimeStampWithError < float, float> + ;
#pragma link C++ class o2::dataformats::TimeStampWithError < double, double> + ;
#pragma link C++ class std::vector < o2::dataformats::TimeStampWithError < float, float>> + ;
#pragma link C++ class o2::dataformats::TimeStampWithError < int, int> + ;
#pragma link C++ class o2::dataformats::TimeStampWithError < uint32_t, uint32_t> + ;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ class AODProducerWorkflowDPL : public Task
// Strangeness tracking indices lookup tables
std::vector<int> mVertexStrLUT; /// LUT for accessing strangeness tracks for each vertex
std::vector<std::pair<int, int>> mCollisionStrTrk; /// collision index and original index of the strangeness track
std::vector<std::pair<int, int>> mCollisionExtendedStrTrk, mCollisionITSShortTrk;
std::vector<int> mVertexExtendedStrLUT, mVertexITSShortLUT;
std::vector<int> mExtendedStrTrkIndices;
std::unordered_map<int, int> mCascadeToTableID, mDecay3BodyToTableID;
std::vector<int> mStrTrkIndices; /// indices of strangeness tracks in the track table

// std::unordered_map<int, int> mIndexTableFwd;
Expand Down Expand Up @@ -604,7 +608,11 @@ class AODProducerWorkflowDPL : public Task
template <typename HMPCursorType>
void fillHMPID(const o2::globaltracking::RecoContainer& recoData, HMPCursorType& hmpCursor);

void prepareStrangenessTrackingExtensions(const o2::globaltracking::RecoContainer& recoData);
void prepareITSShortTracks(const o2::globaltracking::RecoContainer& recoData);
void prepareStrangenessTracking(const o2::globaltracking::RecoContainer& recoData);
// Stored AO2D decay row, or -1 if the source decay was filtered.
int getDecayTableID(int partType, int sourceRef) const;
template <typename V0C, typename CC, typename D3BC>
void fillStrangenessTrackingTables(const o2::globaltracking::RecoContainer& data, V0C& v0Cursor, CC& cascadeCursor, D3BC& decay3bodyCursor);

Expand Down Expand Up @@ -707,7 +715,7 @@ class AODProducerWorkflowDPL : public Task
};

/// create a processor spec
framework::DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, bool enableST, bool useMC, bool CTPConfigPerRun, bool enableFITextra, bool enableTRDextra);
framework::DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, bool enableST, bool useMC, bool CTPConfigPerRun, bool enableFITextra, bool enableTRDextra, bool enableExtensions = false, bool enableShortTracks = false);

// helper interface for calo cells to "befriend" emcal and phos cells
class CellHelper
Expand Down
Loading