PandaRoot
PndCAParameters.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 PNDCAPARAMETERS_H
18 #define PNDCAPARAMETERS_H
19 
20 #include "PndCAVector.h"
21 
22 struct PndCAParameters {
23  enum {
28  // LastCellLength = 4 // length of rightmost cell
30  };
31 
32  // Transform CALocal coordinates in global x y z coordinates and back
33  // CALocal coor are: X0 is normal to the station module, X2 is paralel to magnetic field. X0 X1 X2 are right handed coordinates
34  template <typename T>
35  static void CALocalToGlobal(T x0, T x1, T angle, T &x, T &y);
36  template <typename T>
37  static void GlobalToCALocal(T x, T y, T angle, T &x0, T &x1);
38  template <typename T>
39  static void CALocalToGlobal(T x0, T x1, T x2, T angle, T &x, T &y, T &z);
40  template <typename T>
41  static void GlobalToCALocal(T x, T y, T z, T angle, T &x0, T &x1, T &x2);
42 
43 }; // namespace PndCAParameters
44 // namespace Parameters{ using namespace PndCAParameters; }
45 
46 /*
47 template< typename T >
48 void PndCAParameters::CALocalToGlobal( T x0, T x1, T angle, T& x, T& y ) {
49  const T cA = CAMath::Cos( angle );
50  const T sA = CAMath::Sin( angle );
51  x = x0*sA + x1*cA;
52  y = x0*cA - x1*sA;
53 }
54 
55 template< typename T >
56 void PndCAParameters::CALocalToGlobal( T x0, T x1, T x2, T angle, T& x, T& y, T &z ) {
57  CALocalToGlobal<T>(x0,x1,angle,x,y);
58  z = - x2;
59 }
60 */
61 template <typename T>
62 void PndCAParameters::GlobalToCALocal(T x, T y, T angle, T &x0, T &x1)
63 {
64  const T cA = CAMath::Cos(angle);
65  const T sA = CAMath::Sin(angle);
66  // SG!!!
67  // x0 = x*cA + y*sA;
68  // x1 = x*cA - y*cA;
69  x0 = x * sA + y * cA;
70  x1 = x * cA - y * sA;
71 }
72 
73 template <typename T>
74 void PndCAParameters::GlobalToCALocal(T x, T y, T z, T angle, T &x0, T &x1, T &x2)
75 {
76  GlobalToCALocal<T>(x, y, angle, x0, x1);
77  x2 = -z;
78 }
79 
80 namespace PndCAPParameters {
81 
87 enum {
88 
92  MinimumHitsForMCTrack = 6, // PndCAParameters::MinimumHitsForRecoTrack,
93 
97  MinimumMCPointsForMCTrack = MinimumHitsForMCTrack, // PndCAParameters::MinimumHitsForRecoTrack,
98 
103 }; // enum
104 
108 static const float ExtraThreshold = 0.05;
109 
113 static const float RefThreshold = 1.;
114 
118 static const float MinTrackPurity = .75;
119 } // namespace PndCAPParameters
120 namespace PParameters {
121 using namespace PndCAPParameters;
122 }
123 
124 #endif
static const float ExtraThreshold
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 CALocalToGlobal(T x0, T x1, T angle, T &x, T &y)
static void GlobalToCALocal(T x, T y, T angle, T &x0, T &x1)
static const float RefThreshold