]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - PHOS/AliPHOSHit.cxx
Compliance with Effective C++AliPHOSHit.cxx
[u/mrichter/AliRoot.git] / PHOS / AliPHOSHit.cxx
... / ...
CommitLineData
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) & Dmitri Peressounko (RRC KI & SUBATECH)
23
24// --- ROOT system ---
25
26// --- Standard library ---
27
28// --- AliRoot header files ---
29#include "AliPHOSHit.h"
30
31ClassImp(AliPHOSHit)
32
33 //____________________________________________________________________________
34 AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit) : AliHit(hit)
35{
36 // copy ctor
37 fX = hit.fX ;
38 fY = hit.fY ;
39 fZ = hit.fZ ;
40 fId = hit.fId ;
41 fELOS = hit.fELOS ;
42 fTrack = hit.fTrack ;
43 fTime = hit.fTime ;
44
45}
46
47//____________________________________________________________________________
48AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t track, Int_t id, Float_t *hits): AliHit(shunt, track)
49{
50 //
51 // Create a CPV hit object
52 //
53
54 fX = hits[0] ;
55 fY = hits[1] ;
56 fZ = hits[2] ;
57 fTime = hits[3] ;
58 fId = id ;
59 fELOS = hits[4] ;
60}
61//____________________________________________________________________________
62Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
63{
64 // Two hits are identical if they have the same Id and originate from the same primary
65
66 Bool_t rv = kFALSE ;
67
68 if ( (fId == rValue.GetId()) && ( fTrack == rValue.GetPrimary() ) )
69 rv = kTRUE;
70
71 return rv;
72}
73
74//____________________________________________________________________________
75AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue)
76{
77 // Add the energy of the hit
78
79 fELOS += rValue.GetEnergy() ;
80
81 if(rValue.GetTime() < fTime)
82 fTime = rValue.GetTime() ;
83
84 return *this;
85
86}
87