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 tower
21 // from a single entering particle
22 //*-- Author: Sahal Yacoob (LBL / UCT)
23 // Based on AliPHOSHit
25 // --- Standard library ---
26 #include <Riostream.h>
28 // --- ROOT system ---
30 // --- AliRoot header files ---
31 #include "AliEMCALHit.h"
36 //______________________________________________________________________
37 AliEMCALHit::AliEMCALHit()
52 //______________________________________________________________________
53 AliEMCALHit::AliEMCALHit(const AliEMCALHit & hit)
57 fPrimary(hit.fPrimary),
62 fIparent(hit.fIparent),
63 fIenergy(hit.fIenergy),
68 //_____________________________________________________________________
69 AliEMCALHit& AliEMCALHit::operator = (const AliEMCALHit &source)
70 { // assignment operator; use copy ctor
71 if (&source == this) return *this;
73 new (this) AliEMCALHit(source);
76 //______________________________________________________________________
77 AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,Int_t iparent, Float_t ienergy, Int_t id,
78 Float_t *hits,Float_t *p)
79 : AliHit(shunt, track),
92 // Create an EMCAL hit object
105 //______________________________________________________________________
106 Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const{
107 // Two hits are identical if they have the same Id and originat
108 // from the same enterring Particle
111 if ( (fId == rValue.GetId()) && ( fIparent == rValue.GetIparent()))
116 //______________________________________________________________________
117 AliEMCALHit AliEMCALHit::operator+(const AliEMCALHit &rValue){
118 // Add the energy of the hit
120 fELOS += rValue.GetEnergy() ;
122 if(rValue.GetTime() < fTime)
123 fTime = rValue.GetTime() ;
128 //______________________________________________________________________
129 ostream& operator << (ostream& out,AliEMCALHit& hit){
130 // Print out Id and energy
132 out << "AliEMCALHit:";
133 out << "id=" << hit.GetId();
134 out << ", Eloss=" << hit.GetEnergy();
135 out << ", Time=" << hit.GetTime();
136 out << "GeV , Track no.=" << hit.GetPrimary();
137 out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<<hit.Z()<<") cm";
138 out << ", fTrack=" << hit.GetTrack();
139 out << ", P=(" << hit.GetPx() << "," << hit.GetPy() << "," << hit.GetPz()
140 << "," <<hit.GetPe() << ") GeV" ;
141 out << ", Enterring particle ID" << hit.GetIparent();
142 out << ", Enterring particle initial energy = " << hit.GetIenergy() << " GeV" ;