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