Skip to content

Commit cb698c9

Browse files
matthiasrichtersawenzel
authored andcommitted
Removing the converter step from the TPC reconstruction workflow
The TPC HW Clusterer is capable of writing the HW cluster raw data directly, this makes the conversion step obsolete.
1 parent e2962cb commit cb698c9

6 files changed

Lines changed: 17 additions & 334 deletions

File tree

Detectors/TPC/workflow/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ set(SRCS
1616
src/RecoWorkflow.cxx
1717
src/PublisherSpec.cxx
1818
src/ClustererSpec.cxx
19-
src/ClusterConverterSpec.cxx
2019
src/ClusterDecoderRawSpec.cxx
2120
src/CATrackerSpec.cxx
2221
)

Detectors/TPC/workflow/include/TPCWorkflow/RecoWorkflow.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ namespace RecoWorkflow
2727
/// define input and output types of the workflow
2828
enum struct InputType { Digitizer, // directly read digits from {TPC:DIGITS}
2929
Digits, // read digits from file
30-
Clusters, // read clusters from file
3130
DecodedClusters, // read decoded clusters from file
3231
Raw };
3332
enum struct OutputType { Digits,
34-
Clusters,
3533
Raw,
3634
DecodedClusters,
3735
Tracks };

Detectors/TPC/workflow/src/ClusterConverterSpec.cxx

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

Detectors/TPC/workflow/src/ClusterConverterSpec.h

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

Detectors/TPC/workflow/src/ClustererSpec.cxx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <memory> // for make_shared
2828
#include <vector>
2929
#include <numeric> // std::accumulate
30+
#include <algorithm> // std::copy
3031

3132
using namespace o2::framework;
3233
using namespace o2::header;
@@ -46,7 +47,7 @@ DataProcessorSpec getClustererSpec(bool sendMC)
4647

4748
constexpr static size_t NSectors = o2::TPC::Sector::MAXSECTOR;
4849
struct ProcessAttributes {
49-
std::vector<o2::TPC::Cluster> clusterArray;
50+
std::vector<o2::TPC::ClusterHardwareContainer8kb> clusterArray;
5051
MCLabelContainer mctruthArray;
5152
std::array<std::shared_ptr<o2::TPC::HwClusterer>, NSectors> clusterers;
5253
int verbosity = 1;
@@ -79,9 +80,9 @@ DataProcessorSpec getClustererSpec(bool sendMC)
7980
// forward the control information
8081
// FIXME define and use flags in TPCSectorHeader
8182
o2::TPC::TPCSectorHeader header{ sector };
82-
pc.outputs().snapshot(Output{ gDataOriginTPC, "CLUSTERSIM", fanSpec, Lifetime::Timeframe, { header } }, fanSpec);
83+
pc.outputs().snapshot(Output{ gDataOriginTPC, "CLUSTERHW", fanSpec, Lifetime::Timeframe, { header } }, fanSpec);
8384
if (!labelKey.empty()) {
84-
pc.outputs().snapshot(Output{ gDataOriginTPC, "CLUSTERMCLBL", fanSpec, Lifetime::Timeframe, { header } }, fanSpec);
85+
pc.outputs().snapshot(Output{ gDataOriginTPC, "CLUSTERHWMCLBL", fanSpec, Lifetime::Timeframe, { header } }, fanSpec);
8586
}
8687
return (sectorHeader->sector == -1);
8788
}
@@ -121,9 +122,12 @@ DataProcessorSpec getClustererSpec(bool sendMC)
121122
LOG(INFO) << "clusterer produced " << mctruthArray.getIndexedSize() << " MC label object(s)";
122123
}
123124
}
124-
pc.outputs().snapshot(Output{ gDataOriginTPC, "CLUSTERSIM", fanSpec, Lifetime::Timeframe, { *sectorHeader } }, clusterArray);
125+
// FIXME: that should be a case for pmr, want to send the content of the vector as a binary
126+
// block by using move semantics
127+
auto outputPages = pc.outputs().make<ClusterHardwareContainer8kb>(Output{ gDataOriginTPC, "CLUSTERHW", fanSpec, Lifetime::Timeframe, { *sectorHeader } }, clusterArray.size());
128+
std::copy(clusterArray.begin(), clusterArray.end(), outputPages.begin());
125129
if (!labelKey.empty()) {
126-
pc.outputs().snapshot(Output{ gDataOriginTPC, "CLUSTERMCLBL", fanSpec, Lifetime::Timeframe, { *sectorHeader } }, mctruthArray);
130+
pc.outputs().snapshot(Output{ gDataOriginTPC, "CLUSTERHWMCLBL", fanSpec, Lifetime::Timeframe, { *sectorHeader } }, mctruthArray);
127131
}
128132
return false;
129133
};
@@ -175,12 +179,12 @@ DataProcessorSpec getClustererSpec(bool sendMC)
175179

176180
auto createOutputSpecs = [](bool makeMcOutput) {
177181
std::vector<OutputSpec> outputSpecs{
178-
OutputSpec{ { "clusters" }, gDataOriginTPC, "CLUSTERSIM", 0, Lifetime::Timeframe },
182+
OutputSpec{ { "clusters" }, gDataOriginTPC, "CLUSTERHW", 0, Lifetime::Timeframe },
179183
};
180184
if (makeMcOutput) {
181185
OutputLabel label{ "clusterlbl" };
182186
// FIXME: define common data type specifiers
183-
constexpr o2::header::DataDescription datadesc("CLUSTERMCLBL");
187+
constexpr o2::header::DataDescription datadesc("CLUSTERHWMCLBL");
184188
outputSpecs.emplace_back(label, gDataOriginTPC, datadesc, 0, Lifetime::Timeframe);
185189
}
186190
return std::move(outputSpecs);

0 commit comments

Comments
 (0)