From: loizides Date: Wed, 30 May 2012 05:01:36 +0000 (+0000) Subject: added mc info X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=96919f913cf98c37d4cf8c8e5299cc204ed3f8c0;p=u%2Fmrichter%2FAliRoot.git added mc info --- diff --git a/PWGGA/EMCALJetTasks/AliEmcalJet.cxx b/PWGGA/EMCALJetTasks/AliEmcalJet.cxx index 2932f43af49..071e3185de1 100644 --- a/PWGGA/EMCALJetTasks/AliEmcalJet.cxx +++ b/PWGGA/EMCALJetTasks/AliEmcalJet.cxx @@ -8,6 +8,35 @@ ClassImp(AliEmcalJet) +//__________________________________________________________________________________________________ +AliEmcalJet::AliEmcalJet() : + AliVParticle(), + fPt(0), + fEta(0), + fPhi(0), + fM(0), + fNEF(0), + fArea(0), + fAreaEmc(-1), + fAxisInEmcal(0), + fMaxCPt(0), + fMaxNPt(0), + fMCPt(0), + fNn(0), + fNch(0), + fClusterIDs(), + fTrackIDs(), + fMatched(2) +{ + // Constructor. + + fClosestJets[0] = 0; + fClosestJets[1] = 0; + fClosestJetsDist[0] = 999; + fClosestJetsDist[1] = 999; + fMatched = 2; +} + //__________________________________________________________________________________________________ AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz) : AliVParticle(), @@ -21,8 +50,12 @@ AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz) : fAxisInEmcal(0), fMaxCPt(0), fMaxNPt(0), + fMCPt(0), + fNn(0), + fNch(0), fClusterIDs(), - fTrackIDs() + fTrackIDs(), + fMatched(2) { // Constructor. @@ -31,6 +64,12 @@ AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz) : if (fPhi<0.) fPhi += 2. * TMath::Pi(); } + + fClosestJets[0] = 0; + fClosestJets[1] = 0; + fClosestJetsDist[0] = 999; + fClosestJetsDist[1] = 999; + fMatched = 2; } //_________________________________________________________________________________________________ @@ -45,14 +84,24 @@ AliEmcalJet::AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m) : fAreaEmc(-1), fAxisInEmcal(0), fMaxCPt(0), - fMaxNPt(0), + fMaxNPt(0), + fMCPt(0), + fNn(0), + fNch(0), fClusterIDs(), - fTrackIDs() + fTrackIDs(), + fMatched(2) { // Constructor. if (fPhi<0.) fPhi += TMath::TwoPi(); + + fClosestJets[0] = 0; + fClosestJets[1] = 0; + fClosestJetsDist[0] = 999; + fClosestJetsDist[1] = 999; + fMatched = 2; } //_________________________________________________________________________________________________ @@ -68,6 +117,9 @@ AliEmcalJet::AliEmcalJet(const AliEmcalJet &jet) : fAxisInEmcal(jet.fAxisInEmcal), fMaxCPt(jet.fMaxCPt), fMaxNPt(jet.fMaxNPt), + fMCPt(jet.fMCPt), + fNn(jet.fNn), + fNch(jet.fNch), fClusterIDs(jet.fClusterIDs), fTrackIDs(jet.fTrackIDs) { @@ -91,6 +143,9 @@ AliEmcalJet &AliEmcalJet::operator=(const AliEmcalJet &jet) fAxisInEmcal = jet.fAxisInEmcal; fMaxCPt = jet.fMaxCPt; fMaxNPt = jet.fMaxNPt; + fMCPt = jet.fMCPt; + fNn = jet.fNn; + fNch = jet.fNch; fClusterIDs = jet.fClusterIDs; fTrackIDs = jet.fTrackIDs; } diff --git a/PWGGA/EMCALJetTasks/AliEmcalJet.h b/PWGGA/EMCALJetTasks/AliEmcalJet.h index 22e479aea4c..4332d038402 100644 --- a/PWGGA/EMCALJetTasks/AliEmcalJet.h +++ b/PWGGA/EMCALJetTasks/AliEmcalJet.h @@ -10,14 +10,11 @@ #include "AliVParticle.h" #include "AliVCluster.h" -#include "AliVParticle.h" class AliEmcalJet : public AliVParticle { public: - AliEmcalJet() : AliVParticle(), fPt(0), fEta(0), fPhi(0), fM(0), fNEF(0), fArea(0), - fAreaEmc(-1), fAxisInEmcal(0), fMaxCPt(0), fMaxNPt(0), fClusterIDs(), - fTrackIDs() {;} + AliEmcalJet(); AliEmcalJet(Double_t px, Double_t py, Double_t pz); AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m); AliEmcalJet(const AliEmcalJet &jet); @@ -50,21 +47,31 @@ class AliEmcalJet : public AliVParticle Double_t Area() const { return fArea; } Double_t AreaEmc() const { return fAreaEmc; } Bool_t AxisInEmcal() const { return fAxisInEmcal; } + UShort_t GetNumberOfClusters() const { return fClusterIDs.GetSize(); } Short_t ClusterAt(Int_t idx) const { return fClusterIDs.At(idx); } AliVCluster *ClusterAt(Int_t idx, TClonesArray *clusarray) const { return dynamic_cast(clusarray->At(ClusterAt(idx))); } + UShort_t GetNumberOfTracks() const { return fTrackIDs.GetSize(); } + Short_t TrackAt(Int_t idx) const { return fTrackIDs.At(idx); } + AliVParticle *TrackAt(Int_t idx, TClonesArray *trackarray) const { return dynamic_cast(trackarray->At(TrackAt(idx))); } Double_t FracEmcalArea() const { return fAreaEmc/fArea; } - UShort_t GetNumberOfClusters() const { return Nn(); } - UShort_t GetNumberOfTracks() const { return Nch(); } Bool_t IsInsideEmcal() const { return (fAreaEmc/fArea>0.999); } Bool_t IsInEmcal() const { return (fAreaEmc>0); } - Double_t MaxClusterPt() const { return fMaxNPt; } - Double_t MaxTrackPt() const { return fMaxCPt; } + Double_t MaxNeutralPt() const { return fMaxNPt; } + Double_t MaxChargedPt() const { return fMaxCPt; } Double_t NEF() const { return fNEF; } - UShort_t Nn() const { return fClusterIDs.GetSize(); } - UShort_t Nch() const { return fTrackIDs.GetSize(); } + UShort_t Nn() const { return fNn; } + UShort_t Nch() const { return fNch; } UShort_t N() const { return Nch()+Nn(); } - Short_t TrackAt(Int_t idx) const { return fTrackIDs.At(idx); } - AliVParticle *TrackAt(Int_t idx, TClonesArray *trackarray) const { return dynamic_cast(trackarray->At(TrackAt(idx))); } + Double_t MCPt() const { return fMCPt; } + Bool_t IsMC() const { return (Bool_t)(MCPt() > E() - MCPt()); } + AliEmcalJet* ClosestJet() const { return fClosestJets[0]; } + Double_t ClosestJetDistance() const { return fClosestJetsDist[0]; } + AliEmcalJet* SecondClosestJet() const { return fClosestJets[1]; } + Double_t SecondClosestJetDistance() const { return fClosestJetsDist[1]; } + AliEmcalJet* MatchedJet() const { return fMatched < 2 ? fClosestJets[fMatched] : 0; } + // Only for backward compatibility + Double_t MaxClusterPt() const { return MaxNeutralPt(); } + Double_t MaxTrackPt() const { return MaxChargedPt(); } void AddClusterAt(Int_t clus, Int_t idx){ fClusterIDs.AddAt(clus, idx); } void AddTrackAt(Int_t track, Int_t idx) { fTrackIDs.AddAt(track, idx); } @@ -73,27 +80,40 @@ class AliEmcalJet : public AliVParticle void SetArea(Double_t a) { fArea = a; } void SetAreaEmc(Double_t a) { fAreaEmc = a; } void SetAxisInEmcal(Bool_t b) { fAxisInEmcal = b; } - void SetMaxClusterPt(Double32_t t) { fMaxNPt = t; } - void SetMaxTrackPt(Double32_t t) { fMaxCPt = t; } + void SetMaxNeutralPt(Double32_t t) { fMaxNPt = t; } + void SetMaxChargedPt(Double32_t t) { fMaxCPt = t; } void SetNEF(Double_t nef) { fNEF = nef; } void SetNumberOfClusters(Int_t n) { fClusterIDs.Set(n); } void SetNumberOfTracks(Int_t n) { fTrackIDs.Set(n); } + void SetNumberOfCharged(Int_t n) { fNch = n; } + void SetNumberOfNeutrals(Int_t n) { fNn = n; } + void SetMCPt(Double_t p) { fMCPt = p; } void SortConstituents(); + void SetClosestJet(AliEmcalJet *j, Double_t d) { fClosestJets[0] = j; fClosestJetsDist[0] = d; } + void SetSecondClosestJet(AliEmcalJet *j, Double_t d) { fClosestJets[1] = j; fClosestJetsDist[1] = d; } + void SetMatchedToClosest() { fMatched = 0; } + void SetMatchedToSecondClosest() { fMatched = 1; } protected: - Double32_t fPt; //[0,0,12] pt - Double32_t fEta; //[-1,1,12] eta - Double32_t fPhi; //[0,6.3,12] phi - Double32_t fM; //[0,0,8] mass - Double32_t fNEF; //[0,1,8] neutral energy fraction - Double32_t fArea; //[0,0,12] area - Double32_t fAreaEmc; //[0,0,12] area on EMCAL surface (determined from ghosts) - Bool_t fAxisInEmcal; // =true if jet axis inside EMCAL acceptance - Double32_t fMaxCPt; //[0,0,12] pt of maximum track - Double32_t fMaxNPt; //[0,0,12] pt of maximum cluster - TArrayS fClusterIDs; // array of cluster constituents - TArrayS fTrackIDs; // array of track constituents + Double32_t fPt; //[0,0,12] pt + Double32_t fEta; //[-1,1,12] eta + Double32_t fPhi; //[0,6.3,12] phi + Double32_t fM; //[0,0,8] mass + Double32_t fNEF; //[0,1,8] neutral energy fraction + Double32_t fArea; //[0,0,12] area + Double32_t fAreaEmc; //[0,0,12] area on EMCAL surface (determined from ghosts) + Bool_t fAxisInEmcal; // =true if jet axis inside EMCAL acceptance + Double32_t fMaxCPt; //[0,0,12] pt of maximum charged constituent + Double32_t fMaxNPt; //[0,0,12] pt of maximum neutral constituent + Double32_t fMCPt; // pt from MC particles contributing to the jet + Int_t fNn; // number of neutral constituents + Int_t fNch; // number of charged constituents + TArrayS fClusterIDs; // array of cluster constituents + TArrayS fTrackIDs; // array of track constituents + AliEmcalJet *fClosestJets[2]; //! if this is MC it contains the two closest detector level jets in order of distance and viceversa + Double32_t fClosestJetsDist[2]; //! distance to closest jets (see above) + UShort_t fMatched; //! 0,1 if it is matched with one of the closest jets; 2 if it is not matched - ClassDef(AliEmcalJet,4) // Emcal jet class in cylindrical coordinates + ClassDef(AliEmcalJet,6) // Emcal jet class in cylindrical coordinates }; #endif