]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/trigger/AliHLTTriggerDetectorGeomRectangle.cxx
Fixes for #84564: Change in AliESDpid.cxx
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTTriggerDetectorGeomRectangle.cxx
1
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: Oystein Djuvsland                                     *
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   AliHLTTriggerDetectorGeomRectangle.cxx
19 /// @author Oystein Djuvsland
20 /// @date   2009-10-08
21 /// @brief  HLT class describing simple rectangular geometry of (sub-)detectors.
22 ///         Used for the AliHLTTriggerBarrelGeomMultiplicity classes
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 #include "AliHLTTriggerDetectorGeomRectangle.h"
31 #include "AliHLTTriggerDetectorGeom.h"
32 #include "TVector3.h"
33 #include "TMath.h"
34
35
36 AliHLTTriggerDetectorGeomRectangle::AliHLTTriggerDetectorGeomRectangle() : AliHLTTriggerDetectorGeom()
37 {
38   // See header file for class documentation
39 }
40
41 AliHLTTriggerDetectorGeomRectangle::~AliHLTTriggerDetectorGeomRectangle()
42 {
43   // See header file for class documentation
44 }
45
46 Bool_t AliHLTTriggerDetectorGeomRectangle::IsInDetector(Double_t point[3])
47 {
48   // See header file for class documentation
49   TVector3 trackPos(point);
50   
51   Double_t phi = 0;
52
53   if(trackPos.Phi() < 0) phi = trackPos.Phi() + 2*TMath::Pi();
54   else phi = trackPos.Phi();
55
56   if(trackPos.Eta() >= fEtaMin && 
57      trackPos.Eta() <= fEtaMax &&
58      phi >= fPhiMin &&
59      phi <= fPhiMax)
60     {
61       //      printf("Checking point: Eta: %f Phi: %f against cuts EtaMin: %f EtaMax: %f PhiMin: %f PhiMax: %f - true\n", trackPos.Eta(), phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax);
62       return true;
63     }
64
65   //  printf("Checking point: Eta: %f Phi: %f against cuts EtaMin: %f EtaMax: %f PhiMin: %f PhiMax: %f - false\n", trackPos.Eta(), phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax);
66
67   if(trackPos.Eta() >= fEtaMin && 
68      trackPos.Eta() <= fEtaMax &&
69      phi >= fPhiMin &&
70      phi <= fPhiMax)
71     {
72       //      printf("Checking point: Eta: %f Phi: %f against cuts EtaMin: %f EtaMax: %f PhiMin: %f PhiMax: %f - true\n", trackPos.Eta(), phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax);
73       return true;
74     }
75
76   //  printf("Checking point: Eta: %f Phi: %f against cuts EtaMin: %f EtaMax: %f PhiMin: %f PhiMax: %f - false\n", trackPos.Eta(), phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax);
77
78   return false;
79 }
80