CbmRoot
CbmStsAlgoFindClusters.h
Go to the documentation of this file.
1 
6 #ifndef CBMSTSALGOFINDCLUSTERS_H
7 #define CBMSTSALGOFINDCLUSTERS_H 1
8 
9 
10 #include <Rtypes.h>
11 #include <vector>
12 
13 class CbmStsCluster;
14 class CbmStsDigi;
15 class CbmStsParModule;
16 
17 
55 
56 public:
58  typedef std::pair<const CbmStsDigi*, Long64_t> InputData;
59 
60 
63 
64 
67 
68 
85  Long64_t Exec(const std::vector<InputData>& input,
86  std::vector<CbmStsCluster>& output,
87  UInt_t address,
88  UShort_t nChannels,
89  UShort_t channelOffset,
90  Double_t timeCutSigma,
91  Double_t timeCutAbs,
92  Bool_t connectEdge,
93  const CbmStsParModule* modPar);
94 
95 
96 private:
104  Short_t ChanLeft(UShort_t channel) {
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  if (fConnectEdge) return (channel == fNofChannels - 1 ? 0 : channel + 1);
119  return channel + 1;
120  }
121 
122 
132  Bool_t CheckChannel(Short_t channel, Double_t time);
133 
134 
144  void CreateCluster(UShort_t channel);
145 
146 
151  Bool_t IsActive(Short_t channel) {
152  if (channel < 0 || channel >= fNofChannels) return kFALSE;
153  return fStatus[channel].first > -1;
154  }
155 
156 
166  Bool_t ProcessDigi(UShort_t channel, Double_t time, Int_t index);
167 
168 
169 private:
175  std::vector<std::pair<Long64_t, Double_t>> fStatus {1024, {-1, 0.}};
176 
178  std::vector<CbmStsCluster>* fOutput = nullptr;
179 
180  // Required parameters
181  UInt_t fAddress = 0;
182  UShort_t fNofChannels = 0;
183  UShort_t fChannelOffset = 0;
184  Double_t fTimeCutSig = 0.;
185  Double_t fTimeCutAbs = 0.;
186  Bool_t fConnectEdge = kFALSE;
187  const CbmStsParModule* fModPar = nullptr;
188 };
189 
190 #endif /* CBMSTSALGOFINDCLUSTERS_H */
CbmStsCluster
Data class for STS clusters.
Definition: CbmStsCluster.h:31
CbmStsAlgoFindClusters::fModPar
const CbmStsParModule * fModPar
Definition: CbmStsAlgoFindClusters.h:187
CbmStsAlgoFindClusters::CreateCluster
void CreateCluster(UShort_t channel)
Create a cluster from an active channel.
Definition: CbmStsAlgoFindClusters.cxx:101
CbmStsAlgoFindClusters::fOutput
std::vector< CbmStsCluster > * fOutput
Pointer to output vector.
Definition: CbmStsAlgoFindClusters.h:178
CbmStsAlgoFindClusters::Exec
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.
Definition: CbmStsAlgoFindClusters.cxx:55
CbmStsAlgoFindClusters::fTimeCutSig
Double_t fTimeCutSig
Time cut in multiples of error.
Definition: CbmStsAlgoFindClusters.h:184
CbmStsAlgoFindClusters::IsActive
Bool_t IsActive(Short_t channel)
Check for a channel being active.
Definition: CbmStsAlgoFindClusters.h:151
CbmStsAlgoFindClusters::InputData
std::pair< const CbmStsDigi *, Long64_t > InputData
Typedef for input data.
Definition: CbmStsAlgoFindClusters.h:58
CbmStsParModule
Parameters for one STS module.
Definition: CbmStsParModule.h:28
CbmStsAlgoFindClusters::ChanRight
Short_t ChanRight(UShort_t channel)
Number of right neighbour channel.
Definition: CbmStsAlgoFindClusters.h:117
CbmStsDigi
Data class for a single-channel message in the STS.
Definition: CbmStsDigi.h:29
CbmStsAlgoFindClusters::fAddress
UInt_t fAddress
Unique module address for clusters.
Definition: CbmStsAlgoFindClusters.h:181
CbmStsAlgoFindClusters::ChanLeft
Short_t ChanLeft(UShort_t channel)
Number of left neighbour channel.
Definition: CbmStsAlgoFindClusters.h:104
CbmStsAlgoFindClusters::CbmStsAlgoFindClusters
CbmStsAlgoFindClusters()
Default constructor.
Definition: CbmStsAlgoFindClusters.h:62
CbmStsAlgoFindClusters::fNofChannels
UShort_t fNofChannels
Number of channels.
Definition: CbmStsAlgoFindClusters.h:182
CbmStsAlgoFindClusters::fTimeCutAbs
Double_t fTimeCutAbs
Absolute time cut [ns].
Definition: CbmStsAlgoFindClusters.h:185
CbmStsAlgoFindClusters::fStatus
std::vector< std::pair< Long64_t, Double_t > > fStatus
Status buffer.
Definition: CbmStsAlgoFindClusters.h:175
CbmStsAlgoFindClusters
Algorithm for cluster finding in a linear array of channels.
Definition: CbmStsAlgoFindClusters.h:54
CbmStsAlgoFindClusters::CheckChannel
Bool_t CheckChannel(Short_t channel, Double_t time)
Check for a matching digi in a given channel.
Definition: CbmStsAlgoFindClusters.cxx:23
CbmStsAlgoFindClusters::fChannelOffset
UShort_t fChannelOffset
Number of first channel.
Definition: CbmStsAlgoFindClusters.h:183
CbmStsAlgoFindClusters::fConnectEdge
Bool_t fConnectEdge
Connect last and first channel.
Definition: CbmStsAlgoFindClusters.h:186
CbmStsAlgoFindClusters::ProcessDigi
Bool_t ProcessDigi(UShort_t channel, Double_t time, Int_t index)
Process one input digi.
Definition: CbmStsAlgoFindClusters.cxx:141
CbmStsAlgoFindClusters::~CbmStsAlgoFindClusters
virtual ~CbmStsAlgoFindClusters()
Destructor.
Definition: CbmStsAlgoFindClusters.h:66