Skip to content

Commit 9eb74fd

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into UpdateTRKA3
2 parents b312866 + 62b9999 commit 9eb74fd

File tree

96 files changed

+2383
-591
lines changed

Some content is hidden

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

96 files changed

+2383
-591
lines changed

CCDB/src/CcdbApi.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ void CcdbApi::curlInit()
165165

166166
void CcdbApi::init(std::string const& host)
167167
{
168+
if (host.empty()) {
169+
throw std::invalid_argument("Empty url passed CcdbApi, cannot initialize. Aborting.");
170+
}
171+
168172
// if host is prefixed with "file://" this is a local snapshot
169173
// in this case we init the API in snapshot (readonly) mode
170174
constexpr const char* SNAPSHOTPREFIX = "file://";

CCDB/test/testCcdbApi.cxx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,4 +589,11 @@ BOOST_AUTO_TEST_CASE(vectored)
589589
for (auto context : contexts) {
590590
BOOST_CHECK(context.dest.size() != 0);
591591
}
592-
}
592+
}
593+
594+
BOOST_AUTO_TEST_CASE(empty_url)
595+
{
596+
CcdbApi api;
597+
string url = "";
598+
BOOST_CHECK_EXCEPTION(api.init(url), invalid_argument, [](std::invalid_argument const&) -> bool { return true; });
599+
}

