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 ---
31 // --- AliRoot header files ---
33 #include "AliPHOSRecParticle.h"
35 #include "AliPHOSIndexToObject.h"
37 ClassImp(AliPHOSRecParticle)
40 //____________________________________________________________________________
41 AliPHOSRecParticle::AliPHOSRecParticle(AliPHOSTrackSegment * ts)
45 fPHOSTrackSegment = ts->GetIndexInList() ;
47 Float_t kenergy = ts->GetEnergy() ;
48 TVector3 momdir = ts->GetMomentumDirection() ;
49 fPx = kenergy * momdir.X() ;
50 fPy = kenergy * momdir.Y() ;
51 fPz = kenergy * momdir.Z() ;
53 fE = kenergy ; // !!! all particles have mass = 0
56 //____________________________________________________________________________
57 AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
61 fPHOSTrackSegment = rp.fPHOSTrackSegment ;
63 fIndexInList = rp.fIndexInList ;
65 fPdgCode = rp.fPdgCode;
66 fStatusCode = rp.fStatusCode;
67 fMother[0] = rp.fMother[0];
68 fMother[1] = rp.fMother[1];
69 fDaughter[0] = rp.fDaughter[0];
70 fDaughter[1] = rp.fDaughter[1];
72 fCalcMass = rp.fCalcMass;
81 fPolarTheta = rp.fPolarTheta;
82 fPolarPhi = rp.fPolarPhi;
83 fParticlePDG = rp.fParticlePDG;
86 //____________________________________________________________________________
87 Int_t * AliPHOSRecParticle::GetPrimaries(Int_t & number)
89 // Retrieves all the primary particles at the origine of this reconstructed particle
91 AliPHOSTrackSegment * ts = GetPHOSTrackSegment() ;
94 Int_t * emclist = ts->GetPrimariesEmc(emcnumber) ;
96 Int_t ppsdlnumber = 0 ;
97 Int_t * ppsdllist = ts->GetPrimariesPpsdLow(ppsdlnumber) ;
99 Int_t ppsdunumber = 0 ;
100 Int_t * ppsdulist = ts->GetPrimariesPpsdUp(ppsdunumber) ;
102 number = emcnumber + ppsdlnumber + ppsdunumber ;
103 Int_t * list = new Int_t[number] ;
106 for ( index = 0 ; index < emcnumber ; index++)
107 list[index] = emclist[index] ;
110 for ( jndex = 0 ; jndex < ppsdlnumber ; jndex++) {
111 assert(index < number) ;
112 list[index] = ppsdllist[jndex] ;
116 for ( jndex = 0 ; jndex < ppsdunumber ; jndex++) {
117 assert(index < number) ;
118 list[index] = ppsdulist[jndex] ;
129 //____________________________________________________________________________
130 AliPHOSTrackSegment * AliPHOSRecParticle::GetPHOSTrackSegment() const
132 // Retrieves the PHOS track segment at the origine of this reconstructed particle
134 AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
135 return please->GimeTrackSegment( fPHOSTrackSegment ) ;