]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSRecParticle.cxx
Added MakePID method the embryo of Bayesian PID with PHOS
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRecParticle.cxx
CommitLineData
6ad0bfa0 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 **************************************************************************/
b2a60966 15/* $Id$ */
6ad0bfa0 16//_________________________________________________________________________
b2a60966 17// A Reconstructed Particle in PHOS
2f04ed65 18// To become a general class of AliRoot ?
19// Why should I put meaningless comments
20// just to satisfy
21// the code checker
b2a60966 22//
23//*-- Author: Yves Schutz (SUBATECH)
24
6ad0bfa0 25
26// --- ROOT system ---
27
28// --- Standard library ---
29
ed4205d8 30
6ad0bfa0 31// --- AliRoot header files ---
6ad0bfa0 32#include "AliPHOSRecParticle.h"
8f3968d8 33#include "AliPHOSGetter.h"
6ad0bfa0 34
0272607d 35//____________________________________________________________________________
36 AliPHOSRecParticle::AliPHOSRecParticle(): fPHOSTrackSegment(0) , fDebug( kFALSE )
37{
38 // ctor
88340ded 39 const Int_t nSPECIES = AliESDtrack::kSPECIESN;
40 for(Int_t i = 0; i<nSPECIES ; i++)
0272607d 41 fPID[i]=0.;
42}
6ad0bfa0 43
44
a73f33f0 45//____________________________________________________________________________
46 AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
a8c47ab6 47 : AliPHOSFastRecParticle(rp)
a73f33f0 48{
b2a60966 49 // copy ctor
50
83974468 51 fPHOSTrackSegment = rp.fPHOSTrackSegment ;
51d189f4 52 fDebug = kFALSE ;
a73f33f0 53 fType = rp.fType ;
83974468 54 fIndexInList = rp.fIndexInList ;
b2a60966 55
cafda784 56 fPdgCode = rp.fPdgCode;
57 fStatusCode = rp.fStatusCode;
58 fMother[0] = rp.fMother[0];
59 fMother[1] = rp.fMother[1];
60 fDaughter[0] = rp.fDaughter[0];
61 fDaughter[1] = rp.fDaughter[1];
62 fWeight = rp.fWeight;
63 fCalcMass = rp.fCalcMass;
64 fPx = rp.fPx;
65 fPy = rp.fPy;
66 fPz = rp.fPz;
67 fE = rp.fE;
68 fVx = rp.fVx;
69 fVy = rp.fVy;
70 fVz = rp.fVz;
71 fVt = rp.fVt;
72 fPolarTheta = rp.fPolarTheta;
73 fPolarPhi = rp.fPolarPhi;
74 fParticlePDG = rp.fParticlePDG;
88340ded 75 const Int_t nSPECIES = AliESDtrack::kSPECIESN;
76 for(Int_t i = 0; i<nSPECIES ; i++)
0272607d 77 fPID[i]=rp.fPID[i];
b2a60966 78}
83974468 79
8f3968d8 80//____________________________________________________________________________
81const Int_t AliPHOSRecParticle::GetNPrimaries() const
88cb7938 82{
83 return -1;
a278df55 84}
85
86//____________________________________________________________________________
87const Int_t AliPHOSRecParticle::GetNPrimariesToRecParticles() const
8f3968d8 88{
e957fea8 89 // Get the number of primaries at the origine of the RecParticle
8f3968d8 90 Int_t rv = 0 ;
88cb7938 91 AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
92 Int_t emcRPindex = dynamic_cast<AliPHOSTrackSegment*>(gime->TrackSegments()->At(GetPHOSTSIndex()))->GetEmcIndex();
93 dynamic_cast<AliPHOSEmcRecPoint*>(gime->EmcRecPoints()->At(emcRPindex))->GetPrimaries(rv) ;
8f3968d8 94 return rv ;
95}
83974468 96
8f3968d8 97//____________________________________________________________________________
98const TParticle * AliPHOSRecParticle::GetPrimary(Int_t index) const
99{
e957fea8 100 // Get the list of primary particles at the origine of the RecParticle
a278df55 101 if ( index > GetNPrimariesToRecParticles() ) {
51d189f4 102 if (fDebug)
88cb7938 103 Warning("GetPrimary", "AliPHOSRecParticle::GetPrimary -> %d is larger that the number of primaries %d",
104 index, GetNPrimaries()) ;
105 return 0 ;
51d189f4 106 }
88cb7938 107 else {
108 Int_t dummy ;
109 AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
110
111 Int_t emcRPindex = dynamic_cast<AliPHOSTrackSegment*>(gime->TrackSegments()->At(GetPHOSTSIndex()))->GetEmcIndex();
112 Int_t primaryindex = dynamic_cast<AliPHOSEmcRecPoint*>(gime->EmcRecPoints()->At(emcRPindex))->GetPrimaries(dummy)[index] ;
113 return gime->Primary(primaryindex) ;
114 }
fc7e2f43 115 // return 0 ;
8f3968d8 116}
948a4b24 117
06e774ed 118//____________________________________________________________________________
119const Double_t * AliPHOSRecParticle::GetPID()
120{
121 // Get the probability densities that this reconstructed particle
122 // has a type of i:
123 // i particle types
124 // ----------------------
125 // 0 electron
126 // 1 muon
127 // 2 pi+-
128 // 3 K+-
129 // 4 p/pbar
130 // 5 photon
131 // 6 pi0 at high pt
132 // 7 neutron
133 // 8 K0L
0272607d 134
135
06e774ed 136 if (IsElectron() ) fPID[0] = 1.0;
137 if (IsChargedHadron()) {
138 fPID[1] = 0.25;
139 fPID[2] = 0.25;
140 fPID[3] = 0.25;
141 fPID[4] = 0.25;
142 }
143 if (IsFastChargedHadron()) {
144 fPID[1] = 0.33;
145 fPID[2] = 0.33;
146 fPID[3] = 0.33;
147 fPID[4] = 0.00;
148 }
149 if (IsSlowChargedHadron()) {
150 fPID[1] = 0.00;
151 fPID[2] = 0.00;
152 fPID[3] = 0.00;
153 fPID[4] = 1.00;
154 }
155
88340ded 156 if (IsPhoton() || IsHardPhoton()) fPID[5] = 1.0;
157 if (IsHardPi0()) fPID[6] = 1.0;
158 if (IsFastNeutralHadron()) fPID[7] = 1.0;
159 if (IsSlowNeutralHadron()) fPID[8] = 1.0;
06e774ed 160
948a4b24 161 if (IsEleCon()) fPID[9] = 1.0;
06e774ed 162 return fPID;
163}