Common/SimConfig/src/SimConfig.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
9898
activeModules[i] != "TF3" &&
9999
activeModules[i] != "RCH" &&
100100
activeModules[i] != "MI3" &&
101-
activeModules[i] != "ECL") {
101+
activeModules[i] != "ECL" &&
102+
activeModules[i] != "FD3") {
102103
LOGP(fatal, "List of active modules contains {}, which is not a module from the upgrades.", activeModules[i]);
103104
}
104105
}
@@ -112,7 +113,8 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
112113
activeModules[i] == "TF3" ||
113114
activeModules[i] == "RCH" ||
114115
activeModules[i] == "MI3" ||
115-
activeModules[i] == "ECL") {
116+
activeModules[i] == "ECL" ||
117+
activeModules[i] == "FD3") {
116118
LOGP(fatal, "List of active modules contains {}, which is not a run 3 module", activeModules[i]);
117119
}
118120
}
@@ -130,6 +132,7 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
130132
d == DetID::TF3 ||
131133
d == DetID::RCH ||
132134
d == DetID::ECL ||
135+
d == DetID::FD3 ||
133136
d == DetID::MI3) {
134137
activeModules.emplace_back(DetID::getName(d));
135138
}
@@ -149,7 +152,7 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
149152
activeModules.emplace_back("SHIL");
150153
for (int d = DetID::First; d <= DetID::Last; ++d) {
151154
#ifdef ENABLE_UPGRADES
152-
if (d != DetID::IT3 && d != DetID::TRK && d != DetID::FT3 && d != DetID::FCT && d != DetID::TF3 && d != DetID::RCH && d != DetID::ECL && d != DetID::MI3) {
155+
if (d != DetID::IT3 && d != DetID::TRK && d != DetID::FT3 && d != DetID::FCT && d != DetID::TF3 && d != DetID::RCH && d != DetID::ECL && d != DetID::FD3 && d != DetID::MI3) {
153156
activeModules.emplace_back(DetID::getName(d));
154157
}
155158
}

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ class DetID
8787
static constexpr ID RCH = 23;
8888
static constexpr ID MI3 = 24;
8989
static constexpr ID ECL = 25;
90-
static constexpr ID Last = ECL;
90+
static constexpr ID FD3 = 26;
91+
static constexpr ID Last = FD3;
9192
#else
9293
static constexpr ID Last = FOC; ///< if extra detectors added, update this !!!
9394
#endif
@@ -181,7 +182,7 @@ class DetID
181182
// detector names, will be defined in DataSources
182183
static constexpr const char* sDetNames[nDetectors + 1] = ///< defined detector names
183184
#ifdef ENABLE_UPGRADES
184-
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "TST", "CTP", "FOC", "IT3", "TRK", "FT3", "FCT", "TF3", "RCH", "MI3", "ECL", nullptr};
185+
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "TST", "CTP", "FOC", "IT3", "TRK", "FT3", "FCT", "TF3", "RCH", "MI3", "ECL", "FD3", nullptr};
185186
#else
186187
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "TST", "CTP", "FOC", nullptr};
187188
#endif
@@ -195,7 +196,7 @@ class DetID
195196
#ifdef ENABLE_UPGRADES
196197
,
197198
o2h::gDataOriginIT3, o2h::gDataOriginTRK, o2h::gDataOriginFT3, o2h::gDataOriginFCT, o2h::gDataOriginTF3,
198-
o2h::gDataOriginRCH, o2h::gDataOriginMI3, o2h::gDataOriginECL
199+
o2h::gDataOriginRCH, o2h::gDataOriginMI3, o2h::gDataOriginECL, o2h::gDataOriginFD3
199200
#endif
200201
};
201202
#endif // GPUCA_GPUCODE_DEVICE
@@ -211,10 +212,11 @@ GPUconstexpr() DetID::mask_t sMasks[DetID::nDetectors] = ///< detectot masks
211212
DetID::mask_t(math_utils::bit2Mask(DetID::CPV)), DetID::mask_t(math_utils::bit2Mask(DetID::EMC)), DetID::mask_t(math_utils::bit2Mask(DetID::HMP)), DetID::mask_t(math_utils::bit2Mask(DetID::MFT)), DetID::mask_t(math_utils::bit2Mask(DetID::MCH)),
212213
DetID::mask_t(math_utils::bit2Mask(DetID::MID)), DetID::mask_t(math_utils::bit2Mask(DetID::ZDC)), DetID::mask_t(math_utils::bit2Mask(DetID::FT0)), DetID::mask_t(math_utils::bit2Mask(DetID::FV0)), DetID::mask_t(math_utils::bit2Mask(DetID::FDD)),
213214
DetID::mask_t(math_utils::bit2Mask(DetID::TST)), DetID::mask_t(math_utils::bit2Mask(DetID::CTP)), DetID::mask_t(math_utils::bit2Mask(DetID::FOC))
215+
214216
#ifdef ENABLE_UPGRADES
215217
,
216218
DetID::mask_t(math_utils::bit2Mask(DetID::IT3)), DetID::mask_t(math_utils::bit2Mask(DetID::TRK)), DetID::mask_t(math_utils::bit2Mask(DetID::FT3)), DetID::mask_t(math_utils::bit2Mask(DetID::FCT)), DetID::mask_t(math_utils::bit2Mask(DetID::TF3)),
217-
DetID::mask_t(math_utils::bit2Mask(DetID::RCH)), DetID::mask_t(math_utils::bit2Mask(DetID::MI3)), DetID::mask_t(math_utils::bit2Mask(DetID::ECL))
219+
DetID::mask_t(math_utils::bit2Mask(DetID::RCH)), DetID::mask_t(math_utils::bit2Mask(DetID::MI3)), DetID::mask_t(math_utils::bit2Mask(DetID::ECL)), DetID::mask_t(math_utils::bit2Mask(DetID::FD3))
218220
#endif
219221
};
220222
} // namespace detid_internal

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -929,9 +929,11 @@ CTFIOSize EncodedBlocks<H, N, W>::decode(D_IT dest, // it
929929
const auto& md = mMetadata[slot];
930930
LOGP(debug, "Slot{} | NStored={} Ndict={} nData={}, MD: messageLength:{} opt:{} min:{} max:{} offs:{} width:{} ", slot, block.getNStored(), block.getNDict(), block.getNData(), md.messageLength, (int)md.opt, md.min, md.max, md.literalsPackingOffset, md.literalsPackingWidth);
931931

932+
constexpr size_t word_size = sizeof(W);
933+
932934
if (ansVersion == ANSVersionCompat) {
933935
if (!block.getNStored()) {
934-
return {0, md.getUncompressedSize(), md.getCompressedSize()};
936+
return {0, md.getUncompressedSize(), md.getCompressedSize() * word_size};
935937
}
936938
if (md.opt == Metadata::OptStore::EENCODE) {
937939
return decodeCompatImpl(dest, slot, decoderExt);
@@ -943,7 +945,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decode(D_IT dest, // it
943945
return decodeUnpackImpl(dest, slot);
944946
}
945947
if (!block.getNStored()) {
946-
return {0, md.getUncompressedSize(), md.getCompressedSize()};
948+
return {0, md.getUncompressedSize(), md.getCompressedSize() * word_size};
947949
}
948950
if (md.opt == Metadata::OptStore::EENCODE) {
949951
return decodeRansV1Impl(dest, slot, decoderExt);
@@ -991,7 +993,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decodeCompatImpl(dst_IT dstBegin, int slot, co
991993
} else {
992994
getDecoder().process(block.getData() + block.getNData(), dstBegin, md.messageLength, NDecoderStreams);
993995
}
994-
return {0, md.getUncompressedSize(), md.getCompressedSize()};
996+
return {0, md.getUncompressedSize(), md.getCompressedSize() * sizeof(W)};
995997
};
996998

997999
template <typename H, int N, typename W>
@@ -1045,7 +1047,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decodeRansV1Impl(dst_IT dstBegin, int slot, co
10451047
} else {
10461048
getDecoder().process(block.getData() + block.getNData(), dstBegin, md.messageLength, md.nStreams);
10471049
}
1048-
return {0, md.getUncompressedSize(), md.getCompressedSize()};
1050+
return {0, md.getUncompressedSize(), md.getCompressedSize() * sizeof(W)};
10491051
};
10501052

10511053
template <typename H, int N, typename W>
@@ -1079,7 +1081,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decodeUnpackImpl(dst_IT dest, int slot) const
10791081
} else {
10801082
rans::unpack(srcIt, messageLength, dest, packingWidth, offset);
10811083
}
1082-
return {0, md.getUncompressedSize(), md.getCompressedSize()};
1084+
return {0, md.getUncompressedSize(), md.getCompressedSize() * sizeof(W)};
10831085
};
10841086

