FairRoot/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 {
24  enum {
25 #ifdef STAR_HFT
26  MaxNStations = 4, // max number of stations
28  MaxCellLength = 3, // length of triplet
29  LastCellLength = 3 // length of rightmost cell
30 #elif ALICE_ITS
31  MaxNStations = 8,
33  MaxCellLength = 3,
34  LastCellLength = 3 // length of rightmost cell
35 #elif PANDA_STT
36  MaxNStations = 30,
37  NMVDStations = 4,
39  MaxCellLength = 6,
40  LastCellLength = 4 // length of rightmost cell
41 #elif PANDA_FTS
42  MaxNStations = 48,
43  NMVDStations = 0,
45  MaxCellLength = 6,
46  LastCellLength = 6 // length of rightmost cell
47 #endif
48  };
49 
50  // Transform CALocal coordinates in global x y z coordinates and back
51  // CALocal coor are: X0 is normal to the station module, X2 is paralel to magnetic field. X0 X1 X2 are right handed coordinates
52 #ifndef PANDA_FTS
53  template< typename T >
54  static void CALocalToGlobal( T x0, T x1, T angle, T& x, T& y );
55  template< typename T >
56  static void GlobalToCALocal( T x, T y, T angle, T& x0, T& x1 );
57 #endif
58  template< typename T >
59  static void CALocalToGlobal( T x0, T x1, T x2, T angle, T& x, T& y, T &z );
60  template< typename T >
61  static void GlobalToCALocal( T x, T y, T z, T angle, T& x0, T& x1, T& x2 );
62 
63 }; // namespace PndFTSCAParameters
64 //namespace Parameters{ using namespace PndFTSCAParameters; }
65 
66 #ifdef PANDA_STT
67 // Panda global coordinates: watching downstream: x looks to the left, y - up, z - front.
68 // Panda STT local coordinates: watching downstream: X0 is "radial" - normal to the layer, looks from beam, X1 - left, X2 - back.
69 template< typename T >
70 void PndFTSCAParameters::CALocalToGlobal( T x0, T x1, T angle, T& x, T& y ) {
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  CALocalToGlobal<T>(x0,x1,angle,x,y);
80  z = - x2;
81 }
82 
83 template< typename T >
84 void PndFTSCAParameters::GlobalToCALocal( T x, T y, T angle, T& x0, T& x1 ) {
85  const T cA = CAMath::Cos( angle );
86  const T sA = CAMath::Sin( angle );
87  x0 = x*sA + y*cA;
88  x1 = x*cA - y*sA;
89 }
90 
91 template< typename T >
92 void PndFTSCAParameters::GlobalToCALocal( T x, T y, T z, T angle, T& x0, T& x1, T& x2 ) {
93  GlobalToCALocal<T>(x,y,angle,x0,x1);
94  x2 = -z;
95 }
96 #elif PANDA_FTS
97 // x0 along the beam (normal to planes)
98 // x1 to the right if look downstream
99 // x2 vertical (along the mag.field)
100 template< typename T >
101 void PndFTSCAParameters::CALocalToGlobal( T x0, T x1, T x2, T angle, T& x, T& y, T &z ) {
102  UNUSED_PARAM1(angle);
103  x = x1;
104  y = x2;
105  z = x0;
106 }
107 template< typename T >
108 void PndFTSCAParameters::GlobalToCALocal( T x, T y, T z, T angle, T& x0, T& x1, T& x2 ) {
109  UNUSED_PARAM1(angle);
110  x0 = z;
111  x1 = x;
112  x2 = y;
113 }
114 #else
115 template< typename T >
117  const T cA = CAMath::Cos( angle );
118  const T sA = CAMath::Sin( angle );
119  x = x0*cA - x1*sA;
120  y = x0*sA + x1*cA;
121 }
122 
123 template< typename T >
124 void PndFTSCAParameters::CALocalToGlobal( T x0, T x1, T x2, T angle, T& x, T& y, T &z ) {
125  CALocalToGlobal<T>(x0,x1,angle,x,y);
126  z = x2;
127 }
128 
129 template< typename T >
131  const T cA = CAMath::Cos( angle );
132  const T sA = CAMath::Sin( angle );
133  x0 = x*cA + y*sA;
134  x1 = -x*sA + y*cA;
135 }
136 
137 template< typename T >
138 void PndFTSCAParameters::GlobalToCALocal( T x, T y, T z, T angle, T& x0, T& x1, T& x2 ) {
139  GlobalToCALocal<T>(x,y,angle,x0,x1);
140  x2 = z;
141 }
142 #endif
143 
145 
151  enum{
152 
153 #ifdef PANDA_STT
154 
157  MinimumHitsForMCTrack = 6,//PndFTSCAParameters::MinimumHitsForRecoTrack,
158 
162  MinimumMCPointsForMCTrack = MinimumHitsForMCTrack,//PndFTSCAParameters::MinimumHitsForRecoTrack,
163 #else
166 #endif
167 
172  }; // enum
173 
177  static const float ExtraThreshold = 0.05;
178 
182  static const float RefThreshold = 1.;
183 
184 
188  static const float MinTrackPurity = .75;
189 
190 } // namespace PndFTSCAPParameters
191 namespace PParameters{ using namespace PndFTSCAPParameters; }
192 
193 #endif // ALIHLTTPCCAPARAMETERS_H
static const float RefThreshold
static const float MinTrackPurity
Double_t x0
Definition: checkhelixhit.C:70
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
TTree * T
Definition: anaLmdReco.C:32
static void GlobalToCALocal(T x, T y, T angle, T &x0, T &x1)
static const float ExtraThreshold
Double_t z
Double_t x
static void CALocalToGlobal(T x0, T x1, T angle, T &x, T &y)
Double_t y
Double_t angle