Belle II Software
development
TOPCalTOFCorrection.cc
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
#include <top/dbobjects/TOPCalTOFCorrection.h>
10
11
using namespace
std
;
12
13
namespace
Belle2
{
18
19
void
TOPCalTOFCorrection::set
(
const
TProfile* pf)
20
{
21
m_zmin
= pf->GetXaxis()->GetXmin();
22
m_dz
= pf->GetXaxis()->GetBinWidth(1);
23
for
(
int
i = 1; i <= pf->GetNbinsX(); i++) {
24
if
(pf->GetBinEntries(i) > 100)
m_corrections
.push_back(pf->GetBinContent(i));
25
else
m_corrections
.push_back(0.);
26
}
27
}
28
29
double
TOPCalTOFCorrection::get
(
double
z)
const
30
{
31
if
(
m_corrections
.empty())
return
0;
32
if
(z <
m_zmin
)
return
0;
33
34
unsigned
i = (z -
m_zmin
) /
m_dz
;
35
if
(i <
m_corrections
.size())
return
m_corrections
[i];
36
return
0;
37
}
38
40
}
// end Belle2 namespace
41
Belle2::TOPCalTOFCorrection::m_zmin
float m_zmin
minimal z
Definition
TOPCalTOFCorrection.h:72
Belle2::TOPCalTOFCorrection::m_corrections
std::vector< float > m_corrections
time-of-flight corrections as function of z
Definition
TOPCalTOFCorrection.h:74
Belle2::TOPCalTOFCorrection::m_dz
float m_dz
bin width
Definition
TOPCalTOFCorrection.h:73
Belle2::TOPCalTOFCorrection::set
void set(const TProfile *pf)
Setter.
Definition
TOPCalTOFCorrection.cc:19
Belle2::TOPCalTOFCorrection::get
double get(double z) const
Getter.
Definition
TOPCalTOFCorrection.cc:29
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
std
STL namespace.
top
dbobjects
src
TOPCalTOFCorrection.cc
Generated on Fri Apr 17 2026 03:21:42 for Belle II Software by
1.13.2