Skip to content

Commit 8695595

Browse files
committed
Split ALICE3 TRK and FT3 layout
Restructure the ALICE3 upgrade detectors so TRK and FT3 live under a shared Detectors/Upgrades/ALICE3/TRKFT3 top-level directory. TRK-specific code is kept in TRKFT3/TRK, FT3-specific code is kept in TRKFT3/FT3, and shared reconstruction, workflow, and simulation code is placed under TRKFT3/common. The data formats follow the same split with DataFormats/Detectors/Upgrades/ALICE3/TRKFT3/common providing shared TRKFT3 objects. Move the common hit, digit, cluster, and ROF data formats to DataFormatsTRKFT3. The TRKFT3 Hit is a standalone clone of the ITSMFT-style hit rather than deriving from ITSMFT. The Digit is cloned into the TRKFT3 data formats so digitization no longer relies on ITSMFT digits. The Cluster type is now template<int DetID>, with TRKCluster and FT3Cluster aliases, preserving subDetID for geometry lookups while replacing the previous disk/dist split with a single layer field. The MC2ROF data format and related digitizer/cluster writer paths are removed. Move common digitization code to TRKFT3/common/simulation and template the digitizer stack by DetID. DigiParams, DPLDigitizerParam, and Digitizer are now instantiated separately for TRK and FT3. DigiParams uses std::array storage with detector-specific compile-time layer capacities, and the DPL digitizer workflow can instantiate independent TRK and FT3 digitizers using the shared TRKFT3 digitizer implementation. Split GeometryTGeo into TRK and FT3-specific classes. TRK keeps the barrel/vertex geometry implementation, while FT3 has its own FT3Base GeometryTGeo and parameters. Both detector simulations use the shared TRKFT3 Hit type. Global reconstruction, digitizer workflow, reconstruction, workflow, and validation macros were updated to consume DataFormatsTRKFT3 types and the new TRKFT3 layout. Validation: this change was iterated against the O2 build, fixing configure, compile, and link errors reported during the build, including stale DataFormatsTRK references, missing TRKFT3 includes, clusterer template namespace usage, removed cluster disk access, and the FT3 GeometryTGeo Print symbol.
1 parent be5a2bb commit 8695595

109 files changed

