]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSRecParticle.cxx
make it compile with Federico modifications
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRecParticle.cxx
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
16 /* $Id$ */
17
18 //_________________________________________________________________________
19 //  A Reconstructed Particle in PHOS    
20 //  To become a general class of AliRoot ?        
21 //       
22 //*-- Author: Yves Schutz (SUBATECH)
23
24
25 // --- ROOT system ---
26
27 // --- Standard library ---
28
29 #include <assert.h>
30
31 // --- AliRoot header files ---
32
33 #include "AliPHOSRecParticle.h"
34 #include "TPad.h"
35 #include "AliPHOSIndexToObject.h"
36
37 ClassImp(AliPHOSRecParticle)
38
39
40 //____________________________________________________________________________
41  AliPHOSRecParticle::AliPHOSRecParticle(AliPHOSTrackSegment * ts)
42 {
43   // ctor
44  
45   fPHOSTrackSegment = ts->GetIndexInList() ;
46   fIndexInList      = -1 ;
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() ; 
52   fType             = kUNDEFINED;  
53   fE                = kenergy ;    // !!! all particles have mass = 0 
54 }
55
56 //____________________________________________________________________________
57  AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
58 {
59   // copy ctor
60
61   fPHOSTrackSegment = rp.fPHOSTrackSegment ; 
62   fType             = rp.fType ; 
63   fIndexInList      = rp.fIndexInList ;
64
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];
71   fWeight      = rp.fWeight;
72   fCalcMass    = rp.fCalcMass;
73   fPx          = rp.fPx;
74   fPy          = rp.fPy;
75   fPz          = rp.fPz;
76   fE           = rp.fE;
77   fVx          = rp.fVx;
78   fVy          = rp.fVy;
79   fVz          = rp.fVz;
80   fVt          = rp.fVt;
81   fPolarTheta  = rp.fPolarTheta;
82   fPolarPhi    = rp.fPolarPhi;
83   fParticlePDG = rp.fParticlePDG; 
84 }
85
86 //____________________________________________________________________________
87 Int_t * AliPHOSRecParticle::GetPrimaries(Int_t & number) 
88 {
89   // Retrieves all the primary particles at the origine of this reconstructed particle
90
91   AliPHOSTrackSegment * ts = GetPHOSTrackSegment() ;
92
93   Int_t emcnumber = 0 ; 
94   Int_t * emclist = ts->GetPrimariesEmc(emcnumber) ;
95   
96   Int_t ppsdlnumber = 0 ;
97   Int_t * ppsdllist = ts->GetPrimariesPpsdLow(ppsdlnumber) ;
98  
99   Int_t ppsdunumber = 0 ; 
100   Int_t * ppsdulist = ts->GetPrimariesPpsdUp(ppsdunumber) ;
101
102   number = emcnumber + ppsdlnumber + ppsdunumber ;
103   Int_t * list   = new Int_t[number] ;
104   
105   Int_t index ; 
106   for ( index = 0 ; index < emcnumber ; index++)
107     list[index] = emclist[index] ;
108
109   Int_t jndex ; 
110   for ( jndex = 0 ; jndex < ppsdlnumber ; jndex++) {
111     assert(index < number) ;
112     list[index] = ppsdllist[jndex] ;
113     index++ ; 
114   }
115
116   for ( jndex = 0 ; jndex < ppsdunumber ; jndex++) {
117     assert(index < number) ;
118     list[index] = ppsdulist[jndex] ;
119     index++ ; 
120   }
121
122   delete emclist ;
123   delete ppsdllist ;
124   delete ppsdulist ;
125
126   return list ; 
127 }
128
129 //____________________________________________________________________________
130 AliPHOSTrackSegment * AliPHOSRecParticle::GetPHOSTrackSegment() const 
131 {
132   // Retrieves the PHOS track segment at the origine of this reconstructed particle
133
134   AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
135   return please->GimeTrackSegment( fPHOSTrackSegment ) ;
136
137 }
138
139
140