Skip to content

Commit 93658c6

Browse files
authored
Merge 7d1f10f into sapling-pr-archive-ktf
2 parents 8d807e5 + 7d1f10f commit 93658c6

15 files changed

Lines changed: 198 additions & 115 deletions

File tree

DataFormats/Detectors/ZDC/include/DataFormatsZDC/FEEConfig.h

Lines changed: 0 additions & 52 deletions
This file was deleted.

DataFormats/Headers/include/Headers/DataHeader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ constexpr o2::header::DataDescription gDataDescriptionClusters{"CLUSTERS"};
600600
constexpr o2::header::DataDescription gDataDescriptionTracks{"TRACKS"};
601601
constexpr o2::header::DataDescription gDataDescriptionConfig{"CONFIGURATION"};
602602
constexpr o2::header::DataDescription gDataDescriptionInfo{"INFORMATION"};
603+
constexpr o2::header::DataDescription gDataDescriptionEos{"EOS"};
603604
constexpr o2::header::DataDescription gDataDescriptionROOTStreamers{"ROOT STREAMERS"};
604605
constexpr o2::header::DataDescription gDataDescriptionDISTSTF{"DISTSUBTIMEFRAME"};
605606
/// @} // end of doxygen group

Detectors/GlobalTrackingWorkflow/study/src/CheckResid.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
// Attention: in case the residuals are checked with geometry different from the one used for initial reconstruction,
4646
// pass a --configKeyValues option for vertex refit as:
47-
// ;pvertexer.useMeanVertexConstraint=false;pvertexer.iniScale2=100;pvertexer.acceptableScale2=10.;
47+
// ;pvertexer.useMeanVertexConstraint=false;pvertexer.meanVertexExtraErrSelection=0.2;pvertexer.iniScale2=100;pvertexer.acceptableScale2=10.;
4848
// In any case, it is better to pass ;pvertexer.useMeanVertexConstraint=false;
4949

5050
namespace o2::checkresid
@@ -152,6 +152,7 @@ void CheckResidSpec::updateTimeDependentParams(ProcessingContext& pc)
152152
}
153153
if (mMeanVertexUpdated) {
154154
mMeanVertexUpdated = false;
155+
mVertexer.setMeanVertex(&mMeanVtx);
155156
mVertexer.initMeanVertexConstraint();
156157
}
157158
bool updateMaps = false;

Framework/Core/include/Framework/ASoA.h

Lines changed: 75 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,12 +1176,6 @@ struct TableIterator : IP, C... {
11761176
return *this;
11771177
}
11781178

