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 **************************************************************************/
16 //_________________________________________________________________________
17 // A Reconstructed Particle in PHOS
18 // To become a general class of AliRoot ?
19 // Why should I put meaningless comments
23 //*-- Author: Yves Schutz (SUBATECH)
26 // --- ROOT system ---
28 // --- Standard library ---
32 // --- AliRoot header files ---
34 #include "AliPHOSRecParticle.h"
36 #include "AliPHOSIndexToObject.h"
38 ClassImp(AliPHOSRecParticle)
41 //____________________________________________________________________________
42 AliPHOSRecParticle::AliPHOSRecParticle(AliPHOSTrackSegment * ts)
46 fPHOSTrackSegment = ts->GetIndexInList() ;
48 Float_t kenergy = ts->GetEnergy() ;
49 TVector3 momdir = ts->GetMomentumDirection() ;
50 fPx = kenergy * momdir.X() ;
51 fPy = kenergy * momdir.Y() ;
52 fPz = kenergy * momdir.Z() ;
54 fE = kenergy ; // !!! all particles have mass = 0
57 //____________________________________________________________________________
58 AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
62 fPHOSTrackSegment = rp.fPHOSTrackSegment ;
64 fIndexInList = rp.fIndexInList ;
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];
73 fCalcMass = rp.fCalcMass;
82 fPolarTheta = rp.fPolarTheta;
83 fPolarPhi = rp.fPolarPhi;
84 fParticlePDG = rp.fParticlePDG;
87 //____________________________________________________________________________
88 Int_t * AliPHOSRecParticle::GetPrimaries(Int_t & number)
90 // Retrieves all the primary particles at the origine of this reconstructed particle
92 AliPHOSTrackSegment * ts = GetPHOSTrackSegment() ;
95 Int_t * emclist = ts->GetPrimariesEmc(emcnumber) ;
97 Int_t ppsdlnumber = 0 ;
98 Int_t * ppsdllist = ts->GetPrimariesPpsdLow(ppsdlnumber) ;
100 Int_t ppsdunumber = 0 ;
101 Int_t * ppsdulist = ts->GetPrimariesPpsdUp(ppsdunumber) ;
103 number = emcnumber + ppsdlnumber + ppsdunumber ;
104 Int_t * list = new Int_t[number] ;
107 for ( index = 0 ; index < emcnumber ; index++)
108 list[index] = emclist[index] ;
111 for ( jndex = 0 ; jndex < ppsdlnumber ; jndex++) {
112 assert(index < number) ;
113 list[index] = ppsdllist[jndex] ;
117 for ( jndex = 0 ; jndex < ppsdunumber ; jndex++) {
118 assert(index < number) ;
119 list[index] = ppsdulist[jndex] ;
130 //____________________________________________________________________________
131 AliPHOSTrackSegment * AliPHOSRecParticle::GetPHOSTrackSegment() const
133 // Retrieves the PHOS track segment at the origine of this reconstructed particle
135 AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
136 return please->GimeTrackSegment( fPHOSTrackSegment ) ;