Belle II Software  release-08-01-10
SVDClustering.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 #pragma once
10 
11 #include <vxd/dataobjects/VxdID.h>
12 #include <svd/dbobjects/SVDCalibrationsBase.h>
13 #include <svd/dbobjects/SVDCalibrationsScalar.h>
14 #include <svd/dbobjects/SVDClusterCuts.h>
15 #include <framework/database/DBObjPtr.h>
16 #include <framework/logging/Logger.h>
17 #include <string>
18 
19 namespace Belle2 {
29  class SVDClustering {
30  public:
31  static std::string name;
37  : m_aDBObjPtr(name)
38  {
39  m_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
40  B2DEBUG(20, "SVDClustering: from now on we are using " <<
41  this->m_aDBObjPtr -> get_uniqueID()); });
42 
43  }
44 
45 
55  inline double getMinSeedSNR(
56  const Belle2::VxdID& sensorID,
57  const bool& isU
58  ) const
59  {
60  return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
61  sensorID.getLadderNumber(),
62  sensorID.getSensorNumber(),
63  m_aDBObjPtr->sideIndex(isU),
64  0).minSeedSNR;
65 
66  }
67 
77  inline double getMinAdjSNR(
78  const Belle2::VxdID& sensorID,
79  const bool& isU
80  ) const
81  {
82  return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
83  sensorID.getLadderNumber(),
84  sensorID.getSensorNumber(),
85  m_aDBObjPtr->sideIndex(isU),
86  0 //strip not relevant
87  ).minAdjSNR;
88 
89  }
90 
100  inline double getUnfoldingCoeff(
101  const Belle2::VxdID& sensorID,
102  const bool& isU
103  ) const
104  {
105  return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
106  sensorID.getLadderNumber(),
107  sensorID.getSensorNumber(),
108  m_aDBObjPtr->sideIndex(isU),
109  0 //strip not relevant
110  ).UnfoldingCoeff;
111 
112  }
113 
123  inline double getMinClusterSNR(
124  const Belle2::VxdID& sensorID,
125  const bool& isU
126  ) const
127  {
128  return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
129  sensorID.getLadderNumber(),
130  sensorID.getSensorNumber(),
131  m_aDBObjPtr->sideIndex(isU),
132  0 // strip not relevant
133  ).minClusterSNR;
134 
135  }
136 
137 
139  TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
140 
142  bool isValid() { return m_aDBObjPtr.isValid(); }
143 
144 
145  private:
146 
148  };
150 }
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
base class for calibrations classes
This class defines the dbobject and the methods to access the calibration of the cluster reconstructi...
Definition: SVDClustering.h:29
SVDClustering()
Constructor, no input argument is required.
Definition: SVDClustering.h:36
static std::string name
name of SVDClusterCuts payload
Definition: SVDClustering.h:31
double getUnfoldingCoeff(const Belle2::VxdID &sensorID, const bool &isU) const
Return the unfolding coefficient for the strip charge.
double getMinClusterSNR(const Belle2::VxdID &sensorID, const bool &isU) const
Return the minimum SNR for the cluster.
double getMinSeedSNR(const Belle2::VxdID &sensorID, const bool &isU) const
Return the minimum SNR for the seed.
Definition: SVDClustering.h:55
SVDCalibrationsBase< SVDCalibrationsScalar< SVDClusterCuts > > t_payload
typedef for the of SVDClusterCuts payload of all SVD sensors
Definition: SVDClustering.h:33
double getMinAdjSNR(const Belle2::VxdID &sensorID, const bool &isU) const
Return the minimum SNR for the adjacent.
Definition: SVDClustering.h:77
TString getUniqueID()
returns the unique ID of the payload
DBObjPtr< t_payload > m_aDBObjPtr
SVDClusterCuts payload.
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:100
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:98
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:96
Abstract base class for different kinds of events.