Belle II Software  release-05-01-25
SVDRecoTimeBase.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Peter Kvasnicka *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef SVD_RECOTIMEBASE_H
12 #define SVD_RECOTIMEBASE_H
13 
14 #include <vxd/dataobjects/VxdID.h>
15 #include <svd/dataobjects/SVDModeByte.h>
16 #include <framework/datastore/RelationsObject.h>
17 
18 #include <vector>
19 #include <sstream>
20 #include <string>
21 #include <algorithm>
22 
23 namespace Belle2 {
37  class SVDRecoTimeBase : public RelationsObject {
38 
39  public:
40 
43  typedef float BinnedDataType;
45  typedef std::vector<BinnedDataType> BinEdgesArray;
46 
54  template<typename T>
55  SVDRecoTimeBase(VxdID sensorID, bool isU, const T& bins,
56  SVDModeByte mode = SVDModeByte()):
57  m_sensorID(sensorID), m_isU(isU), m_mode(mode.getID())
58  {
59  std::copy(bins.begin(), bins.end(), std::back_inserter(m_bins));
60  }
61 
63  SVDRecoTimeBase() : SVDRecoTimeBase(0, true, std::vector<double>( {0.0}))
64  { }
65 
69  VxdID getSensorID() const { return m_sensorID; }
70 
75  VxdID::baseType getRawSensorID() const { return m_sensorID; }
76 
80  bool isUStrip() const { return m_isU; }
81 
85  std::size_t getNBins() const { return m_bins.size() - 1; }
86 
90  const BinEdgesArray& getBins() const
91  {
92  return m_bins;
93  }
94 
99  { return m_mode; }
100 
102  std::string toString() const
103  {
104  VxdID thisSensorID(m_sensorID);
105  SVDModeByte thisMode(m_mode);
106 
107  std::ostringstream os;
108  os << "VXDID : " << m_sensorID << " = " << std::string(thisSensorID)
109  << " side: " << ((m_isU) ? "U" : "V") << " bins: ";
110  std::copy(m_bins.begin(), m_bins.end(),
111  std::ostream_iterator<BinnedDataType>(os, " "));
112  os << " mode: " << thisMode << std::endl;
113  return os.str();
114  }
115 
116  private:
117 
119  bool m_isU;
125  }; // class SVDRecoTimeBase
126 
128 } // end namespace Belle2
129 
130 #endif // SVD_RECOTIMEBASE_H
Belle2::SVDRecoTimeBase::getBins
const BinEdgesArray & getBins() const
Get the bins array.
Definition: SVDRecoTimeBase.h:98
Belle2::SVDRecoTimeBase::BinnedDataType
float BinnedDataType
Types for bins array.
Definition: SVDRecoTimeBase.h:51
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::SVDRecoTimeBase
The SVD RecoTimeBase class.
Definition: SVDRecoTimeBase.h:45
Belle2::SVDRecoTimeBase::toString
std::string toString() const
Display main parameters in this object.
Definition: SVDRecoTimeBase.h:110
Belle2::SVDRecoTimeBase::m_sensorID
VxdID::baseType m_sensorID
Compressed sensor identifier.
Definition: SVDRecoTimeBase.h:126
Belle2::getID
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
Definition: calibTools.h:71
Belle2::RelationsInterface::ClassDef
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
Belle2::SVDRecoTimeBase::getRawSensorID
VxdID::baseType getRawSensorID() const
Get raw sensor ID.
Definition: SVDRecoTimeBase.h:83
Belle2::SVDModeByte
Class to store SVD mode information.
Definition: SVDModeByte.h:79
Belle2::SVDRecoTimeBase::getSensorID
VxdID getSensorID() const
Get the sensor ID.
Definition: SVDRecoTimeBase.h:77
Belle2::VxdID::baseType
unsigned short baseType
The base integer type for VxdID.
Definition: VxdID.h:46
Belle2::SVDRecoTimeBase::m_bins
BinEdgesArray m_bins
Bins used by the time fitter.
Definition: SVDRecoTimeBase.h:128
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVDModeByte::baseType
uint8_t baseType
The base integer type for SVDModeByte.
Definition: SVDModeByte.h:82
Belle2::SVDRecoTimeBase::getModeByte
SVDModeByte getModeByte() const
Get the SVDMOdeByte object containing information on trigger FADCTime and DAQ mode.
Definition: SVDRecoTimeBase.h:106
Belle2::SVDRecoTimeBase::getNBins
std::size_t getNBins() const
Get number of bins.
Definition: SVDRecoTimeBase.h:93
Belle2::SVDRecoTimeBase::SVDRecoTimeBase
SVDRecoTimeBase()
Default constructor for the ROOT IO.
Definition: SVDRecoTimeBase.h:71
Belle2::SVDRecoTimeBase::BinEdgesArray
std::vector< BinnedDataType > BinEdgesArray
BinEdgesArray[i] is the left edge of bin i.
Definition: SVDRecoTimeBase.h:53
Belle2::SVDRecoTimeBase::isUStrip
bool isUStrip() const
Get strip direction.
Definition: SVDRecoTimeBase.h:88
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::SVDRecoTimeBase::m_mode
SVDModeByte::baseType m_mode
Mode byte, trigger FADCTime + DAQ mode.
Definition: SVDRecoTimeBase.h:129
Belle2::SVDRecoTimeBase::m_isU
bool m_isU
True if U, false if V.
Definition: SVDRecoTimeBase.h:127
Belle2::SVDRecoTimeBase::SVDRecoTimeBase
SVDRecoTimeBase(VxdID sensorID, bool isU, const T &bins, SVDModeByte mode=SVDModeByte())
Constructor using a stl container of time bin probabilities.
Definition: SVDRecoTimeBase.h:63