-
Notifications
You must be signed in to change notification settings - Fork 665
Expand file tree
/
Copy pathTOFResoALICE3.h
More file actions
79 lines (65 loc) · 2.84 KB
/
Copy pathTOFResoALICE3.h
File metadata and controls
79 lines (65 loc) · 2.84 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// 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.
///
/// \file TOFResoALICE3.h
/// \author Nicolo' Jacazio
/// \since 11/03/2021
/// \brief Implementation for the TOF PID response of the expected times resolution
///
#ifndef ALICE3_CORE_TOFRESOALICE3_H_
#define ALICE3_CORE_TOFRESOALICE3_H_
#include <PID/ParamBase.h>
#include <ReconstructionDataFormats/PID.h>
#include <Rtypes.h>
#include <cmath>
#include <cstdlib>
#include <math.h>
namespace o2::pid::tof
{
class TOFResoALICE3 : public Parametrization
{
public:
TOFResoALICE3() : Parametrization("TOFResoALICE3", 1){};
~TOFResoALICE3() override = default;
float operator()(const float* x) const override
{
const float p = abs(x[0]);
if (p <= 0) {
return -999;
}
/** get info **/
// const float time = x[1];
const float evtimereso = x[2];
const float mass = x[3];
const float L = x[4];
const float p2 = p * p;
// const float ep = x[5] * x[6];
const float ep = x[5] * p2;
const float Lc = L / 0.0299792458f;
// const float Lc = L / 29.9792458f;
const float mass2 = mass * mass;
const float etexp = Lc * mass2 / p2 / sqrt(mass2 + p2) * ep;
return sqrt(etexp * etexp + mParameters[0] * mParameters[0] + evtimereso * evtimereso);
}
ClassDef(TOFResoALICE3, 1);
};
float TOFResoALICE3Param(const float& momentum, const float& momentumError, const float& evtimereso, const float& length, const float& mass, const Parameters& parameters);
template <o2::track::PID::ID id, typename T>
float TOFResoALICE3ParamTrack(const T& track, const Parameters& parameters)
{
const float BETA = tan(0.25f * static_cast<float>(M_PI) - 0.5f * atan(track.tgl()));
const float sigmaP = sqrt(track.pt() * track.pt() * track.sigma1Pt() * track.sigma1Pt() + (BETA * BETA - 1.f) / (BETA * (BETA * BETA + 1.f)) * (track.tgl() / sqrt(track.tgl() * track.tgl() + 1.f) - 1.f) * track.sigmaTgl() * track.sigmaTgl());
// const float sigmaP = std::sqrt( track.getSigma1Pt2() ) * track.pt();
return TOFResoALICE3Param(track.p(), sigmaP, track.collision().collisionTimeRes() * 1000.f, track.length(), o2::track::pid_constants::sMasses2Z[id], parameters);
// return TOFResoALICE3Param(track.p(), track.sigma1Pt(), collision.collisionTimeRes() * 1000.f, track.length(), o2::track::pid_constants::sMasses[id], parameters);
}
} // namespace o2::pid::tof
#endif // ALICE3_CORE_TOFRESOALICE3_H_