]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
From Adrian: Add helper functions to calculate z and xi
authormvl <marco.van.leeuwen@cern.ch>
Mon, 1 Sep 2014 08:57:41 +0000 (10:57 +0200)
committermvl <marco.van.leeuwen@cern.ch>
Mon, 1 Sep 2014 08:58:21 +0000 (10:58 +0200)
PWGJE/EMCALJetTasks/AliEmcalJet.cxx
PWGJE/EMCALJetTasks/AliEmcalJet.h

index 3884daded939862e28d1d0da22b8ee4dfd309eb5..e98a457eb8630d11762dfc600dfd634af55f7d15 100644 (file)
@@ -455,6 +455,26 @@ std::vector<int> AliEmcalJet::SortConstituentsPt( TClonesArray *tracks ) const
     return index_sorted_list;
 }
 
+//________________________________________________________________________
+Double_t AliEmcalJet::GetZ ( const Double_t trkPx, const Double_t trkPy, const Double_t trkPz ) const
+    {
+    // Get the z of a constituent inside of a jet
+    Double_t pJetSq = this->Px() * this->Px() + this->Py() * this->Py() + this->Pz() * this->Pz();
+
+    if(pJetSq>1e-6)
+        { return ( trkPx * this->Px() + trkPy * this->Py() + trkPz * this->Pz() ) / pJetSq ; }
+    else
+        { AliWarning(Form("%s: strange, pjet*pjet seems to be zero pJetSq: %f",GetName(), pJetSq)); return -1; }
+
+    }
+
+//________________________________________________________________________
+Double_t AliEmcalJet::GetZ ( const AliVParticle* trk )          const
+    {
+    // Get Z of constituent trk
+    return GetZ ( trk->Px(), trk->Py(), trk->Pz() );
+    }
+
 //__________________________________________________________________________________________________
 AliVParticle* AliEmcalJet::GetLeadingTrack(TClonesArray *tracks) const
 {
index 6c35f917877094344a3beecf3fe67275904410a1..589579e46a752f99325e5433f7e8a90663c8e3e0 100644 (file)
@@ -102,6 +102,10 @@ class AliEmcalJet : public AliVParticle
   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;
+  Double_t          GetZ ( const Double_t trkPx, const Double_t trkPy, const Double_t trkPz ) const; // Get Z of constituent trk
+  Double_t          GetZ ( const AliVParticle* trk )       const; // Get Z of constituent trk
+  Double_t          GetXi ( const AliVParticle* trk )      const { return TMath::Log ( 1/GetZ (trk) ); } // Get Xi of constituent trk
+  Double_t          GetXi ( const Double_t trkPx, const Double_t trkPy, const Double_t trkPz ) const { return TMath::Log ( 1/GetZ (trkPx, trkPy, trkPz ) ); } // Get Xi of constituent trk
 
   void              SetLabel(Int_t l)                  { fLabel = l;                       }
   void              SetArea(Double_t a)                { fArea    = a;                     }