Lines changed: 2541 additions & 1064 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/SimTraits.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ namespace itsmft
124124
{
125125
class Hit;
126126
}
127+
namespace trkft3
128+
{
129+
class Hit;
130+
}
127131
namespace tof
128132
{
129133
class HitType;
@@ -246,11 +250,11 @@ struct DetIDToHitTypes<o2::detectors::DetID::IT3> {
246250
};
247251
template <>
248252
struct DetIDToHitTypes<o2::detectors::DetID::TRK> {
249-
using HitType = o2::itsmft::Hit;
253+
using HitType = o2::trkft3::Hit;
250254
};
251255
template <>
252256
struct DetIDToHitTypes<o2::detectors::DetID::FT3> {
253-
using HitType = o2::itsmft::Hit;
257+
using HitType = o2::trkft3::Hit;
254258
};
255259
template <>
256260
struct DetIDToHitTypes<o2::detectors::DetID::FCT> {

DataFormats/Detectors/Upgrades/ALICE3/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
# or submit itself to any jurisdiction.
1111

1212
add_subdirectory(FD3)
13-
add_subdirectory(TRK)
13+
add_subdirectory(TRKFT3)

DataFormats/Detectors/Upgrades/ALICE3/TRK/CMakeLists.txt renamed to DataFormats/Detectors/Upgrades/ALICE3/TRKFT3/CMakeLists.txt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,4 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12-
o2_add_library(DataFormatsTRK
13-
SOURCES src/Cluster.cxx
14-
src/ROFRecord.cxx
15-
PUBLIC_LINK_LIBRARIES O2::CommonDataFormat
16-
O2::DataFormatsITSMFT
17-
O2::SimulationDataFormat
18-
)
19-
20-
o2_target_root_dictionary(DataFormatsTRK
21-
HEADERS include/DataFormatsTRK/Cluster.h
22-
include/DataFormatsTRK/ROFRecord.h
23-
LINKDEF src/DataFormatsTRKLinkDef.h
24-
)
12+
add_subdirectory(common)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2+
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
# All rights not expressly granted are reserved.
4+
#
5+
# This software is distributed under the terms of the GNU General Public
6+
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
#
8+
# In applying this license CERN does not waive the privileges and immunities
9+
# granted to it by virtue of its status as an Intergovernmental Organization
10+
# or submit itself to any jurisdiction.
11+
12+
o2_add_library(DataFormatsTRKFT3
13+
SOURCES src/Digit.cxx
14+
src/Hit.cxx
15+
src/ROFRecord.cxx
16+
PUBLIC_LINK_LIBRARIES O2::CommonDataFormat
17+
O2::SimulationDataFormat)
18+
19+
o2_target_root_dictionary(DataFormatsTRKFT3
20+
HEADERS include/DataFormatsTRKFT3/Cluster.h
21+
include/DataFormatsTRKFT3/Digit.h
22+
include/DataFormatsTRKFT3/Hit.h
23+
include/DataFormatsTRKFT3/ROFRecord.h
24+
LINKDEF src/DataFormatsTRKFT3LinkDef.h)

DataFormats/Detectors/Upgrades/ALICE3/TRK/include/DataFormatsTRK/Cluster.h renamed to DataFormats/Detectors/Upgrades/ALICE3/TRKFT3/common/include/DataFormatsTRKFT3/Cluster.h

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,44 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#ifndef ALICEO2_DATAFORMATSTRK_CLUSTER_H
13-
#define ALICEO2_DATAFORMATSTRK_CLUSTER_H
12+
#ifndef ALICEO2_DATAFORMATSTRKFT3_CLUSTER_H
13+
#define ALICEO2_DATAFORMATSTRKFT3_CLUSTER_H
1414

15+
#include "DetectorsCommonDataFormats/DetID.h"
1516
#include <Rtypes.h>
1617
#include <cstdint>
18+
#include <sstream>
1719
#include <string>
1820

19-
namespace o2::trk
21+
namespace o2::trkft3
2022
{
2123

24+
template <int DetID>
2225
struct Cluster {
26+
static_assert(DetID == o2::detectors::DetID::TRK || DetID == o2::detectors::DetID::FT3, "only TRK and FT3 clusters are supported");
27+
2328
uint16_t chipID = 0;
2429
uint16_t row = 0;
2530
uint16_t col = 0;
2631
uint16_t size = 1;
2732
int16_t subDetID = -1;
2833
int16_t layer = -1;
29-
int16_t disk = -1;
3034

31-
std::string asString() const;
35+
std::string asString() const
36+
{
37+
std::ostringstream stream;
38+
stream << o2::detectors::DetID(DetID).getName() << " cluster chip=" << chipID
39+
<< " row=" << row << " col=" << col << " size=" << size
40+
<< " subDet=" << subDetID << " layer=" << layer;
41+
return stream.str();
42+
}
3243

3344
ClassDefNV(Cluster, 1);
3445
};
3546

36-
} // namespace o2::trk
47+
using TRKCluster = Cluster<o2::detectors::DetID::TRK>;
48+
using FT3Cluster = Cluster<o2::detectors::DetID::FT3>;
49+
50+
} // namespace o2::trkft3
3751

3852
#endif
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#ifndef ALICEO2_DATAFORMATSTRKFT3_DIGIT_H
13+
#define ALICEO2_DATAFORMATSTRKFT3_DIGIT_H
14+
15+
#include "Rtypes.h"
16+
#include <climits>
17+
#include <iosfwd>
18+
19+
namespace o2::trkft3
20+
{
21+
22+
class Digit
23+
{
24+
public:
25+
Digit(UShort_t chipindex = 0, UShort_t row = 0, UShort_t col = 0, Int_t charge = 0);
26+
~Digit() = default;
27+
28+
UShort_t getChipIndex() const { return mChipIndex; }
29+
UShort_t getColumn() const { return mCol; }
30+
UShort_t getRow() const { return mRow; }
31+
Int_t getCharge() const { return mCharge; }
32+
33+
void setChipIndex(UShort_t index) { mChipIndex = index; }
34+
void setPixelIndex(UShort_t row, UShort_t col)
35+
{
36+
mRow = row;
37+
mCol = col;
38+
}
39+
void setCharge(Int_t charge) { mCharge = charge < USHRT_MAX ? charge : USHRT_MAX; }
40+
void addCharge(int charge) { setCharge(charge + int(mCharge)); }
41+
42+
std::ostream& print(std::ostream& output) const;
43+
friend std::ostream& operator<<(std::ostream& output, const Digit& digi)
44+
{
45+
digi.print(output);
46+
return output;
47+
}
48+
49+
private:
50+
UShort_t mChipIndex = 0;
51+
UShort_t mRow = 0;
52+
UShort_t mCol = 0;
53+
UShort_t mCharge = 0;
54+
55+
ClassDefNV(Digit, 1);
56+
};
57+
58+
} // namespace o2::trkft3
59+
60+
#endif
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#ifndef ALICEO2_DATAFORMATSTRKFT3_HIT_H
13+
#define ALICEO2_DATAFORMATSTRKFT3_HIT_H
14+
15+
#include <ostream>
16+
#include <vector>
17+
18+
#include "CommonUtils/ShmAllocator.h"
19+
#include "SimulationDataFormat/BaseHits.h"
20+
#include "Rtypes.h"
21+
#include "TVector3.h"
22+
23+
namespace o2::trkft3
24+
{
25+
26+
class Hit : public o2::BasicXYZEHit<Float_t, Float_t>
27+
{
28+
public:
29+
enum HitStatus_t {
30+
kTrackEntering = 0x1,
31+
kTrackInside = 0x1 << 1,
32+
kTrackExiting = 0x1 << 2,
33+
kTrackOut = 0x1 << 3,
34+
kTrackStopped = 0x1 << 4,
35+
kTrackAlive = 0x1 << 5
36+
};
37+
38+
Hit() = default;
39+
40+
Hit(int trackID, unsigned short detID, const TVector3& startPos, const TVector3& endPos, const TVector3& startMom,
41+
double startE, double endTime, double eLoss, unsigned char startStatus, unsigned char endStatus);
42+
43+
math_utils::Point3D<Float_t> GetPosStart() const { return mPosStart; }
44+
Float_t GetStartX() const { return mPosStart.X(); }
45+
Float_t GetStartY() const { return mPosStart.Y(); }
46+
Float_t GetStartZ() const { return mPosStart.Z(); }
47+
template <typename F>
48+
void GetStartPosition(F& x, F& y, F& z) const
49+
{
50+
x = GetStartX();
51+
y = GetStartY();
52+
z = GetStartZ();
53+
}
54+
55+
math_utils::Vector3D<Float_t> GetMomentum() const { return mMomentum; }
56+
math_utils::Vector3D<Float_t>& GetMomentum() { return mMomentum; }
57+
Float_t GetPx() const { return mMomentum.X(); }
58+
Float_t GetPy() const { return mMomentum.Y(); }
59+
Float_t GetPz() const { return mMomentum.Z(); }
60+
Float_t GetE() const { return mE; }
61+
Float_t GetTotalEnergy() const { return GetE(); }
62+
63+
UChar_t GetStatusEnd() const { return mTrackStatusEnd; }
64+
UChar_t GetStatusStart() const { return mTrackStatusStart; }
65+
66+
Bool_t IsEntering() const { return mTrackStatusEnd & kTrackEntering; }
67+
Bool_t IsInside() const { return mTrackStatusEnd & kTrackInside; }
68+
Bool_t IsExiting() const { return mTrackStatusEnd & kTrackExiting; }
69+
Bool_t IsOut() const { return mTrackStatusEnd & kTrackOut; }
70+
Bool_t IsStopped() const { return mTrackStatusEnd & kTrackStopped; }
71+
Bool_t IsAlive() const { return mTrackStatusEnd & kTrackAlive; }
72+
73+
Bool_t IsEnteringStart() const { return mTrackStatusStart & kTrackEntering; }
74+
Bool_t IsInsideStart() const { return mTrackStatusStart & kTrackInside; }
75+
Bool_t IsExitingStart() const { return mTrackStatusStart & kTrackExiting; }
76+
Bool_t IsOutStart() const { return mTrackStatusStart & kTrackOut; }
77+
Bool_t IsStoppedStart() const { return mTrackStatusStart & kTrackStopped; }
78+
Bool_t IsAliveStart() const { return mTrackStatusStart & kTrackAlive; }
79+
80+
void SetPosStart(const math_utils::Point3D<Float_t>& p) { mPosStart = p; }
81+
82+
void Print(const Option_t* opt) const;
83+
friend std::ostream& operator<<(std::ostream& of, const Hit& point)
84+
{
85+
of << "-I- Hit: O2 trkft3 point for track " << point.GetTrackID() << " in detector " << point.GetDetectorID() << std::endl;
86+
return of;
87+
}
88+
89+
private:
90+
math_utils::Vector3D<Float_t> mMomentum; ///< momentum at entrance
91+
math_utils::Point3D<Float_t> mPosStart; ///< position at entrance, base position is at exit
92+
Float_t mE = 0.f; ///< total energy at entrance
93+
UChar_t mTrackStatusEnd = 0; ///< MC status flag at exit
94+
UChar_t mTrackStatusStart = 0; ///< MC status at starting point
95+
96+
ClassDefNV(Hit, 3);
97+
};
98+
99+
} // namespace o2::trkft3
100+
101+
#ifdef USESHM
102+
namespace std
103+
{
104+
template <>
105+
class allocator<o2::trkft3::Hit> : public o2::utils::ShmAllocator<o2::trkft3::Hit>
106+
{
107+
};
108+
} // namespace std
109+
#endif
110+
111+
#endif

DataFormats/Detectors/Upgrades/ALICE3/TRK/include/DataFormatsTRK/ROFRecord.h renamed to DataFormats/Detectors/Upgrades/ALICE3/TRKFT3/common/include/DataFormatsTRKFT3/ROFRecord.h

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#ifndef ALICEO2_DATAFORMATSTRK_ROFRECORD_H
13-
#define ALICEO2_DATAFORMATSTRK_ROFRECORD_H
12+
#ifndef ALICEO2_DATAFORMATSTRKFT3_ROFRECORD_H
13+
#define ALICEO2_DATAFORMATSTRKFT3_ROFRECORD_H
1414

1515
#include "CommonDataFormat/InteractionRecord.h"
1616
#include "CommonDataFormat/RangeReference.h"
1717
#include <Rtypes.h>
1818
#include <cstdint>
1919
#include <string>
2020

21-
namespace o2::trk
21+
namespace o2::trkft3
2222
{
2323

2424
class ROFRecord
@@ -56,20 +56,6 @@ class ROFRecord
5656
ClassDefNV(ROFRecord, 1);
5757
};
5858

59-
struct MC2ROFRecord {
60-
using ROFtype = unsigned int;
61-
62-
int eventRecordID = -1;
63-
int rofRecordID = 0;
64-
ROFtype minROF = 0;
65-
ROFtype maxROF = 0;
66-
67-
MC2ROFRecord() = default;
68-
MC2ROFRecord(int evID, int rofRecID, ROFtype mnrof, ROFtype mxrof) : eventRecordID(evID), rofRecordID(rofRecID), minROF(mnrof), maxROF(mxrof) {}
69-
70-
ClassDefNV(MC2ROFRecord, 1);
71-
};
72-
73-
} // namespace o2::trk
59+
} // namespace o2::trkft3
7460

7561
#endif
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#ifdef __CLING__
13+
14+
#pragma link off all globals;
15+
#pragma link off all classes;
16+
#pragma link off all functions;
17+
18+
#pragma link C++ class o2::trkft3::Digit + ;
19+
#pragma link C++ class std::vector < o2::trkft3::Digit> + ;
20+
#pragma link C++ class o2::trkft3::Hit + ;
21+
#pragma link C++ class std::vector < o2::trkft3::Hit> + ;
22+
#pragma link C++ class o2::trkft3::Cluster < o2::detectors::DetID::TRK> + ;
23+
#pragma link C++ class std::vector < o2::trkft3::Cluster < o2::detectors::DetID::TRK>> + ;
24+
#pragma link C++ class o2::trkft3::Cluster < o2::detectors::DetID::FT3> + ;
25+
#pragma link C++ class std::vector < o2::trkft3::Cluster < o2::detectors::DetID::FT3>> + ;
26+
#pragma link C++ class o2::trkft3::ROFRecord + ;
27+
#pragma link C++ class std::vector < o2::trkft3::ROFRecord> + ;
28+
29+
#endif

0 commit comments

Comments
 (0)