]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSRecParticle.cxx
Improve documentation
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRecParticle.cxx
CommitLineData
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"
6ad0bfa0 33
34ClassImp(AliPHOSRecParticle)
35
36
37//____________________________________________________________________________
38 AliPHOSRecParticle::AliPHOSRecParticle(AliPHOSTrackSegment * ts)
39{
40 // ctor
41
42 fPHOSTrackSegment = new AliPHOSTrackSegment(*ts) ;
bd46e694 43 Float_t kenergy = ts->GetEnergy() ;
6ad0bfa0 44 TVector3 momdir = ts->GetMomentumDirection() ;
bd46e694 45 fPx = kenergy * momdir.X() ;
46 fPy = kenergy * momdir.Y() ;
47 fPz = kenergy * momdir.Z() ;
0dd37dda 48 fType = kUNDEFINED ;
bd46e694 49 fE = kenergy ; // !!! all particles have mass = 0
6ad0bfa0 50}
51
a73f33f0 52//____________________________________________________________________________
53 AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
54{
b2a60966 55 // copy ctor
56
a73f33f0 57 fPHOSTrackSegment = new AliPHOSTrackSegment( *( rp.GetPHOSTrackSegment()) ) ;
58 fType = rp.fType ;
b2a60966 59
cafda784 60 fPdgCode = rp.fPdgCode;
61 fStatusCode = rp.fStatusCode;
62 fMother[0] = rp.fMother[0];
63 fMother[1] = rp.fMother[1];
64 fDaughter[0] = rp.fDaughter[0];
65 fDaughter[1] = rp.fDaughter[1];
66 fWeight = rp.fWeight;
67 fCalcMass = rp.fCalcMass;
68 fPx = rp.fPx;
69 fPy = rp.fPy;
70 fPz = rp.fPz;
71 fE = rp.fE;
72 fVx = rp.fVx;
73 fVy = rp.fVy;
74 fVz = rp.fVz;
75 fVt = rp.fVt;
76 fPolarTheta = rp.fPolarTheta;
77 fPolarPhi = rp.fPolarPhi;
78 fParticlePDG = rp.fParticlePDG;
a73f33f0 79}
80
81//____________________________________________________________________________
82 AliPHOSRecParticle::~AliPHOSRecParticle()
83{
b2a60966 84 // dtor
85
a73f33f0 86 if(!fPHOSTrackSegment) {
87 delete fPHOSTrackSegment ;
88 fPHOSTrackSegment = 0 ;
89 }
90}
b2a60966 91
92//____________________________________________________________________________
93Int_t * AliPHOSRecParticle::GetPrimaries(Int_t & number)
94{
95 // Retrieves all the primary particles at the origine of this reconstructed particle
96
97 Int_t emcnumber = 0 ;
98 Int_t * emclist = fPHOSTrackSegment->GetPrimariesEmc(emcnumber) ;
99
100 Int_t ppsdlnumber = 0 ;
101 Int_t * ppsdllist = fPHOSTrackSegment->GetPrimariesPpsdLow(ppsdlnumber) ;
102
103 Int_t ppsdunumber = 0 ;
104 Int_t * ppsdulist = fPHOSTrackSegment->GetPrimariesPpsdUp(ppsdunumber) ;
105
106 number = emcnumber + ppsdlnumber + ppsdunumber ;
107 Int_t * list = new Int_t[number] ;
108
109 Int_t index ;
110 for ( index = 0 ; index < emcnumber ; index++)
111 list[index] = emclist[index] ;
112
113 Int_t jndex ;
114 for ( jndex = 0 ; jndex < ppsdlnumber ; jndex++) {
115 assert(index < number) ;
116 list[index] = ppsdllist[jndex] ;
117 index++ ;
118 }
119
120 for ( jndex = 0 ; jndex < ppsdunumber ; jndex++) {
121 assert(index < number) ;
122 list[index] = ppsdulist[jndex] ;
123 index++ ;
124 }
125
126 cout << "passed 6 " << endl;
127
128 delete emclist ;
129 delete ppsdllist ;
130 delete ppsdulist ;
131
132 return list ;
133}