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