Skip to content

Commit 20741d8

Browse files
committed
[ALICE3] Cluster finding of TRK
Please consider the following formatting changes
1 parent efa0898 commit 20741d8

File tree

20 files changed

+1505
-6
lines changed

20 files changed

+1505
-6
lines changed

DataFormats/Detectors/Upgrades/ALICE3/CMakeLists.txt

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

1212
add_subdirectory(FD3)
13+
add_subdirectory(TRK)
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(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+
)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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_DATAFORMATSTRK_CLUSTER_H
13+
#define ALICEO2_DATAFORMATSTRK_CLUSTER_H
14+
15+
#include <Rtypes.h>
16+
#include <cstdint>
17+
#include <string>
18+
19+
namespace o2::trk
20+
{
21+
22+
struct Cluster {
23+
uint16_t chipID = 0;
24+
uint16_t row = 0;
25+
uint16_t col = 0;
26+
uint16_t size = 1;
27+
int16_t subDetID = -1;
28+
int16_t layer = -1;
29+
int16_t disk = -1;
30+
31+
std::string asString() const;
32+
33+
ClassDefNV(Cluster, 1);
34+
};
35+
36+
} // namespace o2::trk
37+
38+
#endif
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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_DATAFORMATSTRK_ROFRECORD_H
13+
#define ALICEO2_DATAFORMATSTRK_ROFRECORD_H
14+
15+
#include "CommonDataFormat/InteractionRecord.h"
16+
#include "CommonDataFormat/RangeReference.h"
17+
#include <Rtypes.h>
18+
#include <cstdint>
19+
#include <string>
20+
21+
namespace o2::trk
22+
{
23+
24+
class ROFRecord
25+
{
26+
public:
27+
using EvIdx = o2::dataformats::RangeReference<int, int>;
28+
using BCData = o2::InteractionRecord;
29+
using ROFtype = unsigned int;
30+
31+
ROFRecord() = default;
32+
ROFRecord(const BCData& bc, ROFtype rof, int idx, int n)
33+
: mBCData(bc), mROFEntry(idx, n), mROFrame(rof) {}
34+
35+
void setBCData(const BCData& bc) { mBCData = bc; }
36+
void setROFrame(ROFtype rof) { mROFrame = rof; }
37+
void setEntry(EvIdx entry) { mROFEntry = entry; }
38+
void setFirstEntry(int idx) { mROFEntry.setFirstEntry(idx); }
39+
void setNEntries(int n) { mROFEntry.setEntries(n); }
40+
41+
const BCData& getBCData() const { return mBCData; }
42+
BCData& getBCData() { return mBCData; }
43+
EvIdx getEntry() const { return mROFEntry; }
44+
EvIdx& getEntry() { return mROFEntry; }
45+
int getNEntries() const { return mROFEntry.getEntries(); }
46+
int getFirstEntry() const { return mROFEntry.getFirstEntry(); }
47+
ROFtype getROFrame() const { return mROFrame; }
48+
49+
std::string asString() const;
50+
51+
private:
52+
o2::InteractionRecord mBCData;
53+
EvIdx mROFEntry;
54+
ROFtype mROFrame = 0;
55+
56+
ClassDefNV(ROFRecord, 1);
57+
};
58+
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
74+
75+
#endif
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
#include "DataFormatsTRK/Cluster.h"
13+
#include <sstream>
14+
15+
ClassImp(o2::trk::Cluster);
16+
17+
namespace o2::trk
18+
{
19+
20+
std::string Cluster::asString() const
21+
{
22+
std::ostringstream stream;
23+
stream << "chip=" << chipID << " row=" << row << " col=" << col << " size=" << size
24+
<< " subDet=" << subDetID << " layer=" << layer << " disk=" << disk;
25+
return stream.str();
26+
}
27+
28+
} // namespace o2::trk
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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::trk::Cluster + ;
19+
#pragma link C++ class std::vector < o2::trk::Cluster> + ;
20+
#pragma link C++ class o2::trk::ROFRecord + ;
21+
#pragma link C++ class std::vector < o2::trk::ROFRecord> + ;
22+
#pragma link C++ class o2::trk::MC2ROFRecord + ;
23+
#pragma link C++ class std::vector < o2::trk::MC2ROFRecord> + ;
24+
25+
#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+
#include "DataFormatsTRK/ROFRecord.h"
13+
#include <sstream>
14+
15+
ClassImp(o2::trk::ROFRecord);
16+
ClassImp(o2::trk::MC2ROFRecord);
17+
18+
namespace o2::trk
19+
{
20+
21+
std::string ROFRecord::asString() const
22+
{
23+
std::ostringstream stream;
24+
stream << "IR=" << mBCData.asString() << " ROFrame=" << mROFrame
25+
<< " first=" << mROFEntry.getFirstEntry() << " n=" << mROFEntry.getEntries();
26+
return stream.str();
27+
}
28+
29+
} // namespace o2::trk

Detectors/Upgrades/ALICE3/TRK/macros/test/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,10 @@ o2_add_test_root_macro(CheckTracksCA.C
2828
O2::TRKBase
2929
O2::TRKSimulation
3030
O2::Steer
31-
LABELS trk COMPILE_ONLY)
31+
LABELS trk COMPILE_ONLY)
32+
33+
o2_add_test_root_macro(CheckClusters.C
34+
PUBLIC_LINK_LIBRARIES O2::DataFormatsTRK
35+
O2::SimulationDataFormat
36+
O2::Framework
37+
LABELS trk COMPILE_ONLY)

0 commit comments

Comments
 (0)