Belle II Software  release-05-02-19
SVDHotStripsCalibrations.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/SVDCalibrationsBitmap.h>
17 #include <framework/database/DBObjPtr.h>
18 
19 
20 #include <string>
21 
22 //#include <framework/logging/Logger.h>
23 
24 
25 namespace Belle2 {
35  class SVDHotStripsCalibrations {
36  public:
37  static std::string name;
38  typedef SVDCalibrationsBase< SVDCalibrationsBitmap >
39  t_payload;
43  {
44  m_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
45  B2INFO("SVDHotStripsCalibrations: from now on we are using " <<
46  this->m_aDBObjPtr -> get_uniqueID()); });
47  }
48 
49 
61  inline float isHot(const VxdID& sensorID, const bool& isU , const unsigned short& strip) const
62  {
63  return m_aDBObjPtr->get(sensorID.getLayerNumber(), sensorID.getLadderNumber(),
64  sensorID.getSensorNumber(), m_aDBObjPtr->sideIndex(isU),
65  strip);
66  }
67 
68 
70  TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
71 
73  bool isValid() { return m_aDBObjPtr.isValid(); }
74 
75  private:
76  DBObjPtr< t_payload > m_aDBObjPtr;
79  };
81 }
82 
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::VxdID::getLadderNumber
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:108
Belle2::SVDHotStripsCalibrations::t_payload
SVDCalibrationsBase< SVDCalibrationsBitmap > t_payload
typedef of the SVDHotStripsCalibrations payload for all SVD strips
Definition: SVDHotStripsCalibrations.h:48
Belle2::SVDHotStripsCalibrations::isValid
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
Definition: SVDHotStripsCalibrations.h:82
Belle2::SVDHotStripsCalibrations::getUniqueID
TString getUniqueID()
returns the unique ID of the payload
Definition: SVDHotStripsCalibrations.h:79
Belle2::SVDHotStripsCalibrations::name
static std::string name
name of the SVDHotStripsCalibrations payload
Definition: SVDHotStripsCalibrations.h:46
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVDHotStripsCalibrations::m_aDBObjPtr
DBObjPtr< t_payload > m_aDBObjPtr
SVDHotStripsCalibrations payload.
Definition: SVDHotStripsCalibrations.h:85
Belle2::VxdID::getSensorNumber
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:110
Belle2::SVDHotStripsCalibrations::isHot
float isHot(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the offline list of bad strips to be masked.
Definition: SVDHotStripsCalibrations.h:70
Belle2::SVDHotStripsCalibrations::SVDHotStripsCalibrations
SVDHotStripsCalibrations()
Constructor, no input argument is required.
Definition: SVDHotStripsCalibrations.h:51
Belle2::VxdID::getLayerNumber
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:106