Skip to content

Commit 3e2f1f3

Browse files
committed
add a test workflow for embedding source
1 parent dacd577 commit 3e2f1f3

File tree

3 files changed

+53
-4
lines changed

3 files changed

+53
-4
lines changed

Framework/TestWorkflows/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ o2_add_dpl_workflow(analysis-ccdb
4646
PUBLIC_LINK_LIBRARIES O2::DataFormatsTOF
4747
COMPONENT_NAME TestWorkflows)
4848

49+
o2_add_dpl_workflow(analysis-emb
50+
SOURCES src/o2TestMultisource.cxx
51+
COMPONENT_NAME TestWorkflows)
52+
4953
o2_add_dpl_workflow(two-timers
5054
SOURCES src/o2TwoTimers.cxx
5155
COMPONENT_NAME TestWorkflows)

Framework/TestWorkflows/src/o2TestHistograms.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#include "Framework/runDataProcessing.h"
1717
#include "Framework/AnalysisTask.h"
1818
#include <TH2F.h>
19-
#include <cmath>
20-
#include <iostream>
2119

2220
using namespace o2;
2321
using namespace o2::framework;
@@ -72,7 +70,7 @@ struct EtaAndClsHistogramsSimple {
7270
}
7371
}
7472

75-
void process(soa::Filtered<aod::Tracks> const& tracks, aod::FT0s const&, aod::StoredTracksFrom<o2::aod::Hash<"EMB"_h>> const& ortherTracks)
73+
void process(soa::Filtered<aod::Tracks> const& tracks, aod::FT0s const&)
7674
{
7775
LOGP(info, "Invoking the simple one");
7876
for (auto& track : tracks) {
@@ -110,7 +108,7 @@ struct EtaAndClsHistogramsIUSimple {
110108
}
111109
}
112110

113-
void process(soa::Filtered<aod::TracksIU> const& tracks, aod::FT0s const&, aod::TracksIUFrom<o2::aod::Hash<"EMB"_h>> const& otherTracks)
111+
void process(soa::Filtered<aod::TracksIU> const& tracks, aod::FT0s const&)
114112
{
115113
LOGP(info, "Invoking the simple one IU");
116114
for (auto& track : tracks) {
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
/// \brief Tests that the same tables from different origins are routed correctly.
13+
/// Required two input files, <name>.root and <name>_EMB.root, that contain
14+
/// same number of DFs with the same names.
15+
/// \author
16+
/// \since
17+
18+
#include "Framework/runDataProcessing.h"
19+
#include "Framework/AnalysisTask.h"
20+
21+
using namespace o2;
22+
using namespace o2::framework;
23+
using namespace o2::framework::expressions;
24+
25+
namespace o2::aod
26+
{
27+
O2ORIGIN("EMB");
28+
template <is_aod_hash T>
29+
using BCsFrom = BCs_001From<T>;
30+
using TracksPlus = soa::Join<StoredTracksIU, StoredTracksExtra>;
31+
template <is_aod_hash T>
32+
using TracksPlusFrom = soa::Join<StoredTracksIUFrom<T>, StoredTracksExtra_002From<T>>;
33+
} // namespace o2::aod
34+
35+
struct TestEmbeddingSubscription {
36+
void process(aod::BCs const& bcs, aod::BCsFrom<aod::Hash<"EMB"_h>> const& bcse,
37+
aod::TracksPlus const& tracks, aod::TracksPlusFrom<aod::Hash<"EMB"_h>> const& trackse)
38+
{
39+
LOGP(info, "BCs from run {} and {}", bcs.begin().runNumber(), bcse.begin().runNumber());
40+
LOGP(info, "Joined tracks: {} and {}", tracks.size(), trackse.size());
41+
}
42+
};
43+
44+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
45+
{
46+
return {adaptAnalysisTask<TestEmbeddingSubscription>(cfgc)};
47+
}

0 commit comments

Comments
 (0)