Belle II Software  release-06-02-00
SVDCluster.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #ifndef SVDCLUSTER_H
10 #define SVDCLUSTER_H
11 
12 #include <framework/datastore/RelationsObject.h>
13 #include <vxd/dataobjects/VxdID.h>
14 #include <vxd/geometry/SensorInfoBase.h>
15 #include <vxd/geometry/GeoCache.h>
16 
17 #include <sstream>
18 
19 namespace Belle2 {
28  class SVDCluster: public RelationsObject {
29  public:
30 
45  SVDCluster(VxdID sensorID, bool isU, float position, float positionSigma,
46  double clsTime, double clsTimeSigma, float clsCharge, float seedCharge,
47  unsigned short clsSize, float clsSN, float clsChi2, int firstFrame = 0):
48  m_sensorID(sensorID), m_isU(isU),
49  m_position(position), m_positionSigma(positionSigma),
50  m_clsTime(clsTime), m_clsTimeSigma(clsTimeSigma), m_clsCharge(clsCharge),
51  m_seedCharge(seedCharge), m_clsSize(clsSize), m_clsSN(clsSN),
52  m_clsChi2(clsChi2), m_firstFrame(firstFrame)
53  {}
54 
56  SVDCluster(): SVDCluster(0, false, 0.0, 1.0, 0.0, 100.0, 0.0, 0.0, 0, 1.0,
57  100.0)
58  {}
59 
71  SVDCluster(VxdID sensorID, bool isU, float position, double clsTime,
72  double clsTimeSigma, float clsCharge, float seedCharge,
73  unsigned short clsSize):
74  SVDCluster(sensorID, isU, position, 1.0, clsTime, clsTimeSigma,
75  clsCharge, seedCharge, clsSize, 1.0, 100.0)
76  {}
77 
91  SVDCluster(VxdID sensorID, bool isU, float position, float positionSigma,
92  double clsTime, double clsTimeSigma, float clsCharge, float seedCharge,
93  unsigned short clsSize, float clsSN):
94  SVDCluster(sensorID, isU, position, positionSigma, clsTime, clsTimeSigma,
95  clsCharge, seedCharge, clsSize, clsSN, 100.0)
96  {}
97 
101  VxdID getSensorID() const { return m_sensorID; }
102 
104  unsigned short getRawSensorID() const { return m_sensorID; }
105 
109  bool isUCluster() const { return m_isU; }
110 
116  float getPosition(double v = 0) const
117  {
118  if (v == 0) return m_position;
119  else {
121  return (aSensorInfo->getWidth(v) / aSensorInfo->getWidth()) * m_position;
122  }
123  }
124 
128  float getPositionSigma() const { return m_positionSigma; }
129 
133  float getClsTime() const { return m_clsTime; }
134 
138  float getClsTimeSigma() const { return m_clsTimeSigma; }
139 
143  float getCharge() const { return m_clsCharge; }
144 
148  float getSeedCharge() const { return m_seedCharge; }
149 
153  unsigned short getSize() const { return m_clsSize; }
154 
158  float getSNR() const { return m_clsSN; }
159 
163  float getChi2() const { return m_clsChi2; }
164 
168  int getFirstFrame() const { return m_firstFrame; }
169 
173  double getQuality() const { return m_qualityIndicator; }
174 
178  double getQualityError() const { return m_qualityIndicatorError; }
179 
183  void setQualityIndicator(const double qualityIndicator)
184  {
185  m_qualityIndicator = qualityIndicator;
186  }
187 
191  void setQualityIndicatorError(double qualityIndicatorError)
192  {
193  m_qualityIndicatorError = qualityIndicatorError;
194  }
195 
196 
197 
199  std::string print() const
200  {
201  VxdID thisSensorID(m_sensorID);
202  std::ostringstream os;
203  os << "VXDID : " << m_sensorID << " = " << std::string(thisSensorID)
204  << " side: " << ((m_isU) ? "U" : "V") << " position: " << m_position
205  << " +/- " << m_positionSigma << " time: " << m_clsTime << " +/- "
206  << m_clsTimeSigma << " charge: " << m_clsCharge << " seed charge: "
207  << m_seedCharge << " size: " << m_clsSize << " S/N: " << m_clsSN
208  << " Fit Chi2: " << m_clsChi2 << " Signal Prob.: " << m_qualityIndicator
209  << " Signal Prob. Error " << m_qualityIndicatorError << std::endl;
210  return os.str();
211  }
212 
213  protected:
214  unsigned short m_sensorID;
215  bool m_isU;
216  float m_position;
218  double m_clsTime;
219  double m_clsTimeSigma;
220  float m_clsCharge;
221  float m_seedCharge;
222  unsigned short m_clsSize;
223  float m_clsSN;
224  float m_clsChi2;
226  double m_qualityIndicator = {0.};
227  double m_qualityIndicatorError = {0.};
229  ClassDef(SVDCluster, 7)
230 
231  };
232 
233 
235 } //Belle2 namespace
236 #endif
Defines interface for accessing relations of objects in StoreArray.
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:28
void setQualityIndicator(const double qualityIndicator)
Add quality indicator to object.
Definition: SVDCluster.h:183
float m_clsChi2
Chi2 for time/amplitude fit.
Definition: SVDCluster.h:224
double m_qualityIndicator
Probability of signal cluster.
Definition: SVDCluster.h:226
float m_position
Reconstructed hit position in r-phi or z.
Definition: SVDCluster.h:216
int m_firstFrame
firstFrame computed with the MaxSum algorithm
Definition: SVDCluster.h:225
float getClsTime() const
Get average of waveform maximum times of cluster strip signals.
Definition: SVDCluster.h:133
unsigned short m_clsSize
Cluster size in pixels.
Definition: SVDCluster.h:222
SVDCluster()
Default constructor for the ROOT IO.
Definition: SVDCluster.h:56
bool m_isU
True if clusters of u-strips, otherwise false.
Definition: SVDCluster.h:215
unsigned short m_sensorID
Compressed sensor identifier.
Definition: SVDCluster.h:214
float getSNR() const
Get cluster SNR.
Definition: SVDCluster.h:158
unsigned short getSize() const
Get cluster size.
Definition: SVDCluster.h:153
float m_clsCharge
Deposited charge in electrons.
Definition: SVDCluster.h:220
float m_positionSigma
Standard deviation of hit position in r-phi or z.
Definition: SVDCluster.h:217
double m_clsTime
Average waveform maximum time.
Definition: SVDCluster.h:218
float getChi2() const
Get chi2 of the time/amplitude fit.
Definition: SVDCluster.h:163
SVDCluster(VxdID sensorID, bool isU, float position, double clsTime, double clsTimeSigma, float clsCharge, float seedCharge, unsigned short clsSize)
OLD STYLE 8-params constructor, just for backward compatibility.
Definition: SVDCluster.h:71
double getQualityError() const
Get cluster quality indicator error.
Definition: SVDCluster.h:178
float m_clsSN
Cluster S/N ratio.
Definition: SVDCluster.h:223
double getQuality() const
Get cluster quality indicator.
Definition: SVDCluster.h:173
float getCharge() const
Get collected charge.
Definition: SVDCluster.h:143
SVDCluster(VxdID sensorID, bool isU, float position, float positionSigma, double clsTime, double clsTimeSigma, float clsCharge, float seedCharge, unsigned short clsSize, float clsSN, float clsChi2, int firstFrame=0)
Constructor.
Definition: SVDCluster.h:45
double m_clsTimeSigma
Standard deviation of waveform maximum times.
Definition: SVDCluster.h:219
void setQualityIndicatorError(double qualityIndicatorError)
Add quality indicator error to object.
Definition: SVDCluster.h:191
VxdID getSensorID() const
Get the sensor ID.
Definition: SVDCluster.h:101
bool isUCluster() const
Get the direction of strips.
Definition: SVDCluster.h:109
float getSeedCharge() const
Get seed charge.
Definition: SVDCluster.h:148
float getPosition(double v=0) const
Get the coordinate of reconstructed hit.
Definition: SVDCluster.h:116
std::string print() const
Get a string representation of the cluster.
Definition: SVDCluster.h:199
float getClsTimeSigma() const
Get the error of the reconstructed hit time.
Definition: SVDCluster.h:138
SVDCluster(VxdID sensorID, bool isU, float position, float positionSigma, double clsTime, double clsTimeSigma, float clsCharge, float seedCharge, unsigned short clsSize, float clsSN)
OLD STYLE Constructor, just for backward compatibility.
Definition: SVDCluster.h:91
float m_seedCharge
Cluster seed charge in electrons.
Definition: SVDCluster.h:221
float getPositionSigma() const
Get the error of the reconstructed hit coordinate.
Definition: SVDCluster.h:128
double m_qualityIndicatorError
Error associated with probability calcualtion.
Definition: SVDCluster.h:227
int getFirstFrame() const
Get firstFrame of the MaxSum algorithm.
Definition: SVDCluster.h:168
unsigned short getRawSensorID() const
Get raw sensor ID.
Definition: SVDCluster.h:104
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:66
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:213
Base class to provide Sensor Information for PXD and SVD.
double getWidth(double v=0) const
Return the width of the sensor.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.