]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSHit.cxx
a quick update to correct a few coding conventions but RS2 and GC2 have been ignored
[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
b2a60966 16/* $Id$ */
17
49cd54c0 18//_________________________________________________________________________
b2a60966 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)
49cd54c0 23
24// --- ROOT system ---
25
26// --- Standard library ---
de9ec31b 27#include <stdio.h>
28#include <string.h>
29#include <stdlib.h>
30#include <strstream.h>
49cd54c0 31
32// --- AliRoot header files ---
33#include "AliPHOSHit.h"
34#include "AliRun.h"
35#include "AliConst.h"
36
37
38ClassImp(AliPHOSHit)
39
31aa6d6c 40//____________________________________________________________________________
41AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit)
42{
43 // copy ctor
44
45 fId = hit.fId ;
46 fELOS = hit.fELOS ;
47 fPrimary = hit.fPrimary ;
48 fTrack = hit.fTrack ;
49 fX = hit.fX ;
50 fY = hit.fY ;
51 fZ = hit.fZ ;
e39caaf7 52 fPid = hit.fPid ;
31aa6d6c 53
54}
55
49cd54c0 56//____________________________________________________________________________
e39caaf7 57AliPHOSHit::AliPHOSHit(Int_t Shunt, Int_t primary, Int_t Track, Int_t id, Float_t *hits, Int_t pid) : AliHit(Shunt, Track)
fb689dbe 58{
59 // ctor
60
61 fId = id ;
fb689dbe 62 fX = hits[0] ;
63 fY = hits[1] ;
64 fZ = hits[2] ;
65 fELOS = hits[3] ;
66 fPrimary = primary ;
e39caaf7 67 fPid = pid ;
fb689dbe 68}
69
49cd54c0 70//____________________________________________________________________________
71Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
72{
b2a60966 73 // Two hits are identical if they have the same Id and originate from the same primary
74
ff4c968a 75 Bool_t rv = kFALSE ;
76
ed4205d8 77 if ( fId == rValue.GetId() && fPrimary == rValue.GetPrimary() )
ff4c968a 78 rv = kTRUE;
49cd54c0 79
ff4c968a 80 return rv;
49cd54c0 81}
82
83//____________________________________________________________________________
84AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) const
85{
b2a60966 86 // Add the energy of the hit
49cd54c0 87
88 AliPHOSHit added(*this);
89
e39caaf7 90 // the accumulated hit position is the position of the first hi
91 // added.fX = rValue.fX ;
92 // added.fY = rValue.fY ;
93 // added.fZ = rValue.fZ ;
49cd54c0 94
ff4c968a 95 added.fELOS += rValue.GetEnergy() ;
96
ff4c968a 97 return added;
49cd54c0 98
99}
100
101//____________________________________________________________________________
102ostream& operator << (ostream& out, const AliPHOSHit& hit)
103{
b2a60966 104 // Print out Id and energy
105
49cd54c0 106 out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << endl ;
107 return out ;
108}
109
110
111