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 //_________________________________________________________________________
19 // Hits class for PHOS
20 // A hit in PHOS is the sum of all hits in a single crystal
22 //*-- Author: Maxime Volkov (RRC KI) & Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
24 // --- ROOT system ---
27 // --- Standard library ---
29 // --- AliRoot header files ---
30 #include "AliPHOSHit.h"
32 #include "AliPHOSGeometry.h"
37 //____________________________________________________________________________
38 AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit) : AliHit(hit)
46 fPrimary = hit.fPrimary ;
52 //____________________________________________________________________________
53 AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits): AliHit(shunt, track)
56 // Create a CPV hit object
67 //____________________________________________________________________________
68 Float_t AliPHOSHit::X() const
72 AliPHOS * phos = static_cast<AliPHOS*> (gAlice->GetDetector("PHOS")) ;
73 phos->GetGeometry() ->RelPosInAlice(GetId(), pos) ;
81 //____________________________________________________________________________
82 Float_t AliPHOSHit::Y() const
86 AliPHOS * phos = static_cast<AliPHOS*> (gAlice->GetDetector("PHOS")) ;
87 phos->GetGeometry() ->RelPosInAlice(GetId(), pos) ;
95 //____________________________________________________________________________
96 Float_t AliPHOSHit::Z() const
100 AliPHOS * phos = static_cast<AliPHOS*> (gAlice->GetDetector("PHOS")) ;
101 phos->GetGeometry() ->RelPosInAlice(GetId(), pos) ;
109 //____________________________________________________________________________
110 Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
112 // Two hits are identical if they have the same Id and originate from the same primary
116 if ( (fId == rValue.GetId()) && ( fPrimary == rValue.GetPrimary() ) )
122 //____________________________________________________________________________
123 AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue)
125 // Add the energy of the hit
127 fELOS += rValue.GetEnergy() ;
129 if(rValue.GetTime() < fTime)
130 fTime = rValue.GetTime() ;
136 //____________________________________________________________________________
137 // Commented out by Yu.Kharlov 4.09.2003
138 // ostream& operator << (ostream& out, const AliPHOSHit& hit)
140 // // Print out Id and energy
142 // //out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << " " << hit.GetTime() << endl ;
143 // Warning("operator <<", "Implement differently") ;