CbmRoot
Loading...
Searching...
No Matches
CbmStsAlgoFindClusters.h
Go to the documentation of this file.
1/* Copyright (C) 2017-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
10#ifndef CBMSTSALGOFINDCLUSTERS_H
11#define CBMSTSALGOFINDCLUSTERS_H 1
12
13
14#include <Rtypes.h>
15
16#include <vector>
17
18class CbmStsCluster;
19class CbmStsDigi;
20class CbmStsParModule;
21
22
60
61 public:
63 typedef std::pair<const CbmStsDigi*, Long64_t> InputData;
64
65
68
69
72
73
90 Long64_t Exec(const std::vector<InputData>& input, std::vector<CbmStsCluster>& output, UInt_t address,
91 UShort_t nChannels, UShort_t channelOffset, Double_t timeCutSigma, Double_t timeCutAbs,
92 Bool_t connectEdge, const CbmStsParModule* modPar);
93
94
95 private:
103 Short_t ChanLeft(UShort_t channel)
104 {
105 if (fConnectEdge) return (channel == 0 ? fNofChannels - 1 : channel - 1);
106 return channel - 1;
107 }
108
109
117 Short_t ChanRight(UShort_t channel)
118 {
119 if (fConnectEdge) return (channel == fNofChannels - 1 ? 0 : channel + 1);
120 return channel + 1;
121 }
122
123
133 Bool_t CheckChannel(Short_t channel, Double_t time);
134
135
145 void CreateCluster(UShort_t channel);
146
147
152 Bool_t IsActive(Short_t channel)
153 {
154 if (channel < 0 || channel >= fNofChannels) return kFALSE;
155 return fStatus[channel].first > -1;
156 }
157
158
168 Bool_t ProcessDigi(UShort_t channel, Double_t time, Int_t index);
169
170
171 private:
177 std::vector<std::pair<Long64_t, Double_t>> fStatus{1024, {-1, 0.}};
178
180 std::vector<CbmStsCluster>* fOutput = nullptr;
181
182 // Required parameters
183 UInt_t fAddress = 0;
184 UShort_t fNofChannels = 0;
185 UShort_t fChannelOffset = 0;
186 Double_t fTimeCutSig = 0.;
187 Double_t fTimeCutAbs = 0.;
188 Bool_t fConnectEdge = kFALSE;
189 const CbmStsParModule* fModPar = nullptr;
190};
191
192#endif /* CBMSTSALGOFINDCLUSTERS_H */
Algorithm for cluster finding in a linear array of channels.
UShort_t fChannelOffset
Number of first channel.
Double_t fTimeCutSig
Time cut in multiples of error.
Short_t ChanRight(UShort_t channel)
Number of right neighbour channel.
Double_t fTimeCutAbs
Absolute time cut [ns].
UShort_t fNofChannels
Number of channels.
std::vector< std::pair< Long64_t, Double_t > > fStatus
Status buffer.
Bool_t IsActive(Short_t channel)
Check for a channel being active.
CbmStsAlgoFindClusters()
Default constructor.
UInt_t fAddress
Unique module address for clusters.
std::vector< CbmStsCluster > * fOutput
Pointer to output vector.
Bool_t ProcessDigi(UShort_t channel, Double_t time, Int_t index)
Process one input digi.
Short_t ChanLeft(UShort_t channel)
Number of left neighbour channel.
Long64_t Exec(const std::vector< InputData > &input, std::vector< CbmStsCluster > &output, UInt_t address, UShort_t nChannels, UShort_t channelOffset, Double_t timeCutSigma, Double_t timeCutAbs, Bool_t connectEdge, const CbmStsParModule *modPar)
Algorithm execution.
std::pair< const CbmStsDigi *, Long64_t > InputData
Typedef for input data.
Bool_t fConnectEdge
Connect last and first channel.
const CbmStsParModule * fModPar
virtual ~CbmStsAlgoFindClusters()
Destructor.
void CreateCluster(UShort_t channel)
Create a cluster from an active channel.
Bool_t CheckChannel(Short_t channel, Double_t time)
Check for a matching digi in a given channel.
Data class for STS clusters.
Data class for a single-channel message in the STS.
Definition CbmStsDigi.h:40
Parameters for one STS module.