]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/JET/AliHLTJETBase.cxx
removing the HLT autoconf build system, however keep on using that for the
[u/mrichter/AliRoot.git] / HLT / JET / AliHLTJETBase.cxx
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 */
37 ClassImp(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 //##################################################################################
56 AliHLTJETBase::~AliHLTJETBase() {
57   // see header file for class documentation
58 }
59
60 /*
61  * ---------------------------------------------------------------------------------
62  *                              Initialize static const
63  * ---------------------------------------------------------------------------------
64  */
65
66 //##################################################################################
67 const Char_t *AliHLTJETBase::fgkJetAlgorithmType[] = { 
68   "Anti Kt", 
69   "Kt",
70   "FFSC SquareCell",
71   "FFSC RadiusCell"
72 };
73
74 #if 0
75
76 //################################################################################## 
77 Float_t AliHLTJETBase::GetDistance2( const Float_t eta1, const Float_t phi1, 
78                                      const Float_t eta2, const Float_t phi2) {
79   // see header file for class documentation
80   
81   return ( (eta1-eta2)*(eta1-eta2) ) + ( (phi1-phi2)*(phi1-phi2) );
82 }
83
84 //##################################################################################
85 void AliHLTJETBase::XYZtoRPhiEta( const Double_t *xyz, Double_t *rpe ) {
86   // see header file for class documentation
87
88   // Spherical [r,phi,eta] - rpe
89   // Cartesian [x,y,z] - xyz
90   
91   rpe[0] = TMath::Sqrt( xyz[0]*xyz[0] + xyz[1]*xyz[1] + xyz[2]*xyz[2] );
92   rpe[1] = AliHLTJETBase::GetPhiFromXYZ( xyz );
93   rpe[2] = 0.5 * TMath::Log( (rpe[0]+xyz[2])/(rpe[0]-xyz[2]) );
94 }
95
96 //##################################################################################
97 void AliHLTJETBase::XYZEtoRPhiEtaPt( const Double_t *xyze, Double_t *rpep ) {
98   // see header file for class documentation
99
100   // Spherical [r,phi,eta,pt] - rpep
101   // Cartesian [x,y,z,E] - xyze
102   
103   rpep[0] = TMath::Sqrt( xyze[0]*xyze[0] + xyze[1]*xyze[1] + xyze[2]*xyze[2] );
104   rpep[1] = AliHLTJETBase::GetPhiFromXYZ( xyze );
105   rpep[2] = 0.5 * TMath::Log( (rpep[0]+xyze[2])/(rpep[0]-xyze[2]) );
106   rpep[3] = AliHLTJETBase::GetPtFromXYZ( xyze );
107 }
108
109 //##################################################################################
110 void AliHLTJETBase::XYZEtoRPhiEtaPt( const Float_t *xyze, Double_t *rpep ) {
111   // see header file for class documentation
112
113   // Spherical [r,phi,eta,pt] - rpep
114   // Cartesian [x,y,z,E] - xyze
115   Double_t x = (Double_t) xyze[0];
116   Double_t y = (Double_t) xyze[1];
117   Double_t z = (Double_t) xyze[2];
118   
119   rpep[0] = TMath::Sqrt( x*x + y*y + z*z );
120   rpep[1] = AliHLTJETBase::GetPhiFromXYZ( xyze );
121   rpep[2] = 0.5 * TMath::Log( (rpep[0]+z)/(rpep[0]-z) );
122   rpep[3] = AliHLTJETBase::GetPtFromXYZ( xyze );
123 }
124
125 //##################################################################################
126 void AliHLTJETBase::XYZEtoEPhiEtaPt( const Double_t *xyze, Double_t *epep ) {
127   // see header file for class documentation
128
129   // Spherical [r,phi,eta,pt] - rpep
130   // Cartesian [x,y,z,E] - xyze
131
132   Double_t r = TMath::Sqrt( xyze[0]*xyze[0] + xyze[1]*xyze[1] + xyze[2]*xyze[2] );
133   
134   epep[0] = xyze[3];
135   epep[1] = AliHLTJETBase::GetPhiFromXYZ( xyze );
136   epep[2] = 0.5 * TMath::Log( (r+xyze[2])/(r-xyze[2]) );
137   epep[3] = AliHLTJETBase::GetPtFromXYZ( xyze );
138 }
139
140 //##################################################################################
141 void AliHLTJETBase::XYZEtoEPhiEtaPt( const Float_t *xyze, Double_t *epep ) {
142   // see header file for class documentation
143
144   // Spherical [r,phi,eta,pt] - rpep
145   // Cartesian [x,y,z,E] - xyze
146   Double_t x = (Double_t) xyze[0];
147   Double_t y = (Double_t) xyze[1];
148   Double_t z = (Double_t) xyze[2];
149   Double_t e = (Double_t) xyze[3];
150   Double_t r = TMath::Sqrt( x*x + y*y + z*z );
151   
152   epep[0] = e;
153   epep[1] = AliHLTJETBase::GetPhiFromXYZ( xyze );
154   epep[2] = 0.5 * TMath::Log( (r+z)/(r-z) );
155   epep[3] = AliHLTJETBase::GetPtFromXYZ( xyze );
156 }
157
158 //##################################################################################
159 Double_t AliHLTJETBase::GetPtFromXYZ( const Double_t *pxpypz ) {
160   // see header file for class documentation
161   // Cartesian [px,py,pz] 
162   
163   return TMath::Sqrt( pxpypz[0]*pxpypz[0] + pxpypz[1]*pxpypz[1] );
164 }
165
166 //##################################################################################
167 Double_t AliHLTJETBase::GetPtFromXYZ( const Float_t *pxpypz ) {
168   // see header file for class documentation
169   // Cartesian [px,py,pz] 
170   
171   Double_t px = (Double_t) pxpypz[0];
172   Double_t py = (Double_t) pxpypz[1];
173
174   return TMath::Sqrt( px*px + py*py );
175 }
176
177 //##################################################################################
178 Double_t AliHLTJETBase::GetPhiFromXYZ( const Double_t *xyz ) {
179   // see header file for class documentation
180   // Cartesian [x,y,z,E] - xyz
181  
182   Double_t phi = TMath::ATan2( xyz[1], xyz[0] );  
183   if ( phi < 0.0 ) phi += TMath::TwoPi();
184
185   return phi;
186 }
187
188 //##################################################################################
189 Double_t AliHLTJETBase::GetPhiFromXYZ( const Float_t *xyz ) {
190   // see header file for class documentation
191   // Cartesian [x,y,z,E] - xyz
192  
193   Double_t x = (Double_t) xyz[0];
194   Double_t y = (Double_t) xyz[1];
195
196   Double_t phi = TMath::ATan2( y, x );  
197   if ( phi < 0.0 ) phi += TMath::TwoPi();
198
199   return phi;
200 }
201
202 //##################################################################################
203 Double_t AliHLTJETBase::GetEtaFromXYZ( const Double_t *xyz ) {
204   // see header file for class documentation
205   // Cartesian [x,y,z,E] - xyz
206   
207   Double_t r = TMath::Sqrt( xyz[0]*xyz[0] + xyz[1]*xyz[1] + xyz[2]*xyz[2] );
208   return 0.5 * TMath::Log( (r+xyz[2])/(r-xyz[2]) );
209 }
210 //##################################################################################
211 Double_t AliHLTJETBase::GetEtaFromXYZ( const Float_t *xyz ) {
212   // see header file for class documentation
213   // Cartesian [x,y,z,E] - xyz
214   
215   Double_t x = (Double_t) xyz[0];
216   Double_t y = (Double_t) xyz[1];
217   Double_t z = (Double_t) xyz[2];
218   
219   Double_t r = TMath::Sqrt( x*x + y*y + z*z );
220   return 0.5 * TMath::Log( (r+z)/(r-z) );
221 }
222
223
224
225 #endif