10851087
template <typename H, int N, typename W>
@@ -1098,7 +1100,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decodeCopyImpl(dst_IT dest, int slot) const
10981100
destPtr_t srcEnd = srcBegin + md.messageLength * sizeof(dest_t);
10991101
std::copy(srcBegin, srcEnd, dest);
11001102

1101-
return {0, md.getUncompressedSize(), md.getCompressedSize()};
1103+
return {0, md.getUncompressedSize(), md.getCompressedSize() * sizeof(W)};
11021104
};
11031105

11041106
///_____________________________________________________________________________
@@ -1268,7 +1270,7 @@ o2::ctf::CTFIOSize EncodedBlocks<H, N, W>::entropyCodeRANSCompat(const input_IT
12681270
dataSize,
12691271
nLiteralWords);
12701272

1271-
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1273+
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W)};
12721274
}
12731275

12741276
template <typename H, int N, typename W>
@@ -1349,7 +1351,7 @@ CTFIOSize EncodedBlocks<H, N, W>::encodeRANSV1External(const input_IT srcBegin,
13491351
dataSize,
13501352
literalsSize);
13511353

1352-
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1354+
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W)};
13531355
};
13541356

13551357
template <typename H, int N, typename W>
@@ -1458,7 +1460,7 @@ CTFIOSize EncodedBlocks<H, N, W>::encodeRANSV1Inplace(const input_IT srcBegin, c
14581460
dataSize,
14591461
literalsSize);
14601462

1461-
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1463+
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W)};
14621464
}; // namespace ctf
14631465

