]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/EMCAL/AliEmcalParticle.h
Add ptr to original AliVTrack.
[u/mrichter/AliRoot.git] / PWG / EMCAL / AliEmcalParticle.h
CommitLineData
d11dc2a6 1#ifndef ALIEMCALPARTICLE_H
2#define ALIEMCALPARTICLE_H
3
4// $Id$
5
6#include <TLorentzVector.h>
5ded2286 7#include <TMath.h>
46dd554b 8#include "AliVCluster.h"
4e04e015 9#include "AliVParticle.h"
d11dc2a6 10#include "AliVTrack.h"
11
4e04e015 12class AliEmcalParticle: public AliVParticle {
d11dc2a6 13 public:
14 AliEmcalParticle();
46dd554b 15 AliEmcalParticle(TObject *particle, Int_t id = -1, Double_t vx=0, Double_t vy=0, Double_t vz=0);
d11dc2a6 16 AliEmcalParticle(const AliEmcalParticle &p);
17 AliEmcalParticle &operator=(const AliEmcalParticle &p);
9af299a9 18 virtual ~AliEmcalParticle();
d11dc2a6 19
4e04e015 20 // AliVParticle interface
21 Double_t Px() const { return fPt*TMath::Cos(fPhi); }
22 Double_t Py() const { return fPt*TMath::Sin(fPhi); };
23 Double_t Pz() const { return fPt*TMath::SinH(fEta); }
24 Double_t Pt() const { return fPt ; }
25 Double_t P() const { return TMath::Sqrt(Px()*Px()+Py()*Py()+Pz()*Pz()); }
26 Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return 1; }
27 Double_t Xv() const { return 0; }
28 Double_t Yv() const { return 0; }
29 Double_t Zv() const { return 0; }
30 Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return 1; }
31 Double_t OneOverPt() const { return 1./fPt; }
32 Double_t Phi() const { return fPhi; }
33 Double_t Theta() const { return 0.; }
006fb267 34 Double_t E() const { if (fTrack) return fTrack->E(); return fCluster->E(); }
4e04e015 35 Double_t M() const { if (fTrack) return fTrack->M(); return 0; }
36 Double_t Eta() const { return fEta; }
37 Double_t Y() const { if (fTrack) return fTrack->Y(); return fEta; }
38 Short_t Charge() const { if (fTrack) return fTrack->Charge(); else return 0; }
99264a5c
CL
39 Int_t GetLabel() const { if (fTrack) return fTrack->GetLabel(); return fCluster->GetLabel(); }
40 Int_t PdgCode() const { return 0; }
41 const Double_t *PID() const { return 0; }
4e04e015 42
9af299a9 43 AliVCluster* GetCluster() const { return fCluster ; }
4e04e015 44 Int_t GetMatchedObjId(UShort_t i = 0) const { return fNMatched > i ? fMatchedIds[i] : -1 ; }
45 Double_t GetMatchedObjDistance(UShort_t i = 0) const { return fNMatched > i ? fMatchedDist[i] : -1 ; }
46 UShort_t GetNumberOfMatchedObj() const { return fNMatched ; }
9af299a9 47 AliVTrack* GetTrack() const { return fTrack ; }
d11dc2a6 48 Double_t GetTrackPhiOnEMCal() const { if (fTrack) return fTrack->GetTrackPhiOnEMCal(); else return -999; }
49 Double_t GetTrackEtaOnEMCal() const { if (fTrack) return fTrack->GetTrackEtaOnEMCal(); else return -999; }
9af299a9 50 Int_t IdInCollection() const { return fId ; }
51 Bool_t IsCluster() const { return (Bool_t) fCluster != 0 ; }
99264a5c 52 Bool_t IsEMCAL() const { if (fCluster) return fCluster->IsEMCAL();
d11dc2a6 53 if (fTrack) return fTrack->IsEMCAL();
54 return kFALSE; }
d11dc2a6 55 Bool_t IsTrack() const { return (Bool_t) fTrack != 0 ; }
5ded2286 56 Bool_t IsMC(Int_t minLabel=0) const { if (fTrack) return (TMath::Abs(fTrack->GetLabel()) > minLabel);
57 return (fCluster->GetLabel() > minLabel); }
d11dc2a6 58
d11dc2a6 59 void AddMatchedObj(Int_t id, Double_t d);
60 void ResetMatchedObjects();
61 void SetIdInCollection(Int_t id) { fId = id ; }
62 void SetMatchedObj(Int_t id, Double_t d) { ResetMatchedObjects(); fMatchedIds[0] = id; fMatchedDist[0] = d; fNMatched = 1; }
63
64 protected:
46dd554b 65 TLorentzVector &GetLorentzVector(const Double_t *vertex = 0) const;
66
67 static const UShort_t fSizeMatched = 99; //!size of matched clusters array
d11dc2a6 68
69 AliVTrack *fTrack; //!track
70 AliVCluster *fCluster; //!cluster
71 UShort_t fMatchedIds[fSizeMatched]; //!ids of matched clusters, ordered from the closest to the farthest
72 Double_t fMatchedDist[fSizeMatched]; //!distances of matched clusters
73 UShort_t fNMatched; //!number of matched objects
46dd554b 74 Int_t fId; //!id in original collection
75 Double_t fPhi; //!phi
76 Double_t fEta; //!eta
77 Double_t fPt; //!pt
d11dc2a6 78
4e04e015 79 ClassDef(AliEmcalParticle, 1) // Emcal particle class
d11dc2a6 80};
81#endif