AliPhysics  ff1d528 (ff1d528)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalParticle.h
Go to the documentation of this file.
1 #ifndef ALIEMCALPARTICLE_H
2 #define ALIEMCALPARTICLE_H
3 
4 #include <TLorentzVector.h>
5 #include <TMath.h>
6 #include <TObjArray.h>
7 #include "AliVCluster.h"
8 #include "AliVParticle.h"
9 #include "AliVTrack.h"
10 
11 class AliEmcalParticle: public AliVParticle {
12  public:
14  AliEmcalParticle(AliVTrack* track, Int_t id = -1);
15  AliEmcalParticle(AliVCluster* cluster, Int_t id = -1, Double_t vx=0, Double_t vy=0, Double_t vz=0, Int_t ude=-1);
18  virtual ~AliEmcalParticle();
19 
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 2*TMath::ATan(TMath::Exp(-fEta)); }
34  Double_t E() const { Double_t p=P(); return TMath::Sqrt(M()*M()+p*p); }
35  Double_t M() const { return fM; }
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; }
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; }
42 
43  void AddMatchedObj(Int_t id, Double_t d);
44  AliVCluster *GetCluster() const { return fCluster ; }
45  Int_t GetMatchedObjId(UShort_t i = 0) const { return fNMatched > i ? fMatchedIds[i] : -1 ; }
46  Double_t GetMatchedObjDistance(UShort_t i = 0) const { return fNMatched > i ? fMatchedDist[i] : -1 ; }
48  AliVCluster *GetMatchedCluster(UShort_t i = 0) const { if (fTrack && fMatchedPtr && (fNMatched > i))
49  return static_cast<AliVCluster*>(fMatchedPtr->At(fMatchedIds[i]));
50  return 0 ; }
51  AliVTrack *GetMatchedTrack(UShort_t i = 0) const { if (fCluster && fMatchedPtr && (fNMatched > i))
52  return static_cast<AliVTrack*>(fMatchedPtr->At(fMatchedIds[i]));
53  return 0 ; }
54  AliVTrack *GetTrack() const { return fTrack ; }
55  Double_t GetTrackPhiOnEMCal() const { if (fTrack) return fTrack->GetTrackPhiOnEMCal(); else return -999; }
56  Double_t GetTrackEtaOnEMCal() const { if (fTrack) return fTrack->GetTrackEtaOnEMCal(); else return -999; }
57  Double_t GetTrackPtOnEMCal() const { if (fTrack) return fTrack->GetTrackPtOnEMCal(); else return -999; }
58  Int_t IdInCollection() const { return fId ; }
59  Bool_t IsCluster() const { return (Bool_t) fCluster != 0 ; }
60  Bool_t IsEMCAL() const { if (fCluster) return fCluster->IsEMCAL();
61  if (fTrack) return fTrack->IsEMCAL();
62  return kFALSE; }
63  Bool_t IsTrack() const { return (Bool_t) fTrack != 0 ; }
64  Bool_t IsMC(Int_t minLabel=0) const { if (fTrack) return (TMath::Abs(fTrack->GetLabel()) > minLabel);
65  return (fCluster->GetLabel() > minLabel); }
66  void ResetMatchedObjects();
67  void SetIdInCollection(Int_t id) { fId = id ; }
69  void SetMatchedPtr(TObjArray *arr) { fMatchedPtr = arr; }
70 
71  void SetPtEtaPhiM(Double_t pt, Double_t eta, Double_t phi, Double_t m) {fPt=pt; fEta=eta; fPhi=phi; fM=m;}
72 
73  protected:
74  TLorentzVector &GetLorentzVector(const Double_t *vertex = 0) const;
75 
76  static const UShort_t fSizeMatched = 99;
77 
78  AliVTrack *fTrack;
79  AliVCluster *fCluster;
89 
90  ClassDef(AliEmcalParticle, 3) // Emcal particle class
91 };
92 #endif
Double_t E() const
Int_t fId
number of matched objects
Double_t fMatchedDist[fSizeMatched]
ids of matched tracks/clusters, ordered from the closest to the farthest
static const UShort_t fSizeMatched
double Double_t
Definition: External.C:58
AliVCluster * GetMatchedCluster(UShort_t i=0) const
Double_t GetTrackEtaOnEMCal() const
Double_t Px() const
Int_t GetMatchedObjId(UShort_t i=0) const
Double_t Phi() const
Double_t fPt
eta
Double_t Theta() const
UShort_t GetNumberOfMatchedObj() const
Int_t GetLabel() const
TLorentzVector & GetLorentzVector(const Double_t *vertex=0) const
void SetMatchedPtr(TObjArray *arr)
Double_t P() const
Double_t fPhi
id in original collection
AliVTrack * GetTrack() const
Double_t Xv() const
Double_t M() const
Bool_t IsMC(Int_t minLabel=0) const
AliVCluster * fCluster
track
Double_t fEta
phi
UShort_t fMatchedIds[fSizeMatched]
cluster
Short_t Charge() const
int Int_t
Definition: External.C:63
Double_t Eta() const
Double_t Pt() const
Double_t GetTrackPhiOnEMCal() const
Int_t PdgCode() const
AliEmcalParticle & operator=(const AliEmcalParticle &p)
void SetPtEtaPhiM(Double_t pt, Double_t eta, Double_t phi, Double_t m)
void SetIdInCollection(Int_t id)
Int_t IdInCollection() const
const Double_t * PID() const
Double_t Y() const
UShort_t fNMatched
distances of matched tracks/clusters
AliVTrack * GetMatchedTrack(UShort_t i=0) const
Double_t Zv() const
Double_t GetMatchedObjDistance(UShort_t i=0) const
short Short_t
Definition: External.C:23
Double_t Py() const
AliVCluster * GetCluster() const
Bool_t IsCluster() const
Double_t Yv() const
Double_t Pz() const
void SetMatchedObj(Int_t id, Double_t d)
void AddMatchedObj(Int_t id, Double_t d)
unsigned short UShort_t
Definition: External.C:28
Bool_t IsEMCAL() const
Bool_t IsTrack() const
Bool_t PxPyPz(Double_t p[3]) const
TObjArray * fMatchedPtr
M.
bool Bool_t
Definition: External.C:53
Bool_t XvYvZv(Double_t x[3]) const
Double_t GetTrackPtOnEMCal() const
AliVTrack * fTrack
size of matched clusters array
Double_t OneOverPt() const