Project
Loading...
Searching...
No Matches
TrackITS.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#include <TMath.h>
17
21
22using namespace o2::itsmft;
23using namespace o2::its;
24using namespace o2::constants::math;
25using namespace o2::track;
26
27bool TrackITS::operator<(const TrackITS& o) const
28{
29 //-----------------------------------------------------------------
30 // This function compares tracks according to the their curvature
31 //-----------------------------------------------------------------
32 float co = TMath::Abs(o.getPt());
33 float c = TMath::Abs(getPt());
34 // float co=o.GetSigmaY2()*o.GetSigmaZ2();
35 // float c =GetSigmaY2()*GetSigmaZ2();
36
37 return (c > co);
38}
39
40void TrackITS::getImpactParams(float x, float y, float z, float bz, float ip[2]) const
41{
42 //------------------------------------------------------------------
43 // This function calculates the transverse and longitudinal impact parameters
44 // with respect to a point with global coordinates (x,y,0)
45 // in the magnetic field "bz" (kG)
46 //------------------------------------------------------------------
47 float f1 = getSnp(), r1 = TMath::Sqrt((1. - f1) * (1. + f1));
48 float xt = getX(), yt = getY();
49 float sn = TMath::Sin(getAlpha()), cs = TMath::Cos(getAlpha());
50 float a = x * cs + y * sn;
51 y = -x * sn + y * cs;
52 x = a;
53 xt -= x;
54 yt -= y;
55
56 float rp4 = getCurvature(bz);
57 if ((TMath::Abs(bz) < Almost0) || (TMath::Abs(rp4) < Almost0)) {
58 ip[0] = -(xt * f1 - yt * r1);
59 ip[1] = getZ() + (ip[0] * f1 - xt) / r1 * getTgl() - z;
60 return;
61 }
62
63 sn = rp4 * xt - f1;
64 cs = rp4 * yt + r1;
65 a = 2 * (xt * f1 - yt * r1) - rp4 * (xt * xt + yt * yt);
66 float rr = TMath::Sqrt(sn * sn + cs * cs);
67 ip[0] = -a / (1 + rr);
68 float f2 = -sn / rr, r2 = TMath::Sqrt((1. - f2) * (1. + f2));
69 ip[1] = getZ() + getTgl() / rp4 * TMath::ASin(f2 * r1 - f1 * r2) - z;
70}
71
72bool TrackITS::propagate(float alpha, float x, float bz)
73{
74 if (rotate(alpha)) {
75 if (propagateTo(x, bz)) {
76 return true;
77 }
78 }
79 return false;
80}
81
82bool TrackITS::update(const Cluster& c, float chi2)
83{
84 //--------------------------------------------------------------------
85 // Update track params
86 //--------------------------------------------------------------------
87 if (!o2::track::TrackParCov::update(static_cast<const o2::BaseCluster<float>&>(c))) {
88 return false;
89 }
90 mChi2 += chi2;
91 return true;
92}
93
94bool TrackITS::isBetter(const TrackITS& best, float maxChi2) const
95{
96 int ncl = getNumberOfClusters();
97 int nclb = best.getNumberOfClusters();
98
99 if (ncl >= nclb) {
100 float chi2 = getChi2();
101 if (chi2 < maxChi2) {
102 if (ncl > nclb || chi2 < best.getChi2()) {
103 return true;
104 }
105 }
106 }
107 return false;
108}
109
111{
112 int nFake{0};
113 auto firstClus = getFirstClusterLayer();
114 auto lastClus = firstClus + getNClusters();
115 for (auto iCl{firstClus}; iCl < lastClus; ++iCl) {
116 if (hasHitOnLayer(iCl) && isFakeOnLayer(iCl)) {
117 ++nFake;
118 }
119 }
120 return nFake;
121}
Definition of the ITSMFT cluster.
bool o
useful math constants
uint32_t c
Definition RawData.h:2
Definition of the ITS track.
bool operator<(const TrackITS &o) const
Definition TrackITS.cxx:27
bool hasHitOnLayer(uint32_t i) const
Definition TrackITS.h:104
uint32_t getFirstClusterLayer() const
Definition TrackITS.h:115
int getNFakeClusters() const
Definition TrackITS.cxx:110
void getImpactParams(float x, float y, float z, float bz, float ip[2]) const
Definition TrackITS.cxx:40
bool isFakeOnLayer(uint32_t i) const
Definition TrackITS.h:105
bool propagate(float alpha, float x, float bz)
Definition TrackITS.cxx:72
bool isBetter(const TrackITS &best, float maxChi2) const
Definition TrackITS.cxx:94
bool update(const Cluster &c, float chi2)
Definition TrackITS.cxx:82
Cluster class for the ITSMFT.
Definition Cluster.h:34
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
GLint y
Definition glcorearb.h:270
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
constexpr float Almost0
value_T f1
Definition TrackUtils.h:91
value_T f2
Definition TrackUtils.h:92