]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGJE/EMCALJetTasks/AliEmcalJet.h
Copy MC info in PicoTrack
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / AliEmcalJet.h
index 3c7e4b55b585a4c5b738ab3cfb3a045fa7867602..25f37daa4fbafb6031146c3aa4e3b05e78e5bccd 100644 (file)
@@ -1,12 +1,14 @@
 #ifndef AliEmcalJet_H
 #define AliEmcalJet_H
 
-// $Id$
-
+#include <vector>
+#include <algorithm>
+#include <utility>
 #include <TArrayS.h>
 #include <TLorentzVector.h>
 #include <TMath.h>
 #include <TClonesArray.h>
+#include <TVector2.h>
 
 #include "AliVParticle.h"
 #include "AliVCluster.h"
@@ -45,7 +47,7 @@ class AliEmcalJet : public AliVParticle
   Double_t          Eta()                        const { return fEta;    }
   Double_t          Y()                          const { return 0.5*TMath::Log((E()+Pz())/(E()-Pz()));    }
   Short_t           Charge()                     const { return 0;       }
-  Int_t             GetLabel()                   const { return -1;      }
+  Int_t             GetLabel()                   const { return fLabel;  }
   Int_t             PdgCode()                    const { return 0;       }
   const Double_t   *PID()                        const { return 0;       }
   void              GetMom(TLorentzVector &vec)  const;
@@ -85,7 +87,7 @@ class AliEmcalJet : public AliVParticle
   Double_t          PtSub(Double_t rho)          const { return fPt - fArea*rho;           }
   Double_t          PtSubVect(Double_t rho)      const;
   Short_t           TrackAt(Int_t idx)           const { return fTrackIDs.At(idx);         }
-  AliVParticle     *TrackAt(Int_t idx, TClonesArray *ta)   const { if (!ta) return 0; return dynamic_cast<AliVParticle*>(ta->At(TrackAt(idx))); } 
+  AliVParticle     *TrackAt(Int_t idx, TClonesArray *ta)  const { if (!ta) return 0; return dynamic_cast<AliVParticle*>(ta->At(TrackAt(idx))); } 
   AliVParticle     *GetLeadingTrack(TClonesArray *tracks) const;
   Int_t             GetFlavour()                 const { return fFlavourTagging;           } 
   
@@ -94,6 +96,9 @@ class AliEmcalJet : public AliVParticle
   void              AddTrackAt(Int_t track, Int_t idx) { fTrackIDs.AddAt(track, idx);      }
   void              Clear(Option_t */*option*/="")     { fClusterIDs.Set(0); fTrackIDs.Set(0); fClosestJets[0] = 0; fClosestJets[1] = 0; 
                                                          fClosestJetsDist[0] = 0; fClosestJetsDist[1] = 0; fMatched = 0; fPtSub = 0; }
+  Double_t          DeltaR(const AliVParticle* part) const;
+
+  void              SetLabel(Int_t l)                  { fLabel = l;                       }
   void              SetArea(Double_t a)                { fArea    = a;                     }
   void              SetAreaEta(Double_t a)             { fAreaEta = a;                     }
   void              SetAreaPhi(Double_t a)             { fAreaPhi = a;                     }
@@ -109,6 +114,7 @@ class AliEmcalJet : public AliVParticle
   void              SetNumberOfNeutrals(Int_t n)       { fNn = n;                          }
   void              SetMCPt(Double_t p)                { fMCPt = p;                        }
   void              SortConstituents();
+  std::vector<int>  SortConstituentsPt(TClonesArray *tracks) const;
   void              SetNEmc(Int_t n)                   { fNEmc           = n;              }
   void              SetPtEmc(Double_t pt)              { fPtEmc          = pt;             }
   void              SetPtSub(Double_t ps)              { fPtSub          = ps;             } 
