Belle II Software  release-05-02-19
SVDFADCMaskedStrips.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 SVDFADCMaskedStrips {
36  public:
37  static std::string name;
38  typedef SVDCalibrationsBase< SVDCalibrationsBitmap > t_payload;
42  {
43  m_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
44  B2INFO("SVDFADCMaskedStrips: from now on we are using " <<
45  this->m_aDBObjPtr -> get_uniqueID()); });
46  }
47 
48 
63  inline float isMasked(const VxdID& sensorID, const bool& isU , const unsigned short& strip) const
64  {
65  return m_aDBObjPtr->get(sensorID.getLayerNumber(), sensorID.getLadderNumber(),
66  sensorID.getSensorNumber(), m_aDBObjPtr->sideIndex(isU),
67  strip);
68  }
69 
70 
72  TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
73 
75  bool isValid() { return m_aDBObjPtr.isValid(); }
76 
77  private:
78  DBObjPtr< t_payload > m_aDBObjPtr;
81  };
83 }
84 
Belle2::SVDFADCMaskedStrips::isMasked
float isMasked(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the comprehensive list of masked strips at FADC level.
Definition: SVDFADCMaskedStrips.h:72
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::SVDFADCMaskedStrips::getUniqueID
TString getUniqueID()
returns the unique ID of the payload
Definition: SVDFADCMaskedStrips.h:81
Belle2::SVDFADCMaskedStrips::t_payload
SVDCalibrationsBase< SVDCalibrationsBitmap > t_payload
typedef of the SVDFADCMaskedStrips payload for all SVD strips
Definition: SVDFADCMaskedStrips.h:47
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVDFADCMaskedStrips::name
static std::string name
name of the SVDFADCMaskedStrips payload
Definition: SVDFADCMaskedStrips.h:46
Belle2::SVDFADCMaskedStrips::m_aDBObjPtr
DBObjPtr< t_payload > m_aDBObjPtr
SVDFADCMaskedStrips payload.
Definition: SVDFADCMaskedStrips.h:87
Belle2::VxdID::getSensorNumber
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:110
Belle2::SVDFADCMaskedStrips::SVDFADCMaskedStrips
SVDFADCMaskedStrips()
Constructor, no input argument is required.
Definition: SVDFADCMaskedStrips.h:50
Belle2::SVDFADCMaskedStrips::isValid
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
Definition: SVDFADCMaskedStrips.h:84
Belle2::VxdID::getLayerNumber
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:106