PandaRoot
PndCAParameters.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 PNDCAPARAMETERS_H
30 #define PNDCAPARAMETERS_H
31 
32 #include "PndCAVector.h"
33 
34 struct PndCAParameters {
35  enum {
40  // LastCellLength = 4 // length of rightmost cell
42  };
43 
44  // Transform CALocal coordinates in global x y z coordinates and back
45  // CALocal coor are: X0 is normal to the station module, X2 is paralel to magnetic field. X0 X1 X2 are right handed coordinates
46  template <typename T>
47  static void CALocalToGlobal(T x0, T x1, T angle, T &x, T &y);
48  template <typename T>
49  static void GlobalToCALocal(T x, T y, T angle, T &x0, T &x1);
50  template <typename T>
51  static void CALocalToGlobal(T x0, T x1, T x2, T angle, T &x, T &y, T &z);
52  template <typename T>
53  static void GlobalToCALocal(T x, T y, T z, T angle, T &x0, T &x1, T &x2);
54 
55 }; // namespace PndCAParameters
56 // namespace Parameters{ using namespace PndCAParameters; }
57 
58 /*
59 template< typename T >
60 void PndCAParameters::CALocalToGlobal( T x0, T x1, T angle, T& x, T& y ) {
61  const T cA = CAMath::Cos( angle );
62  const T sA = CAMath::Sin( angle );
63  x = x0*sA + x1*cA;
64  y = x0*cA - x1*sA;
65 }
66 
67 template< typename T >
68 void PndCAParameters::CALocalToGlobal( T x0, T x1, T x2, T angle, T& x, T& y, T &z ) {
69  CALocalToGlobal<T>(x0,x1,angle,x,y);
70  z = - x2;
71 }
72 */
73 template <typename T>
74 void PndCAParameters::GlobalToCALocal(T x, T y, T angle, T &x0, T &x1)
75 {
76  const T cA = CAMath::Cos(angle);
77  const T sA = CAMath::Sin(angle);
78  // SG!!!
79  // x0 = x*cA + y*sA;
80  // x1 = x*cA - y*cA;
81  x0 = x * sA + y * cA;
82  x1 = x * cA - y * sA;
83 }
84 
85 template <typename T>
86 void PndCAParameters::GlobalToCALocal(T x, T y, T z, T angle, T &x0, T &x1, T &x2)
87 {
88  GlobalToCALocal<T>(x, y, angle, x0, x1);
89  x2 = -z;
90 }
91 
92 namespace PndCAPParameters {
93 
99 enum {
100 
104  MinimumHitsForMCTrack = 6, // PndCAParameters::MinimumHitsForRecoTrack,
105 
109  MinimumMCPointsForMCTrack = MinimumHitsForMCTrack, // PndCAParameters::MinimumHitsForRecoTrack,
110 
115 }; // enum
116 
120 static const float ExtraThreshold = 0.05;
121 
125 static const float RefThreshold = 1.;
126 
130 static const float MinTrackPurity = .75;
131 } // namespace PndCAPParameters
132 namespace PParameters {
133 using namespace PndCAPParameters;
134 }
135 
136 #endif
static const float ExtraThreshold
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 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