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 EMCAL
20 // A hit in EMCAL is the sum of all hits in a single crystal
22 //*-- Author: Sahal Yacoob (LBL / UCT)
23 // Based on AliPHOSHit
25 // --- Standard library ---
29 #include <strstream.h>
32 // --- ROOT system ---
33 #include <TLorentzVector.h>
35 // --- AliRoot header files ---
36 #include "AliEMCALHit.h"
43 //______________________________________________________________________
44 AliEMCALHit::AliEMCALHit(){
56 //______________________________________________________________________
57 AliEMCALHit::AliEMCALHit(const AliEMCALHit & hit){
62 fPrimary = hit.fPrimary ;
69 //______________________________________________________________________
70 AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,Int_t id,
71 Float_t *hits,TLorentzVector *p):AliHit(shunt, track){
73 // Create a CPV hit object
84 //______________________________________________________________________
85 Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const{
86 // Two hits are identical if they have the same Id and originat
87 // from the same primary
90 if ( (fId == rValue.GetId()) && ( fPrimary == rValue.GetPrimary()) )
95 //______________________________________________________________________
96 AliEMCALHit AliEMCALHit::operator+(const AliEMCALHit &rValue){
97 // Add the energy of the hit
99 fELOS += rValue.GetEnergy() ;
104 //______________________________________________________________________
105 ostream& operator << (ostream& out,AliEMCALHit& hit){
106 // Print out Id and energy
108 out << "AliEMCALHit:";
109 out << "id=" << hit.GetId();
110 out << ", Eloss=" << hit.GetEnergy();
111 out << "GeV , Track no.=" << hit.GetPrimary();
112 out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<<hit.Z()<<") cm";
113 out << ", fTrack=" << hit.GetTrack();
114 out << ", P=(" << hit.GetP().Px() << "," << hit.GetP().Py() <<","
115 << hit.GetP().Pz() << "," << hit.GetP().E();