Belle II Software  release-05-01-25
SVDCrossTalkStripsCalibrations.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 SVDCrossTalkStripsCalibrations {
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("SVDCrossTalkStripsCalibrations: from now on we are using " <<
46  this->m_aDBObjPtr -> get_uniqueID()); });
47  }
48 
49 
62  inline bool isCrossTalkStrip(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 
82  bool isInCrossTalkRegion(const VxdID& sensorID, const bool& isU , const float& clsPosition);
83 
85  TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
86 
88  bool isValid() { return m_aDBObjPtr.isValid(); }
89 
90  private:
91  DBObjPtr< t_payload > m_aDBObjPtr;
93  };
95 }
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::SVDCrossTalkStripsCalibrations::m_aDBObjPtr
DBObjPtr< t_payload > m_aDBObjPtr
SVDCrossTalkStripsCalibrations payload.
Definition: SVDCrossTalkStripsCalibrations.h:100
Belle2::SVDCrossTalkStripsCalibrations::getUniqueID
TString getUniqueID()
returns the unique ID of the payload
Definition: SVDCrossTalkStripsCalibrations.h:94
Belle2::SVDCrossTalkStripsCalibrations::isCrossTalkStrip
bool isCrossTalkStrip(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the comprehensive list of strips flagged as "cross talk" by the SVDCro...
Definition: SVDCrossTalkStripsCalibrations.h:71
Belle2::SVDCrossTalkStripsCalibrations::name
static std::string name
name of the SVDCrossTalkStripsCalibrations payload
Definition: SVDCrossTalkStripsCalibrations.h:46
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::SVDCrossTalkStripsCalibrations::t_payload
SVDCalibrationsBase< SVDCalibrationsBitmap > t_payload
typedef of the SVDCrossTalkStripsCalibrations payload for all SVD strips
Definition: SVDCrossTalkStripsCalibrations.h:48
Belle2::SVDCrossTalkStripsCalibrations::isInCrossTalkRegion
bool isInCrossTalkRegion(const VxdID &sensorID, const bool &isU, const float &clsPosition)
This is the method for checking if a given region is affected by Cross Talk, according to the bitmap ...
Definition: SVDCrossTalkStripsCalibrations.cc:9
Belle2::SVDCrossTalkStripsCalibrations::isValid
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
Definition: SVDCrossTalkStripsCalibrations.h:97
Belle2::VxdID::getLayerNumber
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:106
Belle2::SVDCrossTalkStripsCalibrations::SVDCrossTalkStripsCalibrations
SVDCrossTalkStripsCalibrations()
Constructor, no input argument is required.
Definition: SVDCrossTalkStripsCalibrations.h:51