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 segment
21 // from a single enterring particle
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"
39 #include "AliEMCALGeometry.h"
40 #include "AliEMCALGetter.h"
44 //______________________________________________________________________
45 AliEMCALHit::AliEMCALHit(){
63 //______________________________________________________________________
64 AliEMCALHit::AliEMCALHit(const AliEMCALHit & hit){
69 fPrimary = hit.fPrimary ;
78 fIparent = hit.fIparent;
79 fIenergy = hit.fIenergy;
82 //______________________________________________________________________
83 AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,Int_t iparent, Float_t ienergy, Int_t id,
84 Float_t *hits,Float_t *p):AliHit(shunt, track){
86 // Create an EMCAL hit object
103 //______________________________________________________________________
104 const Bool_t AliEMCALHit::IsInPreShower() const
108 const AliEMCALGeometry * geom = AliEMCALGetter::GetInstance()->EMCALGeometry() ;
109 if((GetId()/geom->GetNPhi()) < (2*geom->GetNZ()))
114 //______________________________________________________________________
115 Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const{
116 // Two hits are identical if they have the same Id and originat
117 // from the same enterring Particle
120 if ( (fId == rValue.GetId()) && ( fIparent == rValue.GetIparent()) )
125 //______________________________________________________________________
126 AliEMCALHit AliEMCALHit::operator+(const AliEMCALHit &rValue){
127 // Add the energy of the hit
129 fELOS += rValue.GetEnergy() ;
131 if(rValue.GetTime() < fTime)
132 fTime = rValue.GetTime() ;
137 //______________________________________________________________________
138 ostream& operator << (ostream& out,AliEMCALHit& hit){
139 // Print out Id and energy
141 out << "AliEMCALHit:";
142 out << "id=" << hit.GetId();
143 out << ", Eloss=" << hit.GetEnergy();
144 out << ", Time=" << hit.GetTime();
145 out << "GeV , Track no.=" << hit.GetPrimary();
146 out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<<hit.Z()<<") cm";
147 out << ", fTrack=" << hit.GetTrack();
148 out << ", P=(" << hit.GetPx() << "," << hit.GetPy() << "," << hit.GetPz()
149 << "," <<hit.GetPe() << ") GeV" ;
150 out << ", Enterring particle ID" << hit.GetIparent();
151 out << ", Enterring particle initial energy = " << hit.GetIenergy() << " GeV" ;