AliRoot Core  edcc906 (edcc906)
AliEMCALHit.cxx
Go to the documentation of this file.
1  /**************************************************************************
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 // --- Standard library ---
17 #include <Riostream.h>
18 
19 // --- AliRoot header files ---
20 #include "AliEMCALHit.h"
21 
22 using std::endl;
23 
25 ClassImp(AliEMCALHit) ;
27 
30 //______________________________________________________________________
32  : fId(0),
33  fELOS(0.),
34  fPrimary(0),
35  fPx(0.),
36  fPy(0.),
37  fPz(0.),
38  fPe(0.),
39  fIparent(0),
40  fIenergy(0.),
41  fTime(0.)
42 { }
43 
46 //______________________________________________________________________
48  : AliHit(hit),
49  fId(hit.fId),
50  fELOS(hit.fELOS),
51  fPrimary(hit.fPrimary),
52  fPx(hit.fPx),
53  fPy(hit.fPy),
54  fPz(hit.fPz),
55  fPe(hit.fPe),
56  fIparent(hit.fIparent),
57  fIenergy(hit.fIenergy),
58  fTime(hit.fTime)
59 { }
60 
63 //_____________________________________________________________________
65 {
66  if (&source == this) return *this;
67 
68  new (this) AliEMCALHit(source);
69  return *this;
70 }
71 
83 //______________________________________________________________________
84 AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,
85  Int_t iparent, Float_t ienergy, Int_t id,
86  Float_t *hits,Float_t *p)
87  : AliHit(shunt, track),
88  fId(id),
89  fELOS(0.),
90  fPrimary(primary),
91  fPx(0.),
92  fPy(0.),
93  fPz(0.),
94  fPe(0.),
95  fIparent(iparent),
96  fIenergy(ienergy),
97  fTime(0.)
98 {
99  fX = hits[0];
100  fY = hits[1];
101  fZ = hits[2];
102  fTime = hits[3] ;
103  fELOS = hits[4];
104  fPx = p[0];
105  fPy = p[1];
106  fPz = p[2];
107  fPe = p[3];
108 }
109 
113 //______________________________________________________________________
114 Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const
115 {
116  Bool_t rv = kFALSE;
117 
118  if ( (fId == rValue.GetId()) && ( fIparent == rValue.GetIparent()) )
119  rv = kTRUE;
120 
121  return rv;
122 }
123 
126 //______________________________________________________________________
128 {
129  fELOS += rValue.GetEnergy() ;
130 
131  if(rValue.GetTime() < fTime)
132  fTime = rValue.GetTime() ;
133 
134  return *this;
135 }
136 
139 //______________________________________________________________________
140 ostream& operator << (ostream& out,AliEMCALHit& hit)
141 {
142  out << "AliEMCALHit:";
143  out << "id=" << hit.GetId();
144  out << ", Eloss=" << hit.GetEnergy();
145  out << ", Time=" << hit.GetTime();
146  out << "GeV , Track no.=" << hit.GetPrimary();
147  out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<<hit.Z()<<") cm";
148  out << ", fTrack=" << hit.GetTrack();
149  out << ", P=(" << hit.GetPx() << "," << hit.GetPy() << "," << hit.GetPz()
150  << "," <<hit.GetPe() << ") GeV" ;
151  out << ", Enterring particle ID" << hit.GetIparent();
152  out << ", Enterring particle initial energy = " << hit.GetIenergy() << " GeV" ;
153  out << endl;
154 
155  return out;
156 }
Float_t fPy
Primary particle entrance momentum/energy.
Definition: AliEMCALHit.h:73
Float_t GetPe(void) const
Definition: AliEMCALHit.h:59
Int_t fId
Absolute Id number EMCAL segment.
Definition: AliEMCALHit.h:69
Definition: AliHit.h:14
AliEMCALHit()
Default constructor.
Definition: AliEMCALHit.cxx:31
Int_t GetTrack() const
Definition: AliHit.h:19
Float_t fTime
Time of the energy deposition.
Definition: AliEMCALHit.h:78
Float_t p[]
Definition: kNNTest.C:133
AliTPCfastTrack * track
Float_t Z() const
Definition: AliHit.h:23
Int_t fPrimary
Primary particles at the origin of the hit.
Definition: AliEMCALHit.h:71
Int_t GetId(void) const
Definition: AliEMCALHit.h:44
Float_t GetPx(void) const
Definition: AliEMCALHit.h:56
Float_t X() const
Definition: AliHit.h:21
Float_t fPx
Primary particle entrance momentum/energy.
Definition: AliEMCALHit.h:72
AliEMCALHit operator+(const AliEMCALHit &rValue)
Add the energy of the hit.
Float_t fPz
Primary particle entrance momentum/energy.
Definition: AliEMCALHit.h:74
Float_t Y() const
Definition: AliHit.h:22
Float_t GetIenergy(void) const
Definition: AliEMCALHit.h:49
EMCal hits object.
Definition: AliEMCALHit.h:24
Float_t fZ
Definition: AliHit.h:30
Float_t fX
Definition: AliHit.h:28
Bool_t operator==(AliEMCALHit const &rValue) const
Float_t fELOS
Energy deposited.
Definition: AliEMCALHit.h:70
Int_t fIparent
Parent particle that entered emcal.
Definition: AliEMCALHit.h:76
Float_t fPe
Primary particle entrance momentum/energy.
Definition: AliEMCALHit.h:75
Int_t GetIparent(void) const
Definition: AliEMCALHit.h:47
Int_t GetPrimary(void) const
Definition: AliEMCALHit.h:51
friend ostream & operator<<(ostream &, AliEMCALHit &)
Dump hit info.
Float_t GetPy(void) const
Definition: AliEMCALHit.h:57
AliEMCALHit & operator=(const AliEMCALHit &source)
Assignment operator; use copy constructor.
Definition: AliEMCALHit.cxx:64
Float_t fIenergy
Initial energy of parent particle that enterred the emcal.
Definition: AliEMCALHit.h:77
Float_t GetEnergy(void) const
Definition: AliEMCALHit.h:41
Float_t GetTime(void) const
Definition: AliEMCALHit.h:54
Float_t fY
Definition: AliHit.h:29
Float_t GetPz(void) const
Definition: AliEMCALHit.h:58