]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG/EMCAL/AliPicoTrack.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / EMCAL / AliPicoTrack.cxx
index bee93b0aa9679bd098e3285ce2be74954a27576f..327556cc32e4d8300fd0b0f55c0d2916f6e052f3 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 //
 // Track class with minimal number of information 
 // (targets at selection of primary tracks).
 //_________________________________________________________________________________________________
 AliPicoTrack::AliPicoTrack() :
   AliVTrack(),
-  fPt(0), fEta(0), fPhi(0), fQ(0), fLabel(-1), fTrackType(0), fEtaEmc(0), fPhiEmc(0), fPtEmc(0), fEmcal(0), fClusId(-1)
+  fPt(0), fEta(0), fPhi(0), fM(0.13957), fQ(0), fLabel(-1), fTrackType(0), 
+  fEtaEmc(0), fPhiEmc(0), fPtEmc(0), fEmcal(0), fFlag(0), fGeneratorIndex(-1), fClusId(-1), fOrig(0)
 {
   // Default constructor.
 }
 
 //_________________________________________________________________________________________________
 AliPicoTrack::AliPicoTrack(Double_t pt, Double_t eta, Double_t phi, Byte_t q, Int_t lab, Byte_t type,
-                           Double_t etaemc, Double_t phiemc, Double_t ptemc, Bool_t ise) :
+                           Double_t etaemc, Double_t phiemc, Double_t ptemc, Bool_t ise, Double_t mass) :
   AliVTrack(),
-  fPt(pt), fEta(eta), fPhi(phi), fQ(q), fLabel(lab), fTrackType(type), 
-  fEtaEmc(etaemc), fPhiEmc(phiemc), fPtEmc(ptemc), fEmcal(ise), fClusId(-1)
+  fPt(pt), fEta(eta), fPhi(phi), fM(mass), fQ(q), fLabel(lab), fTrackType(type), 
+  fEtaEmc(etaemc), fPhiEmc(phiemc), fPtEmc(ptemc), fEmcal(ise), fFlag(0), fGeneratorIndex(-1), fClusId(-1), fOrig(0)
 {
   // Constructor.
 }
@@ -30,10 +30,10 @@ AliPicoTrack::AliPicoTrack(Double_t pt, Double_t eta, Double_t phi, Byte_t q, In
 //_________________________________________________________________________________________________
 AliPicoTrack::AliPicoTrack(const AliPicoTrack &pc) :
   AliVTrack(pc),
-  fPt(pc.fPt), fEta(pc.fEta), fPhi(pc.fPhi), 
+  fPt(pc.fPt), fEta(pc.fEta), fPhi(pc.fPhi), fM(pc.fM),
   fQ(pc.fQ), fLabel(pc.fLabel), fTrackType(pc.fTrackType),  
-  fEtaEmc(pc.fEtaEmc), fPhiEmc(pc.fPhiEmc), fPtEmc(pc.fPtEmc), fEmcal(pc.fEmcal),
-  fClusId(pc.fClusId)
+  fEtaEmc(pc.fEtaEmc), fPhiEmc(pc.fPhiEmc), fPtEmc(pc.fPtEmc), fEmcal(pc.fEmcal), fFlag(pc.fFlag), fGeneratorIndex(pc.fGeneratorIndex),
+  fClusId(pc.fClusId), fOrig(pc.fOrig)
 {
   // Constructor.
 }
@@ -48,6 +48,7 @@ AliPicoTrack &AliPicoTrack::operator=(const AliPicoTrack &pc)
     fPt     = pc.fPt;
     fEta    = pc.fEta;
     fPhi    = pc.fPhi;
+    fM      = pc.fM;
     fQ      = pc.fQ;
     fLabel  = pc.fLabel;
     fTrackType = pc.fTrackType;
@@ -55,7 +56,10 @@ AliPicoTrack &AliPicoTrack::operator=(const AliPicoTrack &pc)
     fPhiEmc = pc.fPhiEmc;
     fPtEmc  = pc.fPtEmc;
     fEmcal  = pc.fEmcal;
+    fFlag  = pc.fFlag;
+    fGeneratorIndex  = pc.fGeneratorIndex;
     fClusId = pc.fClusId;
+    fOrig = pc.fOrig;
   }
 
   return *this;
@@ -79,7 +83,7 @@ Int_t AliPicoTrack::Compare(const TObject* obj) const
 }
 
 //_________________________________________________________________________________________________
-void AliPicoTrack::GetEtaPhiDiff(AliVTrack *t, AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
+void AliPicoTrack::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
 {
   // Calculate phi and eta difference between track and cluster.
  
@@ -103,3 +107,18 @@ void AliPicoTrack::GetEtaPhiDiff(AliVTrack *t, AliVCluster *v, Double_t &phidiff
   etadiff=veta-ceta;
   phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
 }
+
+//_________________________________________________________________________________________________
+Byte_t AliPicoTrack::GetTrackType(const AliVTrack *t)
+{
+  // Get track type encoded from bits 20 and 21.
+
+  Byte_t ret = 0;
+  if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
+    ret = 1;
+  else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
+    ret = 2;
+  else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
+    ret = 3;
+  return ret;
+}