]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALHit.cxx
Fixing problems in the generation of HTML documentation
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALHit.cxx
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 sum of all hits in a tower
21 //  from a single entering particle             
22 //*-- Author: Sahal Yacoob (LBL / UCT)
23 // Based on AliPHOSHit
24
25 // --- Standard library ---
26 #include <Riostream.h>
27
28 // --- ROOT system ---
29
30 // --- AliRoot header files ---
31 #include "AliEMCALHit.h"
32
33 ClassImp(AliEMCALHit)
34
35 //______________________________________________________________________
36 AliEMCALHit::AliEMCALHit(){
37     // Default ctor
38    
39     fId      = 0;
40     fELOS    = 0.0;
41     fTime    = 0.0;
42     fPrimary = 0;
43     fTrack   = 0;
44     fX       = 0.0;
45     fY       = 0.0;
46     fZ       = 0.0;
47     fPx      = 0.0;
48     fPy      = 0.0;
49     fPz      = 0.0;
50     fPe      = 0.0;
51     fIparent = 0;
52     fIenergy = 0.0;
53 }
54 //______________________________________________________________________
55 AliEMCALHit::AliEMCALHit(const AliEMCALHit & hit) : AliHit(hit){
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;
65     fPx       = hit.fPx;
66     fPy       = hit.fPy;
67     fPz       = hit.fPz;
68     fPe       = hit.fPe;
69     fIparent = hit.fIparent;
70     fIenergy = hit.fIenergy;
71     fTime    = hit.fTime  ;
72 }
73 //______________________________________________________________________
74 AliEMCALHit::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){
76     //
77     // Create an EMCAL  hit object
78     //
79     fX          = hits[0];
80     fY          = hits[1];
81     fZ          = hits[2];
82     fTime       = hits[3] ;
83     fId         = id;
84     fELOS       = hits[4];
85     fPrimary    = primary;
86     fPx          = p[0];
87     fPy          = p[1];
88     fPz          = p[2];
89     fPe          = p[3];
90     fIparent    = iparent;
91     fIenergy    = ienergy;
92 }
93
94 //______________________________________________________________________
95 Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const{ 
96     // Two hits are identical if they have the same Id and originat
97     // from the same enterring Particle 
98     Bool_t rv = kFALSE;
99
100     if ( (fId == rValue.GetId()) && ( fIparent == rValue.GetIparent()))
101         rv = kTRUE;
102
103     return rv;
104 }
105 //______________________________________________________________________
106 AliEMCALHit AliEMCALHit::operator+(const AliEMCALHit &rValue){
107     // Add the energy of the hit
108
109     fELOS += rValue.GetEnergy() ;
110  
111     if(rValue.GetTime() < fTime)
112       fTime = rValue.GetTime() ;
113  
114     return *this;
115
116 }
117 //______________________________________________________________________
118 ostream& 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();
124     out << ", Time=" << hit.GetTime();
125     out << "GeV , Track no.=" << hit.GetPrimary();
126     out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<<hit.Z()<<") cm";
127     out << ", fTrack=" << hit.GetTrack();
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" ;
132     out << endl;
133
134     return out;
135 }