]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSHit.cxx
AliPHOSDigit remembers now which primary particle it comes from
[u/mrichter/AliRoot.git] / PHOS / AliPHOSHit.cxx
CommitLineData
49cd54c0 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//_________________________________________________________________________
17// Hit classes for PHOS
18//*-- Author : Maxim Volkov, RRC KI
19//////////////////////////////////////////////////////////////////////////////
20
21// --- ROOT system ---
22
23// --- Standard library ---
ff4c968a 24#include <cstdio>
25#include <cstring>
26#include <cstdlib>
27#include <strstream>
28#include <cassert>
49cd54c0 29
30// --- AliRoot header files ---
31#include "AliPHOSHit.h"
32#include "AliRun.h"
33#include "AliConst.h"
34
35
36ClassImp(AliPHOSHit)
37
38//____________________________________________________________________________
ff4c968a 39AliPHOSHit::AliPHOSHit(Int_t primary, Int_t id, Float_t *hits)
49cd54c0 40{
41
ff4c968a 42 fId = id ;
43 fX = hits[0] ;
44 fY = hits[1] ;
45 fZ = hits[2] ;
46 fELOS = hits[3] ;
47 fPrimary = primary ;
49cd54c0 48}
49
50//____________________________________________________________________________
51Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
52{
ff4c968a 53 Bool_t rv = kFALSE ;
54
55 if ( fId == rValue.GetId() && fPrimary == rValue.GetPrimary() )
56 rv = kTRUE;
49cd54c0 57
ff4c968a 58 return rv;
49cd54c0 59}
60
61//____________________________________________________________________________
62AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) const
63{
64
65 AliPHOSHit added(*this);
66
67 added.fX = rValue.fX ;
68 added.fY = rValue.fY ;
69 added.fZ = rValue.fZ ;
70
ff4c968a 71 added.fELOS += rValue.GetEnergy() ;
72
73 assert ( added.fPrimary == rValue.fPrimary ) ;
49cd54c0 74
ff4c968a 75 return added;
49cd54c0 76
77}
78
79//____________________________________________________________________________
80ostream& operator << (ostream& out, const AliPHOSHit& hit)
81{
82 out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << endl ;
83 return out ;
84}
85
86
87