Belle II Software  release-08-01-10
SVDNoiseCalibrations.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/SVDCalibrationsVector.h>
14 #include <framework/database/DBObjPtr.h>
15 #include <svd/calibration/SVDPulseShapeCalibrations.h>
16 
17 #include <string>
18 
19 //#include <framework/logging/Logger.h>
20 
21 
22 namespace Belle2 {
35  public:
36  static std::string name;
42  {
43  m_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
44  B2DEBUG(20, "SVDNoiseCalibrations: from now on we are using " <<
45  this->m_aDBObjPtr -> get_uniqueID()); });
46  }
47 
48 
58  inline float getNoise(const VxdID& sensorID, const bool& isU, const unsigned short& strip) const
59  {
60  return m_aDBObjPtr->get(sensorID.getLayerNumber(), sensorID.getLadderNumber(),
61  sensorID.getSensorNumber(), m_aDBObjPtr->sideIndex(isU),
62  strip);
63  }
64 
66  TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
67 
69  bool isValid() { return m_aDBObjPtr.isValid(); }
70 
71 
83  inline float getNoiseInElectrons(const VxdID& sensorID, const bool& isU, const unsigned short& strip) const
84  {
85  SVDPulseShapeCalibrations m_pulseShape;
86  return m_pulseShape.getChargeFromADC(sensorID, isU, strip, getNoise(sensorID, isU, strip));
87  }
88 
89  /* inline void setNoise(const VxdID& sensorID, const bool& isU , const unsigned short& strip, float stripNoise)
90  {
91  m_aDBObjPtr->set(sensorID.getLayerNumber(), sensorID.getLadderNumber(),
92  sensorID.getSensorNumber(), m_aDBObjPtr->sideIndex(isU),
93  strip, stripNoise);
94  }
95  */
96 
97  private:
101  };
103 }
104 
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
base class for calibrations classes
This class defines the dbobject and the method to access SVD calibrations from the noise local runs.
float getNoiseInElectrons(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This method provides the correct noise conversion into electrons, taking into account that the noise ...
float getNoise(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the noise.
SVDCalibrationsBase< SVDCalibrationsVector< float > > t_payload
typedef of the SVDNoiseCalibrations payload of all SVD strips
SVDNoiseCalibrations()
Constructor, no input argument is required.
static std::string name
name of the SVDNoiseCalibrations payload
TString getUniqueID()
returns the unique ID of the payload
DBObjPtr< t_payload > m_aDBObjPtr
the SVDNoiseCalibrations pyaload
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
This class defines the dbobject and the methods to access the SVD calibrations from the local runs pr...
double getChargeFromADC(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &pulseADC) const
Return the charge (number of electrons/holes) collected on a specific strip, given the number of ADC ...
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.