CbmRoot
|
Algorithm for cluster finding in a linear array of channels. More...
#include <CbmStsAlgoFindClusters.h>
Public Types | |
typedef std::pair< const CbmStsDigi *, Long64_t > | InputData |
Typedef for input data. More... | |
Public Member Functions | |
CbmStsAlgoFindClusters () | |
Default constructor. More... | |
virtual | ~CbmStsAlgoFindClusters () |
Destructor. More... | |
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. More... | |
Private Member Functions | |
Short_t | ChanLeft (UShort_t channel) |
Number of left neighbour channel. More... | |
Short_t | ChanRight (UShort_t channel) |
Number of right neighbour channel. More... | |
Bool_t | CheckChannel (Short_t channel, Double_t time) |
Check for a matching digi in a given channel. More... | |
void | CreateCluster (UShort_t channel) |
Create a cluster from an active channel. More... | |
Bool_t | IsActive (Short_t channel) |
Check for a channel being active. More... | |
Bool_t | ProcessDigi (UShort_t channel, Double_t time, Int_t index) |
Process one input digi. More... | |
Private Attributes | |
std::vector< std::pair< Long64_t, Double_t > > | fStatus {1024, {-1, 0.}} |
Status buffer. More... | |
std::vector< CbmStsCluster > * | fOutput = nullptr |
Pointer to output vector. More... | |
UInt_t | fAddress = 0 |
Unique module address for clusters. More... | |
UShort_t | fNofChannels = 0 |
Number of channels. More... | |
UShort_t | fChannelOffset = 0 |
Number of first channel. More... | |
Double_t | fTimeCutSig = 0. |
Time cut in multiples of error. More... | |
Double_t | fTimeCutAbs = 0. |
Absolute time cut [ns]. More... | |
Bool_t | fConnectEdge = kFALSE |
Connect last and first channel. More... | |
const CbmStsParModule * | fModPar = nullptr |
Algorithm for cluster finding in a linear array of channels.
Cluster finding is performed in a linear array of channels, corresponding e.g. to one side of a STS sensor / module. A cluster is defined by a group of matching digis. Two digis are considered matching if they are in neighbouring channels and their time difference is less than the chosen limit.
Clustering is performed in a streaming way, i.e. on adding of each digi by the method ProcessDigi. If a cluster in the same or in a neighbour channel is found which does not match the digi, it is written to the output. This makes the runtime of the algorithm independent of input data size, but has as a consequence that the output clusters are not sorted w.r.t. time.
The time resolution is assumed to be the same for all digis and has to be specified to the Exec method. The time cut can be specified in units of the time resolution or in absolute units. The latter, if positive, overrides the former.
Clustering around-the-edge means periodic boundary conditions, i.e., the first and the last channel are considered neighbours.
The digis are connected to the cluster in the order left to right, i.e. with ascending channel number. In case of clustering round the edge, the channel at the right edge is considered left neighbour of the first channel, i.e. the cluster starts with high channel number.
The algorithm is described in: V. Friese, EPJ Web of Conferences 214 (2019) 01008
Definition at line 54 of file CbmStsAlgoFindClusters.h.
typedef std::pair<const CbmStsDigi*, Long64_t> CbmStsAlgoFindClusters::InputData |
Typedef for input data.
Definition at line 58 of file CbmStsAlgoFindClusters.h.
|
inline |
Default constructor.
Definition at line 62 of file CbmStsAlgoFindClusters.h.
|
inlinevirtual |
Destructor.
Definition at line 66 of file CbmStsAlgoFindClusters.h.
|
inlineprivate |
Number of left neighbour channel.
channel | Channel number |
In case of clustering round-the-edge, the left neighbour of the first channel is the last channel. Otherwise, it is -1.
Definition at line 104 of file CbmStsAlgoFindClusters.h.
References fConnectEdge, and fNofChannels.
Referenced by CreateCluster(), and ProcessDigi().
|
inlineprivate |
Number of right neighbour channel.
channel | Channel number |
In case of clustering round-the-edge, the right neighbour of the last channel is the first channel. Otherwise, it is the increment.
Definition at line 117 of file CbmStsAlgoFindClusters.h.
References fConnectEdge, and fNofChannels.
Referenced by CreateCluster(), and ProcessDigi().
|
private |
Check for a matching digi in a given channel.
channel | Channel number |
time | Time [ns] |
The digi is considered matching if the time difference between the time argument and the time of the active digi in the channel is within the time window defined by the cut value.
Definition at line 23 of file CbmStsAlgoFindClusters.cxx.
References CreateCluster(), fModPar, fNofChannels, fStatus, fTimeCutAbs, fTimeCutSig, CbmStsParModule::GetParAsic(), CbmStsParAsic::GetTimeResol(), and IsActive().
Referenced by ProcessDigi().
|
private |
Create a cluster from an active channel.
channel | Channel number |
Starting from the specified channel, a cluster is created by searching for active neighbours left and right until an inactive channel is found.
No action if the channel is not active.
Definition at line 101 of file CbmStsAlgoFindClusters.cxx.
References ChanLeft(), ChanRight(), fAddress, fConnectEdge, first, fNofChannels, fOutput, fStatus, IsActive(), and CbmCluster::SetAddress().
Referenced by CheckChannel(), and Exec().
Long64_t CbmStsAlgoFindClusters::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.
input | Vector of input data (pairs of digi and index) |
output | Vector of output clusters |
address | Cluster address (module) |
nChannels | Number of channels |
channelOffset | Number of first channel |
timeResol | Time resolution of digis [ns] |
timeCutSigma | Time cut in units of time resolution |
timeCutAbs | Time cut in ns |
connectEdge | If true, clustering round-the-edge is done. |
isBackSide | Treat back-side clusters w.r.t. channel number |
The channel numbers are assumed to be consecutive, starting with channelOffset. If connectEdge is specififed, the first channel and the last channel are considered neighbours.
Definition at line 55 of file CbmStsAlgoFindClusters.cxx.
References CreateCluster(), fAddress, fChannelOffset, fConnectEdge, fModPar, fNofChannels, fOutput, fStatus, fTimeCutAbs, fTimeCutSig, and ProcessDigi().
Referenced by CbmStsRecoModule::Reconstruct().
|
inlineprivate |
Check for a channel being active.
channel | Channel number |
Definition at line 151 of file CbmStsAlgoFindClusters.h.
References fNofChannels, and fStatus.
Referenced by CheckChannel(), and CreateCluster().
|
private |
Process one input digi.
channel | Channel number |
time | Digi time [ns] |
index | Index of digi object in its TClonesArray |
Depending on the state of the respective channel, the proper action is taken.
Definition at line 141 of file CbmStsAlgoFindClusters.cxx.
References ChanLeft(), ChanRight(), CheckChannel(), fNofChannels, and fStatus.
Referenced by Exec().
|
private |
Unique module address for clusters.
Definition at line 181 of file CbmStsAlgoFindClusters.h.
Referenced by CreateCluster(), and Exec().
|
private |
Number of first channel.
Definition at line 183 of file CbmStsAlgoFindClusters.h.
Referenced by Exec().
|
private |
Connect last and first channel.
Definition at line 186 of file CbmStsAlgoFindClusters.h.
Referenced by ChanLeft(), ChanRight(), CreateCluster(), and Exec().
|
private |
Definition at line 187 of file CbmStsAlgoFindClusters.h.
Referenced by CheckChannel(), and Exec().
|
private |
Number of channels.
Definition at line 182 of file CbmStsAlgoFindClusters.h.
Referenced by ChanLeft(), ChanRight(), CheckChannel(), CreateCluster(), Exec(), IsActive(), and ProcessDigi().
|
private |
Pointer to output vector.
Definition at line 178 of file CbmStsAlgoFindClusters.h.
Referenced by CreateCluster(), and Exec().
|
private |
Status buffer.
The vector index is the channel number. The first element of the content is the digi index, the second one the time.
Definition at line 175 of file CbmStsAlgoFindClusters.h.
Referenced by CheckChannel(), CreateCluster(), Exec(), IsActive(), and ProcessDigi().
|
private |
Absolute time cut [ns].
Definition at line 185 of file CbmStsAlgoFindClusters.h.
Referenced by CheckChannel(), and Exec().
|
private |
Time cut in multiples of error.
Definition at line 184 of file CbmStsAlgoFindClusters.h.
Referenced by CheckChannel(), and Exec().