Belle II Software development
SVDMCClusterPositionFudgeFactor.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/SVDMCFudgeFactorFunction.h>
15#include <framework/database/DBObjPtr.h>
16#include <string>
17
18namespace Belle2 {
28 public:
29 static std::string name;
35 {
36 m_aDBObjPtr.addCallback([this](const std::string&) -> void
37 { B2DEBUG(20, "SVDMCClusterPositionFudgeFactor: from now on we are using " << this->m_aDBObjPtr->get_uniqueID()); });
38 }
39
49 inline double getFudgeFactor(
50 const Belle2::VxdID& sensorID,
51 const bool& isU,
52 const double& trkAngle) const
53 {
54 return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
55 sensorID.getLadderNumber(),
56 sensorID.getSensorNumber(),
57 m_aDBObjPtr->sideIndex(isU),
58 1)
59 .getFudgeFactor(trkAngle);
60 }
61
63 TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
64
66 bool isValid() { return m_aDBObjPtr.isValid(); }
67
68 private:
70 };
72}
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 cluster position fudge factors for ...
double getFudgeFactor(const Belle2::VxdID &sensorID, const bool &isU, const double &trkAngle) const
Return the MC fudge factor.
DBObjPtr< t_payload > m_aDBObjPtr
SVDMCClusterPositionFudgeFactor payload.
static std::string name
name of the SVDMCClusterPositionFudgeFactor payload
SVDMCClusterPositionFudgeFactor()
Constructor, no input argument is required.
TString getUniqueID()
returns the unique ID of the payload
SVDCalibrationsBase< SVDCalibrationsScalar< SVDMCFudgeFactorFunction > > t_payload
typedef for the SVDMCClusterPositionFudgeFactor payload of all SVD sensors
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.