Belle II Software  release-05-01-25
SVDPedestalCalibrations.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Giulia Casarosa *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <vxd/dataobjects/VxdID.h>
14 #include <svd/dbobjects/SVDCalibrationsBase.h>
15 #include <svd/dbobjects/SVDCalibrationsVector.h>
16 #include <framework/database/DBObjPtr.h>
17 
18 #include <string>
19 
20 namespace Belle2 {
32  class SVDPedestalCalibrations {
33  public:
34  static std::string name;
35  typedef SVDCalibrationsBase< SVDCalibrationsVector< float > >
36  t_payload;
40  {
41  m_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
42  B2INFO("SVDPedestalCalibrations: from now on we are using " <<
43  this->m_aDBObjPtr -> get_uniqueID()); });
44  }
45 
46 
57  inline float getPedestal(const VxdID& sensorID, const bool& isU , const unsigned short& strip) const
58  {
59  return m_aDBObjPtr->get(sensorID.getLayerNumber(), sensorID.getLadderNumber(),
60  sensorID.getSensorNumber(), m_aDBObjPtr->sideIndex(isU),
61  strip);
62  }
63 
64  /* inline void setPedestal(const VxdID& sensorID, const bool& isU , const unsigned short& strip, float stripPedestal)
65  {
66  m_aDBObjPtr->set(sensorID.getLayerNumber(), sensorID.getLadderNumber(),
67  sensorID.getSensorNumber(), m_aDBObjPtr->sideIndex(isU),
68  strip, stripPedestal);
69  }
70  */
71 
73  TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
74 
76  bool isValid() { return m_aDBObjPtr.isValid(); }
77 
78  private:
79  DBObjPtr< t_payload > m_aDBObjPtr;
82  };
84 }
85 
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::SVDPedestalCalibrations::m_aDBObjPtr
DBObjPtr< t_payload > m_aDBObjPtr
SVDPedestalCalibrations payload.
Definition: SVDPedestalCalibrations.h:87
Belle2::SVDPedestalCalibrations::getUniqueID
TString getUniqueID()
returns the unique ID of the payload
Definition: SVDPedestalCalibrations.h:81
Belle2::SVDPedestalCalibrations::isValid
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
Definition: SVDPedestalCalibrations.h:84
Belle2::VxdID::getLadderNumber
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:108
Belle2::SVDPedestalCalibrations::SVDPedestalCalibrations
SVDPedestalCalibrations()
Constructor, no input argument is required.
Definition: SVDPedestalCalibrations.h:47
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVDPedestalCalibrations::getPedestal
float getPedestal(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the pedestal.
Definition: SVDPedestalCalibrations.h:65
Belle2::SVDPedestalCalibrations::t_payload
SVDCalibrationsBase< SVDCalibrationsVector< float > > t_payload
typedef of the SVDPedestalCalibrations payload of all SVD strips
Definition: SVDPedestalCalibrations.h:44
Belle2::SVDPedestalCalibrations::name
static std::string name
name of the SVDPedestalCalibrations payload
Definition: SVDPedestalCalibrations.h:42
Belle2::VxdID::getSensorNumber
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:110
Belle2::VxdID::getLayerNumber
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:106