]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/AliITSUAux.h
79483cddad27738d8a50dd1cb78c0a0311703108
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUAux.h
1 #ifndef ALIITSUAUX
2 #define ALIITSUAUX
3
4 #include <TObject.h>
5 #include <TMath.h>
6
7 ///////////////////////////////////////////////////////////////////////
8 //                                                                   //
9 //  Namespace AliITSUAux                                             //
10 //  Set of utilities for the ITSU classes                            //
11 //                                                                   //
12 ///////////////////////////////////////////////////////////////////////
13
14
15 class AliITSUGeomTGeo;
16 class AliITSsegmentation;
17 using namespace TMath;
18
19
20 namespace AliITSUAux {
21   void   BringTo02Pi(double &phi);
22   Bool_t OKforPhiMin(double phiMin,double phi);
23   Bool_t OKforPhiMax(double phiMax,double phi);
24 }
25
26 //_________________________________________________________________________________
27 inline void AliITSUAux::BringTo02Pi(double &phi) {   
28   // bring phi to 0-2pi range
29   if (phi<0) phi+=TwoPi(); else if (phi>TwoPi()) phi-=TwoPi();
30 }
31
32 //_________________________________________________________________________________
33 inline Bool_t AliITSUAux::OKforPhiMin(double phiMin,double phi) {
34   // check if phi is above the phiMin, phi's must be in 0-2pi range
35   double dphi = phi-phiMin;
36   return ((dphi>0 && dphi<Pi()) || dphi<-Pi()) ? kTRUE:kFALSE;
37 }
38
39 //_________________________________________________________________________________
40 inline Bool_t AliITSUAux::OKforPhiMax(double phiMax,double phi) {
41   // check if phi is below the phiMax, phi's must be in 0-2pi range
42   double dphi = phi-phiMax;
43   return ((dphi<0 && dphi>-Pi()) || dphi>Pi()) ? kTRUE:kFALSE;
44 }
45
46
47 #endif