Have ProdProcess return const char*
[u/mrichter/AliRoot.git] / RALICE / Ali4Vector.h
CommitLineData
d88f97cc 1#ifndef ALI4VECTOR_H
2#define ALI4VECTOR_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
d88f97cc 8///////////////////////////////////////////////////////////////////////////
9// Class Ali4Vector
10// Handling of Lorentz 4-vectors in various reference frames.
11//
12// This class is meant to serve as a base class for ALICE objects
13// that have Lorentz 4-vector characteristics.
14//
15// All 4-vectors are treated in the contravariant form and the convention
16// for the metric and the 4-vector components is according to the one
17// used in the book "Classical Electrodynamics" by J.D. Jackson.
18//
19// The dotproduct is defined such that p.Dot(p) yields the Lorentz invariant
20// scalar of the 4-vector p (i.e. m**2 in case p is a 4-momentum).
21//
22// Note :
23// ------
24// Vectors (v) and reference frames (f) are specified via
25// SetVector(Float_t* v,TString f) under the following conventions :
26//
27// f="car" ==> 3-vector part of v in Cartesian coordinates (x,y,z)
28// f="sph" ==> 3-vector part of v in Spherical coordinates (r,theta,phi)
29// f="cyl" ==> 3-vector part of v in Cylindrical coordinates (rho,phi,z)
30//
31// All angles are in radians.
32//
33// Example :
34// ---------
35//
36// Ali4Vector a;
37//
38// Float_t v[4]={25,-1,3,7};
39// a.SetVector(v,"car");
40//
41// Float_t vec[4];
42// a.GetVector(vec,"sph");
43//
44// Ali4Vector b;
45// Float_t v2[4]={33,6,-18,2};
46// b.SetVector(v2,"car");
47//
48// Float_t dotpro=a.Dot(b);
49//
50// Float_t x0=16;
51// Ali3Vector x;
52// Float_t vec2[3]={1,2,3};
53// x.SetVector(vec2,"car");
54//
55// Ali4Vector c;
56// c.SetVector(x0,x);
57// c.GetVector(vec,"car");
58// c.Info("cyl");
59// c=a+b;
60// c=a-b;
61// c=a*5;
62//
63//--- NvE 01-apr-1999 UU-SAP Utrecht
64///////////////////////////////////////////////////////////////////////////
65
66#include <iostream.h>
67#include <math.h>
68
69#include "Ali3Vector.h"
70
71class Ali4Vector
72{
73 public:
74 Ali4Vector(); // Default constructor for contravariant vector
75 virtual ~Ali4Vector(); // Destructor
76 virtual void SetVector(Double_t v0,Ali3Vector v); // Store contravariant vector
77 virtual void SetVector(Double_t* v,TString f); // Store contravariant vector v^i in frame f
78 virtual void GetVector(Double_t* v,TString f); // Provide contravariant vector v^i in frame f
79 virtual void SetVector(Float_t* v,TString f); // Store contravariant vector v^i in frame f
80 virtual void GetVector(Float_t* v,TString f); // Provide contravariant vector v^i in frame f
81 Double_t GetScalar(); // Provide the scalar part of v
82 Ali3Vector Get3Vector(); // Provide the 3-vector part of v
83 virtual void Info(TString f="car"); // Print contravariant components in frame f
84 Double_t Dot(Ali4Vector& q); // Provide dot product v^i*q_i
85 Ali4Vector operator+(Ali4Vector& q); // Add contravariant vector q
86 Ali4Vector operator-(Ali4Vector& q); // Subtract contravariant vector q
87 Ali4Vector operator*(Double_t s); // Multiply contravariant vector with scalar s
88 Ali4Vector operator/(Double_t s); // Divide contravariant vector by scalar s
89 Ali4Vector& operator+=(Ali4Vector& q); // Add contravariant vector q
90 Ali4Vector& operator-=(Ali4Vector& q); // Subtract contravariant vector q
91 Ali4Vector& operator*=(Double_t s); // Multiply with scalar s
92 Ali4Vector& operator/=(Double_t s); // Divide by scalar s
93
94 protected:
95 Double_t fV0; // The scalar part
96 Ali3Vector fV; // The 3-vector part
97
98 ClassDef(Ali4Vector,1) // Class definition to enable ROOT I/O
99};
100#endif