]>
Commit | Line | Data |
---|---|---|
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 | //*-- |
b2a60966 | 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 | ||
38 | ClassImp(AliPHOSHit) | |
39 | ||
31aa6d6c | 40 | //____________________________________________________________________________ |
41 | AliPHOSHit::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 ; | |
b37750a6 | 49 | |
31aa6d6c | 50 | |
51 | } | |
52 | ||
49cd54c0 | 53 | //____________________________________________________________________________ |
b37750a6 | 54 | AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits): AliHit(shunt, track) |
fb689dbe | 55 | { |
037cc66d | 56 | // |
57 | // Create a CPV hit object | |
58 | // | |
59 | ||
60 | fId = id ; | |
61 | fELOS = hits[3] ; | |
62 | fPrimary = primary ; | |
fb689dbe | 63 | } |
64 | ||
49cd54c0 | 65 | //____________________________________________________________________________ |
66 | Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const | |
67 | { | |
037cc66d | 68 | // Two hits are identical if they have the same Id and originate from the same primary |
b2a60966 | 69 | |
ff4c968a | 70 | Bool_t rv = kFALSE ; |
71 | ||
b37750a6 | 72 | if ( (fId == rValue.GetId()) && ( fPrimary == rValue.GetPrimary() ) ) |
ff4c968a | 73 | rv = kTRUE; |
49cd54c0 | 74 | |
ff4c968a | 75 | return rv; |
49cd54c0 | 76 | } |
77 | ||
78 | //____________________________________________________________________________ | |
7854a24a | 79 | AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) |
49cd54c0 | 80 | { |
b2a60966 | 81 | // Add the energy of the hit |
49cd54c0 | 82 | |
7854a24a | 83 | fELOS += rValue.GetEnergy() ; |
ff4c968a | 84 | |
7854a24a | 85 | return *this; |
49cd54c0 | 86 | |
87 | } | |
88 | ||
89 | //____________________________________________________________________________ | |
90 | ostream& operator << (ostream& out, const AliPHOSHit& hit) | |
91 | { | |
b2a60966 | 92 | // Print out Id and energy |
93 | ||
49cd54c0 | 94 | out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << endl ; |
95 | return out ; | |
96 | } | |
97 | ||
98 | ||
99 |