1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //_________________________________________________________________________
17 // A Reconstructed Particle in PHOS
18 // To become a general class of AliRoot ?
19 // Why should I put meaningless comments
23 //*-- Author: Yves Schutz (SUBATECH)
26 // --- ROOT system ---
28 // --- Standard library ---
31 // --- AliRoot header files ---
32 #include "AliPHOSRecParticle.h"
33 #include "AliPHOSGetter.h"
35 //____________________________________________________________________________
36 AliPHOSRecParticle::AliPHOSRecParticle(): fPHOSTrackSegment(0) , fDebug( kFALSE )
39 const Int_t nSPECIES = AliESDtrack::kSPECIESN;
40 for(Int_t i = 0; i<nSPECIES ; i++)
45 //____________________________________________________________________________
46 AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
47 : AliPHOSFastRecParticle(rp)
51 fPHOSTrackSegment = rp.fPHOSTrackSegment ;
54 fIndexInList = rp.fIndexInList ;
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];
63 fCalcMass = rp.fCalcMass;
72 fPolarTheta = rp.fPolarTheta;
73 fPolarPhi = rp.fPolarPhi;
74 fParticlePDG = rp.fParticlePDG;
75 const Int_t nSPECIES = AliESDtrack::kSPECIESN;
76 for(Int_t i = 0; i<nSPECIES ; i++)
80 //____________________________________________________________________________
81 const Int_t AliPHOSRecParticle::GetNPrimaries() const
86 //____________________________________________________________________________
87 const Int_t AliPHOSRecParticle::GetNPrimariesToRecParticles() const
89 // Get the number of primaries at the origine of the RecParticle
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) ;
97 //____________________________________________________________________________
98 const TParticle * AliPHOSRecParticle::GetPrimary(Int_t index) const
100 // Get the list of primary particles at the origine of the RecParticle
101 if ( index > GetNPrimariesToRecParticles() ) {
103 Warning("GetPrimary", "AliPHOSRecParticle::GetPrimary -> %d is larger that the number of primaries %d",
104 index, GetNPrimaries()) ;
109 AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
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) ;
118 //____________________________________________________________________________
119 const Double_t * AliPHOSRecParticle::GetPID()
121 // Get the probability densities that this reconstructed particle
124 // ----------------------
136 if (IsElectron() ) fPID[0] = 1.0;
137 if (IsChargedHadron()) {
143 if (IsFastChargedHadron()) {
149 if (IsSlowChargedHadron()) {
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;
161 if (IsEleCon()) fPID[9] = 1.0;