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
1 change: 1 addition & 0 deletions DataFormats/Detectors/Upgrades/ALICE3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
# or submit itself to any jurisdiction.

add_subdirectory(FD3)
add_subdirectory(TRK)
24 changes: 24 additions & 0 deletions DataFormats/Detectors/Upgrades/ALICE3/TRK/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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.

o2_add_library(DataFormatsTRK
SOURCES src/Cluster.cxx
src/ROFRecord.cxx
PUBLIC_LINK_LIBRARIES O2::CommonDataFormat
O2::DataFormatsITSMFT
O2::SimulationDataFormat
)

o2_target_root_dictionary(DataFormatsTRK
HEADERS include/DataFormatsTRK/Cluster.h
include/DataFormatsTRK/ROFRecord.h
LINKDEF src/DataFormatsTRKLinkDef.h
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// 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 ALICEO2_DATAFORMATSTRK_CLUSTER_H
#define ALICEO2_DATAFORMATSTRK_CLUSTER_H

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

namespace o2::trk
{

struct Cluster {
uint16_t chipID = 0;
uint16_t row = 0;
uint16_t col = 0;
uint16_t size = 1;
int16_t subDetID = -1;
int16_t layer = -1;
int16_t disk = -1;

std::string asString() const;

ClassDefNV(Cluster, 1);
};

} // namespace o2::trk

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// 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 ALICEO2_DATAFORMATSTRK_ROFRECORD_H
#define ALICEO2_DATAFORMATSTRK_ROFRECORD_H

#include "CommonDataFormat/InteractionRecord.h"
#include "CommonDataFormat/RangeReference.h"
#include <Rtypes.h>
#include <cstdint>
#include <string>

namespace o2::trk
{

class ROFRecord
{
public:
using EvIdx = o2::dataformats::RangeReference<int, int>;
using BCData = o2::InteractionRecord;
using ROFtype = unsigned int;

ROFRecord() = default;
ROFRecord(const BCData& bc, ROFtype rof, int idx, int n)
: mBCData(bc), mROFEntry(idx, n), mROFrame(rof) {}

void setBCData(const BCData& bc) { mBCData = bc; }
void setROFrame(ROFtype rof) { mROFrame = rof; }
void setEntry(EvIdx entry) { mROFEntry = entry; }
void setFirstEntry(int idx) { mROFEntry.setFirstEntry(idx); }
void setNEntries(int n) { mROFEntry.setEntries(n); }

const BCData& getBCData() const { return mBCData; }
BCData& getBCData() { return mBCData; }
EvIdx getEntry() const { return mROFEntry; }
EvIdx& getEntry() { return mROFEntry; }
int getNEntries() const { return mROFEntry.getEntries(); }
int getFirstEntry() const { return mROFEntry.getFirstEntry(); }
ROFtype getROFrame() const { return mROFrame; }

std::string asString() const;

private:
o2::InteractionRecord mBCData;
EvIdx mROFEntry;
ROFtype mROFrame = 0;

ClassDefNV(ROFRecord, 1);
};

struct MC2ROFRecord {
using ROFtype = unsigned int;

int eventRecordID = -1;
int rofRecordID = 0;
ROFtype minROF = 0;
ROFtype maxROF = 0;

MC2ROFRecord() = default;
MC2ROFRecord(int evID, int rofRecID, ROFtype mnrof, ROFtype mxrof) : eventRecordID(evID), rofRecordID(rofRecID), minROF(mnrof), maxROF(mxrof) {}

ClassDefNV(MC2ROFRecord, 1);
};

} // namespace o2::trk

#endif
28 changes: 28 additions & 0 deletions DataFormats/Detectors/Upgrades/ALICE3/TRK/src/Cluster.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// 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 "DataFormatsTRK/Cluster.h"
#include <sstream>

ClassImp(o2::trk::Cluster);

namespace o2::trk
{

std::string Cluster::asString() const
{
std::ostringstream stream;
stream << "chip=" << chipID << " row=" << row << " col=" << col << " size=" << size
<< " subDet=" << subDetID << " layer=" << layer << " disk=" << disk;
return stream.str();
}

} // namespace o2::trk
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.

#ifdef __CLING__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class o2::trk::Cluster + ;
#pragma link C++ class std::vector < o2::trk::Cluster> + ;
#pragma link C++ class o2::trk::ROFRecord + ;
#pragma link C++ class std::vector < o2::trk::ROFRecord> + ;
#pragma link C++ class o2::trk::MC2ROFRecord + ;
#pragma link C++ class std::vector < o2::trk::MC2ROFRecord> + ;

#endif
29 changes: 29 additions & 0 deletions DataFormats/Detectors/Upgrades/ALICE3/TRK/src/ROFRecord.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// 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 "DataFormatsTRK/ROFRecord.h"
#include <sstream>

ClassImp(o2::trk::ROFRecord);
ClassImp(o2::trk::MC2ROFRecord);

namespace o2::trk
{

std::string ROFRecord::asString() const
{
std::ostringstream stream;
stream << "IR=" << mBCData.asString() << " ROFrame=" << mROFrame
<< " first=" << mROFEntry.getFirstEntry() << " n=" << mROFEntry.getEntries();
return stream.str();
}

} // namespace o2::trk
10 changes: 9 additions & 1 deletion Detectors/Upgrades/ALICE3/TRK/macros/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ o2_add_test_root_macro(CheckTracksCA.C
O2::TRKBase
O2::TRKSimulation
O2::Steer
LABELS trk COMPILE_ONLY)
LABELS trk COMPILE_ONLY)

o2_add_test_root_macro(CheckClusters.C
PUBLIC_LINK_LIBRARIES O2::DataFormatsTRK
O2::SimulationDataFormat
O2::Framework
O2::TRKBase
O2::TRKSimulation
LABELS trk COMPILE_ONLY)
Loading