CbmRoot
Loading...
Searching...
No Matches
tof/Clusterizer.h
Go to the documentation of this file.
1/* Copyright (C) 2022 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dominik Smith [committer], Pierre-Alain Loizeau */
4
5/*
6 This algo was based on CbmTofEventClusterizer
7*/
8
9#ifndef CLUSTERIZERTOF_H
10#define CLUSTERIZERTOF_H
11
12// TOF Classes and includes
13class CbmTofDigi;
14
15#include "ClusterizerPars.h"
16#include "Hit.h"
17
18// C++ Classes and includes
19#include <cmath>
20#include <memory>
21#include <vector>
22
23namespace cbm::algo::tof
24{
26 public:
27 typedef std::tuple<std::vector<Hit>, std::vector<size_t>, std::vector<u32>, std::vector<int32_t>> resultType;
28
33
37 Clusterizer() = default;
38
42 resultType operator()(const std::vector<std::pair<CbmTofDigi, int32_t>>& digisIn);
43
44 private:
45 typedef std::vector<std::pair<const CbmTofDigi*, int32_t>> inputType;
46
48
49 std::vector<inputType> chanSortDigis(const std::vector<std::pair<CbmTofDigi, int32_t>>& digisIn);
50
51 resultType buildClusters(std::vector<inputType>& input);
52
53 bool AddNextChan(std::vector<inputType>& input, int32_t iLastChan, Hit& cluster, std::vector<Hit>& clustersOut,
54 std::vector<int32_t>& digiIndRef, std::vector<inputType::iterator>* lastChanPos = nullptr);
55 };
56
57} // namespace cbm::algo::tof
58
59#endif // CLUSTERIZERTOF_H
Data class for expanded digital TOF information.
Definition CbmTofDigi.h:47
std::vector< inputType > chanSortDigis(const std::vector< std::pair< CbmTofDigi, int32_t > > &digisIn)
Clusterizer()=default
Default constructor.
resultType operator()(const std::vector< std::pair< CbmTofDigi, int32_t > > &digisIn)
Build clusters out of ToF Digis and store the resulting info in a TofHit.
bool AddNextChan(std::vector< inputType > &input, int32_t iLastChan, Hit &cluster, std::vector< Hit > &clustersOut, std::vector< int32_t > &digiIndRef, std::vector< inputType::iterator > *lastChanPos=nullptr)
std::tuple< std::vector< Hit >, std::vector< size_t >, std::vector< u32 >, std::vector< int32_t > > resultType
Clusterizer(ClusterizerRpcPar params)
Constructor.
ClusterizerRpcPar fParams
Parameter container.
std::vector< std::pair< const CbmTofDigi *, int32_t > > inputType
resultType buildClusters(std::vector< inputType > &input)