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