Keep e+e- from pair production of primary gammas.
[u/mrichter/AliRoot.git] / PWG3 / muon / AliMCMuonPair.cxx
CommitLineData
4292b3b6 1#include "AliAODMuonPair.h"
2#include "AliMCMuonTrack.h"
3#include "AliMCMuonPair.h"
4
5ClassImp(AliAODMuonPair)
6
7//-----------------------------------------------------------------------------
8AliMCMuonPair::AliMCMuonPair() :
9AliAODMuonPair(),
10fIsFull(kFALSE),
11fPGen(),
12fSource(-1)
13{
14 //
15 // default constructor
16 //
17 for (Int_t i=0; i<2; i++) fTrk[i] = 0;
18
19}
20
21//-----------------------------------------------------------------------------
22AliMCMuonPair::AliMCMuonPair(AliMCMuonTrack *trk0, AliMCMuonTrack *trk1, Bool_t full) :
23AliAODMuonPair(),
24fIsFull(full),
25fPGen(),
26fSource(-1)
27{
28 //
29 // default constructor
30 //
31 fTrk[0] = trk0;
32 fTrk[1] = trk1;
33 fPGen = trk0->GetPGen() + trk1->GetPGen();
34 AliAODMuonPair::FillPairInfo();
35 if (fIsFull) this->FindDimuonSourceFull();
36 else this->FindDimuonSourceFast();
37}
38
39//-----------------------------------------------------------------------------
40AliMCMuonPair::~AliMCMuonPair()
41{
42 //
43 // destructor
44 //
45}
46
47//-----------------------------------------------------------------------------
48void AliMCMuonPair::FindDimuonSourceFast()
49{
50 AliMCMuonTrack *trk0 = (AliMCMuonTrack*)fTrk[0].GetObject();
51 Int_t src0 = trk0->GetSource();
52 if (src0<0 || src0==4 || src0==3) {
53 fSource=5; return;
54 }
55
56 AliMCMuonTrack *trk1 = (AliMCMuonTrack*)fTrk[1].GetObject();
57 Int_t src1 = trk1->GetSource();
58 if (src1<0 || src1==4 || src1==3) {
59 fSource=5; return;
60 }
61
62 // Drell-Yan is expected very small at LHC, we ingore it
63 Int_t np0 = trk0->GetNParents() - 1;
64 if (np0<0) {
65 fSource=5; return;
66 }
67
68 Int_t np1 = trk1->GetNParents() - 1;
69 if (np1<0) {
70 fSource=5; return;
71 }
72
73 if (trk0->IsMotherAResonance(np0) && trk1->IsMotherAResonance(np1) &&
74 (trk0->GetParentIndex(np0))==(trk1->GetParentIndex(np1))) {
75 fSource=4; return;
76 }
77
78 if (src0==0 && src1==0) {
79 if ((trk0->GetParentIndex(0))==(trk1->GetParentIndex(0)))
80 fSource = 1;
81 else
82 fSource = 0;
83 return;
84 }
85
86 if (src0==1 && src1==1) {
87 if ((trk0->GetParentIndex(0))==(trk1->GetParentIndex(0)))
88 fSource = 3;
89 else
90 fSource = 2;
91 return;
92 }
93
94 fSource = 5;
95 return;
96}