]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALHit.cxx
Adding comments
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALHit.cxx
CommitLineData
fdebddeb 1 /**************************************************************************
b13bbe81 2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id: */
17
18//_________________________________________________________________________
19// Hits class for EMCAL
19a2fe5a 20// A hit in EMCAL is the sum of all hits in a tower
21// from a single entering particle
b13bbe81 22//*-- Author: Sahal Yacoob (LBL / UCT)
23// Based on AliPHOSHit
24
25// --- Standard library ---
70479d0e 26#include <Riostream.h>
b13bbe81 27
28// --- ROOT system ---
b13bbe81 29
30// --- AliRoot header files ---
31#include "AliEMCALHit.h"
b13bbe81 32
33ClassImp(AliEMCALHit)
34
35//______________________________________________________________________
36AliEMCALHit::AliEMCALHit(){
37 // Default ctor
38
39 fId = 0;
40 fELOS = 0.0;
773f6f3f 41 fTime = 0.0;
b13bbe81 42 fPrimary = 0;
43 fTrack = 0;
44 fX = 0.0;
45 fY = 0.0;
46 fZ = 0.0;
d64c959b 47 fPx = 0.0;
48 fPy = 0.0;
49 fPz = 0.0;
50 fPe = 0.0;
61e0abb5 51 fIparent = 0;
52 fIenergy = 0.0;
b13bbe81 53}
54//______________________________________________________________________
9e5d2067 55AliEMCALHit::AliEMCALHit(const AliEMCALHit & hit) : AliHit(hit){
b13bbe81 56 // copy ctor
57
58 fId = hit.fId ;
59 fELOS = hit.fELOS ;
60 fPrimary = hit.fPrimary ;
61 fTrack = hit.fTrack ;
62 fX = hit.fX;
63 fY = hit.fY;
64 fZ = hit.fZ;
61e0abb5 65 fPx = hit.fPx;
66 fPy = hit.fPy;
67 fPz = hit.fPz;
68 fPe = hit.fPe;
69 fIparent = hit.fIparent;
70 fIenergy = hit.fIenergy;
773f6f3f 71 fTime = hit.fTime ;
b13bbe81 72}
73//______________________________________________________________________
61e0abb5 74AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,Int_t iparent, Float_t ienergy, Int_t id,
75 Float_t *hits,Float_t *p):AliHit(shunt, track){
b13bbe81 76 //
ffa6d63b 77 // Create an EMCAL hit object
b13bbe81 78 //
b13bbe81 79 fX = hits[0];
80 fY = hits[1];
81 fZ = hits[2];
773f6f3f 82 fTime = hits[3] ;
b13bbe81 83 fId = id;
773f6f3f 84 fELOS = hits[4];
b13bbe81 85 fPrimary = primary;
61e0abb5 86 fPx = p[0];
87 fPy = p[1];
88 fPz = p[2];
89 fPe = p[3];
90 fIparent = iparent;
91 fIenergy = ienergy;
b13bbe81 92}
4c35d512 93
b13bbe81 94//______________________________________________________________________
95Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const{
96 // Two hits are identical if they have the same Id and originat
ffa6d63b 97 // from the same enterring Particle
b13bbe81 98 Bool_t rv = kFALSE;
99
fdebddeb 100 if ( (fId == rValue.GetId()) && ( fIparent == rValue.GetIparent()))
b13bbe81 101 rv = kTRUE;
102
103 return rv;
104}
105//______________________________________________________________________
106AliEMCALHit AliEMCALHit::operator+(const AliEMCALHit &rValue){
107 // Add the energy of the hit
108
109 fELOS += rValue.GetEnergy() ;
773f6f3f 110
111 if(rValue.GetTime() < fTime)
112 fTime = rValue.GetTime() ;
113
b13bbe81 114 return *this;
115
116}
117//______________________________________________________________________
118ostream& operator << (ostream& out,AliEMCALHit& hit){
119 // Print out Id and energy
120
121 out << "AliEMCALHit:";
122 out << "id=" << hit.GetId();
123 out << ", Eloss=" << hit.GetEnergy();
773f6f3f 124 out << ", Time=" << hit.GetTime();
b13bbe81 125 out << "GeV , Track no.=" << hit.GetPrimary();
126 out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<<hit.Z()<<") cm";
127 out << ", fTrack=" << hit.GetTrack();
61e0abb5 128 out << ", P=(" << hit.GetPx() << "," << hit.GetPy() << "," << hit.GetPz()
129 << "," <<hit.GetPe() << ") GeV" ;
130 out << ", Enterring particle ID" << hit.GetIparent();
131 out << ", Enterring particle initial energy = " << hit.GetIenergy() << " GeV" ;
b13bbe81 132 out << endl;
133
134 return out;
135}