Belle II Software development
SVDCoGOnlyPositionError.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/SVDCalibrationsScalar.h>
14#include <svd/dbobjects/SVDPositionErrorFunction.h>
15#include <framework/database/DBObjPtr.h>
16#include <framework/logging/Logger.h>
17#include <string>
18
19namespace Belle2 {
30 public:
31 static std::string name;
37 {
38 m_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
39 B2DEBUG(20, "SVDCoGOnlyPositionError: from now on we are using " <<
40 this->m_aDBObjPtr -> get_uniqueID()); });
41 }
42
55 inline double getPositionError(
56 const Belle2::VxdID& sensorID,
57 const bool& isU, const unsigned short& strip,
58 const double& clSNR,
59 const int& clSize,
60 const float& pitch
61 ) const
62 {
63 return pitch * m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
64 sensorID.getLadderNumber(),
65 sensorID.getSensorNumber(),
66 m_aDBObjPtr->sideIndex(isU),
67 strip).getPositionError(clSNR, clSize);
68
69 }
70
72 TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
73
75 bool isValid() { return m_aDBObjPtr.isValid(); }
76
77
78 private:
79
81 };
83}
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
base class for calibrations classes
This class defines the dbobject and the methods to access the SVD position error parameters and provi...
static std::string name
name of the SVDPositionErrorFunction payload
double getPositionError(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &clSNR, const int &clSize, const float &pitch) const
Return the position error.
SVDCoGOnlyPositionError()
Constructor, no input argument is required.
SVDCalibrationsBase< SVDCalibrationsScalar< SVDPositionErrorFunction > > t_payload
typedef for the SVDPositionErrorFunction payload of all SVD sensors
TString getUniqueID()
returns the unique ID of the payload
DBObjPtr< t_payload > m_aDBObjPtr
SVDPositionErrorFunction payload.
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
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.