]>
Commit | Line | Data |
---|---|---|
dd233e4e | 1 | // $Id$ |
2 | // | |
3 | // Track class with minimal number of information | |
980821ba | 4 | // (targets at selection of primary tracks). |
dd233e4e | 5 | // |
cd231d42 | 6 | // Author: C.Loizides |
dd233e4e | 7 | |
8 | #include "AliPicoTrack.h" | |
b723beb6 | 9 | #include "AliExternalTrackParam.h" |
10 | #include "AliVCluster.h" | |
dd233e4e | 11 | |
12 | //_________________________________________________________________________________________________ | |
13 | AliPicoTrack::AliPicoTrack() : | |
14 | AliVTrack(), | |
5be3857d | 15 | fPt(0), fEta(0), fPhi(0), fQ(0), fLabel(-1), fTrackType(0), fEtaEmc(0), fPhiEmc(0), fEmcal(0), fClusId(-1) |
dd233e4e | 16 | { |
17 | // Default constructor. | |
18 | } | |
19 | ||
20 | //_________________________________________________________________________________________________ | |
39799f2a | 21 | AliPicoTrack::AliPicoTrack(Double_t pt, Double_t eta, Double_t phi, Byte_t q, Int_t lab, Byte_t type, |
dd233e4e | 22 | Double_t etaemc, Double_t phiemc, Bool_t ise) : |
23 | AliVTrack(), | |
39799f2a | 24 | fPt(pt), fEta(eta), fPhi(phi), fQ(q), fLabel(lab), fTrackType(type), |
b723beb6 | 25 | fEtaEmc(etaemc), fPhiEmc(phiemc), fEmcal(ise), fClusId(-1) |
dd233e4e | 26 | { |
27 | // Constructor. | |
28 | } | |
29 | ||
30 | //_________________________________________________________________________________________________ | |
31 | AliPicoTrack::AliPicoTrack(const AliPicoTrack &pc) : | |
32 | AliVTrack(pc), | |
33 | fPt(pc.fPt), fEta(pc.fEta), fPhi(pc.fPhi), | |
39799f2a | 34 | fQ(pc.fQ), fLabel(pc.fLabel), fTrackType(pc.fTrackType), |
b723beb6 | 35 | fEtaEmc(pc.fEtaEmc), fPhiEmc(pc.fPhiEmc), fEmcal(pc.fEmcal), |
36 | fClusId(pc.fClusId) | |
dd233e4e | 37 | { |
38 | // Constructor. | |
39 | } | |
40 | ||
41 | //_________________________________________________________________________________________________ | |
42 | AliPicoTrack &AliPicoTrack::operator=(const AliPicoTrack &pc) | |
43 | { | |
44 | // Assignment operator. | |
45 | ||
46 | if (this!=&pc) { | |
47 | AliVTrack::operator=(pc); | |
48 | fPt = pc.fPt; | |
49 | fEta = pc.fEta; | |
50 | fPhi = pc.fPhi; | |
51 | fQ = pc.fQ; | |
52 | fLabel = pc.fLabel; | |
39799f2a | 53 | fTrackType = pc.fTrackType; |
dd233e4e | 54 | fEtaEmc = pc.fEtaEmc; |
55 | fPhiEmc = pc.fPhiEmc; | |
56 | fEmcal = pc.fEmcal; | |
b723beb6 | 57 | fClusId = pc.fClusId; |
dd233e4e | 58 | } |
59 | ||
60 | return *this; | |
61 | } | |
62 | ||
63 | //_________________________________________________________________________________________________ | |
64 | Int_t AliPicoTrack::Compare(const TObject* obj) const | |
65 | { | |
66 | // Compare this class with an other instance of this class used in a | |
67 | // TCollection::Sort()/TClonesArray::Sort() which is descending. | |
68 | // Returns 0 when equal, 1 when this is smaller and -1 when bigger. | |
69 | ||
70 | const AliPicoTrack *t = dynamic_cast<const AliPicoTrack*>(obj); | |
71 | if (!t) | |
72 | return -1; | |
73 | if (t->Pt()>Pt()) | |
74 | return 1; | |
75 | if (t->Pt()<Pt()) | |
76 | return -1; | |
77 | return 0; | |
78 | } | |
79 | ||
b723beb6 | 80 | //_________________________________________________________________________________________________ |
81 | void AliPicoTrack::GetEtaPhiDiff(AliVTrack *t, AliVCluster *v, Double_t &phidiff, Double_t &etadiff) | |
82 | { | |
83 | // Calculate phi and eta difference between track and cluster. | |
84 | ||
85 | phidiff = 999; | |
86 | etadiff = 999; | |
87 | ||
88 | if (!t||!v) | |
89 | return; | |
90 | ||
91 | if (!t->IsEMCAL()) | |
92 | return; | |
dd233e4e | 93 | |
4d925f52 | 94 | Double_t veta = t->GetTrackEtaOnEMCal(); |
95 | Double_t vphi = t->GetTrackPhiOnEMCal(); | |
b723beb6 | 96 | |
97 | Float_t pos[3] = {0}; | |
98 | v->GetPosition(pos); | |
99 | TVector3 cpos(pos); | |
100 | Double_t ceta = cpos.Eta(); | |
101 | Double_t cphi = cpos.Phi(); | |
102 | etadiff=veta-ceta; | |
103 | phidiff=TVector2::Phi_mpi_pi(vphi-cphi); | |
104 | } |