@@ -133,6 +139,21 @@ class AliEmcalJet : public AliVParticle
   AliEmcalJet*      MatchedJet()                              const { return fMatched < 2 ? fClosestJets[fMatched] : 0; }
   UShort_t          GetMatchingType()                         const { return fMatchingType                            ; }
 
+  void              SetTaggedJet(AliEmcalJet *j)                    { fTaggedJet = j                                  ; }
+  void              SetTagStatus(Int_t i)                           { fTagStatus = i                                  ; }
+  AliEmcalJet*      GetTaggedJet()                            const { return fTaggedJet                               ; }
+  Int_t             GetTagStatus()                            const { return fTagStatus                               ; }
+
+  //jet shape derivatives
+  void              SetFirstDerivative(Double_t d)                  { fJetShapeMassFirstDer = d                       ; }
+  void              SetSecondDerivative(Double_t d)                 { fJetShapeMassSecondDer = d                      ; }
+  void              SetFirstOrderSubtracted(Double_t d)             { fJetShapeMassFirstSub = d                       ; }
+  void              SetSecondOrderSubtracted(Double_t d)            { fJetShapeMassSecondSub = d                      ; }
+  Double_t          GetFirstDerivative()                      const { return fJetShapeMassFirstDer                    ; }
+  Double_t          GetSecondDerivative()                     const { return fJetShapeMassSecondDer                   ; }
+  Double_t          GetFirstOrderSubtracted()                 const { return fJetShapeMassFirstSub                    ; }
+  Double_t          GetSecondOrderSubtracted()                const { return fJetShapeMassSecondSub                   ; }
+
  protected:
   Double32_t        fPt;                  //[0,0,12]   pt 
   Double32_t        fEta;                 //[-1,1,12]  eta
@@ -152,16 +173,30 @@ class AliEmcalJet : public AliVParticle
   Int_t             fNch;                 //           number of charged constituents
   Double32_t        fPtEmc;               //[0,0,12]   pt in EMCAL acceptance
   Int_t             fNEmc;                //           number of constituents in EMCAL acceptance
-  TArrayI           fClusterIDs;          //           array of cluster constituents  
-  TArrayI           fTrackIDs;            //           array of track constituents   
+  TArrayI           fClusterIDs;          //           array containing ids of cluster constituents  
+  TArrayI           fTrackIDs;            //           array containing ids 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
   UShort_t          fMatchingType;        //!          matching type
+  AliEmcalJet      *fTaggedJet;           //!          jet tagged to this jet
+  Int_t             fTagStatus;           //!          status of tagging -1: NA 0: not tagged 1: tagged
   Double_t          fPtSub;               //!          background subtracted pt (not stored set from outside) 
   Double_t          fPtVectSub;           //!          background vector subtracted pt (not stored set from outside) 
   UInt_t            fTriggers;            //!          triggers that the jet might have fired (AliVEvent::EOfflineTriggerTypes)
+  Double_t          fJetShapeMassFirstDer;  //!        result from shape derivatives for jet mass: 1st derivative
+  Double_t          fJetShapeMassSecondDer; //!        result from shape derivatives for jet mass: 2nd derivative
+  Double_t          fJetShapeMassFirstSub;  //!        result from shape derivatives for jet mass: 1st order subtracted
+  Double_t          fJetShapeMassSecondSub; //!        result from shape derivatives for jet mass: 2nd order subtracted
+  Int_t             fLabel;               //           label to inclusive jet for constituent subtracted jet    
+
+  private:
+    struct sort_descend
+        { // sort in decreasing order
+          // first value of the pair is Pt and the second is entry index
+        bool operator () (const std::pair<Double_t, Int_t>& p1, const std::pair<Double_t, Int_t>& p2)  { return p1.first > p2.first ; }
+        };
 
-  ClassDef(AliEmcalJet,11) // Emcal jet class in cylindrical coordinates
+  ClassDef(AliEmcalJet,14) // Emcal jet class in cylindrical coordinates
 };
 #endif