changes from gsi. Using mult if no centrality. testfilterbit 128
[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),
12 fIMass(-999)
2eedd4ed 13{
14 //Default constructor
15 fLabel[0] = -1;
16 fLabel[1] = -1;
17
18 fMCLabel[0]=-1;
19 fMCLabel[1]=-1;
20
21
22 fArmenteros[0]=-999;
23 fArmenteros[1]=-999;
24
25 fConversionPoint[0]=-999;
26 fConversionPoint[1]=-999;
27 fConversionPoint[2]=-999;
2eedd4ed 28}
29
30
31AliConversionPhotonBase::AliConversionPhotonBase(const AliConversionPhotonBase & original) :
32fV0Index(original.fV0Index),
33fChi2perNDF(original.fChi2perNDF),
3b77b2d1 34fTagged(original.fTagged),
35 fIMass(original.fIMass)
2eedd4ed 36 {
37 //Copy constructor
38 fLabel[0] = original.fLabel[0];
39 fLabel[1] = original.fLabel[1];
40
41 fMCLabel[0]=original.fMCLabel[0];
42 fMCLabel[1]=original.fMCLabel[1];
43
44 fArmenteros[0]=original.fArmenteros[0];
45 fArmenteros[1]=original.fArmenteros[1];
46
47 fConversionPoint[0]=original.fConversionPoint[0];
48 fConversionPoint[1]=original.fConversionPoint[1];
49 fConversionPoint[2]=original.fConversionPoint[2];
50
2eedd4ed 51 }
52
53AliConversionPhotonBase::~AliConversionPhotonBase() {
54// empty standard destructor
55
56}
57
58
59AliConversionPhotonBase & AliConversionPhotonBase::operator = (const AliConversionPhotonBase & /*source*/)
60{
61 // assignment operator
62 return *this;
63}
64
65TParticle *AliConversionPhotonBase::GetMCParticle(AliStack *fMCStack){
66 if(!fMCStack){printf("MC Stack not defined");return 0x0;}
67
68 Int_t label=GetMCParticleLabel(fMCStack);
69
70 if(label>-1){
71 return fMCStack->Particle(label);
72 }
73
74 return 0x0;
75}
76
77Int_t AliConversionPhotonBase::GetMCParticleLabel(AliStack *fMCStack){
78 if(!fMCStack){printf("MC Stack not defined");return -1;}
79
80 TParticle *fPositiveMCParticle=GetPositiveMCDaughter(fMCStack);
81 TParticle *fNegativeMCParticle=GetNegativeMCDaughter(fMCStack);
82
83 if(!fPositiveMCParticle||!fNegativeMCParticle){return -1;}
84
85 if(fPositiveMCParticle->GetMother(0)>-1&&(fNegativeMCParticle->GetMother(0) == fPositiveMCParticle->GetMother(0))){
86
3b77b2d1 87 return fPositiveMCParticle->GetMother(0);
2eedd4ed 88 }
3b77b2d1 89
90 return -1;
2eedd4ed 91}
92
93
94TParticle *AliConversionPhotonBase::GetMCDaughter(AliStack *fMCStack,Int_t label){
95 if(!fMCStack){printf("MC Stack not defined \n");return 0x0;}
8c3fa0c4 96 if(label<0||label>1){printf("Requested index out of bounds: %i \n",label);return 0x0;}
2eedd4ed 97
98 if(fMCLabel[label]>-1){
99 TParticle *fMCDaughter=fMCStack->Particle(fMCLabel[label]);
100 return fMCDaughter;}
101 else return 0x0;
102}