]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGJE/EMCALJetTasks/AliEmcalJet.h
Charged jets(pPb) framework bugfixes
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / AliEmcalJet.h
index fb50bb724134152cde3100ddec7a75a1c4303a33..3dad735c300024d03aea502e5730b3e5745471e0 100644 (file)
 
 #include "AliVParticle.h"
 #include "AliVCluster.h"
+#include "AliVEvent.h"
 
 class AliEmcalJet : public AliVParticle
 {
  public:
+     enum EFlavourTag{
+       kDStar = 1<<0,
+       kD0 = 1<<1
+       //.....
+    }; 
   AliEmcalJet();
   AliEmcalJet(Double_t px, Double_t py, Double_t pz);
   AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m);
@@ -34,7 +41,7 @@ class AliEmcalJet : public AliVParticle
   Double_t          Phi()                        const { return fPhi;    }
   Double_t          Theta()                      const { return 2*TMath::ATan(TMath::Exp(-fEta));         }
   Double_t          E()                          const { Double_t p=P(); return TMath::Sqrt(M()*M()+p*p); }
-  Double_t          M()                          const { return 0.13957; }
+  Double_t          M()                          const { return fM; }
   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;       }
@@ -51,10 +58,9 @@ class AliEmcalJet : public AliVParticle
   Double_t          AreaEmc()                    const { return fAreaEmc;                  }
   Bool_t            AxisInEmcal()                const { return fAxisInEmcal;              }
   Int_t             Compare(const TObject* obj)  const;
-  AliEmcalJet*      ClosestJet()                 const { return fClosestJets[0];           }
-  Double_t          ClosestJetDistance()         const { return fClosestJetsDist[0];       }
   Short_t           ClusterAt(Int_t idx)         const { return fClusterIDs.At(idx);       }
   AliVCluster      *ClusterAt(Int_t idx, TClonesArray *ca)  const { if (!ca) return 0; return dynamic_cast<AliVCluster*>(ca->At(ClusterAt(idx))); }
+  AliVCluster      *GetLeadingCluster(TClonesArray *clusters) const;
   UShort_t          GetNumberOfClusters()        const { return fClusterIDs.GetSize();     }
   UShort_t          GetNumberOfTracks()          const { return fTrackIDs.GetSize();       }
   UShort_t          GetNumberOfConstituents()    const { return GetNumberOfClusters()+GetNumberOfTracks();       }
@@ -71,7 +77,6 @@ class AliEmcalJet : public AliVParticle
   UShort_t          N()                          const { return Nch()+Nn();                }
   Int_t             NEmc()                       const { return fNEmc;                     }
   Double_t          MCPt()                       const { return fMCPt;                     }
-  AliEmcalJet*      MatchedJet()                 const { return fMatched < 2 ? fClosestJets[fMatched] : 0; }
   Double_t          MaxClusterPt()               const { return MaxNeutralPt();            }
   Double_t          MaxTrackPt()                 const { return MaxChargedPt();            }
   Double_t          MaxPartPt()                  const { return fMaxCPt < fMaxNPt ? fMaxNPt : fMaxCPt;     }
@@ -79,12 +84,13 @@ class AliEmcalJet : public AliVParticle
   Double_t          PtSub()                      const { return fPtSub;                    }
   Double_t          PtSub(Double_t rho)          const { return fPt - fArea*rho;           }
   Double_t          PtSubVect(Double_t rho)      const;
-  AliEmcalJet*      SecondClosestJet()           const { return fClosestJets[1];           }
-  Double_t          SecondClosestJetDistance()   const { return fClosestJetsDist[1];       }
   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     *GetLeadingTrack(TClonesArray *tracks) const;
+  Int_t             GetFlavour()                 const { return fFlavourTagging;           } 
+  
   void              AddClusterAt(Int_t clus, Int_t idx){ fClusterIDs.AddAt(clus, idx);     }
+  void              AddFlavourTag(Int_t tag)           { fFlavourTagging |= tag; }
   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; }
@@ -93,6 +99,7 @@ class AliEmcalJet : public AliVParticle
   void              SetAreaPhi(Double_t a)             { fAreaPhi = a;                     }
   void              SetAreaEmc(Double_t a)             { fAreaEmc = a;                     }
   void              SetAxisInEmcal(Bool_t b)           { fAxisInEmcal = b;                 }
+  void              SetFlavour(Int_t flavour)          { fFlavourTagging = flavour;        }
   void              SetMaxNeutralPt(Double32_t t)      { fMaxNPt  = t;                     }
   void              SetMaxChargedPt(Double32_t t)      { fMaxCPt  = t;                     }
   void              SetNEF(Double_t nef)               { fNEF     = nef;                   }
@@ -102,14 +109,34 @@ class AliEmcalJet : public AliVParticle
   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;      }
-  void              SetNEmc(Int_t n)                                { fNEmc      = n;      }
-  void              SetPtEmc(Double_t pt)                           { fPtEmc     = pt;     }
-  void              SetPtSub(Double_t ps)                           { fPtSub     = ps;     } 
-  void              SetPtSubVect(Double_t ps)                       { fPtVectSub = ps;     } 
+  void              SetNEmc(Int_t n)                   { fNEmc           = n;              }
+  void              SetPtEmc(Double_t pt)              { fPtEmc          = pt;             }
+  void              SetPtSub(Double_t ps)              { fPtSub          = ps;             } 
+  void              SetPtSubVect(Double_t ps)          { fPtVectSub      = ps;             }
+  Bool_t            TestFlavourTag(Int_t tag)          { return (Bool_t)((tag & fFlavourTagging) !=0); }
+
+  // Trigger
+  Bool_t            IsTriggerJet(UInt_t trigger=AliVEvent::kEMCEJE) const   { return (Bool_t)((fTriggers & trigger) != 0); }
+  void              SetTrigger(UInt_t trigger)                              { fTriggers  = trigger;                        }
+  void              AddTrigger(UInt_t trigger)                              { fTriggers |= trigger;                        }
+
+  // Matching
+  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(UShort_t m)                 { fMatched        = 0; fMatchingType       = m    ; }
+  void              SetMatchedToSecondClosest(UShort_t m)           { fMatched        = 1; fMatchingType       = m    ; }
+  void              ResetMatching();
+  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; }
+  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                               ; }
 
  protected:
   Double32_t        fPt;                  //[0,0,12]   pt 
@@ -122,6 +149,7 @@ class AliEmcalJet : public AliVParticle
   Double32_t        fAreaPhi;             //[0,0,12]   area phi
   Double32_t        fAreaEmc;             //[0,0,12]   area on EMCAL surface (determined from ghosts)
   Bool_t            fAxisInEmcal;         //           =true if jet axis inside EMCAL acceptance
+  Int_t             fFlavourTagging;      // tag jet with a falvour, bit 0 = no tag; bit 1= Dstar; bit 2 = D0
   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
@@ -129,14 +157,18 @@ 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
-  TArrayS           fClusterIDs;          //           array of cluster constituents  
-  TArrayS           fTrackIDs;            //           array of track constituents   
+  TArrayI           fClusterIDs;          //           array of cluster constituents  
+  TArrayI           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
+  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)
 
-  ClassDef(AliEmcalJet,9) // Emcal jet class in cylindrical coordinates
+  ClassDef(AliEmcalJet,12) // Emcal jet class in cylindrical coordinates
 };
 #endif