Belle II Software development
SVDRecoTimeBase.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 SVD_RECOTIMEBASE_H
10#define SVD_RECOTIMEBASE_H
11
12#include <vxd/dataobjects/VxdID.h>
13#include <framework/datastore/RelationsObject.h>
14
15#include <vector>
16#include <sstream>
17#include <string>
18#include <algorithm>
19
20namespace Belle2 {
35
36 public:
37
40 typedef float BinnedDataType;
42 typedef std::vector<BinnedDataType> BinEdgesArray;
43
49 template<typename T>
50 SVDRecoTimeBase(VxdID sensorID, bool isU, const T& bins):
51 m_sensorID(sensorID), m_isU(isU)
52 {
53 std::copy(bins.begin(), bins.end(), std::back_inserter(m_bins));
54 }
55
57 SVDRecoTimeBase() : SVDRecoTimeBase(0, true, std::vector<double>({0.0}))
58 { }
59
63 VxdID getSensorID() const { return m_sensorID; }
64
70
74 bool isUStrip() const { return m_isU; }
75
79 std::size_t getNBins() const { return m_bins.size() - 1; }
80
84 const BinEdgesArray& getBins() const
85 {
86 return m_bins;
87 }
88
90 std::string toString() const
91 {
92 VxdID thisSensorID(m_sensorID);
93
94 std::ostringstream os;
95 os << "VXDID : " << m_sensorID << " = " << std::string(thisSensorID)
96 << " side: " << ((m_isU) ? "U" : "V") << " bins: ";
97 std::copy(m_bins.begin(), m_bins.end(),
98 std::ostream_iterator<BinnedDataType>(os, " "));
99 return os.str();
100 }
101
102 private:
103
105 bool m_isU;
110 }; // class SVDRecoTimeBase
111
113} // end namespace Belle2
114
115#endif // SVD_RECOTIMEBASE_H
Defines interface for accessing relations of objects in StoreArray.
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
The SVD RecoTimeBase class.
std::size_t getNBins() const
Get number of bins.
bool m_isU
True if U, false if V.
BinEdgesArray m_bins
Bins used by the time fitter.
std::string toString() const
Display main parameters in this object.
VxdID::baseType m_sensorID
Compressed sensor identifier.
VxdID::baseType getRawSensorID() const
Get raw sensor ID.
const BinEdgesArray & getBins() const
Get the bins array.
float BinnedDataType
Types for bins array.
SVDRecoTimeBase()
Default constructor for the ROOT IO.
VxdID getSensorID() const
Get the sensor ID.
std::vector< BinnedDataType > BinEdgesArray
BinEdgesArray[i] is the left edge of bin i.
bool isUStrip() const
Get strip direction.
SVDRecoTimeBase(VxdID sensorID, bool isU, const T &bins)
Constructor using a stl container of time bin probabilities.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
unsigned short baseType
The base integer type for VxdID.
Definition: VxdID.h:36
Abstract base class for different kinds of events.
STL namespace.