-Move cent, z axis into sparse
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliKFConversionPhoton.cxx
CommitLineData
2eedd4ed 1#include "AliKFConversionPhoton.h"
0a2b2b4b 2// #include "AliV0Reader.h"
2eedd4ed 3#include "AliESDtrack.h"
4#include "AliESDpid.h"
5#include <iostream>
6
7
8using namespace std;
9
10ClassImp(AliKFConversionPhoton)
11
12AliKFConversionPhoton::AliKFConversionPhoton() :
13AliKFParticle(),
14 AliConversionPhotonBase()
15{
16 //Default constructor
17}
18
19AliKFConversionPhoton::AliKFConversionPhoton(AliKFParticle & kfparticle) :
20AliKFParticle(kfparticle),
21AliConversionPhotonBase()
22
23{
24 //Default constructor
25
26}
27
0a2b2b4b 28// AliKFConversionPhoton::AliKFConversionPhoton(AliV0Reader *fV0Reader) ://,AliESDEvent *fESDEvent) :
29// AliKFParticle(*fV0Reader->GetMotherCandidateKFCombination()),
30// AliConversionPhotonBase()
31//
32// {
33//
34// fV0Index=fV0Reader->GetCurrentV0IndexNumber()-1; //?? Checked and its correct
35//
36// //Default constructor
37// fLabel[0] = fV0Reader->GetCurrentV0()->GetPindex();
38// fLabel[1] = fV0Reader->GetCurrentV0()->GetNindex();
39//
40// SetArmenterosQtAlpha(fArmenteros,*fV0Reader->GetNegativeKFParticle(),*fV0Reader->GetPositiveKFParticle());
41//
42// fConversionPoint[0]=fV0Reader->GetX();
43// fConversionPoint[1]=fV0Reader->GetY();
44// fConversionPoint[2]=fV0Reader->GetZ();
45//
46// //Chi2
47//
48// Double_t ndf=fV0Reader->GetMotherCandidateNDF();
49// if(ndf>0)fChi2perNDF=fV0Reader->GetMotherCandidateChi2()/ndf;
50//
51//
52// SetPsiPair(fV0Reader->GetPsiPair(fV0Reader->GetCurrentV0()));
53//
54// }
2eedd4ed 55
56AliKFConversionPhoton::AliKFConversionPhoton(const AliKFParticle &fCurrentNegativeKFParticle,const AliKFParticle &fCurrentPositiveKFParticle) :
57AliKFParticle(fCurrentNegativeKFParticle,fCurrentPositiveKFParticle),
58AliConversionPhotonBase()
59{
60 SetArmenterosQtAlpha(fArmenteros,fCurrentNegativeKFParticle,fCurrentPositiveKFParticle);
61
62 if(GetNDF())fChi2perNDF=GetChi2()/GetNDF();
63 else{fChi2perNDF=-1;}
64
65}
66
67
68AliKFConversionPhoton::AliKFConversionPhoton(const AliKFConversionPhoton & original) :
69AliKFParticle(original),
70AliConversionPhotonBase(original)
71{
72}
73
74void AliKFConversionPhoton::ConstructGamma(const AliKFParticle &fCurrentNegativeKFParticle,const AliKFParticle &fCurrentPositiveKFParticle)
75{
76
77 AliKFParticle::ConstructGamma(fCurrentNegativeKFParticle,fCurrentPositiveKFParticle);
78
79
80 SetArmenterosQtAlpha(fArmenteros,fCurrentNegativeKFParticle,fCurrentPositiveKFParticle);
81}
82
83AliKFConversionPhoton & AliKFConversionPhoton::operator = (const AliKFConversionPhoton & /*source*/)
84{
85 // assignment operator
86 return *this;
87}
88
89
90void AliKFConversionPhoton::SetArmenterosQtAlpha(Double_t armenteros[2],const AliKFParticle &fCurrentNegativeParticle,const AliKFParticle &fCurrentPositiveParticle){
91
2eedd4ed 92
92efd725 93 AliKFParticle PosParticle = fCurrentPositiveParticle;
94 AliKFParticle NegParticle = fCurrentNegativeParticle;
95
96 AliKFParticle Gamma;
97 Gamma += fCurrentPositiveParticle;
98 Gamma += fCurrentNegativeParticle;
99
100 Double_t VertexGamma[3] = {Gamma.GetX(), Gamma.GetY(), Gamma.GetZ()};
101 PosParticle.TransportToPoint(VertexGamma);
102 NegParticle.TransportToPoint(VertexGamma);
103
104 AliKFParticle::GetArmenterosPodolanski(PosParticle,NegParticle, armenteros);
2eedd4ed 105}
106
107
108Double_t AliKFConversionPhoton::Phi() const
109{
110
111
112 Double_t phi = AliKFParticle::GetPhi();
113 if (phi < 0.) phi += 2. * TMath::Pi();
114 return phi;
115}
116