]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/JET/AliHLTJETBase.cxx
* Moved conejetFinderComponent in the cone directory
[u/mrichter/AliRoot.git] / HLT / JET / AliHLTJETBase.cxx
CommitLineData
7c3c85cd 1//-*- Mode: C++ -*-
2//**************************************************************************
3//* This file is property of and copyright by the ALICE HLT Project *
4//* ALICE Experiment at CERN, All rights reserved. *
5//* *
6//* Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
7//* for The ALICE HLT Project. *
8//* *
9//* Permission to use, copy, modify and distribute this software and its *
10//* documentation strictly for non-commercial purposes is hereby granted *
11//* without fee, provided that the above copyright notice appears in all *
12//* copies and that both the copyright notice and this permission notice *
13//* appear in the supporting documentation. The authors make no claims *
14//* about the suitability of this software for any purpose. It is *
15//* provided "as is" without express or implied warranty. *
16//**************************************************************************
17
18/** @file AliHLTJETBase.cxx
19 @author Jochen Thaeder
20 @date
21 @brief Base functionality for HLT JET package
22*/
23
24// see header file for class documentation
25// or
26// refer to README to build package
27// or
28// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
29
30#if __GNUC__>= 3
31 using namespace std;
32#endif
33
34#include "AliHLTJETBase.h"
35
36/** ROOT macro for the implementation of ROOT specific class methods */
37ClassImp(AliHLTJETBase)
38
39/*
40 * ---------------------------------------------------------------------------------
41 * Constructor / Destructor
42 * ---------------------------------------------------------------------------------
43 */
44
45//##################################################################################
46 AliHLTJETBase::AliHLTJETBase() {
47 // see header file for class documentation
48 // or
49 // refer to README to build package
50 // or
51 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
52}
53
54
55//##################################################################################
56AliHLTJETBase::~AliHLTJETBase() {
57 // see header file for class documentation
58}
59
60#if 0
61
62
63//##################################################################################
64void AliHLTJETBase::XYZtoRPhiEta( const Double_t *xyz, Double_t *rpe ) {
65 // see header file for class documentation
66
67 // Spherical [r,phi,eta] - rpe
68 // Cartesian [x,y,z] - xyz
69
70 rpe[0] = TMath::Sqrt( xyz[0]*xyz[0] + xyz[1]*xyz[1] + xyz[2]*xyz[2] );
71 rpe[1] = AliHLTJETBase::GetPhiFromXYZ( xyz );
72 rpe[2] = 0.5 * TMath::Log( (rpe[0]+xyz[2])/(rpe[0]-xyz[2]) );
73}
74
75//##################################################################################
76void AliHLTJETBase::XYZEtoRPhiEtaPt( const Double_t *xyze, Double_t *rpep ) {
77 // see header file for class documentation
78
79 // Spherical [r,phi,eta,pt] - rpep
80 // Cartesian [x,y,z,E] - xyze
81
82 rpep[0] = TMath::Sqrt( xyze[0]*xyze[0] + xyze[1]*xyze[1] + xyze[2]*xyze[2] );
83 rpep[1] = AliHLTJETBase::GetPhiFromXYZ( xyze );
84 rpep[2] = 0.5 * TMath::Log( (rpep[0]+xyze[2])/(rpep[0]-xyze[2]) );
85 rpep[3] = AliHLTJETBase::GetPtFromXYZ( xyze );
86}
87
88//##################################################################################
89void AliHLTJETBase::XYZEtoRPhiEtaPt( const Float_t *xyze, Double_t *rpep ) {
90 // see header file for class documentation
91
92 // Spherical [r,phi,eta,pt] - rpep
93 // Cartesian [x,y,z,E] - xyze
94 Double_t x = (Double_t) xyze[0];
95 Double_t y = (Double_t) xyze[1];
96 Double_t z = (Double_t) xyze[2];
97
98 rpep[0] = TMath::Sqrt( x*x + y*y + z*z );
99 rpep[1] = AliHLTJETBase::GetPhiFromXYZ( xyze );
100 rpep[2] = 0.5 * TMath::Log( (rpep[0]+z)/(rpep[0]-z) );
101 rpep[3] = AliHLTJETBase::GetPtFromXYZ( xyze );
102}
103
104//##################################################################################
105void AliHLTJETBase::XYZEtoEPhiEtaPt( const Double_t *xyze, Double_t *epep ) {
106 // see header file for class documentation
107
108 // Spherical [r,phi,eta,pt] - rpep
109 // Cartesian [x,y,z,E] - xyze
110
111 Double_t r = TMath::Sqrt( xyze[0]*xyze[0] + xyze[1]*xyze[1] + xyze[2]*xyze[2] );
112
113 epep[0] = xyze[3];
114 epep[1] = AliHLTJETBase::GetPhiFromXYZ( xyze );
115 epep[2] = 0.5 * TMath::Log( (r+xyze[2])/(r-xyze[2]) );
116 epep[3] = AliHLTJETBase::GetPtFromXYZ( xyze );
117}
118
119//##################################################################################
120void AliHLTJETBase::XYZEtoEPhiEtaPt( const Float_t *xyze, Double_t *epep ) {
121 // see header file for class documentation
122
123 // Spherical [r,phi,eta,pt] - rpep
124 // Cartesian [x,y,z,E] - xyze
125 Double_t x = (Double_t) xyze[0];
126 Double_t y = (Double_t) xyze[1];
127 Double_t z = (Double_t) xyze[2];
128 Double_t e = (Double_t) xyze[3];
129 Double_t r = TMath::Sqrt( x*x + y*y + z*z );
130
131 epep[0] = e;
132 epep[1] = AliHLTJETBase::GetPhiFromXYZ( xyze );
133 epep[2] = 0.5 * TMath::Log( (r+z)/(r-z) );
134 epep[3] = AliHLTJETBase::GetPtFromXYZ( xyze );
135}
136
137//##################################################################################
138Double_t AliHLTJETBase::GetPtFromXYZ( const Double_t *pxpypz ) {
139 // see header file for class documentation
140 // Cartesian [px,py,pz]
141
142 return TMath::Sqrt( pxpypz[0]*pxpypz[0] + pxpypz[1]*pxpypz[1] );
143}
144
145//##################################################################################
146Double_t AliHLTJETBase::GetPtFromXYZ( const Float_t *pxpypz ) {
147 // see header file for class documentation
148 // Cartesian [px,py,pz]
149
150 Double_t px = (Double_t) pxpypz[0];
151 Double_t py = (Double_t) pxpypz[1];
152
153 return TMath::Sqrt( px*px + py*py );
154}
155
156//##################################################################################
157Double_t AliHLTJETBase::GetPhiFromXYZ( const Double_t *xyz ) {
158 // see header file for class documentation
159 // Cartesian [x,y,z,E] - xyz
160
161 Double_t phi = TMath::ATan2( xyz[1], xyz[0] );
162 if ( phi < 0.0 ) phi += TMath::TwoPi();
163
164 return phi;
165}
166
167//##################################################################################
168Double_t AliHLTJETBase::GetPhiFromXYZ( const Float_t *xyz ) {
169 // see header file for class documentation
170 // Cartesian [x,y,z,E] - xyz
171
172 Double_t x = (Double_t) xyz[0];
173 Double_t y = (Double_t) xyz[1];
174
175 Double_t phi = TMath::ATan2( y, x );
176 if ( phi < 0.0 ) phi += TMath::TwoPi();
177
178 return phi;
179}
180
181//##################################################################################
182Double_t AliHLTJETBase::GetEtaFromXYZ( const Double_t *xyz ) {
183 // see header file for class documentation
184 // Cartesian [x,y,z,E] - xyz
185
186 Double_t r = TMath::Sqrt( xyz[0]*xyz[0] + xyz[1]*xyz[1] + xyz[2]*xyz[2] );
187 return 0.5 * TMath::Log( (r+xyz[2])/(r-xyz[2]) );
188}
189//##################################################################################
190Double_t AliHLTJETBase::GetEtaFromXYZ( const Float_t *xyz ) {
191 // see header file for class documentation
192 // Cartesian [x,y,z,E] - xyz
193
194 Double_t x = (Double_t) xyz[0];
195 Double_t y = (Double_t) xyz[1];
196 Double_t z = (Double_t) xyz[2];
197
198 Double_t r = TMath::Sqrt( x*x + y*y + z*z );
199 return 0.5 * TMath::Log( (r+z)/(r-z) );
200}
201
202//##################################################################################
203Double_t AliHLTJETBase::GetDistance2( const Double_t eta1, const Double_t phi1,
204 const Double_t eta2, const Double_t phi2) {
205 // see header file for class documentation
206
207 return ( (eta1-eta2)*(eta1-eta2) ) + ( (phi1-phi2)*(phi1-phi2) );
208}
209
210
211#endif