]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSHit.cxx
Improve documentation
[u/mrichter/AliRoot.git] / PHOS / AliPHOSHit.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 PHOS     
20 //  A hit in PHOS is the sum of all hits in a single crystal
21 //               
22 //*-- Author: Maxime Volkov (RRC KI) & Yves Schutz (SUBATECH)
23
24 // --- ROOT system ---
25
26 // --- Standard library ---
27 #include <cstdio>
28 #include <cstring>
29 #include <cstdlib>
30 #include <strstream>
31
32 // --- AliRoot header files ---
33 #include "AliPHOSHit.h"
34 #include "AliRun.h"
35 #include "AliConst.h"
36
37
38 ClassImp(AliPHOSHit)
39
40 //____________________________________________________________________________
41 AliPHOSHit::AliPHOSHit(Int_t primary, Int_t id, Float_t *hits)
42 {
43   // ctor
44   
45    fId         = id ;
46    fX          = hits[0] ;
47    fY          = hits[1] ;
48    fZ          = hits[2] ;
49    fELOS       = hits[3] ;
50    fPrimary    = primary ;
51 }
52
53 //____________________________________________________________________________
54 Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
55
56   // Two hits are identical if they have the same Id and originate from the same primary
57
58   Bool_t rv = kFALSE ; 
59
60   if ( fId == rValue.GetId() && fPrimary == rValue.GetPrimary() ) 
61     rv = kTRUE;
62   
63   return rv;
64 }
65
66 //____________________________________________________________________________
67 AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) const
68 {
69   // Add the energy of the hit
70   
71   AliPHOSHit added(*this);
72
73    added.fX    = rValue.fX  ;
74    added.fY    = rValue.fY ;
75    added.fZ    = rValue.fZ ;
76
77    added.fELOS += rValue.GetEnergy() ;
78     
79    return added;
80
81 }
82
83 //____________________________________________________________________________
84 ostream& operator << (ostream& out, const AliPHOSHit& hit) 
85 {
86   // Print out Id and energy 
87   
88   out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << endl ;
89   return out ;
90 }
91
92
93