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 EMCAL
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 "AliEMCALRecParticle.h"
33 #include "AliEMCALGetter.h"
34 #include "TParticle.h"
36 ClassImp(AliEMCALRecParticle)
39 //____________________________________________________________________________
40 AliEMCALRecParticle::AliEMCALRecParticle(): fEMCALRecPoint(0), fDebug(kFALSE)
43 const Int_t nSPECIES = AliESDtrack::kSPECIESN;
44 for(Int_t i = 0; i<nSPECIES ; i++)
47 //____________________________________________________________________________
48 AliEMCALRecParticle::AliEMCALRecParticle(const AliEMCALRecParticle & rp)
49 : AliEMCALFastRecParticle(rp)
53 fEMCALRecPoint = rp.fEMCALRecPoint ;
56 fIndexInList = rp.fIndexInList ;
58 fPdgCode = rp.fPdgCode;
59 fStatusCode = rp.fStatusCode;
60 fMother[0] = rp.fMother[0];
61 fMother[1] = rp.fMother[1];
62 fDaughter[0] = rp.fDaughter[0];
63 fDaughter[1] = rp.fDaughter[1];
65 fCalcMass = rp.fCalcMass;
74 fPolarTheta = rp.fPolarTheta;
75 fPolarPhi = rp.fPolarPhi;
76 fParticlePDG = rp.fParticlePDG;
77 const Int_t nSPECIES = AliESDtrack::kSPECIESN;
78 for(Int_t i = 0; i<nSPECIES ; i++)
82 //____________________________________________________________________________
83 const Int_t AliEMCALRecParticle::GetNPrimaries() const
88 //____________________________________________________________________________
89 const Int_t AliEMCALRecParticle::GetNPrimariesToRecParticles() const
91 // Returns the number of primaries at the origine of a RecParticle
93 AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
94 dynamic_cast<AliEMCALRecPoint*>(gime->ECARecPoints()->At(GetEMCALRPIndex()))->GetPrimaries(rv) ;
99 //____________________________________________________________________________
100 const TParticle * AliEMCALRecParticle::GetPrimary(Int_t index) const
102 // Getts the list of primary particles at the origine of the RecParticle
103 if ( index > GetNPrimariesToRecParticles() ) {
105 Warning("GetPrimary", "AliEMCALRecParticle::GetPrimary -> %d is larger that the number of primaries %d",
106 index, GetNPrimaries()) ;
110 AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
112 Int_t primaryindex = dynamic_cast<AliEMCALRecPoint*>(gime->ECARecPoints()->At(GetEMCALRPIndex()))->GetPrimaries(dummy)[index] ;
114 return gime->Primary(primaryindex) ;
117 //____________________________________________________________________________
118 const Double_t * AliEMCALRecParticle::GetPID()
120 // Get the probability densities that this reconstructed particle
123 // ----------------------
135 if (IsElectron() ) fPID[0] = 1.0;
136 if (IsChargedHadron()) {
142 if (IsFastChargedHadron()) {
148 if (IsSlowChargedHadron()) {
155 if (IsPhoton() || IsHardPhoton()) fPID[5] = 1.0;
156 if (IsHardPi0()) fPID[6] = 1.0;
157 if (IsFastNeutralHadron()) fPID[7] = 1.0;
158 if (IsSlowNeutralHadron()) fPID[8] = 1.0;
160 if (IsEleCon()) fPID[9] = 1.0;