14641466
template <typename H, int N, typename W>
@@ -1491,7 +1493,7 @@ o2::ctf::CTFIOSize EncodedBlocks<H, N, W>::pack(const input_IT srcBegin, const i
14911493
}
14921494

14931495
LOGP(debug, "StoreData {} bytes, offs: {}:{}", packedSize * sizeof(storageBuffer_t), thisBlock->getOffsData(), thisBlock->getOffsData() + packedSize * sizeof(storageBuffer_t));
1494-
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1496+
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W)};
14951497
};
14961498

14971499
template <typename H, int N, typename W>
@@ -1513,7 +1515,7 @@ o2::ctf::CTFIOSize EncodedBlocks<H, N, W>::store(const input_IT srcBegin, const
15131515

15141516
*thisMetadata = detail::makeMetadataStore<input_t, storageBuffer_t>(messageLength, opt, nBufferElems);
15151517

1516-
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1518+
return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W)};
15171519
};
15181520

15191521
/// create a special EncodedBlocks containing only dictionaries made from provided vector of frequency tables

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct Metadata {
3737
size_t nLiterals = 0; // Number of samples that were stored as literals.
3838
uint8_t messageWordSize = 0; // size in Bytes of a symbol in the encoded message.
3939
uint8_t coderType = 0; // what type of CTF Coder is used? (32 vs 64 bit coders).
40-
uint8_t streamSize = 0; // how many Bytes is the rANS encoder emmiting during a stream-out step.
40+
uint8_t streamSize = 0; // number of Bytes emmitted during rANS stream out (ransCompat) or lower renorming bound (ransV1).
4141
uint8_t probabilityBits = 0; // The encoder renormed the distribution of source symbols to sum up to 2^probabilityBits.
4242
OptStore opt = OptStore::EENCODE; // The type of storage operation that was conducted.
4343
int32_t min = 0; // min symbol of the source dataset.
@@ -48,8 +48,21 @@ struct Metadata {
4848
int nDataWords = 0; // Amount of words used to store the actual data.
4949
int nLiteralWords = 0; // Amount of words used to store literal (incompressible) samples.
5050

51+
/**
52+
* @brief Uncompressed size of stored data in bytes
53+
*
54+
* @return size_t Uncompressed size in bytes
55+
*/
5156
size_t getUncompressedSize() const { return messageLength * messageWordSize; }
52-
size_t getCompressedSize() const { return (nDictWords + nDataWords + nLiteralWords) * streamSize; }
57+
58+
/**
59+
* @brief Size of the stored, compressed data in multiples of the underlying buffer word size
60+
*
61+
* @return size_t The size in multiples of the underlying buffer word size
62+
* @warning This size is in number of words of the underlying storage buffer.
63+
* Multiply with the size of the storage buffer type to get the correct size in bytes.
64+
*/
65+
size_t getCompressedSize() const { return nDictWords + nDataWords + nLiteralWords; }
5366
void clear()
5467
{
5568
nStreams = 0;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ class SimTraits
9999
/*TF3*/ VS{ "TF3Hit" },
100100
/*RCH*/ VS{ "RCHHit" },
101101
/*MI3*/ VS{ "MI3Hit" },
102-
/*ECL*/ VS{ "ECLHit" }
102+
/*ECL*/ VS{ "ECLHit" },
103+
/*FD */ VS{ "FDHit" }
103104
#endif
104105
};
105106
// clang-format on
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2019-2025 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+
add_subdirectory(FD3)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2019-2020 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(DataFormatsFD3
13+
SOURCES src/Hit.cxx
14+
PUBLIC_LINK_LIBRARIES O2::FD3Base
15+
O2::SimulationDataFormat
16+
O2::CommonDataFormat
17+
Microsoft.GSL::GSL
18+
O2::DetectorsCommonDataFormats
19+
)
20+
21+
o2_target_root_dictionary(DataFormatsFD3
22+
HEADERS include/DataFormatsFD3/Hit.h
23+
)

0 commit comments

Comments
 (0)