TENDER becomes Tender, removing .so
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliKFConversionPhoton.cxx
1 #include "AliKFConversionPhoton.h"
2 // #include "AliV0Reader.h"
3 #include "AliESDtrack.h"
4 #include "AliESDpid.h"
5 #include <iostream>
6
7
8 using namespace std;
9
10 ClassImp(AliKFConversionPhoton)
11
12 AliKFConversionPhoton::AliKFConversionPhoton() :
13 AliKFParticle(),
14     AliConversionPhotonBase()
15 {
16   //Default constructor
17 }
18
19 AliKFConversionPhoton::AliKFConversionPhoton(AliKFParticle & kfparticle) :
20 AliKFParticle(kfparticle),
21 AliConversionPhotonBase()
22
23 {
24   //Default constructor
25
26 }
27
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 // }
55                                                                
56 AliKFConversionPhoton::AliKFConversionPhoton(const AliKFParticle &fCurrentNegativeKFParticle,const AliKFParticle &fCurrentPositiveKFParticle) :
57 AliKFParticle(fCurrentNegativeKFParticle,fCurrentPositiveKFParticle),
58 AliConversionPhotonBase()
59 {
60     SetArmenterosQtAlpha(fArmenteros,fCurrentNegativeKFParticle,fCurrentPositiveKFParticle);
61
62     if(GetNDF())fChi2perNDF=GetChi2()/GetNDF();
63     else{fChi2perNDF=-1;}
64
65 }
66
67
68 AliKFConversionPhoton::AliKFConversionPhoton(const AliKFConversionPhoton & original) :
69 AliKFParticle(original),
70 AliConversionPhotonBase(original)
71 {
72 }
73
74 void AliKFConversionPhoton::ConstructGamma(const AliKFParticle &fCurrentNegativeKFParticle,const AliKFParticle &fCurrentPositiveKFParticle)
75 {
76
77     AliKFParticle::ConstructGamma(fCurrentNegativeKFParticle,fCurrentPositiveKFParticle);
78
79
80     SetArmenterosQtAlpha(fArmenteros,fCurrentNegativeKFParticle,fCurrentPositiveKFParticle);
81 }
82
83 AliKFConversionPhoton & AliKFConversionPhoton::operator = (const AliKFConversionPhoton & /*source*/)
84 {
85   // assignment operator
86   return *this;
87 }
88
89
90 void AliKFConversionPhoton::SetArmenterosQtAlpha(Double_t armenteros[2],const AliKFParticle &fCurrentNegativeParticle,const AliKFParticle &fCurrentPositiveParticle){
91
92
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);
105 }
106
107
108 Double_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