PandaRoot
PndFTSCAParameters.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /**************************************************************************
14  * This file is property of and copyright by the ALICE HLT Project *
15  * All rights reserved. *
16  * *
17  * Primary Authors: *
18  * Copyright 2009 Matthias Kretz <kretz@kde.org> *
19  * *
20  * Permission to use, copy, modify and distribute this software and its *
21  * documentation strictly for non-commercial purposes is hereby granted *
22  * without fee, provided that the above copyright notice appears in all *
23  * copies and that both the copyright notice and this permission notice *
24  * appear in the supporting documentation. The authors make no claims *
25  * about the suitability of this software for any purpose. It is *
26  * provided "as is" without express or implied warranty. *
27  **************************************************************************/
28 
29 #ifndef PNDFTSCAPARAMETERS_H
30 #define PNDFTSCAPARAMETERS_H
31 
32 #include "PndFTSVector.h"
33 
35  enum {
36 #ifdef STAR_HFT
37  MaxNStations = 4, // max number of stations
38  MinimumHitsForRecoTrack = 4, // 3
39  MaxCellLength = 3, // length of triplet
40  LastCellLength = 3 // length of rightmost cell
41 #elif ALICE_ITS
42  MaxNStations = 8,
43  MinimumHitsForRecoTrack = 4, // 3
44  MaxCellLength = 3,
45  LastCellLength = 3 // length of rightmost cell
46 #elif PANDA_STT
47  MaxNStations = 30,
48  NMVDStations = 4,
50  MaxCellLength = 6,
51  LastCellLength = 4 // length of rightmost cell
52 #elif PANDA_FTS
53  MaxNStations = 48,
54  NMVDStations = 0,
56  MaxCellLength = 6,
57  LastCellLength = 6 // length of rightmost cell
58 #endif
59  };
60 
61  // Transform CALocal coordinates in global x y z coordinates and back
62  // CALocal coor are: X0 is normal to the station module, X2 is paralel to magnetic field. X0 X1 X2 are right handed coordinates
63 #ifndef PANDA_FTS
64  template <typename T>
65  static void CALocalToGlobal(T x0, T x1, T angle, T &x, T &y);
66  template <typename T>
67  static void GlobalToCALocal(T x, T y, T angle, T &x0, T &x1);
68 #endif
69  template <typename T>
70  static void CALocalToGlobal(T x0, T x1, T x2, T angle, T &x, T &y, T &z);
71  template <typename T>
72  static void GlobalToCALocal(T x, T y, T z, T angle, T &x0, T &x1, T &x2);
73 
74 }; // namespace PndFTSCAParameters
75 // namespace Parameters{ using namespace PndFTSCAParameters; }
76 
77 #ifdef PANDA_STT
78 // Panda global coordinates: watching downstream: x looks to the left, y - up, z - front.
79 // Panda STT local coordinates: watching downstream: X0 is "radial" - normal to the layer, looks from beam, X1 - left, X2 - back.
80 template <typename T>
81 void PndFTSCAParameters::CALocalToGlobal(T x0, T x1, T angle, T &x, T &y)
82 {
83  const T cA = CAMath::Cos(angle);
84  const T sA = CAMath::Sin(angle);
85  x = x0 * sA + x1 * cA;
86  y = x0 * cA - x1 * sA;
87 }
88 
89 template <typename T>
90 void PndFTSCAParameters::CALocalToGlobal(T x0, T x1, T x2, T angle, T &x, T &y, T &z)
91 {
92  CALocalToGlobal<T>(x0, x1, angle, x, y);
93  z = -x2;
94 }
95 
96 template <typename T>
97 void PndFTSCAParameters::GlobalToCALocal(T x, T y, T angle, T &x0, T &x1)
98 {
99  const T cA = CAMath::Cos(angle);
100  const T sA = CAMath::Sin(angle);
101  x0 = x * sA + y * cA;
102  x1 = x * cA - y * sA;
103 }
104 
105 template <typename T>
106 void PndFTSCAParameters::GlobalToCALocal(T x, T y, T z, T angle, T &x0, T &x1, T &x2)
107 {
108  GlobalToCALocal<T>(x, y, angle, x0, x1);
109  x2 = -z;
110 }
111 #elif PANDA_FTS
112 // x0 along the beam (normal to planes)
113 // x1 to the right if look downstream
114 // x2 vertical (along the mag.field)
115 template <typename T>
116 void PndFTSCAParameters::CALocalToGlobal(T x0, T x1, T x2, T angle, T &x, T &y, T &z)
117 {
118  UNUSED_PARAM1(angle);
119  x = x1;
120  y = x2;
121  z = x0;
122 }
123 template <typename T>
124 void PndFTSCAParameters::GlobalToCALocal(T x, T y, T z, T angle, T &x0, T &x1, T &x2)
125 {
126  UNUSED_PARAM1(angle);
127  x0 = z;
128  x1 = x;
129  x2 = y;
130 }
131 #else
132 template <typename T>
133 void PndFTSCAParameters::CALocalToGlobal(T x0, T x1, T angle, T &x, T &y)
134 {
135  const T cA = CAMath::Cos(angle);
136  const T sA = CAMath::Sin(angle);
137  x = x0 * cA - x1 * sA;
138  y = x0 * sA + x1 * cA;
139 }
140 
141 template <typename T>
142 void PndFTSCAParameters::CALocalToGlobal(T x0, T x1, T x2, T angle, T &x, T &y, T &z)
143 {
144  CALocalToGlobal<T>(x0, x1, angle, x, y);
145  z = x2;
146 }
147 
148 template <typename T>
149 void PndFTSCAParameters::GlobalToCALocal(T x, T y, T angle, T &x0, T &x1)
150 {
151  const T cA = CAMath::Cos(angle);
152  const T sA = CAMath::Sin(angle);
153  x0 = x * cA + y * sA;
154  x1 = -x * sA + y * cA;
155 }
156 
157 template <typename T>
158 void PndFTSCAParameters::GlobalToCALocal(T x, T y, T z, T angle, T &x0, T &x1, T &x2)
159 {
160  GlobalToCALocal<T>(x, y, angle, x0, x1);
161  x2 = z;
162 }
163 #endif
164 
166 
172 enum {
173 
174 #ifdef PANDA_STT
175 
178  MinimumHitsForMCTrack = 6, // PndFTSCAParameters::MinimumHitsForRecoTrack,
179 
183  MinimumMCPointsForMCTrack = MinimumHitsForMCTrack, // PndFTSCAParameters::MinimumHitsForRecoTrack,
184 #else
187 #endif
188 
193 }; // enum
194 
198 static const float ExtraThreshold = 0.05;
199 
203 static const float RefThreshold = 1.;
204 
208 static const float MinTrackPurity = .75;
209 
210 } // namespace PndFTSCAPParameters
211 namespace PParameters {
212 using namespace PndFTSCAPParameters;
213 }
214 
215 #endif // ALIHLTTPCCAPARAMETERS_H
static const float RefThreshold
static const float MinTrackPurity
static T Sin(const T &x)
Definition: PndCAMath.h:83
static T Cos(const T &x)
Definition: PndCAMath.h:88
static void GlobalToCALocal(T x, T y, T angle, T &x0, T &x1)
static const float ExtraThreshold
static void CALocalToGlobal(T x0, T x1, T angle, T &x, T &y)