]>
Commit | Line | Data |
---|---|---|
58feed7c | 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 | /* $Id: */ | |
17 | ||
18 | //_________________________________________________________________________ | |
19 | // Hits class for EMCAL | |
20 | // A hit in EMCAL is the usuall hi with full information about xlocal, ylocal, zlocal | |
21 | //*-- Author: Aleksei Pavlinov(WSU); Nov 25, 05 | |
22 | ||
23 | #include <Riostream.h> | |
24 | ||
25 | // --- AliRoot header files --- | |
26 | #include "AliEMCALHitv1.h" | |
27 | ||
28 | ClassImp(AliEMCALHitv1) | |
29 | ||
30 | //______________________________________________________________________ | |
31 | AliEMCALHitv1::AliEMCALHitv1(){ | |
32 | // Default ctor | |
33 | ||
34 | fId = 0; | |
35 | fELOS = 0.0; | |
36 | fTime = 0.0; | |
37 | fPrimary = 0; | |
38 | fTrack = 0; | |
39 | fX = 0.0; | |
40 | fY = 0.0; | |
41 | fZ = 0.0; | |
42 | fPx = 0.0; | |
43 | fPy = 0.0; | |
44 | fPz = 0.0; | |
45 | fPe = 0.0; | |
46 | fIparent = 0; | |
47 | fIenergy = 0.0; | |
48 | } | |
49 | //______________________________________________________________________ | |
50 | AliEMCALHitv1::AliEMCALHitv1(const AliEMCALHitv1 & hit) : AliHit(hit){ | |
51 | // copy ctor | |
52 | ||
53 | fId = hit.fId ; | |
54 | fELOS = hit.fELOS ; | |
55 | fPrimary = hit.fPrimary ; | |
56 | fTrack = hit.fTrack ; | |
57 | fX = hit.fX; | |
58 | fY = hit.fY; | |
59 | fZ = hit.fZ; | |
60 | fPx = hit.fPx; | |
61 | fPy = hit.fPy; | |
62 | fPz = hit.fPz; | |
63 | fPe = hit.fPe; | |
64 | fIparent = hit.fIparent; | |
65 | fIenergy = hit.fIenergy; | |
66 | fTime = hit.fTime ; | |
67 | } | |
68 | //______________________________________________________________________ | |
69 | AliEMCALHitv1::AliEMCALHitv1(Int_t shunt, Int_t primary, Int_t track,Int_t iparent, Float_t ienergy, Int_t id, | |
70 | Float_t *hits,Float_t *p):AliHit(shunt, track){ | |
71 | // | |
72 | // Create an EMCAL hit object | |
73 | // | |
74 | fX = hits[0]; | |
75 | fY = hits[1]; | |
76 | fZ = hits[2]; | |
77 | fTime = hits[3] ; | |
78 | fId = id; | |
79 | fELOS = hits[4]; | |
80 | fPrimary = primary; | |
81 | fPx = p[0]; | |
82 | fPy = p[1]; | |
83 | fPz = p[2]; | |
84 | fPe = p[3]; | |
85 | fIparent = iparent; | |
86 | fIenergy = ienergy; | |
87 | } | |
88 | ||
89 | //______________________________________________________________________ | |
90 | Bool_t AliEMCALHitv1::operator==(AliEMCALHitv1 const &rValue) const{ | |
91 | // no identical hits !! | |
92 | Bool_t rv = kFALSE; | |
93 | ||
94 | if ( (fId == rValue.GetId())); | |
95 | // if ( (fId == rValue.GetId()) && ( fIparent == rValue.GetIparent())) | |
96 | // rv = kTRUE; | |
97 | ||
98 | return rv; | |
99 | } | |
100 | //______________________________________________________________________ | |
101 | AliEMCALHitv1 AliEMCALHitv1::operator+(const AliEMCALHitv1 &rValue){ | |
102 | // Add the energy of the hit | |
103 | ||
104 | fELOS += rValue.GetEnergy() ; | |
105 | ||
106 | if(rValue.GetTime() < fTime) | |
107 | fTime = rValue.GetTime() ; | |
108 | ||
109 | return *this; | |
110 | ||
111 | } | |
112 | //______________________________________________________________________ | |
113 | ostream& operator << (ostream& out,AliEMCALHitv1& hit){ | |
114 | // Print out Id and energy | |
115 | ||
116 | out << "AliEMCALHitv1:"; | |
117 | out << "id=" << hit.GetId(); | |
118 | out << ", Eloss=" << hit.GetEnergy(); | |
119 | out << ", Time=" << hit.GetTime(); | |
120 | out << "GeV , Track no.=" << hit.GetPrimary(); | |
121 | out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<<hit.Z()<<") cm <- local"; | |
122 | out << ", fTrack=" << hit.GetTrack(); | |
123 | out << ", P=(" << hit.GetPx() << "," << hit.GetPy() << "," << hit.GetPz() | |
124 | << "," <<hit.GetPe() << ") GeV" ; | |
125 | out << ", Enterring particle ID" << hit.GetIparent(); | |
126 | out << ", Enterring particle initial energy = " << hit.GetIenergy() << " GeV" ; | |
127 | out << endl; | |
128 | ||
129 | return out; | |
130 | } |