1179-
template <typename... CL, typename TA>
1180-
void doSetCurrentIndex(framework::pack<CL...>, TA* current)
1181-
{
1182-
(CL::setCurrent(current), ...);
1183-
}
1184-
11851179
template <typename CL>
11861180
auto getCurrent() const
11871181
{
@@ -1202,7 +1196,18 @@ struct TableIterator : IP, C... {
12021196
template <typename... TA>
12031197
void bindExternalIndices(TA*... current)
12041198
{
1205-
(doSetCurrentIndex(external_index_columns_t{}, current), ...);
1199+
([this]<soa::is_index_column... CCs>(TA* cur, framework::pack<CCs...>) {
1200+
(CCs::setCurrent(cur), ...);
1201+
}(current, external_index_columns_t{}),
1202+
...);
1203+
}
1204+
1205+
template <typename TA>
1206+
void bindExternalIndex(TA* current)
1207+
{
1208+
[this]<soa::is_index_column... CCs>(TA* cur, framework::pack<CCs...>) {
1209+
(CCs::setCurrent(cur), ...);
1210+
}(current, external_index_columns_t{});
12061211
}
12071212

12081213
template <typename... Cs>
@@ -1812,6 +1817,12 @@ consteval auto computeOriginals()
18121817
return o2::soa::mergeOriginals<Ts...>();
18131818
}
18141819

1820+
template <size_t N, std::array<TableRef, N> refs>
1821+
consteval auto commonOrigin()
1822+
{
1823+
return (refs | std::ranges::views::filter([](TableRef const& r) { return (!(r.origin_hash == "DYN"_h || r.origin_hash == "IDX"_h)); })).front().origin_hash;
1824+
}
1825+
18151826
/// A Table class which observes an arrow::Table and provides
18161827
/// It is templated on a set of Column / DynamicColumn types.
18171828
template <aod::is_aod_hash L, aod::is_aod_hash D, aod::is_origin_hash O, typename... Ts>
@@ -1823,7 +1834,10 @@ class Table
18231834
using table_t = self_t;
18241835

18251836
static constexpr const auto originals = computeOriginals<ref, Ts...>();
1826-
static constexpr const auto originalLabels = []<size_t N, std::array<TableRef, N> refs, size_t... Is>(std::index_sequence<Is...>) { return std::array<const char*, N>{o2::aod::label<refs[Is]>()...}; }.template operator()<originals.size(), originals>(std::make_index_sequence<originals.size()>());
1837+
static constexpr const auto originalLabels = []<size_t N, std::array<TableRef, N> refs, size_t... Is>(std::index_sequence<Is...>) {
1838+
return std::array<const char*, N>{o2::aod::label<refs[Is]>()...};
1839+
}.template operator()<originals.size(), originals>(std::make_index_sequence<originals.size()>());
1840+
static constexpr const uint32_t binding_origin = commonOrigin<originals.size(), originals>();
18271841

18281842
template <size_t N, std::array<TableRef, N> bindings>
18291843
requires(ref.origin_hash == "CONC"_h)
@@ -1836,10 +1850,10 @@ class Table
18361850
requires(ref.origin_hash == "JOIN"_h)
18371851
static consteval auto isIndexTargetOf()
18381852
{
1839-
return std::find_if(self_t::originals.begin(), self_t::originals.end(),
1840-
[](TableRef const& r) {
1841-
return std::find(bindings.begin(), bindings.end(), r) != bindings.end();
1842-
}) != self_t::originals.end();
1853+
return std::ranges::find_if(self_t::originals,
1854+
[](TableRef const& r) {
1855+
return std::ranges::find(bindings, r) != bindings.end();
1856+
}) != self_t::originals.end();
18431857
}
18441858

18451859
template <size_t N, std::array<TableRef, N> bindings>
@@ -2179,7 +2193,18 @@ class Table
21792193
template <typename... TA>
21802194
void bindExternalIndices(TA*... current)
21812195
{
2182-
mBegin.bindExternalIndices(current...);
2196+
([this](TA* cur) {
2197+
if constexpr (binding_origin == TA::binding_origin) {
2198+
mBegin.bindExternalIndex(cur);
2199+
}
2200+
}(current),
2201+
...);
2202+
}
2203+
2204+
template <typename TA>
2205+
void bindExternalIndex(TA* current)
2206+
{
2207+
mBegin.bindExternalIndex(current); // unchecked binding for the derived tables
21832208
}
21842209

21852210
template <typename I>
@@ -3395,6 +3420,18 @@ struct JoinFull : Table<o2::aod::Hash<"JOIN"_h>, D, o2::aod::Hash<"JOIN"_h>, Ts.
33953420
}
33963421
using base::bindExternalIndices;
33973422
using base::bindInternalIndicesTo;
3423+
static constexpr const uint32_t binding_origin = base::binding_origin;
3424+
3425+
template <typename... TA>
3426+
void bindExternalIndices(TA*... current)
3427+
{
3428+
([this](TA* cur) {
3429+
if constexpr (binding_origin == TA::binding_origin) {
3430+
this->bindExternalIndex(cur);
3431+
}
3432+
}(current),
3433+
...);
3434+
}
33983435

33993436
using self_t = JoinFull<D, Ts...>;
34003437
using table_t = base;
@@ -3524,6 +3561,18 @@ class FilteredBase : public T
35243561
using self_t = FilteredBase<T>;
35253562
using table_t = typename T::table_t;
35263563
using T::originals;
3564+
static constexpr const uint32_t binding_origin = T::binding_origin;
3565+
template <typename... TA>
3566+
void bindExternalIndices(TA*... current)
3567+
{
3568+
([this](TA* cur) {
3569+
if constexpr (binding_origin == TA::binding_origin) {
3570+
this->bindExternalIndex(cur);
3571+
mFilteredBegin.bindExternalIndex(cur);
3572+
}
3573+
}(current),
3574+
...);
3575+
}
35273576
using columns_t = typename T::columns_t;
35283577
using persistent_columns_t = typename T::persistent_columns_t;
35293578
using external_index_columns_t = typename T::external_index_columns_t;
@@ -3645,13 +3694,6 @@ class FilteredBase : public T
36453694

