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)
24 // --- ROOT system ---
26 // --- Standard library ---
30 #include <strstream.h>
32 // --- AliRoot header files ---
33 #include "AliPHOSHit.h"
40 //____________________________________________________________________________
41 AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit)
47 fPrimary = hit.fPrimary ;
56 //____________________________________________________________________________
57 AliPHOSHit::AliPHOSHit(Int_t Shunt, Int_t primary, Int_t Track, Int_t id, Float_t *hits, Int_t pid) : AliHit(Shunt, Track)
70 //____________________________________________________________________________
71 Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
73 // Two hits are identical if they have the same Id and originate from the same primary
77 if ( fId == rValue.GetId() && fPrimary == rValue.GetPrimary() )
83 //____________________________________________________________________________
84 AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) const
86 // Add the energy of the hit
88 AliPHOSHit added(*this);
90 // the accumulated hit position is the position of the first hi
91 // added.fX = rValue.fX ;
92 // added.fY = rValue.fY ;
93 // added.fZ = rValue.fZ ;
95 added.fELOS += rValue.GetEnergy() ;
101 //____________________________________________________________________________
102 ostream& operator << (ostream& out, const AliPHOSHit& hit)
104 // Print out Id and energy
106 out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << endl ;