7 #include <TLorentzVector.h>
9 #include <TClonesArray.h>
11 #include "AliVParticle.h"
12 #include "AliVCluster.h"
14 class AliEmcalJet : public AliVParticle
18 AliEmcalJet(Double_t px, Double_t py, Double_t pz);
19 AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m);
20 AliEmcalJet(const AliEmcalJet &jet);
21 AliEmcalJet& operator=(const AliEmcalJet &jet);
23 Double_t Px() const { return fPt*TMath::Cos(fPhi); }
24 Double_t Py() const { return fPt*TMath::Sin(fPhi); }
25 Double_t Pz() const { return fPt*TMath::SinH(fEta); }
26 Double_t Pt() const { return fPt; }
27 Double_t P() const { return fPt*TMath::CosH(fEta); }
28 Bool_t PxPyPz(Double_t p[3]) const { p[0]=Px();p[1]=Py();p[2]=Pz(); return 1; }
29 Double_t Xv() const { return 0.; }
30 Double_t Yv() const { return 0.; }
31 Double_t Zv() const { return 0.; }
32 Bool_t XvYvZv(Double_t x[3]) const { x[0]=0;x[1]=0;x[2]=0; return 1; }
33 Double_t OneOverPt() const { return 1./fPt; }
34 Double_t Phi() const { return fPhi; }
35 Double_t Theta() const { return 2*TMath::ATan(TMath::Exp(-fEta)); }
36 Double_t E() const { Double_t p=P(); return TMath::Sqrt(M()*M()+p*p); }
37 Double_t M() const { return 0.13957; }
38 Double_t Eta() const { return fEta; }
39 Double_t Y() const { return 0.5*TMath::Log((E()+Pz())/(E()-Pz())); }
40 Short_t Charge() const { return 0; }
41 Int_t GetLabel() const { return -1; }
42 Int_t PdgCode() const { return 0; }
43 const Double_t *PID() const { return 0; }
44 void GetMom(TLorentzVector &vec) const;
45 void Print(Option_t* option = "") const;
47 Double_t Area() const { return fArea; }
48 Double_t AreaPt() const { return fArea; }
49 Double_t AreaEta() const { return fAreaEta; }
50 Double_t AreaPhi() const { return fAreaPhi; }
51 Double_t AreaEmc() const { return fAreaEmc; }
52 Bool_t AxisInEmcal() const { return fAxisInEmcal; }
53 Int_t Compare(const TObject* obj) const;
54 Short_t ClusterAt(Int_t idx) const { return fClusterIDs.At(idx); }
55 AliVCluster *ClusterAt(Int_t idx, TClonesArray *ca) const { if (!ca) return 0; return dynamic_cast<AliVCluster*>(ca->At(ClusterAt(idx))); }
56 AliVCluster *GetLeadingCluster(TClonesArray *clusters) const;
57 UShort_t GetNumberOfClusters() const { return fClusterIDs.GetSize(); }
58 UShort_t GetNumberOfTracks() const { return fTrackIDs.GetSize(); }
59 UShort_t GetNumberOfConstituents() const { return GetNumberOfClusters()+GetNumberOfTracks(); }
60 Double_t FracEmcalArea() const { return fAreaEmc/fArea; }
61 Bool_t IsInsideEmcal() const { return (fAreaEmc/fArea>0.999); }
62 Bool_t IsInEmcal() const { return (fAreaEmc>0); }
63 Bool_t IsMC() const { return (Bool_t)(MCPt() > 0); }
64 Bool_t IsSortable() const { return kTRUE; }
65 Double_t MaxNeutralPt() const { return fMaxNPt; }
66 Double_t MaxChargedPt() const { return fMaxCPt; }
67 Double_t NEF() const { return fNEF; }
68 UShort_t Nn() const { return fNn; }
69 UShort_t Nch() const { return fNch; }
70 UShort_t N() const { return Nch()+Nn(); }
71 Int_t NEmc() const { return fNEmc; }
72 Double_t MCPt() const { return fMCPt; }
73 Double_t MaxClusterPt() const { return MaxNeutralPt(); }
74 Double_t MaxTrackPt() const { return MaxChargedPt(); }
75 Double_t MaxPartPt() const { return fMaxCPt < fMaxNPt ? fMaxNPt : fMaxCPt; }
76 Double_t PtEmc() const { return fPtEmc; }
77 Double_t PtSub() const { return fPtSub; }
78 Double_t PtSub(Double_t rho) const { return fPt - fArea*rho; }
79 Double_t PtSubVect(Double_t rho) const;
80 Short_t TrackAt(Int_t idx) const { return fTrackIDs.At(idx); }
81 AliVParticle *TrackAt(Int_t idx, TClonesArray *ta) const { if (!ta) return 0; return dynamic_cast<AliVParticle*>(ta->At(TrackAt(idx))); }
82 AliVParticle *GetLeadingTrack(TClonesArray *tracks) const;
84 void AddClusterAt(Int_t clus, Int_t idx){ fClusterIDs.AddAt(clus, idx); }
85 void AddTrackAt(Int_t track, Int_t idx) { fTrackIDs.AddAt(track, idx); }
86 void Clear(Option_t */*option*/="") { fClusterIDs.Set(0); fTrackIDs.Set(0); fClosestJets[0] = 0; fClosestJets[1] = 0;
87 fClosestJetsDist[0] = 0; fClosestJetsDist[1] = 0; fMatched = 0; fPtSub = 0; }
88 void SetArea(Double_t a) { fArea = a; }
89 void SetAreaEta(Double_t a) { fAreaEta = a; }
90 void SetAreaPhi(Double_t a) { fAreaPhi = a; }
91 void SetAreaEmc(Double_t a) { fAreaEmc = a; }
92 void SetAxisInEmcal(Bool_t b) { fAxisInEmcal = b; }
93 void SetMaxNeutralPt(Double32_t t) { fMaxNPt = t; }
94 void SetMaxChargedPt(Double32_t t) { fMaxCPt = t; }
95 void SetNEF(Double_t nef) { fNEF = nef; }
96 void SetNumberOfClusters(Int_t n) { fClusterIDs.Set(n); }
97 void SetNumberOfTracks(Int_t n) { fTrackIDs.Set(n); }
98 void SetNumberOfCharged(Int_t n) { fNch = n; }
99 void SetNumberOfNeutrals(Int_t n) { fNn = n; }
100 void SetMCPt(Double_t p) { fMCPt = p; }
101 void SortConstituents();
102 void SetNEmc(Int_t n) { fNEmc = n; }
103 void SetPtEmc(Double_t pt) { fPtEmc = pt; }
104 void SetPtSub(Double_t ps) { fPtSub = ps; }
105 void SetPtSubVect(Double_t ps) { fPtVectSub = ps; }
108 void SetClosestJet(AliEmcalJet *j, Double_t d) { fClosestJets[0] = j; fClosestJetsDist[0] = d ; }
109 void SetSecondClosestJet(AliEmcalJet *j, Double_t d) { fClosestJets[1] = j; fClosestJetsDist[1] = d ; }
110 void SetMatchedToClosest(UShort_t m) { fMatched = 0; fMatchingType = m ; }
111 void SetMatchedToSecondClosest(UShort_t m) { fMatched = 1; fMatchingType = m ; }
112 void ResetMatching();
113 AliEmcalJet* ClosestJet() const { return fClosestJets[0] ; }
114 Double_t ClosestJetDistance() const { return fClosestJetsDist[0] ; }
115 AliEmcalJet* SecondClosestJet() const { return fClosestJets[1] ; }
116 Double_t SecondClosestJetDistance() const { return fClosestJetsDist[1] ; }
117 AliEmcalJet* MatchedJet() const { return fMatched < 2 ? fClosestJets[fMatched] : 0; }
118 UShort_t GetMatchingType() const { return fMatchingType ; }
121 Double32_t fPt; //[0,0,12] pt
122 Double32_t fEta; //[-1,1,12] eta
123 Double32_t fPhi; //[0,6.3,12] phi
124 Double32_t fM; //[0,0,8] mass
125 Double32_t fNEF; //[0,1,8] neutral energy fraction
126 Double32_t fArea; //[0,0,12] area
127 Double32_t fAreaEta; //[0,0,12] area eta
128 Double32_t fAreaPhi; //[0,0,12] area phi
129 Double32_t fAreaEmc; //[0,0,12] area on EMCAL surface (determined from ghosts)
130 Bool_t fAxisInEmcal; // =true if jet axis inside EMCAL acceptance
131 Double32_t fMaxCPt; //[0,0,12] pt of maximum charged constituent
132 Double32_t fMaxNPt; //[0,0,12] pt of maximum neutral constituent
133 Double32_t fMCPt; // pt from MC particles contributing to the jet
134 Int_t fNn; // number of neutral constituents
135 Int_t fNch; // number of charged constituents
136 Double32_t fPtEmc; //[0,0,12] pt in EMCAL acceptance
137 Int_t fNEmc; // number of constituents in EMCAL acceptance
138 TArrayS fClusterIDs; // array of cluster constituents
139 TArrayS fTrackIDs; // array of track constituents
140 AliEmcalJet *fClosestJets[2]; //! if this is MC it contains the two closest detector level jets in order of distance and viceversa
141 Double32_t fClosestJetsDist[2]; //! distance to closest jets (see above)
142 UShort_t fMatched; //! 0,1 if it is matched with one of the closest jets; 2 if it is not matched
143 UShort_t fMatchingType; //! matching type
144 Double_t fPtSub; //! background subtracted pt (not stored set from outside)
145 Double_t fPtVectSub; //! background vector subtracted pt (not stored set from outside)
147 ClassDef(AliEmcalJet,9) // Emcal jet class in cylindrical coordinates