2 // Track class with minimal number of information
3 // (targets at selection of primary tracks).
7 #include "AliPicoTrack.h"
8 #include "AliExternalTrackParam.h"
9 #include "AliVCluster.h"
11 //_________________________________________________________________________________________________
12 AliPicoTrack::AliPicoTrack() :
14 fPt(0), fEta(0), fPhi(0), fM(0.13957), fQ(0), fLabel(-1), fTrackType(0),
15 fEtaEmc(0), fPhiEmc(0), fPtEmc(0), fEmcal(0), fFlag(0), fGeneratorIndex(-1), fClusId(-1), fOrig(0)
17 // Default constructor.
20 //_________________________________________________________________________________________________
21 AliPicoTrack::AliPicoTrack(Double_t pt, Double_t eta, Double_t phi, Byte_t q, Int_t lab, Byte_t type,
22 Double_t etaemc, Double_t phiemc, Double_t ptemc, Bool_t ise, Double_t mass) :
24 fPt(pt), fEta(eta), fPhi(phi), fM(mass), fQ(q), fLabel(lab), fTrackType(type),
25 fEtaEmc(etaemc), fPhiEmc(phiemc), fPtEmc(ptemc), fEmcal(ise), fFlag(0), fGeneratorIndex(-1), fClusId(-1), fOrig(0)
30 //_________________________________________________________________________________________________
31 AliPicoTrack::AliPicoTrack(const AliPicoTrack &pc) :
33 fPt(pc.fPt), fEta(pc.fEta), fPhi(pc.fPhi), fM(pc.fM),
34 fQ(pc.fQ), fLabel(pc.fLabel), fTrackType(pc.fTrackType),
35 fEtaEmc(pc.fEtaEmc), fPhiEmc(pc.fPhiEmc), fPtEmc(pc.fPtEmc), fEmcal(pc.fEmcal), fFlag(pc.fFlag), fGeneratorIndex(pc.fGeneratorIndex),
36 fClusId(pc.fClusId), fOrig(pc.fOrig)
41 //_________________________________________________________________________________________________
42 AliPicoTrack &AliPicoTrack::operator=(const AliPicoTrack &pc)
44 // Assignment operator.
47 AliVTrack::operator=(pc);
54 fTrackType = pc.fTrackType;
60 fGeneratorIndex = pc.fGeneratorIndex;
68 //_________________________________________________________________________________________________
69 Int_t AliPicoTrack::Compare(const TObject* obj) const
71 // Compare this class with an other instance of this class used in a
72 // TCollection::Sort()/TClonesArray::Sort() which is descending.
73 // Returns 0 when equal, 1 when this is smaller and -1 when bigger.
75 const AliPicoTrack *t = dynamic_cast<const AliPicoTrack*>(obj);
85 //_________________________________________________________________________________________________
86 void AliPicoTrack::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
88 // Calculate phi and eta difference between track and cluster.
99 Double_t veta = t->GetTrackEtaOnEMCal();
100 Double_t vphi = t->GetTrackPhiOnEMCal();
102 Float_t pos[3] = {0};
105 Double_t ceta = cpos.Eta();
106 Double_t cphi = cpos.Phi();
108 phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
111 //_________________________________________________________________________________________________
112 Byte_t AliPicoTrack::GetTrackType(const AliVTrack *t)
114 // Get track type encoded from bits 20 and 21.
117 if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
119 else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
121 else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))