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 "AliHeader.h"
33 #include "AliPHOSRecParticle.h"
34 #include "AliPHOSGetter.h"
35 #include "TParticle.h"
37 ClassImp(AliPHOSRecParticle)
40 //____________________________________________________________________________
41 AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
45 fPHOSTrackSegment = rp.fPHOSTrackSegment ;
48 fIndexInList = rp.fIndexInList ;
50 fPdgCode = rp.fPdgCode;
51 fStatusCode = rp.fStatusCode;
52 fMother[0] = rp.fMother[0];
53 fMother[1] = rp.fMother[1];
54 fDaughter[0] = rp.fDaughter[0];
55 fDaughter[1] = rp.fDaughter[1];
57 fCalcMass = rp.fCalcMass;
66 fPolarTheta = rp.fPolarTheta;
67 fPolarPhi = rp.fPolarPhi;
68 fParticlePDG = rp.fParticlePDG;
72 //____________________________________________________________________________
73 const Int_t AliPHOSRecParticle::GetNPrimaries() const
75 AliHeader *h = gAlice->GetHeader();
76 return h->GetNprimary();
77 // return gAlice->GetNtrack();
80 //____________________________________________________________________________
81 const Int_t AliPHOSRecParticle::GetNPrimariesToRecParticles() const
85 AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
86 Int_t emcRPindex = ((AliPHOSTrackSegment*)gime->TrackSegments()->At(GetPHOSTSIndex()))->GetEmcIndex();
87 ((AliPHOSEmcRecPoint*)gime->EmcRecPoints()->At(emcRPindex))->GetPrimaries(rv) ;
91 //____________________________________________________________________________
92 const TParticle * AliPHOSRecParticle::GetPrimary(Int_t index) const
94 if ( index > GetNPrimariesToRecParticles() ) {
96 cout << "WARNING : AliPHOSRecParticle::GetPrimary -> " << index << " is larger that the number of primaries "
97 << GetNPrimaries() << endl ;
101 AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
102 Int_t emcRPindex = ((AliPHOSTrackSegment*)gime->TrackSegments()->At(GetPHOSTSIndex()))->GetEmcIndex();
103 Int_t primaryindex = ((AliPHOSEmcRecPoint*)gime->EmcRecPoints()->At(emcRPindex))->GetPrimaries(dummy)[index] ;
104 // if (primaryindex >= 10000000) { // it comes from backgroundfile
106 // cout << "WARNING : AliPHOSRecParticle::GetPrimary -> not a signal primary" << endl ;
109 return gime->Primary(primaryindex) ;