]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/GammaConv/AliConversionPhotonBase.cxx
modified psi-pair cut for GG-Task
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliConversionPhotonBase.cxx
CommitLineData
2eedd4ed 1#include "AliConversionPhotonBase.h"
2#include <iostream>
3
4using namespace std;
5
6ClassImp(AliConversionPhotonBase)
7
8AliConversionPhotonBase::AliConversionPhotonBase() :
3b77b2d1 9fV0Index(-1),
10 fChi2perNDF(-1),
11 fTagged(kFALSE),
92efd725 12 fIMass(-999),
4803eb1f 13 fPsiPair(-999),
14 fQuality(0)
2eedd4ed 15{
16 //Default constructor
17 fLabel[0] = -1;
18 fLabel[1] = -1;
19
20 fMCLabel[0]=-1;
21 fMCLabel[1]=-1;
22
23
24 fArmenteros[0]=-999;
25 fArmenteros[1]=-999;
26
27 fConversionPoint[0]=-999;
28 fConversionPoint[1]=-999;
29 fConversionPoint[2]=-999;
2eedd4ed 30}
31
32
33AliConversionPhotonBase::AliConversionPhotonBase(const AliConversionPhotonBase & original) :
34fV0Index(original.fV0Index),
35fChi2perNDF(original.fChi2perNDF),
3b77b2d1 36fTagged(original.fTagged),
92efd725 37fIMass(original.fIMass),
4803eb1f 38fPsiPair(original.fPsiPair),
39fQuality(original.fQuality)
2eedd4ed 40 {
41 //Copy constructor
42 fLabel[0] = original.fLabel[0];
43 fLabel[1] = original.fLabel[1];
44
45 fMCLabel[0]=original.fMCLabel[0];
46 fMCLabel[1]=original.fMCLabel[1];
47
48 fArmenteros[0]=original.fArmenteros[0];
49 fArmenteros[1]=original.fArmenteros[1];
50
51 fConversionPoint[0]=original.fConversionPoint[0];
52 fConversionPoint[1]=original.fConversionPoint[1];
53 fConversionPoint[2]=original.fConversionPoint[2];
54
2eedd4ed 55 }
56
57AliConversionPhotonBase::~AliConversionPhotonBase() {
58// empty standard destructor
59
60}
61
62
63AliConversionPhotonBase & AliConversionPhotonBase::operator = (const AliConversionPhotonBase & /*source*/)
64{
65 // assignment operator
66 return *this;
67}
68
69TParticle *AliConversionPhotonBase::GetMCParticle(AliStack *fMCStack){
70 if(!fMCStack){printf("MC Stack not defined");return 0x0;}
71
72 Int_t label=GetMCParticleLabel(fMCStack);
73
74 if(label>-1){
75 return fMCStack->Particle(label);
76 }
77
78 return 0x0;
79}
80
92efd725 81Bool_t AliConversionPhotonBase::IsTruePhoton(AliStack *fMCStack){
82 TParticle *mcgamma=GetMCParticle(fMCStack);
83
84 if(mcgamma){
85 // Check if it is a true photon
86 if(mcgamma->GetPdgCode()==22){
87 return kTRUE;
88 }
89 }
90 return kFALSE;
91}
92
2eedd4ed 93Int_t AliConversionPhotonBase::GetMCParticleLabel(AliStack *fMCStack){
94 if(!fMCStack){printf("MC Stack not defined");return -1;}
95
96 TParticle *fPositiveMCParticle=GetPositiveMCDaughter(fMCStack);
97 TParticle *fNegativeMCParticle=GetNegativeMCDaughter(fMCStack);
98
99 if(!fPositiveMCParticle||!fNegativeMCParticle){return -1;}
100
101 if(fPositiveMCParticle->GetMother(0)>-1&&(fNegativeMCParticle->GetMother(0) == fPositiveMCParticle->GetMother(0))){
102
3b77b2d1 103 return fPositiveMCParticle->GetMother(0);
2eedd4ed 104 }
3b77b2d1 105
106 return -1;
2eedd4ed 107}
108
109
110TParticle *AliConversionPhotonBase::GetMCDaughter(AliStack *fMCStack,Int_t label){
111 if(!fMCStack){printf("MC Stack not defined \n");return 0x0;}
8c3fa0c4 112 if(label<0||label>1){printf("Requested index out of bounds: %i \n",label);return 0x0;}
2eedd4ed 113
114 if(fMCLabel[label]>-1){
115 TParticle *fMCDaughter=fMCStack->Particle(fMCLabel[label]);
116 return fMCDaughter;}
117 else return 0x0;
118}
4803eb1f 119
120///________________________________________________________________________
121void AliConversionPhotonBase::DeterminePhotonQuality(AliVTrack* negTrack, AliVTrack* posTrack){
122
123
124 if(!negTrack || !posTrack) {
125 fQuality = 0;
126 return;
127 }
128 if(negTrack->Charge() == posTrack->Charge()){
129 fQuality = 0;
130 return;
131 }
132 Int_t nClusterITSneg = negTrack->GetNcls(0);
133 Int_t nClusterITSpos = posTrack->GetNcls(0);
134
135 if (nClusterITSneg > 1 && nClusterITSpos > 1){
136 fQuality = 3;
137 return;
138 } else if (nClusterITSneg > 1 || nClusterITSpos > 1){
139 fQuality = 2;
140 return;
141 } else {
142 fQuality = 1;
143 return;
144 }
145 return;
146
147}