]>
Commit | Line | Data |
---|---|---|
959fbac5 | 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 | ||
f531a546 | 16 | // $Id$ |
959fbac5 | 17 | |
18 | /////////////////////////////////////////////////////////////////////////// | |
19 | // Class AliPositionObj | |
20 | // Handling of positions in various reference frames. | |
21 | // | |
22 | // This class is meant to provide an AliPosition object which is derived | |
23 | // from TObject such that it can be stored in e.g. TObjArray etc... | |
24 | // and that it can be written out using the ROOT I/O machinery. | |
25 | // | |
26 | // Example : | |
27 | // ========= | |
28 | // | |
29 | // Float_t a[3]={1,2,3}; | |
30 | // Float_t ea[3]={0.01,0.02,0.03}; | |
31 | // Float_t b[3]={4,5,6}; | |
32 | // Float_t eb[3]={0.04,0.05,0.06}; | |
33 | // | |
34 | // AliPosition r1,r2; | |
35 | // | |
36 | // r1.SetPosition(a,"car"); | |
37 | // r1.SetPositionErrors(ea,"car"); | |
38 | // r2.SetPosition(b,"car"); | |
39 | // r2.SetPositionErrors(eb,"car"); | |
40 | // | |
41 | // Ali3Vector sum=r1+r2; | |
42 | // Ali3Vector rel=r1-r2; | |
43 | // | |
44 | // AliPositionObj rr1(r1); | |
45 | // AliPositionObj rr2; | |
46 | // rr2.Load(r2); | |
47 | // AliPositionObj ssum(r1+r2); | |
48 | // | |
49 | // rr1.Info(); | |
50 | // rr2.Info(); | |
51 | // ssum.Info(); | |
52 | // | |
53 | //--- Author: Nick van Eijndhoven 18-oct-1999 UU-SAP Utrecht | |
f531a546 | 54 | //- Modified: NvE $Date$ UU-SAP Utrecht |
959fbac5 | 55 | /////////////////////////////////////////////////////////////////////////// |
56 | ||
57 | #include "AliPositionObj.h" | |
58 | ||
59 | ClassImp(AliPositionObj) // Class implementation to enable ROOT I/O | |
60 | ||
61 | AliPositionObj::AliPositionObj() | |
62 | { | |
63 | // Creation of an AliPositionObj object and initialisation of parameters. | |
64 | // All attributes initialised to 0. | |
65 | } | |
66 | /////////////////////////////////////////////////////////////////////////// | |
67 | AliPositionObj::AliPositionObj(Ali3Vector& q) | |
68 | { | |
69 | // Creation of an AliPositionObj object and initialisation of parameters. | |
70 | // All attributes are initialised to the values of the input Ali3Vector. | |
71 | Load(q); | |
72 | } | |
73 | /////////////////////////////////////////////////////////////////////////// | |
74 | AliPositionObj::~AliPositionObj() | |
75 | { | |
76 | // Destructor to delete dynamically allocated memory. | |
77 | } | |
78 | /////////////////////////////////////////////////////////////////////////// | |
79 | void AliPositionObj::Load(Ali3Vector& q) | |
80 | { | |
81 | // Load all attributes of the input Ali3Vector into this AliPositionObj object. | |
82 | Double_t temp=q.GetResultError(); | |
83 | Double_t a[3]; | |
84 | q.GetVector(a,"sph"); | |
85 | SetPosition(a,"sph"); | |
86 | q.GetErrors(a,"car"); | |
87 | SetPositionErrors(a,"car"); | |
88 | fDresult=temp; | |
89 | } | |
90 | /////////////////////////////////////////////////////////////////////////// |