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