]>
Commit | Line | Data |
---|---|---|
6ad0bfa0 | 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 | ||
6ad0bfa0 | 18 | //_________________________________________________________________________ |
b2a60966 | 19 | // A Reconstructed Particle in PHOS |
20 | // To become a general class of AliRoot ? | |
21 | // | |
22 | //*-- Author: Yves Schutz (SUBATECH) | |
23 | ||
6ad0bfa0 | 24 | |
25 | // --- ROOT system --- | |
26 | ||
27 | // --- Standard library --- | |
28 | ||
29 | // --- AliRoot header files --- | |
30 | ||
31 | #include "AliPHOSRecParticle.h" | |
15605d3c | 32 | #include "TPad.h" |
83974468 | 33 | #include "AliPHOSIndexToObject.h" |
6ad0bfa0 | 34 | |
35 | ClassImp(AliPHOSRecParticle) | |
36 | ||
37 | ||
38 | //____________________________________________________________________________ | |
39 | AliPHOSRecParticle::AliPHOSRecParticle(AliPHOSTrackSegment * ts) | |
40 | { | |
41 | // ctor | |
42 | ||
83974468 | 43 | fPHOSTrackSegment = ts->GetIndexInList() ; |
44 | fIndexInList = -1 ; | |
bd46e694 | 45 | Float_t kenergy = ts->GetEnergy() ; |
6ad0bfa0 | 46 | TVector3 momdir = ts->GetMomentumDirection() ; |
bd46e694 | 47 | fPx = kenergy * momdir.X() ; |
48 | fPy = kenergy * momdir.Y() ; | |
49 | fPz = kenergy * momdir.Z() ; | |
0dd37dda | 50 | fType = kUNDEFINED ; |
bd46e694 | 51 | fE = kenergy ; // !!! all particles have mass = 0 |
6ad0bfa0 | 52 | } |
53 | ||
a73f33f0 | 54 | //____________________________________________________________________________ |
55 | AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp) | |
56 | { | |
b2a60966 | 57 | // copy ctor |
58 | ||
83974468 | 59 | fPHOSTrackSegment = rp.fPHOSTrackSegment ; |
a73f33f0 | 60 | fType = rp.fType ; |
83974468 | 61 | fIndexInList = rp.fIndexInList ; |
b2a60966 | 62 | |
cafda784 | 63 | fPdgCode = rp.fPdgCode; |
64 | fStatusCode = rp.fStatusCode; | |
65 | fMother[0] = rp.fMother[0]; | |
66 | fMother[1] = rp.fMother[1]; | |
67 | fDaughter[0] = rp.fDaughter[0]; | |
68 | fDaughter[1] = rp.fDaughter[1]; | |
69 | fWeight = rp.fWeight; | |
70 | fCalcMass = rp.fCalcMass; | |
71 | fPx = rp.fPx; | |
72 | fPy = rp.fPy; | |
73 | fPz = rp.fPz; | |
74 | fE = rp.fE; | |
75 | fVx = rp.fVx; | |
76 | fVy = rp.fVy; | |
77 | fVz = rp.fVz; | |
78 | fVt = rp.fVt; | |
79 | fPolarTheta = rp.fPolarTheta; | |
80 | fPolarPhi = rp.fPolarPhi; | |
81 | fParticlePDG = rp.fParticlePDG; | |
a73f33f0 | 82 | } |
83 | ||
b2a60966 | 84 | //____________________________________________________________________________ |
85 | Int_t * AliPHOSRecParticle::GetPrimaries(Int_t & number) | |
86 | { | |
87 | // Retrieves all the primary particles at the origine of this reconstructed particle | |
88 | ||
83974468 | 89 | AliPHOSTrackSegment * ts = GetPHOSTrackSegment() ; |
90 | ||
b2a60966 | 91 | Int_t emcnumber = 0 ; |
83974468 | 92 | Int_t * emclist = ts->GetPrimariesEmc(emcnumber) ; |
b2a60966 | 93 | |
83974468 | 94 | Int_t ppsdlnumber = 0 ; |
95 | Int_t * ppsdllist = ts->GetPrimariesPpsdLow(ppsdlnumber) ; | |
b2a60966 | 96 | |
97 | Int_t ppsdunumber = 0 ; | |
83974468 | 98 | Int_t * ppsdulist = ts->GetPrimariesPpsdUp(ppsdunumber) ; |
b2a60966 | 99 | |
100 | number = emcnumber + ppsdlnumber + ppsdunumber ; | |
101 | Int_t * list = new Int_t[number] ; | |
102 | ||
103 | Int_t index ; | |
104 | for ( index = 0 ; index < emcnumber ; index++) | |
105 | list[index] = emclist[index] ; | |
106 | ||
107 | Int_t jndex ; | |
108 | for ( jndex = 0 ; jndex < ppsdlnumber ; jndex++) { | |
109 | assert(index < number) ; | |
110 | list[index] = ppsdllist[jndex] ; | |
111 | index++ ; | |
112 | } | |
113 | ||
114 | for ( jndex = 0 ; jndex < ppsdunumber ; jndex++) { | |
115 | assert(index < number) ; | |
116 | list[index] = ppsdulist[jndex] ; | |
117 | index++ ; | |
118 | } | |
119 | ||
b2a60966 | 120 | delete emclist ; |
121 | delete ppsdllist ; | |
122 | delete ppsdulist ; | |
123 | ||
124 | return list ; | |
125 | } | |
83974468 | 126 | |
127 | //____________________________________________________________________________ | |
128 | AliPHOSTrackSegment * AliPHOSRecParticle::GetPHOSTrackSegment() const | |
129 | { | |
130 | // Retrieves the PHOS track segment at the origine of this reconstructed particle | |
131 | ||
132 | AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ; | |
133 | return please->GimeTrackSegment( fPHOSTrackSegment ) ; | |
134 | ||
135 | } | |
136 | ||
137 | ||
138 |