]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSRecParticle.cxx
Particle identification improved by shower profile analysis
[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 //_________________________________________________________________________
17 // Reconstructed Particle
18 //*-- Y. Schutz:   SUBATECH 
19 //////////////////////////////////////////////////////////////////////////////
20
21 // --- ROOT system ---
22
23 // --- Standard library ---
24
25 // --- AliRoot header files ---
26
27 #include "AliPHOSRecParticle.h"
28
29 ClassImp(AliPHOSRecParticle)
30
31
32 //____________________________________________________________________________
33  AliPHOSRecParticle::AliPHOSRecParticle(AliPHOSTrackSegment * ts)
34 {
35   // ctor
36  
37   fPHOSTrackSegment = new AliPHOSTrackSegment(*ts) ; 
38   fE                = ts->GetEnergy() ; 
39   TVector3 momdir   = ts->GetMomentumDirection() ;
40   fPx               = fE * momdir.X() ; 
41   fPy               = fE * momdir.Y() ; 
42   fPz               = fE * momdir.Z() ; 
43
44   fType = kUNDEFINED ; // undefined
45                             
46   if( ts->GetPpsdUp() == 0 ) {     // Neutral
47
48     if( ts->GetPpsdLow() == 0 )    // Neutral  
49       fType = kNEUTRAL ;   
50     else                           // Gamma
51       fType = kGAMMA ;               
52   }
53   else                            // Charged           
54     fType = kCHARGED ;   
55   
56 }
57
58 //____________________________________________________________________________
59 TString AliPHOSRecParticle::Name()
60 {
61   TString  name ; 
62   switch (fType) {
63   case kGAMMA:
64     name = "PHOTON" ;
65     break ; 
66    case kELECTRON:
67      name = "ELECTRON" ;
68     break ; 
69   case kNEUTRAL:
70     name = "NEUTRAL" ;
71     break ; 
72    case kCHARGEDHADRON:
73     name = "CHARGED HADRON" ;
74     break ; 
75   case kNEUTRON:
76     name = "NEUTRAL BARYON" ; 
77     break ; 
78   }
79   return name ; 
80 }
81
82 //____________________________________________________________________________
83 void AliPHOSRecParticle::Print()
84 {
85   cout << "AliPHOSRecParticle > " << "type is  " << Name() << endl 
86        << "                     " << "Energy = " << fE << endl 
87        << "                     " << "Px     = " << fPx << endl 
88        << "                     " << "Py     = " << fPy << endl 
89        << "                     " << "Pz     = " << fPz << endl ; 
90 }