AliPhysics  1811c8f (1811c8f)
AliConversionPhotonBase.cxx
Go to the documentation of this file.
2 #include <iostream>
3 
4 using namespace std;
5 
7 
9 fV0Index(-1),
10  fChi2perNDF(-1),
11  fTagged(kFALSE),
12  fIMass(-999),
13  fPsiPair(-999),
14  fQuality(0)
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;
30 }
31 
32 
34 fV0Index(original.fV0Index),
35 fChi2perNDF(original.fChi2perNDF),
36 fTagged(original.fTagged),
37 fIMass(original.fIMass),
38 fPsiPair(original.fPsiPair),
39 fQuality(original.fQuality)
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 
55  }
56 
58 // empty standard destructor
59 
60 }
61 
62 
64 {
65  // assignment operator
66  return *this;
67 }
68 
69 TParticle *AliConversionPhotonBase::GetMCParticle(AliMCEvent *mcEvent){
70  if(!mcEvent){printf("MCEvent not defined");return 0x0;}
71 
72  Int_t label=GetMCParticleLabel(mcEvent);
73 
74  if(label>-1){
75  return mcEvent->Particle(label);
76  }
77 
78  return 0x0;
79 }
80 
82  TParticle *mcgamma=GetMCParticle(mcEvent);
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 
94  if(!mcEvent){printf("MCEvent not defined");return -1;}
95 
96  TParticle *fPositiveMCParticle=GetPositiveMCDaughter(mcEvent);
97  TParticle *fNegativeMCParticle=GetNegativeMCDaughter(mcEvent);
98 
99  if(!fPositiveMCParticle||!fNegativeMCParticle){return -1;}
100 
101  if(fPositiveMCParticle->GetMother(0)>-1&&(fNegativeMCParticle->GetMother(0) == fPositiveMCParticle->GetMother(0))){
102 
103  return fPositiveMCParticle->GetMother(0);
104  }
105 
106  return -1;
107 }
108 
109 
110 TParticle *AliConversionPhotonBase::GetMCDaughter(AliMCEvent *mcEvent,Int_t label){
111  if(!mcEvent){printf("MCEvent not defined \n");return 0x0;}
112  if(label<0||label>1){printf("Requested index out of bounds: %i \n",label);return 0x0;}
113 
114  if(fMCLabel[label]>-1){
115  TParticle *fMCDaughter=mcEvent->Particle(fMCLabel[label]);
116  return fMCDaughter;}
117  else return 0x0;
118 }
119 
121 void 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 }
TParticle * GetMCParticle(AliMCEvent *mcEvent)
TParticle * GetPositiveMCDaughter(AliMCEvent *mcEvent)
TParticle * GetNegativeMCDaughter(AliMCEvent *mcEvent)
AliConversionPhotonBase & operator=(const AliConversionPhotonBase &g)
int Int_t
Definition: External.C:63
void DeterminePhotonQuality(AliVTrack *negTrack, AliVTrack *posTrack)
Int_t GetMCParticleLabel(AliMCEvent *mcEvent)
TParticle * GetMCDaughter(AliMCEvent *mcEvent, Int_t label)
bool Bool_t
Definition: External.C:53
Bool_t IsTruePhoton(AliMCEvent *mcEvent)