Belle II Software  release-05-02-19
SimpleClusterCandidate.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Giulia Casarosa *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef SVD_SIMPLECLUSTERCANDIDATE_H
12 #define SVD_SIMPLECLUSTERCANDIDATE_H
13 
14 #include <vxd/dataobjects/VxdID.h>
15 #include <svd/dataobjects/SVDShaperDigit.h>
16 #include <vector>
17 
18 namespace Belle2 {
24  namespace SVD {
25 
30  struct stripInCluster {
31  int recoDigitIndex;
32  float charge;
33  float noise;
34  int cellID;
35  float time;
36  float timeError;
37  };
38 
43 
44  public:
45 
47  SimpleClusterCandidate(VxdID vxdID, bool isUside, int sizeHeadTail, double cutSeed, double cutAdjacent, double cutSNR,
48  int timeAlgorithm);
49 
52  SimpleClusterCandidate(VxdID vxdID, bool isUside, int sizeHeadTail, double cutSeed, double cutAdjacent, double cutSNR,
53  int timeAlgorithm,
54  std::string storeShaperDigitsName,
55  std::string storeRecoDigitsName);
56 
63  bool add(VxdID vxdID, bool isUside, struct stripInCluster& aStrip);
64 
68  void finalizeCluster();
69 
73  bool isGoodCluster();
74 
78  VxdID getSensorID() {return m_vxdID;}
79 
83  bool isUSide() {return m_isUside;}
84 
88  float getCharge() const { return m_charge; }
89 
93  float getChargeError() const { return m_chargeError; }
94 
98  float getSeedCharge() const { return m_seedCharge; }
99 
103  float getTime() const;
107  float get6SampleCoGTime() const { return m_6SampleTime; }
111  float get3SampleCoGRawTime() const;
115  float get3SampleELSRawTime() const;
116 
121  float getTimeError() const;
125  float get6SampleCoGTimeError() const { return m_6SampleTimeError; }
129  float get3SampleCoGTimeError() const;
133  float get3SampleELSTimeError() const;
134 
140 
146  std::pair<int, std::vector<float>> getMaxSum3Samples() const;
147 
152  int getFirstFrame()
153  {
154  if (m_timeAlgorithm == 0)
155  return 0;
156  return getMaxSum3Samples().first;
157  }
158 
162  float getPosition() const { return m_position; }
163 
167  float getPositionError() const { return m_positionError; }
168 
172  float getSNR() const { return m_SNR; }
173 
177  int size() const { return m_strips.size(); }
178 
180  const std::vector<stripInCluster> getStripsInCluster() const { return m_strips; };
181 
182  protected:
183 
185  bool m_stopCreationCluster = false;
186 
189 
191  bool m_isUside;
192 
194  int m_sizeHeadTail;
195 
197  double m_cutSeed;
198 
200  double m_cutAdjacent;
201 
203  double m_cutCluster;
204 
210  int m_timeAlgorithm = 0;
211 
213  float m_charge;
214 
216  float m_chargeError;
217 
219  float m_seedCharge;
220 
222  float m_6SampleTime;
223 
225  float m_6SampleTimeError;
226 
228  float m_position;
229 
231  float m_positionError;
232 
234  float m_SNR;
235 
237  float m_seedSNR;
238 
240  int m_seedIndex;
241 
243  // int m_firstFrame = 0;
244 
246  std::vector<stripInCluster> m_strips;
247 
249  std::string m_storeShaperDigitsName;
250 
252  std::string m_storeRecoDigitsName;
253 
254  };
255 
256  }
257 
259 }
260 
261 #endif //SVD_SIMPLECLUSTERCANDIDATE_H
Belle2::SVD::SimpleClusterCandidate::getTime
float getTime() const
return the time of the cluster depending on the m_timeAlgorithm
Definition: SimpleClusterCandidate.cc:226
Belle2::SVD::SimpleClusterCandidate::size
int size() const
return the cluster size (number of strips of the cluster
Definition: SimpleClusterCandidate.h:185
Belle2::SVD::SimpleClusterCandidate::m_seedIndex
int m_seedIndex
SVDRecoDigit index of the seed strip of the cluster.
Definition: SimpleClusterCandidate.h:248
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::SVD::SimpleClusterCandidate::getPosition
float getPosition() const
return the position of the cluster
Definition: SimpleClusterCandidate.h:170
Belle2::SVD::stripInCluster
structure containing the relevant informations of eachstrip of the cluster
Definition: SimpleClusterCandidate.h:38
Belle2::SVD::SimpleClusterCandidate::m_charge
float m_charge
Charge of the cluster.
Definition: SimpleClusterCandidate.h:221
Belle2::SVD::SimpleClusterCandidate::m_6SampleTimeError
float m_6SampleTimeError
Error on Time of the cluster computed with the 6-sample CoG (not implemented yet)
Definition: SimpleClusterCandidate.h:233
Belle2::SVD::stripInCluster::charge
float charge
strip charge
Definition: SimpleClusterCandidate.h:40
Belle2::SVD::stripInCluster::recoDigitIndex
int recoDigitIndex
index of the reco digit
Definition: SimpleClusterCandidate.h:39
Belle2::SVD::SimpleClusterCandidate::m_seedSNR
float m_seedSNR
SNR of the seed strip.
Definition: SimpleClusterCandidate.h:245
Belle2::SVD::SimpleClusterCandidate::SimpleClusterCandidate
SimpleClusterCandidate(VxdID vxdID, bool isUside, int sizeHeadTail, double cutSeed, double cutAdjacent, double cutSNR, int timeAlgorithm)
Constructor to create an empty Cluster.
Definition: SimpleClusterCandidate.cc:30
Belle2::SVD::SimpleClusterCandidate
Class representing a cluster candidate during simple clustering of the SVD.
Definition: SimpleClusterCandidate.h:50
Belle2::SVD::SimpleClusterCandidate::m_6SampleTime
float m_6SampleTime
Time of the cluster computed with the 6-sample CoG.
Definition: SimpleClusterCandidate.h:230
Belle2::SVD::SimpleClusterCandidate::getStripsInCluster
const std::vector< stripInCluster > getStripsInCluster() const
returns the vector of the strips in the cluster
Definition: SimpleClusterCandidate.h:188
Belle2::SVD::SimpleClusterCandidate::get6SampleCoGTime
float get6SampleCoGTime() const
return the time of the cluster for the 6-sample CoG
Definition: SimpleClusterCandidate.h:115
Belle2::SVD::SimpleClusterCandidate::m_stopCreationCluster
bool m_stopCreationCluster
cluster is not good if something goes wrong
Definition: SimpleClusterCandidate.h:193
Belle2::SVD::SimpleClusterCandidate::get6SampleCoGTimeError
float get6SampleCoGTimeError() const
return the time of the cluster for the 6-sample CoG
Definition: SimpleClusterCandidate.h:133
Belle2::SVD::SimpleClusterCandidate::getChargeError
float getChargeError() const
return the error of the charge of the cluster
Definition: SimpleClusterCandidate.h:101
Belle2::SVD::SimpleClusterCandidate::m_timeAlgorithm
int m_timeAlgorithm
selects the algorithm to compute the cluster tim 0 = 6-sample CoG (default) 1 = 3-sample CoG 2 = 3-sa...
Definition: SimpleClusterCandidate.h:218
Belle2::SVD::SimpleClusterCandidate::getSeedCharge
float getSeedCharge() const
return the seed charge of the cluster
Definition: SimpleClusterCandidate.h:106
Belle2::SVD::SimpleClusterCandidate::getPositionError
float getPositionError() const
return the error on the position of the cluster
Definition: SimpleClusterCandidate.h:175
Belle2::SVDShaperDigit::APVFloatSamples
std::array< APVFloatSampleType, c_nAPVSamples > APVFloatSamples
array of APVFloatSampleType objects
Definition: SVDShaperDigit.h:63
Belle2::SVD::SimpleClusterCandidate::m_vxdID
VxdID m_vxdID
VxdID of the cluster.
Definition: SimpleClusterCandidate.h:196
Belle2::SVD::SimpleClusterCandidate::isUSide
bool isUSide()
return true if the cluster is on the U/P side
Definition: SimpleClusterCandidate.h:91
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVD::SimpleClusterCandidate::getSensorID
VxdID getSensorID()
return the VxdID of the cluster sensor
Definition: SimpleClusterCandidate.h:86
Belle2::SVD::SimpleClusterCandidate::get3SampleELSTimeError
float get3SampleELSTimeError() const
return the time of the cluster for the 3-sample ELS
Definition: SimpleClusterCandidate.cc:302
Belle2::SVD::SimpleClusterCandidate::m_storeRecoDigitsName
std::string m_storeRecoDigitsName
Name of the collection to use for the SVDRecoDigits.
Definition: SimpleClusterCandidate.h:260
Belle2::SVD::SimpleClusterCandidate::getClsSamples
Belle2::SVDShaperDigit::APVFloatSamples getClsSamples() const
returns the APVFloatSamples obtained summing sample-by-sample all the strips on the cluster
Definition: SimpleClusterCandidate.cc:310
Belle2::SVD::SimpleClusterCandidate::getTimeError
float getTimeError() const
return the error on the time of the cluster depending on the m_timeAlgorithm, implemented only for th...
Definition: SimpleClusterCandidate.cc:241
Belle2::SVD::SimpleClusterCandidate::m_sizeHeadTail
int m_sizeHeadTail
number of strips after which we switch from COG to HeadTail estimation of the position
Definition: SimpleClusterCandidate.h:202
Belle2::SVD::SimpleClusterCandidate::m_strips
std::vector< stripInCluster > m_strips
first frame selected with the max-sum algorithm
Definition: SimpleClusterCandidate.h:254
Belle2::SVD::SimpleClusterCandidate::m_storeShaperDigitsName
std::string m_storeShaperDigitsName
Name of the collection to use for the SVDShaperDigits.
Definition: SimpleClusterCandidate.h:257
Belle2::SVD::SimpleClusterCandidate::m_cutAdjacent
double m_cutAdjacent
SNR above which the strip can be considered for clustering.
Definition: SimpleClusterCandidate.h:208
Belle2::SVD::SimpleClusterCandidate::get3SampleCoGTimeError
float get3SampleCoGTimeError() const
return the time of the cluster for the 3-sample CoG
Definition: SimpleClusterCandidate.cc:295
Belle2::SVD::SimpleClusterCandidate::get3SampleCoGRawTime
float get3SampleCoGRawTime() const
return the raw time of the cluster for the 3-sample CoG
Definition: SimpleClusterCandidate.cc:256
Belle2::SVD::SimpleClusterCandidate::m_positionError
float m_positionError
Error on Position of the cluster.
Definition: SimpleClusterCandidate.h:239
Belle2::SVD::SimpleClusterCandidate::isGoodCluster
bool isGoodCluster()
return true if the cluster candidate can be promoted to cluster
Definition: SimpleClusterCandidate.cc:209
Belle2::SVD::SimpleClusterCandidate::finalizeCluster
void finalizeCluster()
compute the position, time and their error of the cluster
Definition: SimpleClusterCandidate.cc:108
Belle2::SVD::SimpleClusterCandidate::m_SNR
float m_SNR
SNR of the cluster.
Definition: SimpleClusterCandidate.h:242
Belle2::SVD::SimpleClusterCandidate::getFirstFrame
int getFirstFrame()
return the first frame always 0 if 6-Sample CoG
Definition: SimpleClusterCandidate.h:160
Belle2::SVD::SimpleClusterCandidate::m_chargeError
float m_chargeError
Error on Charge of the cluster.
Definition: SimpleClusterCandidate.h:224
Belle2::SVD::SimpleClusterCandidate::getMaxSum3Samples
std::pair< int, std::vector< float > > getMaxSum3Samples() const
returns the float vector of clustered 3-samples selected by the MaxSum method with First Frame of the...
Definition: SimpleClusterCandidate.cc:339
Belle2::SVD::stripInCluster::time
float time
6-sample CoG strip time
Definition: SimpleClusterCandidate.h:43
Belle2::SVD::stripInCluster::timeError
float timeError
6-sample CoG strip time error
Definition: SimpleClusterCandidate.h:44
Belle2::SVD::SimpleClusterCandidate::get3SampleELSRawTime
float get3SampleELSRawTime() const
return the raw time of the cluster for the 3-sample ELS
Definition: SimpleClusterCandidate.cc:276
Belle2::SVD::SimpleClusterCandidate::m_seedCharge
float m_seedCharge
Seed Charge of the cluster.
Definition: SimpleClusterCandidate.h:227
Belle2::SVD::SimpleClusterCandidate::getSNR
float getSNR() const
return the signal over noise ratio of the cluster
Definition: SimpleClusterCandidate.h:180
Belle2::SVD::SimpleClusterCandidate::m_isUside
bool m_isUside
side of the cluster
Definition: SimpleClusterCandidate.h:199
Belle2::SVD::SimpleClusterCandidate::m_cutSeed
double m_cutSeed
SNR above which the strip can be considered as seed.
Definition: SimpleClusterCandidate.h:205
Belle2::SVD::stripInCluster::cellID
int cellID
strip cellID
Definition: SimpleClusterCandidate.h:42
Belle2::SVD::SimpleClusterCandidate::add
bool add(VxdID vxdID, bool isUside, struct stripInCluster &aStrip)
Add a Strip to the current cluster.
Definition: SimpleClusterCandidate.cc:76
Belle2::SVD::SimpleClusterCandidate::getCharge
float getCharge() const
return the charge of the cluster
Definition: SimpleClusterCandidate.h:96
Belle2::SVD::SimpleClusterCandidate::m_cutCluster
double m_cutCluster
SNR above which the cluster is ok.
Definition: SimpleClusterCandidate.h:211
Belle2::SVD::stripInCluster::noise
float noise
strip noise
Definition: SimpleClusterCandidate.h:41
Belle2::SVD::SimpleClusterCandidate::m_position
float m_position
Position of the cluster.
Definition: SimpleClusterCandidate.h:236