-
Notifications
You must be signed in to change notification settings - Fork 496
Expand file tree
/
Copy pathPIDTOF.cxx
More file actions
63 lines (54 loc) · 2.04 KB
/
PIDTOF.cxx
File metadata and controls
63 lines (54 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "PID/PIDTOF.h"
namespace o2::pid::tof
{
//_________________________________________________________________________
uint EventTime::GetMomBin(float mom) const
{
for (int i = 0; i < mNmomBins; i++)
if (abs(mom) < mMomBins[i + 1])
return i;
return mNmomBins - 1;
}
//_________________________________________________________________________
float Response::ComputeExpectedTime(float tofexpmom, float length, float massZ)
{
const float energy = sqrt((massZ * massZ) + (tofexpmom * tofexpmom));
return length * energy / (kCSPEED * tofexpmom);
}
//_________________________________________________________________________
float Response::GetBeta(float length, float time, float evtime)
{
if (time <= 0)
return -999.f;
return length / (time - evtime) / kCSPEED;
}
//_________________________________________________________________________
float Response::GetBetaExpectedSigma(float length, float time, float evtime, float sigmat)
{
if (time <= 0)
return -999.f;
return GetBeta(length, time, evtime) / (time - evtime) * sigmat;
}
//_________________________________________________________________________
float Response::GetExpectedBeta(float mom, float mass)
{
if (mom > 0)
return mom / TMath::Sqrt(mom * mom + mass * mass);
return 0;
}
//_________________________________________________________________________
float Response::GetExpectedSigma(o2::track::PID::ID id) const
{
const float x[4] = {mMomentum, mTOFSignal, mEventTime.GetEvTimeReso(mMomentum), o2::track::PID::getMass2Z(id)};
return this->operator()(kSigma, x);
}
} // namespace o2::pid::tof