]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/EMCALJetTasks/AliEmcalJet.h
Fix problem in terminate. Add possibility to select the minimum number of vertex...
[u/mrichter/AliRoot.git] / PWGGA / EMCALJetTasks / AliEmcalJet.h
CommitLineData
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"
7efbea04 13
914d486c 14class AliEmcalJet : public AliVParticle
7efbea04 15{
7df864a3 16 public:
96919f91 17 AliEmcalJet();
914d486c 18 AliEmcalJet(Double_t px, Double_t py, Double_t pz);
101cefde 19 AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m);
914d486c 20 AliEmcalJet(const AliEmcalJet &jet);
21 AliEmcalJet& operator=(const AliEmcalJet &jet);
7efbea04 22
a55e4f1d 23 Double_t Px() const { return fPt*TMath::Cos(fPhi); }
24 Double_t Py() const { return fPt*TMath::Cos(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;
688670de 46
a55e4f1d 47 Double_t Area() const { return fArea; }
101cefde 48 Double_t AreaEmc() const { return fAreaEmc; }
49 Bool_t AxisInEmcal() const { return fAxisInEmcal; }
96919f91 50 UShort_t GetNumberOfClusters() const { return fClusterIDs.GetSize(); }
a55e4f1d 51 Short_t ClusterAt(Int_t idx) const { return fClusterIDs.At(idx); }
2bddb6ae 52 AliVCluster *ClusterAt(Int_t idx, TClonesArray *clusarray) const { if (!clusarray) return 0; return dynamic_cast<AliVCluster*>(clusarray->At(ClusterAt(idx))); }
96919f91 53 UShort_t GetNumberOfTracks() const { return fTrackIDs.GetSize(); }
54 Short_t TrackAt(Int_t idx) const { return fTrackIDs.At(idx); }
2bddb6ae 55 AliVParticle *TrackAt(Int_t idx, TClonesArray *trackarray) const { if (!trackarray) return 0; return dynamic_cast<AliVParticle*>(trackarray->At(TrackAt(idx))); }
101cefde 56 Double_t FracEmcalArea() const { return fAreaEmc/fArea; }
101cefde 57 Bool_t IsInsideEmcal() const { return (fAreaEmc/fArea>0.999); }
58 Bool_t IsInEmcal() const { return (fAreaEmc>0); }
96919f91 59 Double_t MaxNeutralPt() const { return fMaxNPt; }
60 Double_t MaxChargedPt() const { return fMaxCPt; }
a55e4f1d 61 Double_t NEF() const { return fNEF; }
96919f91 62 UShort_t Nn() const { return fNn; }
63 UShort_t Nch() const { return fNch; }
a55e4f1d 64 UShort_t N() const { return Nch()+Nn(); }
96919f91 65 Double_t MCPt() const { return fMCPt; }
95bbd5e4 66 Bool_t IsMC() const { return (Bool_t)(MCPt() > 0); }
96919f91 67 AliEmcalJet* ClosestJet() const { return fClosestJets[0]; }
68 Double_t ClosestJetDistance() const { return fClosestJetsDist[0]; }
69 AliEmcalJet* SecondClosestJet() const { return fClosestJets[1]; }
70 Double_t SecondClosestJetDistance() const { return fClosestJetsDist[1]; }
71 AliEmcalJet* MatchedJet() const { return fMatched < 2 ? fClosestJets[fMatched] : 0; }
96919f91 72 Double_t MaxClusterPt() const { return MaxNeutralPt(); }
73 Double_t MaxTrackPt() const { return MaxChargedPt(); }
35789a2d 74
a55e4f1d 75 void AddClusterAt(Int_t clus, Int_t idx){ fClusterIDs.AddAt(clus, idx); }
76 void AddTrackAt(Int_t track, Int_t idx) { fTrackIDs.AddAt(track, idx); }
77 void Clear(Option_t */*option*/="") { fClusterIDs.Set(0);
78 fTrackIDs.Set(0); }
101cefde 79 void SetArea(Double_t a) { fArea = a; }
80 void SetAreaEmc(Double_t a) { fAreaEmc = a; }
81 void SetAxisInEmcal(Bool_t b) { fAxisInEmcal = b; }
96919f91 82 void SetMaxNeutralPt(Double32_t t) { fMaxNPt = t; }
83 void SetMaxChargedPt(Double32_t t) { fMaxCPt = t; }
101cefde 84 void SetNEF(Double_t nef) { fNEF = nef; }
a55e4f1d 85 void SetNumberOfClusters(Int_t n) { fClusterIDs.Set(n); }
86 void SetNumberOfTracks(Int_t n) { fTrackIDs.Set(n); }
96919f91 87 void SetNumberOfCharged(Int_t n) { fNch = n; }
88 void SetNumberOfNeutrals(Int_t n) { fNn = n; }
89 void SetMCPt(Double_t p) { fMCPt = p; }
a55e4f1d 90 void SortConstituents();
96919f91 91 void SetClosestJet(AliEmcalJet *j, Double_t d) { fClosestJets[0] = j; fClosestJetsDist[0] = d; }
92 void SetSecondClosestJet(AliEmcalJet *j, Double_t d) { fClosestJets[1] = j; fClosestJetsDist[1] = d; }
93 void SetMatchedToClosest() { fMatched = 0; }
94 void SetMatchedToSecondClosest() { fMatched = 1; }
629e03fc 95
7df864a3 96 protected:
43a9dcd0 97 Double32_t fPt; //[0,0,12] pt
98 Double32_t fEta; //[-1,1,12] eta
99 Double32_t fPhi; //[0,6.3,12] phi
100 Double32_t fM; //[0,0,8] mass
101 Double32_t fNEF; //[0,1,8] neutral energy fraction
102 Double32_t fArea; //[0,0,12] area
103 Double32_t fAreaEmc; //[0,0,12] area on EMCAL surface (determined from ghosts)
104 Bool_t fAxisInEmcal; // =true if jet axis inside EMCAL acceptance
105 Double32_t fMaxCPt; //[0,0,12] pt of maximum charged constituent
106 Double32_t fMaxNPt; //[0,0,12] pt of maximum neutral constituent
107 Double32_t fMCPt; // pt from MC particles contributing to the jet
108 Int_t fNn; // number of neutral constituents
109 Int_t fNch; // number of charged constituents
110 TArrayS fClusterIDs; // array of cluster constituents
111 TArrayS fTrackIDs; // array of track constituents
112 AliEmcalJet *fClosestJets[2]; //! if this is MC it contains the two closest detector level jets in order of distance and viceversa
113 Double32_t fClosestJetsDist[2]; //! distance to closest jets (see above)
114 UShort_t fMatched; //! 0,1 if it is matched with one of the closest jets; 2 if it is not matched
7df864a3 115
96919f91 116 ClassDef(AliEmcalJet,6) // Emcal jet class in cylindrical coordinates
7df864a3 117};
f472e642 118#endif