Keep e+e- from pair production of primary gammas.
[u/mrichter/AliRoot.git] / PWG3 / muon / AliAODMuonTrack.cxx
CommitLineData
4292b3b6 1#include <TObject.h>
2#include <TDatabasePDG.h>
3#include <TLorentzVector.h>
4#include <TClonesArray.h>
5
6#include "AliAODTrack.h"
7#include "AliESDMuonTrack.h"
8#include "AliMCMuonTrack.h"
9#include "AliAODMuonTrack.h"
10
11ClassImp(AliAODMuonTrack)
12
13//-----------------------------------------------------------------------------
14AliAODMuonTrack::AliAODMuonTrack() :
15TObject(),
16fP(),
17fCharge(0),
18fTrigger(0),
19fDca(0.),
20fChi2(0.),
21fCentr(0.)
22{
23 //
24 // default constructor
25 //
26}
27
28//-----------------------------------------------------------------------------
29AliAODMuonTrack::AliAODMuonTrack(AliAODTrack *trk) :
30TObject(),
31fP(),
32fCharge(0),
33fTrigger(0),
34fDca(0.),
35fChi2(0.),
36fCentr(0.)
37{
38 //
39 // default constructor
40 //
41 this->FillTrackInfo(trk);
42}
43
44//-----------------------------------------------------------------------------
45AliAODMuonTrack::AliAODMuonTrack(AliESDMuonTrack *trk) :
46TObject(),
47fP(),
48fCharge(0),
49fTrigger(0),
50fDca(0.),
51fChi2(0.),
52fCentr(0.)
53{
54 //
55 // default constructor
56 //
57 this->FillTrackInfo(trk);
58}
59
60//-----------------------------------------------------------------------------
61AliAODMuonTrack::~AliAODMuonTrack()
62{
63 //
64 // destructor
65 //
66}
67
68//-----------------------------------------------------------------------------
69void AliAODMuonTrack::FillTrackInfo(AliAODTrack *trk)
70{
71 Double_t mMu = TDatabasePDG::Instance()->GetParticle(13)->Mass();
72 Double_t px = trk->Px();
73 Double_t py = trk->Py();
74 Double_t pz = trk->Pz();
75 Double_t energy = TMath::Sqrt(mMu*mMu + px*px + py*py + pz*pz);
76 fP.SetPxPyPzE(px,py,pz,energy);
77 fCharge = trk->Charge();
78 fTrigger = trk->GetMatchTrigger();
79 fDca = trk->DCA();
80 fChi2 = trk->Chi2perNDF();
81 return;
82}
83
84//-----------------------------------------------------------------------------
85void AliAODMuonTrack::FillTrackInfo(AliESDMuonTrack *trk)
86{
87 trk->LorentzP(fP);
88 fCharge = trk->Charge();
89 fTrigger = trk->GetMatchTrigger();
90 fDca = trk->GetDCA();
91 fChi2 = trk->GetChi2()/(2.*trk->GetNHit()-5.);
92 return;
93}
94
95//-----------------------------------------------------------------------------
96Bool_t AliAODMuonTrack::SelectSingleMuon(Double_t cuts[10])
97{
98 TLorentzVector lorentzP = this->GetP();
99 Double_t p = lorentzP.P();
100 if (p<cuts[0] || (p>cuts[1])) return kFALSE;
101
102 Double_t pt = lorentzP.Pt();
103 if (pt<cuts[2] || pt>cuts[3]) return kFALSE;
104
105 Double_t eta = lorentzP.Eta();
106 if (eta<cuts[4] || eta>cuts[5]) return kFALSE;
107
108 Double_t dca = this->GetDCA();
109 if (dca<cuts[6] || dca>cuts[7]) return kFALSE;
110
111 Int_t trigger = this->GetTrigger();
112 if (trigger<cuts[8] || trigger>cuts[9]) return kFALSE;
113
114 return kTRUE;
115}