1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //_________________________________________________________________________
19 // A Reconstructed Particle in PHOS
20 // To become a general class of AliRoot ?
22 //*-- Author: Yves Schutz (SUBATECH)
25 // --- ROOT system ---
27 // --- Standard library ---
29 // --- AliRoot header files ---
31 #include "AliPHOSRecParticle.h"
33 #include "AliPHOSIndexToObject.h"
35 ClassImp(AliPHOSRecParticle)
38 //____________________________________________________________________________
39 AliPHOSRecParticle::AliPHOSRecParticle(AliPHOSTrackSegment * ts)
43 fPHOSTrackSegment = ts->GetIndexInList() ;
45 Float_t kenergy = ts->GetEnergy() ;
46 TVector3 momdir = ts->GetMomentumDirection() ;
47 fPx = kenergy * momdir.X() ;
48 fPy = kenergy * momdir.Y() ;
49 fPz = kenergy * momdir.Z() ;
51 fE = kenergy ; // !!! all particles have mass = 0
54 //____________________________________________________________________________
55 AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
59 fPHOSTrackSegment = rp.fPHOSTrackSegment ;
61 fIndexInList = rp.fIndexInList ;
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];
70 fCalcMass = rp.fCalcMass;
79 fPolarTheta = rp.fPolarTheta;
80 fPolarPhi = rp.fPolarPhi;
81 fParticlePDG = rp.fParticlePDG;
84 //____________________________________________________________________________
85 Int_t * AliPHOSRecParticle::GetPrimaries(Int_t & number)
87 // Retrieves all the primary particles at the origine of this reconstructed particle
89 AliPHOSTrackSegment * ts = GetPHOSTrackSegment() ;
92 Int_t * emclist = ts->GetPrimariesEmc(emcnumber) ;
94 Int_t ppsdlnumber = 0 ;
95 Int_t * ppsdllist = ts->GetPrimariesPpsdLow(ppsdlnumber) ;
97 Int_t ppsdunumber = 0 ;
98 Int_t * ppsdulist = ts->GetPrimariesPpsdUp(ppsdunumber) ;
100 number = emcnumber + ppsdlnumber + ppsdunumber ;
101 Int_t * list = new Int_t[number] ;
104 for ( index = 0 ; index < emcnumber ; index++)
105 list[index] = emclist[index] ;
108 for ( jndex = 0 ; jndex < ppsdlnumber ; jndex++) {
109 assert(index < number) ;
110 list[index] = ppsdllist[jndex] ;
114 for ( jndex = 0 ; jndex < ppsdunumber ; jndex++) {
115 assert(index < number) ;
116 list[index] = ppsdulist[jndex] ;
127 //____________________________________________________________________________
128 AliPHOSTrackSegment * AliPHOSRecParticle::GetPHOSTrackSegment() const
130 // Retrieves the PHOS track segment at the origine of this reconstructed particle
132 AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
133 return please->GimeTrackSegment( fPHOSTrackSegment ) ;