CbmRoot
Loading...
Searching...
No Matches
tof/Hitfind.h
Go to the documentation of this file.
1/* Copyright (C) 2023 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dominik Smith [committer] */
4
5#ifndef TOFHITFIND_H
6#define TOFHITFIND_H 1
7
8#include "CbmTofDigi.h"
9#include "PODVector.h"
10#include "PartitionedVector.h"
11#include "tof/Clusterizer.h"
12#include "tof/HitfindSetup.h"
13
14#include <gsl/span>
15#include <optional>
16#include <sstream>
17#include <vector>
18
19#include <xpu/host.h>
20
21
22namespace cbm::algo::tof
23{
24
31 //std::vector<tof::ClusterizerMonitorData> fMonitor; //Per RPC monitoring data, to be implemented
32 xpu::timings fTime;
33 xpu::timings fSortTime;
34 size_t fNumDigis = 0;
35 size_t fNumHits = 0;
36
37 std::string print() const
38 {
39 std::stringstream ss;
40 ss << "Hitfind stats: num digis " << fNumDigis << ", time " << fTime.wall() << " ms ( " << fTime.throughput()
41 << " GB/s ), sort time " << fSortTime.wall() << " ms, num hits " << fNumHits << std::endl;
42 return ss.str();
43 }
44 };
45
52 class Hitfind {
53
54 public:
55 typedef std::tuple<PartitionedVector<Hit>, HitfindMonitorData, PODVector<i32>> resultType;
56
63 resultType operator()(gsl::span<CbmTofDigi> digiIn);
64
66 explicit Hitfind(tof::HitfindSetup);
67
68 private: // members
70 std::vector<tof::Clusterizer> fAlgo; //[rpcUnique]
71
73 std::vector<int32_t> fNbSm;
74
76 std::vector<int32_t> fNbRpc;
77
79 std::vector<std::vector<std::vector<std::pair<CbmTofDigi, int32_t>>>> fStorDigi; //[nbType][nbSm*nbRpc][nDigis]
80
82 std::vector<std::vector<std::pair<CbmTofDigi, int32_t>>*> fStorDigiPtr; //[rpcUnique][nDigis]
83 };
84} // namespace cbm::algo::tof
85
86#endif /* TOFHITFIND_H */
Algo class for hitfinding.
Definition tof/Hitfind.h:52
std::vector< std::vector< std::pair< CbmTofDigi, int32_t > > * > fStorDigiPtr
Pointer to storage variables with unique RPC index (for OpenMP)
Definition tof/Hitfind.h:82
std::vector< std::vector< std::vector< std::pair< CbmTofDigi, int32_t > > > > fStorDigi
Intermediate storage variables (digi, index)
Definition tof/Hitfind.h:79
resultType operator()(gsl::span< CbmTofDigi > digiIn)
Algorithm execution.
std::tuple< PartitionedVector< Hit >, HitfindMonitorData, PODVector< i32 > > resultType
Definition tof/Hitfind.h:55
std::vector< int32_t > fNbSm
Number of SMs per super module type.
Definition tof/Hitfind.h:73
std::vector< tof::Clusterizer > fAlgo
TOF hitfinders (with unique RPC index for OpenMP)
Definition tof/Hitfind.h:70
std::vector< int32_t > fNbRpc
Number of RPCs per super module type.
Definition tof/Hitfind.h:76
Hitfind(tof::HitfindSetup)
Constructor.
std::vector< T, PODAllocator< T > > PODVector
PODVector is a std::vector that doesn't initialize its elements.
Definition PODVector.h:17
Monitoring data for hitfinding.
Definition tof/Hitfind.h:30
Hitfind setup / Hardware cabling for TOF Used to create the hardware mapping for the TOF hitfinder.