23#include "fmt/format.h"
58 bool isClusterizerInit =
false;
61 isClusterizerInit = mClusterizer.
init([&](
size_t baseIndex,
size_t relatedIndex) { mCorrelation.push_back({baseIndex, relatedIndex}); });
63 isClusterizerInit = mClusterizer.
init();
65 if (!isClusterizerInit) {
66 LOG(error) <<
"Initialization of MID clusterizer device failed";
69 auto stop = [
this]() {
70 double scaleFactor = (mNROFs == 0) ? 0. : 1.e6 / mNROFs;
71 LOG(info) <<
"Processing time / " << mNROFs <<
" ROFs: full: " << mTimer.count() * scaleFactor <<
" us pre-clustering: " << mTimerPreCluster.count() * scaleFactor <<
" us clustering: " << mTimerCluster.count() * scaleFactor <<
" us";
78 auto tStart = std::chrono::high_resolution_clock::now();
84 auto tAlgoStart = std::chrono::high_resolution_clock::now();
85 mPreClusterizer.
process(patterns, inROFRecords);
86 mTimerPreCluster += std::chrono::high_resolution_clock::now() - tAlgoStart;
90 tAlgoStart = std::chrono::high_resolution_clock::now();
92 mTimerCluster += std::chrono::high_resolution_clock::now() - tAlgoStart;
100 mCorrelation.clear();
103 LOG(
debug) <<
"Sent " << mClusterLabeler.
getContainer().getIndexedSize() <<
" indexed clusters";
111 mTimer += std::chrono::high_resolution_clock::now() - tStart;
112 mNROFs += inROFRecords.size();
118 Clusterizer mClusterizer{};
119 PreClusterLabeler mPreClusterLabeler{};
120 ClusterLabeler mClusterLabeler{};
121 std::vector<std::array<size_t, 2>> mCorrelation{};
122 std::chrono::duration<double> mTimer{0};
123 std::chrono::duration<double> mTimerPreCluster{0};
124 std::chrono::duration<double> mTimerCluster{0};
125 unsigned long mNROFs{0};
Utilities for MID Column Data Specs.
Strip pattern (aka digits)
Definition of a container to keep Monte Carlo truth external to simulation objects.
Pre-cluster structure for MID.
Cluster reconstruction algorithm for MID.
Data processor specs for MID clustering device.
PreClusterLabeler for MID.
Pre-cluster reconstruction algorithm for MID.
void snapshot(const Output &spec, T const &object)
ServiceRegistryRef services()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
void process(gsl::span< const PreCluster > preClusters, const o2::dataformats::MCTruthContainer< MCCompLabel > &inMCContainer, gsl::span< const Cluster > clusters, gsl::span< const std::array< size_t, 2 > > correlations)
const o2::dataformats::MCTruthContainer< MCClusterLabel > & getContainer()
void init(o2::framework::InitContext &ic)
~ClusterizerDeviceDPL()=default
ClusterizerDeviceDPL(bool isMC)
void run(o2::framework::ProcessingContext &pc)
const std::vector< Cluster > & getClusters()
Gets the vector of reconstructed clusters.
const std::vector< ROFRecord > & getROFRecords()
Gets the vector of clusters RO frame records.
bool init(std::function< void(size_t, size_t)> func=[](size_t, size_t) {})
void process(gsl::span< const PreCluster > preClusters, bool accumulate=false)
const o2::dataformats::MCTruthContainer< MCCompLabel > & getContainer()
void process(gsl::span< const PreCluster > preClusters, const o2::dataformats::MCTruthContainer< MCLabel > &inMCContainer, gsl::span< const ROFRecord > rofRecordsPC, gsl::span< const ROFRecord > rofRecordsData)
Pre-clustering algorithm for MID.
const std::vector< ROFRecord > & getROFRecords()
Gets the vector of pre-clusters RO frame records.
void process(gsl::span< const ColumnData > stripPatterns, bool accumulate=false)
const std::vector< PreCluster > & getPreClusters()
Gets the vector of reconstructed pre-clusters.
constexpr o2::header::DataOrigin gDataOriginMID
Defining PrimaryVertex explicitly as messageable.
std::vector< framework::InputSpec > buildInputSpecs(std::string_view dataBind, std::string_view dataDesc, bool useMC)
std::array< gsl::span< const ColumnData >, NEvTypes > getData(framework::ProcessingContext &pc, std::string_view dataBind)
std::unique_ptr< const o2::dataformats::MCTruthContainer< MCLabel > > getLabels(framework::ProcessingContext &pc, std::string_view dataBind)
std::array< gsl::span< const ROFRecord >, NEvTypes > getRofs(framework::ProcessingContext &pc, std::string_view dataBind)
framework::DataProcessorSpec getClusterizerSpec(bool isMC, std::string_view inDataDesc, std::string_view inRofDesc, std::string_view inLabelsDesc)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"