Belle II Software  release-08-01-10
SVD3SampleCoGTimeCalibrations.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/SVDCoGCalibrationFunction.h>
15 #include <framework/database/DBObjPtr.h>
16 #include <framework/logging/Logger.h>
17 #include <string>
18 
19 namespace Belle2 {
32  public:
33  static std::string name;
39  {
40  m_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
41  B2DEBUG(20, "SVD3SampleCoGTimeCalibrations: from now on we are using " <<
42  this->m_aDBObjPtr -> get_uniqueID()); });
43  }
44 
57  inline double getCorrectedTime(
58  const Belle2::VxdID& sensorID,
59  const bool& isU, const unsigned short& strip,
60  const double& raw_time,
61  const int& bin
62  ) const
63  {
64  return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
65  sensorID.getLadderNumber(),
66  sensorID.getSensorNumber(),
67  m_aDBObjPtr->sideIndex(isU),
68  strip).calibratedValue(raw_time, bin);
69 
70  }
71 
84  inline double getCorrectedTimeError(
85  const Belle2::VxdID& sensorID,
86  const bool& isU, const unsigned short& strip,
87  const double& raw_time,
88  const double& raw_timeError,
89  const int& bin
90  ) const
91  {
92  return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
93  sensorID.getLadderNumber(),
94  sensorID.getSensorNumber(),
95  m_aDBObjPtr->sideIndex(isU),
96  strip).calibratedValueError(raw_time, raw_timeError, bin);
97 
98  }
99 
101  TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
102 
104  bool isValid() { return m_aDBObjPtr.isValid(); }
105 
106 
107  private:
108 
110  };
112 }
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
This class defines the dbobject and the methods to access the SVD calibrations from the local runs pr...
double getCorrectedTimeError(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &raw_time, const double &raw_timeError, const int &bin) const
Return the error of the CoG cluster time.
SVDCalibrationsBase< SVDCalibrationsScalar< SVDCoGCalibrationFunction > > t_payload
typedef for the SVDCoGCalibrationFunction payload of all SVD sensors
static std::string name
name of the SVD3SampleCoGTimeCalibration wrapper
SVD3SampleCoGTimeCalibrations()
Constructor, no input argument is required.
TString getUniqueID()
returns the unique ID of the payload
DBObjPtr< t_payload > m_aDBObjPtr
SVDCoGCalibrationFunction payload.
double getCorrectedTime(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &raw_time, const int &bin) const
Return the charge (number of electrons/holes) collected on a specific strip, given the number of ADC ...
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
base class for calibrations classes
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.