]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/AliPicoTrack.cxx
856d28868b2a45519df4a5f14f6d12b997dca331
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliPicoTrack.cxx
1 // $Id$
2 //
3 // Track class with minimal number of information 
4 // (targets at selection of primary tracks)
5 //
6
7 #include "AliPicoTrack.h"
8
9 //_________________________________________________________________________________________________
10 AliPicoTrack::AliPicoTrack() :
11   AliVTrack(),
12   fPt(0), fEta(0), fPhi(0), fQ(0), fLabel(-1), fEtaEmc(0), fPhiEmc(0), fEmcal(0)
13 {
14   // Default constructor.
15 }
16
17 //_________________________________________________________________________________________________
18 AliPicoTrack::AliPicoTrack(Double_t pt, Double_t eta, Double_t phi, Byte_t q, Byte_t lab, 
19                            Double_t etaemc, Double_t phiemc, Bool_t ise) :
20   AliVTrack(),
21   fPt(pt), fEta(eta), fPhi(phi), fQ(q), fLabel(lab), 
22   fEtaEmc(etaemc), fPhiEmc(phiemc), fEmcal(ise)
23 {
24   // Constructor.
25 }
26   
27 //_________________________________________________________________________________________________
28 AliPicoTrack::AliPicoTrack(const AliPicoTrack &pc) :
29   AliVTrack(pc),
30   fPt(pc.fPt), fEta(pc.fEta), fPhi(pc.fPhi), 
31   fQ(pc.fQ), fLabel(pc.fLabel), 
32   fEtaEmc(pc.fEtaEmc), fPhiEmc(pc.fPhiEmc), fEmcal(pc.fEmcal)
33 {
34   // Constructor.
35 }
36
37 //_________________________________________________________________________________________________
38 AliPicoTrack &AliPicoTrack::operator=(const AliPicoTrack &pc)
39 {
40   // Assignment operator.
41
42   if (this!=&pc) {
43     AliVTrack::operator=(pc);
44     fPt     = pc.fPt;
45     fEta    = pc.fEta;
46     fPhi    = pc.fPhi;
47     fQ      = pc.fQ;
48     fLabel  = pc.fLabel;
49     fEtaEmc = pc.fEtaEmc;
50     fPhiEmc = pc.fPhiEmc;
51     fEmcal  = pc.fEmcal;
52   }
53
54   return *this;
55 }
56
57 //_________________________________________________________________________________________________
58 Int_t AliPicoTrack::Compare(const TObject* obj) const
59 {
60   // Compare this class with an other instance of this class used in a 
61   // TCollection::Sort()/TClonesArray::Sort() which is descending.
62   // Returns 0 when equal, 1 when this is smaller and -1 when bigger.
63
64   const AliPicoTrack *t = dynamic_cast<const AliPicoTrack*>(obj);
65   if (!t) 
66     return -1;
67   if (t->Pt()>Pt())
68     return 1;
69   if (t->Pt()<Pt())
70     return -1;
71   return 0;
72 }
73
74