Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ElzKin.h

Go to the documentation of this file.
00001 #ifndef ATLFAST_ELZKIN_H
00002 #define ATLFAST_ELZKIN_H
00003 #include <math.h>
00004 
00005 
00006 namespace Atlfast {
00007 
00008   float ElzRapidity(float pt, float pz){
00009     float etalog = log((sqrt(pt*pt + pz*pz) + sqrt(pz*pz))/pt);
00010     if (pz < 0 ) return -sqrt(etalog*etalog);
00011     else         return  sqrt(etalog*etalog);
00012   }
00013   float ElzPhi(float x, float y){
00014 //   Compute phi angle of particle
00015 // ... this is a copy of function ULANGL
00016 //  .. sign(a,b) = -abs(a) if b <  0
00017 //               =  abs(a) if b >= 0
00018     float angle = 0;
00019     const float kPI  = 4*atan(1.0);
00020     float r = sqrt(x*x + y*y);
00021     if (r < 1e-20) return angle;
00022     if (sqrt(x*x)/r < 0.8) {
00023       //      angle = Sign((float)sqrt(acos(x/r)*acos(x/r)), y);
00024       angle = (float)sqrt(acos(x/r)*acos(x/r));
00025       angle = (y>0)? abs(angle):-abs(angle);
00026     } else {
00027       angle = asin(y/r);
00028       if (x < 0 ) {
00029         if(angle >= 0) angle =  kPI - angle;
00030         else           angle = -kPI - angle;
00031       }
00032     }
00033     return angle;
00034   }
00035 }
00036 #endif

Generated on Mon Feb 4 15:54:23 2002 for Atlfast by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001