1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include "AliACORDEhit.h"
24 ClassImp(AliACORDEhit)
26 //____________________________________________________________________________
27 AliACORDEhit::AliACORDEhit()
37 // default ctor for AliACORDEhit object
41 //_____________________________________________________________________________
42 AliACORDEhit::AliACORDEhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
43 : AliHit(shunt, track),
52 // Constructor of hit object
59 //____________________________________________________________________________
60 AliACORDEhit::AliACORDEhit(const AliACORDEhit & hit)
77 //_____________________________________________________________________________
78 AliACORDEhit::~AliACORDEhit()
81 // Default destructor.
85 //_____________________________________________________________________________
86 AliACORDEhit& AliACORDEhit::operator=(const AliACORDEhit & hit)
89 // aisngment operator.
99 fMedium = hit.fMedium;
103 //_____________________________________________________________________________
104 Float_t AliACORDEhit::Energy() const
109 return TMath::Sqrt(fPx*fPx + fPy*fPy + fPz*fPz);
112 //_____________________________________________________________________________
113 Float_t AliACORDEhit::PolarAngle() const
118 return kRaddeg*TMath::ACos(-fPy/this->Energy());
121 //_____________________________________________________________________________
122 Float_t AliACORDEhit::AzimuthAngle() const
127 return kRaddeg*TMath::ATan2(-fPx, -fPz);
130 //_____________________________________________________________________________
131 Bool_t AliACORDEhit::operator==(const AliACORDEhit& hit)
136 Float_t energy = TMath::Sqrt(fPx*fPx + fPy*fPy + fPz*fPz);
137 Float_t energy2=TMath::Sqrt(hit.fPx*hit.fPx+hit.fPy*hit.fPy+hit.fPz*hit.fPz);
138 return (energy == energy2);
139 //return (fTrack == hit.fTrack);
142 //_____________________________________________________________________________
143 Bool_t AliACORDEhit::operator<(const AliACORDEhit& hit)
148 Float_t energy = TMath::Sqrt(fPx*fPx + fPy*fPy + fPz*fPz);
149 Float_t energy2=TMath::Sqrt(hit.fPx*hit.fPx+hit.fPy*hit.fPy+hit.fPz*hit.fPz);
150 return (energy < energy2);