]>
Commit | Line | Data |
---|---|---|
4c039060 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* | |
17 | $Log$ | |
959fbac5 | 18 | Revision 1.2 1999/09/29 09:24:28 fca |
19 | Introduction of the Copyright and cvs Log | |
20 | ||
4c039060 | 21 | */ |
22 | ||
959fbac5 | 23 | /////////////////////////////////////////////////////////////////////////// |
24 | // Class AliPosition | |
25 | // Handling of positions in various reference frames. | |
26 | // | |
27 | // This class is meant to serve as a base class for ALICE objects | |
28 | // that have a unique position in 3-dimensional space. | |
29 | // | |
30 | // Note : | |
31 | // ------ | |
32 | // Positions (r), errors (e) and reference frames (f) are specified via | |
33 | // | |
34 | // SetPosition(Float_t* r,TString f) | |
35 | // SetPositionErrors(Float_t* e,TString f) | |
36 | // | |
37 | // under the following conventions : | |
38 | // | |
39 | // f="car" ==> r in Cartesian coordinates (x,y,z) | |
40 | // f="sph" ==> r in Spherical coordinates (r,theta,phi) | |
41 | // f="cyl" ==> r in Cylindrical coordinates (rho,phi,z) | |
42 | // | |
43 | // All angles are in radians. | |
44 | // | |
45 | // Example : | |
46 | // --------- | |
47 | // | |
48 | // AliPosition q; | |
49 | // Float_t pos[3]={-1,25,7}; | |
50 | // Float_t err[3]={0.08,1.85,0.5}; | |
51 | // q.SetPosition(pos,"car"); | |
52 | // q.SetPositionErrors(pos,"car"); | |
53 | // Float_t loc[3],dloc[3]; | |
54 | // q.GetPosition(loc,"sph"); | |
55 | // q.GetPositionErrors(dloc,"sph"); | |
56 | // | |
57 | //--- Author: Nick van Eijndhoven 06-feb-1999 UU-SAP Utrecht | |
58 | /////////////////////////////////////////////////////////////////////////// | |
59 | ||
d88f97cc | 60 | #include "AliPosition.h" |
61 | ||
62 | ClassImp(AliPosition) // Class implementation to enable ROOT I/O | |
63 | ||
64 | AliPosition::AliPosition() | |
65 | { | |
66 | // Creation of an AliPosition object and initialisation of parameters | |
67 | } | |
68 | /////////////////////////////////////////////////////////////////////////// | |
69 | AliPosition::~AliPosition() | |
70 | { | |
71 | // Destructor to delete dynamically allocated memory | |
72 | } | |
73 | /////////////////////////////////////////////////////////////////////////// | |
74 | void AliPosition::SetPosition(Double_t* r,TString f) | |
75 | { | |
76 | // Store position according to reference frame f | |
77 | SetVector(r,f); | |
78 | } | |
79 | /////////////////////////////////////////////////////////////////////////// | |
80 | void AliPosition::GetPosition(Double_t* r,TString f) | |
81 | { | |
82 | // Provide position according to reference frame f | |
83 | GetVector(r,f); | |
84 | } | |
85 | /////////////////////////////////////////////////////////////////////////// | |
86 | void AliPosition::SetPosition(Float_t* r,TString f) | |
87 | { | |
88 | // Store position according to reference frame f | |
89 | SetVector(r,f); | |
90 | } | |
91 | /////////////////////////////////////////////////////////////////////////// | |
92 | void AliPosition::GetPosition(Float_t* r,TString f) | |
93 | { | |
94 | // Provide position according to reference frame f | |
95 | GetVector(r,f); | |
96 | } | |
97 | /////////////////////////////////////////////////////////////////////////// | |
98 | AliPosition& AliPosition::GetPosition() | |
99 | { | |
100 | // Provide position | |
101 | return (*this); | |
102 | } | |
103 | /////////////////////////////////////////////////////////////////////////// | |
104 | void AliPosition::SetPosition(Ali3Vector& r) | |
105 | { | |
106 | // Set position | |
107 | Double_t a[3]; | |
108 | r.GetVector(a,"sph"); | |
109 | SetVector(a,"sph"); | |
959fbac5 | 110 | r.GetErrors(a,"car"); |
111 | SetErrors(a,"car"); | |
112 | } | |
113 | /////////////////////////////////////////////////////////////////////////// | |
114 | void AliPosition::SetPositionErrors(Double_t* r,TString f) | |
115 | { | |
116 | // Store position errors according to reference frame f | |
117 | SetErrors(r,f); | |
118 | } | |
119 | /////////////////////////////////////////////////////////////////////////// | |
120 | void AliPosition::GetPositionErrors(Double_t* r,TString f) | |
121 | { | |
122 | // Provide position errors according to reference frame f | |
123 | GetErrors(r,f); | |
124 | } | |
125 | /////////////////////////////////////////////////////////////////////////// | |
126 | void AliPosition::SetPositionErrors(Float_t* r,TString f) | |
127 | { | |
128 | // Store position errors according to reference frame f | |
129 | SetErrors(r,f); | |
130 | } | |
131 | /////////////////////////////////////////////////////////////////////////// | |
132 | void AliPosition::GetPositionErrors(Float_t* r,TString f) | |
133 | { | |
134 | // Provide position errors according to reference frame f | |
135 | GetErrors(r,f); | |
d88f97cc | 136 | } |
137 | /////////////////////////////////////////////////////////////////////////// |