]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSRecParticle.cxx
Debugger output in AliPHOSReconstructioner
[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 // --- AliRoot header files ---
30
31 #include "AliPHOSRecParticle.h"
32 #include "TPad.h"
33 #include "AliPHOSIndexToObject.h"
34
35 ClassImp(AliPHOSRecParticle)
36
37
38 //____________________________________________________________________________
39  AliPHOSRecParticle::AliPHOSRecParticle(AliPHOSTrackSegment * ts)
40 {
41   // ctor
42  
43   fPHOSTrackSegment = ts->GetIndexInList() ;
44   fIndexInList      = -1 ;
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() ; 
50   fType             = kUNDEFINED ;  
51   fE                = kenergy ;    // !!! all particles have mass = 0 
52 }
53
54 //____________________________________________________________________________
55  AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
56 {
57   // copy ctor
58
59   fPHOSTrackSegment = rp.fPHOSTrackSegment ; 
60   fType             = rp.fType ; 
61   fIndexInList      = rp.fIndexInList ;
62
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];
69   fWeight      = rp.fWeight;
70   fCalcMass    = rp.fCalcMass;
71   fPx          = rp.fPx;
72   fPy          = rp.fPy;
73   fPz          = rp.fPz;
74   fE           = rp.fE;
75   fVx          = rp.fVx;
76   fVy          = rp.fVy;
77   fVz          = rp.fVz;
78   fVt          = rp.fVt;
79   fPolarTheta  = rp.fPolarTheta;
80   fPolarPhi    = rp.fPolarPhi;
81   fParticlePDG = rp.fParticlePDG; 
82 }
83
84 //____________________________________________________________________________
85 Int_t * AliPHOSRecParticle::GetPrimaries(Int_t & number) 
86 {
87   // Retrieves all the primary particles at the origine of this reconstructed particle
88
89   AliPHOSTrackSegment * ts = GetPHOSTrackSegment() ;
90
91   Int_t emcnumber = 0 ; 
92   Int_t * emclist = ts->GetPrimariesEmc(emcnumber) ;
93   
94   Int_t ppsdlnumber = 0 ;
95   Int_t * ppsdllist = ts->GetPrimariesPpsdLow(ppsdlnumber) ;
96  
97   Int_t ppsdunumber = 0 ; 
98   Int_t * ppsdulist = ts->GetPrimariesPpsdUp(ppsdunumber) ;
99
100   number = emcnumber + ppsdlnumber + ppsdunumber ;
101   Int_t * list   = new Int_t[number] ;
102   
103   Int_t index ; 
104   for ( index = 0 ; index < emcnumber ; index++)
105     list[index] = emclist[index] ;
106
107   Int_t jndex ; 
108   for ( jndex = 0 ; jndex < ppsdlnumber ; jndex++) {
109     assert(index < number) ;
110     list[index] = ppsdllist[jndex] ;
111     index++ ; 
112   }
113
114   for ( jndex = 0 ; jndex < ppsdunumber ; jndex++) {
115     assert(index < number) ;
116     list[index] = ppsdulist[jndex] ;
117     index++ ; 
118   }
119
120   delete emclist ;
121   delete ppsdllist ;
122   delete ppsdulist ;
123
124   return list ; 
125 }
126
127 //____________________________________________________________________________
128 AliPHOSTrackSegment * AliPHOSRecParticle::GetPHOSTrackSegment() const 
129 {
130   // Retrieves the PHOS track segment at the origine of this reconstructed particle
131
132   AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
133   return please->GimeTrackSegment( fPHOSTrackSegment ) ;
134
135 }
136
137
138