CbmRoot
Loading...
Searching...
No Matches
HitMultTrigger.h
Go to the documentation of this file.
1/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
5#pragma once // include this header only once per compilation unit
6
7#include "DigiTriggerConfig.h"
8#include "RecoResults.h"
10
11#include <utility>
12#include <vector>
13
14#include <xpu/host.h>
15
16namespace cbm::algo::evbuild
17{
18
27
28 public:
29 typedef std::pair<std::vector<double>, TimeClusterTriggerMonitorData> Result;
30
35 : fConfig(config)
36 , fAlgo(config.Window(), config.Threshold(), config.DeadTime()){};
37
42 Result operator()(const RecoResults& recoData) const;
43
45 std::string ToString() const;
46
47 private: // methods
53 std::vector<double> GetHitTimes(const RecoResults& recoData, ECbmModuleId system) const;
54
61 template<class T>
62 std::vector<double> GetTimeStamps(const gsl::span<const T> data) const
63 {
64 std::vector<double> result;
65 result.resize(data.size());
66 std::transform(data.begin(), data.end(), result.begin(), [](const T& obj) { return obj.Time(); });
67 std::sort(result.begin(), result.end());
68 return result;
69 }
70
71
72 private: // members
75 };
76
77} // namespace cbm::algo::evbuild
ECbmModuleId
Definition CbmDefs.h:39
A structure for reconstructed results: digi-events, hits and tracks.
Configuration of the digi trigger class (TimeClusterTrigger)
Trigger class for finding time clusters of hit data.
std::string ToString() const
Info to string.
std::pair< std::vector< double >, TimeClusterTriggerMonitorData > Result
std::vector< double > GetTimeStamps(const gsl::span< const T > data) const
Get vector of time stamps from a data container [template].
DigiTriggerConfig fConfig
Configuration.
TimeClusterTrigger fAlgo
Algorithm.
std::vector< double > GetHitTimes(const RecoResults &recoData, ECbmModuleId system) const
Extract the hit time stamps for the selected trigger detector.
Result operator()(const RecoResults &recoData) const
Execution.
HitMultTrigger(const DigiTriggerConfig &config)
Constructor.
Finds clusters in time-series data.
Monitoring data for time cluster trigger algorithm.