Line data Source code
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 :
31 22 : ClassImp(AliPHOSHit)
32 :
33 : //____________________________________________________________________________
34 : AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit) :
35 561952 : AliHit(hit),fId(hit.fId),fELOS(hit.fELOS),fTime(hit.fTime)
36 1404880 : {
37 : // copy ctor
38 561952 : }
39 :
40 : //____________________________________________________________________________
41 : AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t track, Int_t id, Float_t *hits) :
42 558606 : AliHit(shunt, track),fId(0),fELOS(0),fTime(0)
43 1396515 : {
44 : //
45 : // Create a CPV hit object
46 : //
47 :
48 279303 : fX = hits[0] ;
49 279303 : fY = hits[1] ;
50 279303 : fZ = hits[2] ;
51 279303 : fTime = hits[3] ;
52 279303 : fId = id ;
53 279303 : fELOS = hits[4] ;
54 558606 : }
55 : //____________________________________________________________________________
56 : Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
57 : {
58 : // Two hits are identical if they have the same Id and originate from the same primary
59 :
60 : Bool_t rv = kFALSE ;
61 :
62 25092348 : if ( (fId == rValue.GetId()) && ( fTrack == rValue.GetPrimary() ) )
63 278938 : rv = kTRUE;
64 :
65 12406705 : return rv;
66 : }
67 :
68 : //____________________________________________________________________________
69 : AliPHOSHit & AliPHOSHit::operator = (const AliPHOSHit &)
70 : {
71 0 : Fatal("operator =", "not implemented");
72 0 : return *this;
73 : }
74 : //____________________________________________________________________________
75 : AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue)
76 : {
77 : // Add the energy of the hit
78 :
79 557876 : fELOS += rValue.GetEnergy() ;
80 :
81 278938 : if(rValue.GetTime() < fTime)
82 658 : fTime = rValue.GetTime() ;
83 :
84 278938 : return *this;
85 :
86 : }
87 :
|