Belle II Software  release-08-01-10
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 #include <vector>
19 
20 namespace Belle2 {
29  class SVDCluster: public RelationsObject {
30  public:
31 
46  SVDCluster(VxdID sensorID, bool isU, float position, float positionSigma,
47  double clsTime, double clsTimeSigma, float clsCharge, float seedCharge,
48  unsigned short clsSize, float clsSN, float clsChi2, int firstFrame = 0):
49  m_sensorID(sensorID), m_isU(isU),
50  m_position(position), m_positionSigma(positionSigma),
51  m_clsTime(clsTime), m_clsTimeSigma(clsTimeSigma), m_clsCharge(clsCharge),
52  m_seedCharge(seedCharge), m_clsSize(clsSize), m_clsSN(clsSN),
53  m_clsChi2(clsChi2), m_firstFrame(firstFrame)
54  {}
55 
57  SVDCluster(): SVDCluster(0, false, 0.0, 1.0, 0.0, 100.0, 0.0, 0.0, 0, 1.0,
58  100.0)
59  {}
60 
72  SVDCluster(VxdID sensorID, bool isU, float position, double clsTime,
73  double clsTimeSigma, float clsCharge, float seedCharge,
74  unsigned short clsSize):
75  SVDCluster(sensorID, isU, position, 1.0, clsTime, clsTimeSigma,
76  clsCharge, seedCharge, clsSize, 1.0, 100.0)
77  {}
78 
92  SVDCluster(VxdID sensorID, bool isU, float position, float positionSigma,
93  double clsTime, double clsTimeSigma, float clsCharge, float seedCharge,
94  unsigned short clsSize, float clsSN):
95  SVDCluster(sensorID, isU, position, positionSigma, clsTime, clsTimeSigma,
96  clsCharge, seedCharge, clsSize, clsSN, 100.0)
97  {}
98 
102  VxdID getSensorID() const { return m_sensorID; }
103 
105  unsigned short getRawSensorID() const { return m_sensorID; }
106 
110  bool isUCluster() const { return m_isU; }
111 
117  float getPosition(double v = 0) const
118  {
119  if (v == 0) return m_position;
120  else {
122  return (aSensorInfo->getWidth(v) / aSensorInfo->getWidth()) * m_position;
123  }
124  }
125 
129  float getPositionSigma() const { return m_positionSigma; }
130 
134  float getClsTime() const { return m_clsTime; }
135 
139  float getClsTimeSigma() const { return m_clsTimeSigma; }
140 
144  float getCharge() const { return m_clsCharge; }
145 
149  float getSeedCharge() const { return m_seedCharge; }
150 
154  unsigned short getSize() const { return m_clsSize; }
155 
159  float getSNR() const { return m_clsSN; }
160 
164  float getChi2() const { return m_clsChi2; }
165 
169  int getFirstFrame() const { return m_firstFrame; }
170 
174  double getQuality() const { return m_qualityIndicator; }
175 
179  double getQualityError() const { return m_qualityIndicatorError; }
180 
184  const std::vector<int>& getTimeGroupId() const { return m_timeGroupId; }
185 
189  const std::vector<std::tuple<float, float, float>>& getTimeGroupInfo() const { return m_timeGroupInfo; }
190 
194  void setPosition(const double position)
195  {
196  m_position = position;
197  }
198 
202  void setClsTime(const double time)
203  {
204  m_clsTime = time;
205  }
206 
210  void setQualityIndicator(const double qualityIndicator)
211  {
212  m_qualityIndicator = qualityIndicator;
213  }
214 
218  void setQualityIndicatorError(double qualityIndicatorError)
219  {
220  m_qualityIndicatorError = qualityIndicatorError;
221  }
222 
226  std::vector<int>& setTimeGroupId() { return m_timeGroupId; }
227 
231  std::vector<std::tuple<float, float, float>>& setTimeGroupInfo() { return m_timeGroupInfo; }
232 
234  std::string print() const
235  {
236  VxdID thisSensorID(m_sensorID);
237  std::ostringstream os;
238  os << "VXDID : " << m_sensorID << " = " << std::string(thisSensorID)
239  << " side: " << ((m_isU) ? "U" : "V") << " position: " << m_position
240  << " +/- " << m_positionSigma << " time: " << m_clsTime << " +/- "
241  << m_clsTimeSigma << " charge: " << m_clsCharge << " seed charge: "
242  << m_seedCharge << " size: " << m_clsSize << " S/N: " << m_clsSN
243  << " Fit Chi2: " << m_clsChi2 << " Signal Prob.: " << m_qualityIndicator
244  << " Signal Prob. Error " << m_qualityIndicatorError << std::endl;
245  return os.str();
246  }
247 
248  protected:
249  unsigned short m_sensorID;
250  bool m_isU;
251  float m_position;
253  double m_clsTime;
254  double m_clsTimeSigma;
255  float m_clsCharge;
256  float m_seedCharge;
257  unsigned short m_clsSize;
258  float m_clsSN;
259  float m_clsChi2;
261  std::vector<int> m_timeGroupId;
262  std::vector<std::tuple<float, float, float>> m_timeGroupInfo;
264  double m_qualityIndicator = {0.};
265  double m_qualityIndicatorError = {0.};
267  ClassDef(SVDCluster, 8)
268 
269  };
270 
271 
273 } //Belle2 namespace
274 #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:29
void setQualityIndicator(const double qualityIndicator)
Add quality indicator to object.
Definition: SVDCluster.h:210
float m_clsChi2
Chi2 for time/amplitude fit.
Definition: SVDCluster.h:259
std::vector< int > m_timeGroupId
Grouping of clusters in time.
Definition: SVDCluster.h:261
double m_qualityIndicator
Probability of signal cluster.
Definition: SVDCluster.h:264
float m_position
Reconstructed hit position in r-phi or z.
Definition: SVDCluster.h:251
int m_firstFrame
firstFrame computed with the MaxSum algorithm
Definition: SVDCluster.h:260
float getClsTime() const
Get average of waveform maximum times of cluster strip signals.
Definition: SVDCluster.h:134
unsigned short m_clsSize
Cluster size in pixels.
Definition: SVDCluster.h:257
SVDCluster()
Default constructor for the ROOT IO.
Definition: SVDCluster.h:57
bool m_isU
True if clusters of u-strips, otherwise false.
Definition: SVDCluster.h:250
unsigned short m_sensorID
Compressed sensor identifier.
Definition: SVDCluster.h:249
void setClsTime(const double time)
Set time of the cluster.
Definition: SVDCluster.h:202
float getSNR() const
Get cluster SNR.
Definition: SVDCluster.h:159
void setPosition(const double position)
Set position of the cluster.
Definition: SVDCluster.h:194
unsigned short getSize() const
Get cluster size.
Definition: SVDCluster.h:154
std::vector< std::tuple< float, float, float > > m_timeGroupInfo
TimeGroup Gaussian Parameters, (integral, center, sigma)
Definition: SVDCluster.h:262
float m_clsCharge
Deposited charge in electrons.
Definition: SVDCluster.h:255
float m_positionSigma
Standard deviation of hit position in r-phi or z.
Definition: SVDCluster.h:252
double m_clsTime
Average waveform maximum time.
Definition: SVDCluster.h:253
float getChi2() const
Get chi2 of the time/amplitude fit.
Definition: SVDCluster.h:164
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:72
double getQualityError() const
Get cluster quality indicator error.
Definition: SVDCluster.h:179
float m_clsSN
Cluster S/N ratio.
Definition: SVDCluster.h:258
double getQuality() const
Get cluster quality indicator.
Definition: SVDCluster.h:174
float getCharge() const
Get collected charge.
Definition: SVDCluster.h:144
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:46
double m_clsTimeSigma
Standard deviation of waveform maximum times.
Definition: SVDCluster.h:254
void setQualityIndicatorError(double qualityIndicatorError)
Add quality indicator error to object.
Definition: SVDCluster.h:218
VxdID getSensorID() const
Get the sensor ID.
Definition: SVDCluster.h:102
bool isUCluster() const
Get the direction of strips.
Definition: SVDCluster.h:110
std::vector< int > & setTimeGroupId()
Set ID of the time-group.
Definition: SVDCluster.h:226
float getSeedCharge() const
Get seed charge.
Definition: SVDCluster.h:149
float getPosition(double v=0) const
Get the coordinate of reconstructed hit.
Definition: SVDCluster.h:117
std::string print() const
Get a string representation of the cluster.
Definition: SVDCluster.h:234
float getClsTimeSigma() const
Get the error of the reconstructed hit time.
Definition: SVDCluster.h:139
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:92
float m_seedCharge
Cluster seed charge in electrons.
Definition: SVDCluster.h:256
float getPositionSigma() const
Get the error of the reconstructed hit coordinate.
Definition: SVDCluster.h:129
std::vector< std::tuple< float, float, float > > & setTimeGroupInfo()
Set time-group parameters.
Definition: SVDCluster.h:231
const std::vector< std::tuple< float, float, float > > & getTimeGroupInfo() const
Get time-group parameters.
Definition: SVDCluster.h:189
double m_qualityIndicatorError
Error associated with probability calcualtion.
Definition: SVDCluster.h:265
int getFirstFrame() const
Get firstFrame of the MaxSum algorithm.
Definition: SVDCluster.h:169
const std::vector< int > & getTimeGroupId() const
Get ID of the time-group.
Definition: SVDCluster.h:184
unsigned short getRawSensorID() const
Get raw sensor ID.
Definition: SVDCluster.h:105
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
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.