]>
Commit | Line | Data |
---|---|---|
914d486c | 1 | #ifndef AliEmcalJet_H |
2 | #define AliEmcalJet_H | |
7df864a3 | 3 | |
688670de | 4 | // $Id$ |
5 | ||
f8087a81 | 6 | #include <TArrayS.h> |
7efbea04 | 7 | #include <TLorentzVector.h> |
8 | #include <TMath.h> | |
a55e4f1d | 9 | #include <TClonesArray.h> |
10 | ||
f8087a81 | 11 | #include "AliVParticle.h" |
a55e4f1d | 12 | #include "AliVCluster.h" |
85d48773 | 13 | #include "AliVEvent.h" |
7efbea04 | 14 | |
914d486c | 15 | class AliEmcalJet : public AliVParticle |
7efbea04 | 16 | { |
7df864a3 | 17 | public: |
3c9775d9 | 18 | enum EFlavourTag{ |
19 | kDStar = 1<<0, | |
20 | kD0 = 1<<1 | |
21 | //..... | |
22 | }; | |
23 | ||
96919f91 | 24 | AliEmcalJet(); |
914d486c | 25 | AliEmcalJet(Double_t px, Double_t py, Double_t pz); |
101cefde | 26 | AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m); |
914d486c | 27 | AliEmcalJet(const AliEmcalJet &jet); |
28 | AliEmcalJet& operator=(const AliEmcalJet &jet); | |
7efbea04 | 29 | |
a55e4f1d | 30 | Double_t Px() const { return fPt*TMath::Cos(fPhi); } |
da1bd0e7 | 31 | Double_t Py() const { return fPt*TMath::Sin(fPhi); } |
a55e4f1d | 32 | Double_t Pz() const { return fPt*TMath::SinH(fEta); } |
33 | Double_t Pt() const { return fPt; } | |
34 | Double_t P() const { return fPt*TMath::CosH(fEta); } | |
35 | Bool_t PxPyPz(Double_t p[3]) const { p[0]=Px();p[1]=Py();p[2]=Pz(); return 1; } | |
36 | Double_t Xv() const { return 0.; } | |
37 | Double_t Yv() const { return 0.; } | |
38 | Double_t Zv() const { return 0.; } | |
39 | Bool_t XvYvZv(Double_t x[3]) const { x[0]=0;x[1]=0;x[2]=0; return 1; } | |
40 | Double_t OneOverPt() const { return 1./fPt; } | |
41 | Double_t Phi() const { return fPhi; } | |
42 | Double_t Theta() const { return 2*TMath::ATan(TMath::Exp(-fEta)); } | |
43 | Double_t E() const { Double_t p=P(); return TMath::Sqrt(M()*M()+p*p); } | |
abfd90d8 | 44 | Double_t M() const { return fM; } |
a55e4f1d | 45 | Double_t Eta() const { return fEta; } |
46 | Double_t Y() const { return 0.5*TMath::Log((E()+Pz())/(E()-Pz())); } | |
47 | Short_t Charge() const { return 0; } | |
48 | Int_t GetLabel() const { return -1; } | |
49 | Int_t PdgCode() const { return 0; } | |
50 | const Double_t *PID() const { return 0; } | |
51 | void GetMom(TLorentzVector &vec) const; | |
52 | void Print(Option_t* option = "") const; | |
688670de | 53 | |
a55e4f1d | 54 | Double_t Area() const { return fArea; } |
db8a0184 | 55 | Double_t AreaPt() const { return fArea; } |
56 | Double_t AreaEta() const { return fAreaEta; } | |
57 | Double_t AreaPhi() const { return fAreaPhi; } | |
101cefde | 58 | Double_t AreaEmc() const { return fAreaEmc; } |
59 | Bool_t AxisInEmcal() const { return fAxisInEmcal; } | |
db8a0184 | 60 | Int_t Compare(const TObject* obj) const; |
a55e4f1d | 61 | Short_t ClusterAt(Int_t idx) const { return fClusterIDs.At(idx); } |
8895e61b | 62 | AliVCluster *ClusterAt(Int_t idx, TClonesArray *ca) const { if (!ca) return 0; return dynamic_cast<AliVCluster*>(ca->At(ClusterAt(idx))); } |
f660c2d6 | 63 | AliVCluster *GetLeadingCluster(TClonesArray *clusters) const; |
db8a0184 | 64 | UShort_t GetNumberOfClusters() const { return fClusterIDs.GetSize(); } |
96919f91 | 65 | UShort_t GetNumberOfTracks() const { return fTrackIDs.GetSize(); } |
624bef5b | 66 | UShort_t GetNumberOfConstituents() const { return GetNumberOfClusters()+GetNumberOfTracks(); } |
101cefde | 67 | Double_t FracEmcalArea() const { return fAreaEmc/fArea; } |
101cefde | 68 | Bool_t IsInsideEmcal() const { return (fAreaEmc/fArea>0.999); } |
69 | Bool_t IsInEmcal() const { return (fAreaEmc>0); } | |
db8a0184 | 70 | Bool_t IsMC() const { return (Bool_t)(MCPt() > 0); } |
71 | Bool_t IsSortable() const { return kTRUE; } | |
96919f91 | 72 | Double_t MaxNeutralPt() const { return fMaxNPt; } |
73 | Double_t MaxChargedPt() const { return fMaxCPt; } | |
a55e4f1d | 74 | Double_t NEF() const { return fNEF; } |
96919f91 | 75 | UShort_t Nn() const { return fNn; } |
76 | UShort_t Nch() const { return fNch; } | |
a55e4f1d | 77 | UShort_t N() const { return Nch()+Nn(); } |
8895e61b | 78 | Int_t NEmc() const { return fNEmc; } |
96919f91 | 79 | Double_t MCPt() const { return fMCPt; } |
96919f91 | 80 | Double_t MaxClusterPt() const { return MaxNeutralPt(); } |
81 | Double_t MaxTrackPt() const { return MaxChargedPt(); } | |
e44e8726 | 82 | Double_t MaxPartPt() const { return fMaxCPt < fMaxNPt ? fMaxNPt : fMaxCPt; } |
8895e61b | 83 | Double_t PtEmc() const { return fPtEmc; } |
84 | Double_t PtSub() const { return fPtSub; } | |
85 | Double_t PtSub(Double_t rho) const { return fPt - fArea*rho; } | |
db8a0184 | 86 | Double_t PtSubVect(Double_t rho) const; |
db8a0184 | 87 | Short_t TrackAt(Int_t idx) const { return fTrackIDs.At(idx); } |
88 | AliVParticle *TrackAt(Int_t idx, TClonesArray *ta) const { if (!ta) return 0; return dynamic_cast<AliVParticle*>(ta->At(TrackAt(idx))); } | |
f660c2d6 | 89 | AliVParticle *GetLeadingTrack(TClonesArray *tracks) const; |
3c9775d9 | 90 | Int_t GetFlavour() const { return fFlavourTagging; } |
91 | ||
a55e4f1d | 92 | void AddClusterAt(Int_t clus, Int_t idx){ fClusterIDs.AddAt(clus, idx); } |
3c9775d9 | 93 | void AddFlavourTag(Int_t tag) { fFlavourTagging |= tag; } |
a55e4f1d | 94 | void AddTrackAt(Int_t track, Int_t idx) { fTrackIDs.AddAt(track, idx); } |
038f0049 | 95 | void Clear(Option_t */*option*/="") { fClusterIDs.Set(0); fTrackIDs.Set(0); fClosestJets[0] = 0; fClosestJets[1] = 0; |
96 | fClosestJetsDist[0] = 0; fClosestJetsDist[1] = 0; fMatched = 0; fPtSub = 0; } | |
101cefde | 97 | void SetArea(Double_t a) { fArea = a; } |
db8a0184 | 98 | void SetAreaEta(Double_t a) { fAreaEta = a; } |
99 | void SetAreaPhi(Double_t a) { fAreaPhi = a; } | |
101cefde | 100 | void SetAreaEmc(Double_t a) { fAreaEmc = a; } |
101 | void SetAxisInEmcal(Bool_t b) { fAxisInEmcal = b; } | |
3c9775d9 | 102 | void SetFlavour(Int_t flavour) { fFlavourTagging = flavour; } |
96919f91 | 103 | void SetMaxNeutralPt(Double32_t t) { fMaxNPt = t; } |
104 | void SetMaxChargedPt(Double32_t t) { fMaxCPt = t; } | |
101cefde | 105 | void SetNEF(Double_t nef) { fNEF = nef; } |
a55e4f1d | 106 | void SetNumberOfClusters(Int_t n) { fClusterIDs.Set(n); } |
107 | void SetNumberOfTracks(Int_t n) { fTrackIDs.Set(n); } | |
96919f91 | 108 | void SetNumberOfCharged(Int_t n) { fNch = n; } |
109 | void SetNumberOfNeutrals(Int_t n) { fNn = n; } | |
110 | void SetMCPt(Double_t p) { fMCPt = p; } | |
a55e4f1d | 111 | void SortConstituents(); |
3c9775d9 | 112 | void SetNEmc(Int_t n) { fNEmc = n; } |
113 | void SetPtEmc(Double_t pt) { fPtEmc = pt; } | |
114 | void SetPtSub(Double_t ps) { fPtSub = ps; } | |
115 | void SetPtSubVect(Double_t ps) { fPtVectSub = ps; } | |
116 | Bool_t TestFlavourTag(Int_t tag) { return (Bool_t)((tag & fFlavourTagging) !=0); } | |
85d48773 | 117 | |
118 | // Trigger | |
119 | Bool_t IsTriggerJet(UInt_t trigger=AliVEvent::kEMCEJE) const { return (Bool_t)((fTriggers & trigger) != 0); } | |
120 | void SetTrigger(UInt_t trigger) { fTriggers = trigger; } | |
121 | void AddTrigger(UInt_t trigger) { fTriggers |= trigger; } | |
cfc2ac24 | 122 | |
123 | // Matching | |
2103dc6a | 124 | void SetClosestJet(AliEmcalJet *j, Double_t d) { fClosestJets[0] = j; fClosestJetsDist[0] = d ; } |
cfc2ac24 | 125 | void SetSecondClosestJet(AliEmcalJet *j, Double_t d) { fClosestJets[1] = j; fClosestJetsDist[1] = d ; } |
126 | void SetMatchedToClosest(UShort_t m) { fMatched = 0; fMatchingType = m ; } | |
127 | void SetMatchedToSecondClosest(UShort_t m) { fMatched = 1; fMatchingType = m ; } | |
2103dc6a | 128 | void ResetMatching(); |
cfc2ac24 | 129 | AliEmcalJet* ClosestJet() const { return fClosestJets[0] ; } |
130 | Double_t ClosestJetDistance() const { return fClosestJetsDist[0] ; } | |
131 | AliEmcalJet* SecondClosestJet() const { return fClosestJets[1] ; } | |
132 | Double_t SecondClosestJetDistance() const { return fClosestJetsDist[1] ; } | |
133 | AliEmcalJet* MatchedJet() const { return fMatched < 2 ? fClosestJets[fMatched] : 0; } | |
134 | UShort_t GetMatchingType() const { return fMatchingType ; } | |
629e03fc | 135 | |
254370e1 | 136 | void SetTaggedJet(AliEmcalJet *j) { fTaggedJet = j ; } |
137 | void SetTagStatus(Int_t i) { fTagStatus = i ; } | |
138 | AliEmcalJet* GetTaggedJet() const { return fTaggedJet ; } | |
139 | Int_t GetTagStatus() const { return fTagStatus ; } | |
140 | ||
7df864a3 | 141 | protected: |
43a9dcd0 | 142 | Double32_t fPt; //[0,0,12] pt |
143 | Double32_t fEta; //[-1,1,12] eta | |
144 | Double32_t fPhi; //[0,6.3,12] phi | |
145 | Double32_t fM; //[0,0,8] mass | |
146 | Double32_t fNEF; //[0,1,8] neutral energy fraction | |
147 | Double32_t fArea; //[0,0,12] area | |
db8a0184 | 148 | Double32_t fAreaEta; //[0,0,12] area eta |
149 | Double32_t fAreaPhi; //[0,0,12] area phi | |
43a9dcd0 | 150 | Double32_t fAreaEmc; //[0,0,12] area on EMCAL surface (determined from ghosts) |
151 | Bool_t fAxisInEmcal; // =true if jet axis inside EMCAL acceptance | |
3c9775d9 | 152 | Int_t fFlavourTagging; // tag jet with a falvour, bit 0 = no tag; bit 1= Dstar; bit 2 = D0 |
43a9dcd0 | 153 | Double32_t fMaxCPt; //[0,0,12] pt of maximum charged constituent |
154 | Double32_t fMaxNPt; //[0,0,12] pt of maximum neutral constituent | |
155 | Double32_t fMCPt; // pt from MC particles contributing to the jet | |
156 | Int_t fNn; // number of neutral constituents | |
157 | Int_t fNch; // number of charged constituents | |
8895e61b | 158 | Double32_t fPtEmc; //[0,0,12] pt in EMCAL acceptance |
159 | Int_t fNEmc; // number of constituents in EMCAL acceptance | |
ae456de9 | 160 | TArrayI fClusterIDs; // array of cluster constituents |
161 | TArrayI fTrackIDs; // array of track constituents | |
43a9dcd0 | 162 | AliEmcalJet *fClosestJets[2]; //! if this is MC it contains the two closest detector level jets in order of distance and viceversa |
163 | Double32_t fClosestJetsDist[2]; //! distance to closest jets (see above) | |
164 | UShort_t fMatched; //! 0,1 if it is matched with one of the closest jets; 2 if it is not matched | |
cfc2ac24 | 165 | UShort_t fMatchingType; //! matching type |
254370e1 | 166 | AliEmcalJet *fTaggedJet; //! jet tagged to this jet |
167 | Int_t fTagStatus; //! status of tagging -1: NA 0: not tagged 1: tagged | |
8895e61b | 168 | Double_t fPtSub; //! background subtracted pt (not stored set from outside) |
db8a0184 | 169 | Double_t fPtVectSub; //! background vector subtracted pt (not stored set from outside) |
85d48773 | 170 | UInt_t fTriggers; //! triggers that the jet might have fired (AliVEvent::EOfflineTriggerTypes) |
7df864a3 | 171 | |
254370e1 | 172 | ClassDef(AliEmcalJet,12) // Emcal jet class in cylindrical coordinates |
7df864a3 | 173 | }; |
f472e642 | 174 | #endif |