]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGJE/EMCALJetTasks/AliEmcalJet.cxx
setter to assume pion mass for clusters
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / AliEmcalJet.cxx
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
 {