23#include <fmt/format.h>
57 LOG(info) <<
"initializing event finding";
59 auto config = ic.
options().
get<std::string>(
"mch-config");
60 if (!config.empty()) {
64 auto stop = [
this]() {
65 LOG(info) <<
"event finder duration = " << mElapsedTime.count() <<
" s";
79 auto tStart = std::chrono::high_resolution_clock::now();
81 auto tEnd = std::chrono::high_resolution_clock::now();
82 mElapsedTime += tEnd - tStart;
90 LOGP(info,
"produced {} ROFs with {} digits {}",
99 std::chrono::duration<double> mElapsedTime{};
105 std::string_view inputDigitDataDescription,
106 std::string_view outputDigitDataDescription,
107 std::string_view inputDigitRofDataDescription,
108 std::string_view outputDigitRofDataDescription,
109 std::string_view inputDigitLabelDataDescription,
110 std::string_view outputDigitLabelDataDescription)
113 fmt::format(
"mchdigits:MCH/{}/0;mchrofs:MCH/{}/0", inputDigitDataDescription, inputDigitRofDataDescription);
115 input += fmt::format(
";mchlabels:MCH/{}/0", inputDigitLabelDataDescription);
117 input +=
";midrofs:MID/TRACKROFS/0";
120 fmt::format(
"digits:MCH/{}/0;rofs:MCH/{}/0", outputDigitDataDescription, outputDigitRofDataDescription);
122 output += fmt::format(
";labels:MCH/{}/0", outputDigitLabelDataDescription);
125 std::vector<OutputSpec> outputs;
127 for (
auto& matcher : matchers) {
136 Options{{
"mch-config", VariantType::String,
"", {
"JSON or INI file with event finder parameters"}}}};
Definition of a data processor to group MCH digits based on MID information.
Definition of a class to group MCH digits based on MID information.
Definition of a container to keep Monte Carlo truth external to simulation objects.
static void updateFromFile(std::string const &, std::string const ¶msList="", bool unchangedOnly=false)
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
ServiceRegistryRef services()
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
void run(ProcessingContext &pc)
run the track matching
EventFinderTask(bool useMC)
void init(InitContext &ic)
prepare the event finding
Class to group MCH digits based on MID information.
const std::vector< mch::ROFRecord > & getOutputROFs() const
get the output MCH ROFs
const std::vector< mch::Digit > & getOutputDigits() const
get the output MCH digits
const dataformats::MCLabelContainer & getOutputLabels() const
get the output MCH labels
void run(const gsl::span< const mch::ROFRecord > &mchROFs, const gsl::span< const mch::Digit > &digits, const dataformats::MCLabelContainer *labels, const gsl::span< const mid::ROFRecord > &midROFs)
run the event finder algorithm
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > select(char const *matcher="")
std::vector< InputSpec > Inputs
DataProcessorSpec getEventFinderSpec(bool useMC, std::string_view specName, std::string_view inputDigitDataDescription, std::string_view outputDigitDataDescription, std::string_view inputDigitRofDataDescription, std::string_view outputDigitRofDataDescription, std::string_view inputDigitLabelDataDescription, std::string_view outputDigitLabelDataDescription)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static OutputSpec asOutputSpec(InputSpec const &spec)
std::vector< o2::mid::ROFRecord > midROFs
o2::dataformats::MCLabelContainer mchLabels
std::vector< o2::mch::Digit > mchDigits
std::vector< o2::mch::ROFRecord > mchROFs
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"