Belle II Software  release-05-02-19
SVDNoiseCalibrations.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Laura Zani *
7  * *
8  * This software is provided "as is" without any warranty. *
9  * WARNING: Do not try to fry it with water. Use only olive oil. *
10  **************************************************************************/
11 
12 #pragma once
13 
14 #include <vxd/dataobjects/VxdID.h>
15 #include <svd/dbobjects/SVDCalibrationsBase.h>
16 #include <svd/dbobjects/SVDCalibrationsVector.h>
17 #include <framework/database/DBObjPtr.h>
18 #include <svd/calibration/SVDPulseShapeCalibrations.h>
19 
20 #include <string>
21 
22 //#include <framework/logging/Logger.h>
23 
24 
25 namespace Belle2 {
37  class SVDNoiseCalibrations {
38  public:
39  static std::string name;
40  typedef SVDCalibrationsBase< SVDCalibrationsVector< float > >
41  t_payload;
45  {
46  m_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
47  B2INFO("SVDNoiseCalibrations: from now on we are using " <<
48  this->m_aDBObjPtr -> get_uniqueID()); });
49  }
50 
51 
62  inline float getNoise(const VxdID& sensorID, const bool& isU , const unsigned short& strip) const
63  {
64  return m_aDBObjPtr->get(sensorID.getLayerNumber(), sensorID.getLadderNumber(),
65  sensorID.getSensorNumber(), m_aDBObjPtr->sideIndex(isU),
66  strip);
67  }
68 
70  TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
71 
73  bool isValid() { return m_aDBObjPtr.isValid(); }
74 
75 
88  inline float getNoiseInElectrons(const VxdID& sensorID, const bool& isU , const unsigned short& strip) const
89  {
90  SVDPulseShapeCalibrations m_pulseShape;
91  return m_pulseShape.getChargeFromADC(sensorID, isU, strip, getNoise(sensorID, isU, strip));
92  }
93 
94  /* inline void setNoise(const VxdID& sensorID, const bool& isU , const unsigned short& strip, float stripNoise)
95  {
96  m_aDBObjPtr->set(sensorID.getLayerNumber(), sensorID.getLadderNumber(),
97  sensorID.getSensorNumber(), m_aDBObjPtr->sideIndex(isU),
98  strip, stripNoise);
99  }
100  */
101 
102  private:
106  };
108 }
109 
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::SVDNoiseCalibrations::m_aDBObjPtr
DBObjPtr< t_payload > m_aDBObjPtr
the SVDNoiseCalibrations pyaload
Definition: SVDNoiseCalibrations.h:112
Belle2::SVDNoiseCalibrations::t_payload
SVDCalibrationsBase< SVDCalibrationsVector< float > > t_payload
typedef of the SVDNoiseCalibrations payload of all SVD strips
Definition: SVDNoiseCalibrations.h:50
Belle2::SVDNoiseCalibrations::SVDNoiseCalibrations
SVDNoiseCalibrations()
Constructor, no input argument is required.
Definition: SVDNoiseCalibrations.h:53
Belle2::VxdID::getLadderNumber
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:108
Belle2::SVDNoiseCalibrations::getUniqueID
TString getUniqueID()
returns the unique ID of the payload
Definition: SVDNoiseCalibrations.h:79
Belle2::SVDNoiseCalibrations::name
static std::string name
name of the SVDNoiseCalibrations payload
Definition: SVDNoiseCalibrations.h:48
Belle2::SVDPulseShapeCalibrations::getChargeFromADC
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 ...
Definition: SVDPulseShapeCalibrations.h:74
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::VxdID::getSensorNumber
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:110
Belle2::SVDNoiseCalibrations::getNoise
float getNoise(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the noise.
Definition: SVDNoiseCalibrations.h:71
Belle2::SVDNoiseCalibrations::isValid
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
Definition: SVDNoiseCalibrations.h:82
Belle2::VxdID::getLayerNumber
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:106
Belle2::SVDNoiseCalibrations::getNoiseInElectrons
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 ...
Definition: SVDNoiseCalibrations.h:97
Belle2::SVDPulseShapeCalibrations
This class defines the dbobject and the methods to access the SVD calibrations from the local runs pr...
Definition: SVDPulseShapeCalibrations.h:46