]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALRecParticle.cxx
More hists
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALRecParticle.cxx
CommitLineData
a83bd548 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/* $Id$ */
16//_________________________________________________________________________
17// A Reconstructed Particle in EMCAL
18// To become a general class of AliRoot ?
19// Why should I put meaningless comments
20// just to satisfy
21// the code checker
22//
23//*-- Author: Yves Schutz (SUBATECH)
24
25
26// --- ROOT system ---
27
28// --- Standard library ---
29
30
31// --- AliRoot header files ---
a83bd548 32#include "AliEMCALRecParticle.h"
33#include "AliEMCALGetter.h"
34#include "TParticle.h"
35
36ClassImp(AliEMCALRecParticle)
37
38
39//____________________________________________________________________________
9e5d2067 40AliEMCALRecParticle::AliEMCALRecParticle(const AliEMCALRecParticle & rp)
41 : AliEMCALFastRecParticle(rp)
a83bd548 42{
43 // copy ctor
44
ab091cd5 45 fEMCALRecPoint = rp.fEMCALRecPoint ;
a83bd548 46 fDebug = kFALSE ;
47 fType = rp.fType ;
48 fIndexInList = rp.fIndexInList ;
49
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];
56 fWeight = rp.fWeight;
57 fCalcMass = rp.fCalcMass;
58 fPx = rp.fPx;
59 fPy = rp.fPy;
60 fPz = rp.fPz;
61 fE = rp.fE;
62 fVx = rp.fVx;
63 fVy = rp.fVy;
64 fVz = rp.fVz;
65 fVt = rp.fVt;
66 fPolarTheta = rp.fPolarTheta;
67 fPolarPhi = rp.fPolarPhi;
68 fParticlePDG = rp.fParticlePDG;
69
70}
71
72//____________________________________________________________________________
73const Int_t AliEMCALRecParticle::GetNPrimaries() const
74{
88cb7938 75 return -1;
a83bd548 76}
77
78//____________________________________________________________________________
79const Int_t AliEMCALRecParticle::GetNPrimariesToRecParticles() const
80{
d64c959b 81 // Returns the number of primaries at the origine of a RecParticle
a83bd548 82 Int_t rv = 0 ;
88cb7938 83 AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
70a93198 84 dynamic_cast<AliEMCALRecPoint*>(gime->ECARecPoints()->At(GetEMCALRPIndex()))->GetPrimaries(rv) ;
85
88cb7938 86 return rv ;
a83bd548 87}
88
89//____________________________________________________________________________
90const TParticle * AliEMCALRecParticle::GetPrimary(Int_t index) const
91{
d64c959b 92 // Getts the list of primary particles at the origine of the RecParticle
a83bd548 93 if ( index > GetNPrimariesToRecParticles() ) {
94 if (fDebug)
88cb7938 95 Warning("GetPrimary", "AliEMCALRecParticle::GetPrimary -> %d is larger that the number of primaries %d",
96 index, GetNPrimaries()) ;
97 return 0 ;
a83bd548 98 }
0798b21e 99 Int_t dummy ;
100 AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
88cb7938 101
70a93198 102 Int_t primaryindex = dynamic_cast<AliEMCALRecPoint*>(gime->ECARecPoints()->At(GetEMCALRPIndex()))->GetPrimaries(dummy)[index] ;
103
0798b21e 104 return gime->Primary(primaryindex) ;
a83bd548 105}
106