Belle II Software development
SVDHitTimeSelection.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/SVDHitTimeSelectionFunction.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;
38 {
39 m_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
40 B2DEBUG(20, "SVDHitTimeSelection: from now on we are using " <<
41 this->m_aDBObjPtr -> get_uniqueID()); });
42 }
43
44
45
58 inline bool isClusterInTime(
59 const Belle2::VxdID& sensorID,
60 const bool& isU,
61 const double& svdTime, const double& svdTimeError = 0,
62 const double& t0 = 0, const double& t0Error = 0
63 ) const
64 {
65 return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
66 sensorID.getLadderNumber(),
67 sensorID.getSensorNumber(),
68 m_aDBObjPtr->sideIndex(isU),
69 0 //strip not relevant
70 ).isInTime(svdTime, svdTimeError, t0, t0Error);
71
72 }
73
84 const Belle2::VxdID& sensorID,
85 const double& uTime, const double& vTime = 0
86 ) const
87 {
88 return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
89 sensorID.getLadderNumber(),
90 sensorID.getSensorNumber(),
91 m_aDBObjPtr->sideIndex(true), // side not relevant
92 0 // strip not relevant
93 ).areClustersInTime(uTime, vTime);
94 }
95
96
107 const Belle2::VxdID& sensorID,
108 const bool& isU
109 ) const
110 {
111 return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
112 sensorID.getLadderNumber(),
113 sensorID.getSensorNumber(),
114 m_aDBObjPtr->sideIndex(isU),
115 0 // strip not relevant
116 ).getFunctionID();
117
118 }
119
129 inline float getMinClusterTime(
130 const Belle2::VxdID& sensorID,
131 const bool& isU
132 ) const
133 {
134 return m_aDBObjPtr->getReference(sensorID.getLayerNumber(),
135 sensorID.getLadderNumber(),
136 sensorID.getSensorNumber(),
137 m_aDBObjPtr->sideIndex(isU),
138 0 // strip not relevant
139 ).getMinTime();
140
141 }
142
143
145 TString getUniqueID() { return m_aDBObjPtr->get_uniqueID(); }
146
148 bool isValid() { return m_aDBObjPtr.isValid(); }
149
150
151 private:
152
154 };
156}
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 calibration of the cluster reconstructi...
SVDCalibrationsBase< SVDCalibrationsScalar< SVDHitTimeSelectionFunction > > t_payload
typedef for the of SVDHitTimeSelectionFunction payload of all SVD sensors
bool isClusterInTime(const Belle2::VxdID &sensorID, const bool &isU, const double &svdTime, const double &svdTimeError=0, const double &t0=0, const double &t0Error=0) const
Return whether the cluster is estimated to be in time with the event or off-time.
SVDHitTimeSelection()
Constructor, no input argument is required.
static std::string name
name of SVDHitTimeSelectionFunction payload
float getMinClusterTime(const Belle2::VxdID &sensorID, const bool &isU) const
Return the min value of the cluster time to use it for reconstruction.
bool areClusterTimesCompatible(const Belle2::VxdID &sensorID, const double &uTime, const double &vTime=0) const
Return whether the cluster is estimated to be in time with the event or off-time.
int getTimeSelectionFunction(const Belle2::VxdID &sensorID, const bool &isU) const
Return the version of the function used to determine whether the cluster time is acceptable at the SP...
TString getUniqueID()
returns the unique ID of the payload
DBObjPtr< t_payload > m_aDBObjPtr
SVDHitTimeSelectionFunction paylaod.
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.