AliPhysics  4a7363b (4a7363b)
AliConversionPhotonBase.cxx
Go to the documentation of this file.
2 #include <iostream>
3 
4 using namespace std;
5 
7 
9  fChi2perNDF(-1),
10  fIMass(-999),
11  fPsiPair(-999),
12  fV0Index(-1),
13  fQuality(0),
14  fTagged(kFALSE)
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  fChi2perNDF(original.fChi2perNDF),
35  fIMass(original.fIMass),
36  fPsiPair(original.fPsiPair),
37  fV0Index(original.fV0Index),
38  fQuality(original.fQuality),
39  fTagged(original.fTagged)
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  return fPositiveMCParticle->GetMother(0);
103  }
104 
105  return -1;
106 }
107 
108 
109 TParticle *AliConversionPhotonBase::GetMCDaughter(AliMCEvent *mcEvent,Int_t label){
110  if(!mcEvent){printf("MCEvent not defined \n");return 0x0;}
111  if(label<0||label>1){printf("Requested index out of bounds: %i \n",label);return 0x0;}
112 
113  if(fMCLabel[label]>-1){
114  TParticle *fMCDaughter=mcEvent->Particle(fMCLabel[label]);
115  return fMCDaughter;
116  }
117  else return 0x0;
118 }
119 
121 void AliConversionPhotonBase::DeterminePhotonQuality(AliVTrack* negTrack, AliVTrack* posTrack){
122  if(!negTrack || !posTrack) {
123  fQuality = 0;
124  return;
125  }
126  if(negTrack->Charge() == posTrack->Charge()){
127  fQuality = 0;
128  return;
129  }
130  Int_t nClusterITSneg = negTrack->GetNcls(0);
131  Int_t nClusterITSpos = posTrack->GetNcls(0);
132 
133  if (nClusterITSneg > 1 && nClusterITSpos > 1){
134  fQuality = 3;
135  return;
136  } else if (nClusterITSneg > 1 || nClusterITSpos > 1){
137  fQuality = 2;
138  return;
139  } else {
140  fQuality = 1;
141  return;
142  }
143  return;
144 }
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)