]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSRecParticle.cxx
New classes: AliPHOSRecParticle, AliPHOSParticleGuesser, AliPHOSAnalyze
[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   fType             = ts->GetPartType() ; 
39   fE                = ts->GetEnergy() ; 
40   TVector3 momdir   = ts->GetMomentumDirection() ;
41   fPx               = fE * momdir.X() ; 
42   fPy               = fE * momdir.Y() ; 
43   fPz               = fE * momdir.Z() ; 
44
45 }
46
47 //____________________________________________________________________________
48 TString AliPHOSRecParticle::Name()
49 {
50   TString  name ; 
51   switch (fType) {
52   case GAMMA :
53     name = "PHOTON" ;
54     break ; 
55    case ELECTRON :
56      name = "ELECTRON" ;
57     break ; 
58   case NEUTRAL :
59     name = "NEUTRAL" ;
60     break ; 
61    case CHARGEDHADRON:
62     name = "CHARGED HADRON" ;
63     break ; 
64   }
65   return name ; 
66 }
67
68 //____________________________________________________________________________
69 void AliPHOSRecParticle::Print()
70 {
71   cout << "AliPHOSRecParticle > " << "type is  " << Name() << endl 
72        << "                     " << "Energy = " << fE << endl 
73        << "                     " << "Px     = " << fPx << endl 
74        << "                     " << "Py     = " << fPy << endl 
75        << "                     " << "Pz     = " << fPz << endl ; 
76 }