36463695
/// Bind the columns which refer to other tables
36473696
/// to the associated tables.
3648-
template <typename... TA>
3649-
void bindExternalIndices(TA*... current)
3650-
{
3651-
table_t::bindExternalIndices(current...);
3652-
mFilteredBegin.bindExternalIndices(current...);
3653-
}
3654-
36553697
void bindExternalIndicesRaw(std::vector<o2::soa::Binding>&& ptrs)
36563698
{
36573699
mFilteredBegin.bindExternalIndicesRaw(std::forward<std::vector<o2::soa::Binding>>(ptrs));
@@ -4134,6 +4176,19 @@ struct IndexTable : Table<L, D, O> {
41344176
using first_t = typename H::binding_t;
41354177
using rest_t = framework::pack<typename Ts::binding_t...>;
41364178

4179+
static constexpr const uint32_t binding_origin = Key::binding_origin;
4180+
4181+
template <typename... TA>
4182+
void bindExternalIndices(TA*... current)
4183+
{
4184+
([this](TA* cur) {
4185+
if constexpr (binding_origin == TA::binding_origin) {
4186+
this->bindExternalIndex(cur);
4187+
}
4188+
}(current),
4189+
...);
4190+
}
4191+
41374192
IndexTable(std::shared_ptr<arrow::Table> table, uint64_t offset = 0)
41384193
: base_t{table, offset}
41394194
{

Framework/Core/include/Framework/DataModelViews.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ struct get_header {
153153
// ends the pipeline, returns the number of parts
154154
template <typename R>
155155
requires std::ranges::random_access_range<R> && std::ranges::sized_range<R>
156-
friend fair::mq::MessagePtr& operator|(R&& r, get_header self)
156+
friend auto& operator|(R&& r, get_header self)
157157
{
158158
return r[(r | get_dataref_indices{self.id, 0}).headerIdx];
159159
}
@@ -165,7 +165,7 @@ struct get_payload {
165165
// ends the pipeline, returns the number of parts
166166
template <typename R>
167167
requires std::ranges::random_access_range<R> && std::ranges::sized_range<R>
168-
friend fair::mq::MessagePtr& operator|(R&& r, get_payload self)
168+
friend auto& operator|(R&& r, get_payload self)
169169
{
170170
return r[(r | get_dataref_indices{self.part, self.subPart}).payloadIdx];
171171
}

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,7 @@ bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::v
21532153
return currentSetOfInputs[i].getNumberOfPairs();
21542154
};
21552155
auto refCountGetter = [&currentSetOfInputs](size_t idx) -> int {
2156-
auto& header = static_cast<const fair::mq::shmem::Message&>(*currentSetOfInputs[idx].header(0));
2156+
auto& header = static_cast<const fair::mq::shmem::Message&>(*(currentSetOfInputs[idx].messages | get_header{0}));
21572157
return header.GetRefCount();
21582158
};
21592159
return InputSpan{getter, nofPartsGetter, refCountGetter, currentSetOfInputs.size()};

Framework/Core/src/DataRelayer.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ DataRelayer::ActivityStats DataRelayer::processDanglingInputs(std::vector<Expira
184184
// We check that no data is already there for the given cell
185185
// it is enough to check the first element
186186
auto& part = mCache[ti * mDistinctRoutesIndex.size() + expirator.routeIndex.value];
187-
if (!part.messages.empty() && part.header(0) != nullptr) {
187+
if (!part.messages.empty() && (part.messages | get_header{0}) != nullptr) {
188188
headerPresent++;
189189
continue;
190190
}
191-
if (!part.messages.empty() && part.payload(0) != nullptr) {
191+
if (!part.messages.empty() && (part.messages | get_payload{0, 0}) != nullptr) {
192192
payloadPresent++;
193193
continue;
194194
}
@@ -227,7 +227,7 @@ DataRelayer::ActivityStats DataRelayer::processDanglingInputs(std::vector<Expira
227227
return partial[idx].messages | count_parts{};
228228
};
229229
auto refCountGetter = [&partial](size_t idx) -> int {
230-
auto& header = static_cast<const fair::mq::shmem::Message&>(*partial[idx].header(0));
230+
auto& header = static_cast<const fair::mq::shmem::Message&>(*(partial[idx].messages | get_header{0}));
231231
return header.GetRefCount();
232232
};
233233
InputSpan span{getter, nPartsGetter, refCountGetter, static_cast<size_t>(partial.size())};
@@ -246,8 +246,8 @@ DataRelayer::ActivityStats DataRelayer::processDanglingInputs(std::vector<Expira
246246
activity.expiredSlots++;
247247

248248
mTimesliceIndex.markAsDirty(slot, true);
249-
assert(part.header(0) != nullptr);
250-
assert(part.payload(0) != nullptr);
249+
assert((part.messages | get_header{0}) != nullptr);
250+
assert((part.messages | get_payload{0, 0}) != nullptr);
251251
}
252252
}
253253
LOGP(debug, "DataRelayer::processDanglingInputs headerPresent:{}, payloadPresent:{}, noCheckers:{}, badSlot:{}, checkerDenied:{}",
@@ -800,7 +800,7 @@ void DataRelayer::getReadyToProcess(std::vector<DataRelayer::RecordAction>& comp
800800
return partial[idx].messages | count_parts{};
801801
};
802802
auto refCountGetter = [&partial](size_t idx) -> int {
803-
auto& header = static_cast<const fair::mq::shmem::Message&>(*partial[idx].header(0));
803+
auto& header = static_cast<const fair::mq::shmem::Message&>(*(partial[idx].messages | get_header{0}));
804804
return header.GetRefCount();
805805
};
806806
InputSpan span{getter, nPartsGetter, refCountGetter, static_cast<size_t>(partial.size())};

Framework/Core/src/ExternalFairMQDeviceProxy.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ DataProcessorSpec specifyFairMQDeviceOutputProxy(char const* name,
10051005
}
10061006
DataHeader dh;
10071007
dh.dataOrigin = "DPL";
1008-
dh.dataDescription = "EOS";
1008+
dh.dataDescription = o2::header::gDataDescriptionEos;
10091009
dh.subSpecification = 0;
10101010
dh.payloadSize = 0;
10111011
dh.runNumber = runNumber;
@@ -1137,7 +1137,7 @@ DataProcessorSpec specifyFairMQDeviceMultiOutputProxy(char const* name,
11371137
}
11381138
DataHeader dh;
11391139
dh.dataOrigin = "DPL";
1140-
dh.dataDescription = "EOS";
1140+
dh.dataDescription = o2::header::gDataDescriptionEos;
11411141
dh.subSpecification = 0;
11421142
dh.payloadSize = 0;
11431143
dh.payloadSerializationMethod = o2::header::gSerializationMethodNone;

Framework/Core/src/WorkflowSerializationHelpers.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,11 @@ struct WorkflowImporter : public rapidjson::BaseReaderHandler<rapidjson::UTF8<>,
430430
inputMatcherNodes.push_back(std::move(node));
431431
} else if (in(State::IN_OUTPUT)) {
432432
if (outputHasSubSpec) {
433-
dataProcessors.back().outputs.push_back(OutputSpec({binding}, origin, description, subspec, lifetime));
433+
dataProcessors.back().outputs.push_back(OutputSpec({binding}, origin, description, subspec, lifetime, outputOptions));
434434
} else {
435-
dataProcessors.back().outputs.push_back(OutputSpec({binding}, {origin, description}, lifetime));
435+
dataProcessors.back().outputs.push_back(OutputSpec({binding}, {origin, description}, lifetime, outputOptions));
436436
}
437+
outputOptions.clear();
437438
outputHasSubSpec = false;
438439
} else if (in(State::IN_OPTION)) {
439440
std::unique_ptr<ConfigParamSpec> opt{nullptr};

0 commit comments

Comments
 (0)