54void DigitsToClustersTask::strToFloatsSplit(std::string
s,
55 std::string delimiter,
float*
res,
61 size_t delim_len = delimiter.length();
63 while ((pos_end =
s.find(delimiter, pos_start)) != std::string::npos) {
64 token =
s.substr(pos_start, pos_end - pos_start);
65 pos_start = pos_end + delim_len;
67 if (
index == maxElem) {
71 res[
index++] = (std::stof(
s.substr(pos_start)));
79 mSigmaCutPar = ic.
options().
get<std::string>(
"sigma-cut");
81 if (mSigmaCutPar !=
"") {
82 strToFloatsSplit(mSigmaCutPar,
",", mSigmaCut, 7);
85 mDigitsReceived = 0, mClustersReceived = 0;
95 std::vector<o2::hmpid::Cluster>
clusters;
96 std::vector<o2::hmpid::Trigger> clusterTriggers;
97 LOG(info) <<
"[HMPID DClusterization - run() ] Enter ...";
99 clusterTriggers.clear();
101 auto triggers = pc.
inputs().
get<gsl::span<o2::hmpid::Trigger>>(
"intrecord");
104 for (
const auto& trig : triggers) {
105 if (trig.getNumberOfObjects()) {
106 gsl::span<const o2::hmpid::Digit> trigDigits{
107 digits.data() + trig.getFirstEntry(),
108 size_t(trig.getNumberOfObjects())};
110 mRec->Dig2Clu(trigDigits,
clusters, mSigmaCut,
true);
111 clusterTriggers.emplace_back(trig.getIr(), clStart,
clusters.size() - clStart);
114 LOGP(info,
"Received {} triggers with {} digits -> {} triggers with {} clusters",
115 triggers.size(),
digits.size(), clusterTriggers.size(),
clusters.size());
116 mDigitsReceived +=
digits.size();
117 mClustersReceived +=
clusters.size();
130 mExTimer.
logMes(
"End Clusterization ! digits = " +
140 std::vector<o2::framework::InputSpec> inputs;
143 o2::framework::Lifetime::Timeframe);
145 o2::framework::Lifetime::Timeframe);
148 std::vector<o2::framework::OutputSpec> outputs;
150 outputs.emplace_back(
"HMP",
"CLUSTERS", 0,
151 o2::framework::Lifetime::Timeframe);
152 outputs.emplace_back(
"HMP",
"INTRECORDS1", 0,
153 o2::framework::Lifetime::Timeframe);
156 "HMP-Clusterization", inputs, outputs,
161 {
"sigmas as comma separated list"}}}};
Implementation of writing HMPID clusters to file.
A raw page parser for DPL input.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Definition of the Names Generator class.
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
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 init(framework::InitContext &ic) final
void endOfStream(framework::EndOfStreamContext &ec) override
This is invoked whenever we have an EndOfStream event.
void run(framework::ProcessingContext &pc) final
void stop()
stop : stops the timer
void elapseMes(std::string const message)
void start()
start : starts the timer
void logMes(std::string const message)
constexpr o2::header::DataOrigin gDataOriginHMP
Defining ITS Vertex explicitly as messageable.
o2::framework::DataProcessorSpec getDigitsToClustersSpec()
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string to_string(gsl::span< T, Size > span)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Cluster > clusters
std::vector< Digit > digits