]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/GammaConv/AliKFConversionMother.cxx
Transition PWG4 --> PWGGA
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliKFConversionMother.cxx
1 #include "AliKFConversionMother.h"
2 #include "AliKFParticle.h"
3 #include "TMath.h"
4 #include "TVector3.h"
5
6 using namespace std;
7
8 ClassImp(AliKFConversionMother)
9
10 AliKFConversionMother::AliKFConversionMother() :
11 AliKFParticle(),
12 fOpeningAngle(-1),
13 fAlpha(-1)
14
15 {
16   //Default constructor
17   fLabel[0] = -1;
18   fLabel[1] = -1;
19 }
20
21 /*AliKFConversionMother::AliKFConversionMother(const AliKFParticle& d1, const AliKFParticle& d2) :
22 AliKFParticle(d1,d2),
23 fOpeningAngle(-1),
24 fAlpha(-1)
25
26 {
27   //Default constructor
28   fLabel[0] = -1;
29   fLabel[1] = -1;
30
31         // Calculate Opening Angle
32         TVector3 v1(d1.GetPx(),d1.GetPy(),d1.GetPz());
33         TVector3 v2(d2.GetPx(),d2.GetPy(),d2.GetPz());
34         fOpeningAngle=v1.Angle(v2);
35         // Calculate Alpha
36         if((d1.GetE()+d2.GetE()) != 0){
37             fAlpha=TMath::Abs((d1.GetE()-d2.GetE())/(d1.GetE()+d2.GetE()));
38         }
39 }*/
40
41 AliKFConversionMother::AliKFConversionMother(const AliKFConversionPhoton& d1, const AliKFConversionPhoton& d2) :
42 AliKFParticle(d1,d2),
43 fOpeningAngle(-1),
44 fAlpha(-1)
45
46 {
47   //Default constructor
48     fLabel[0] = -1;
49     fLabel[1] = -1;
50
51         // Calculate Opening Angle
52         TVector3 v1(d1.GetPx(),d1.GetPy(),d1.GetPz());
53         TVector3 v2(d2.GetPx(),d2.GetPy(),d2.GetPz());
54         fOpeningAngle=v1.Angle(v2);
55         // Calculate Alpha
56         if((d1.GetE()+d2.GetE()) != 0){
57             fAlpha=TMath::Abs((d1.GetE()-d2.GetE())/(d1.GetE()+d2.GetE()));
58         }
59 }
60
61 AliKFConversionMother::AliKFConversionMother(const AliKFConversionMother & original) :
62 AliKFParticle(original),
63 fOpeningAngle(original.fOpeningAngle),
64 fAlpha(original.fAlpha)
65 {
66   //Copy constructor
67   fLabel[0] = original.fLabel[0];
68   fLabel[1] = original.fLabel[1];
69 }
70
71
72 AliKFConversionMother & AliKFConversionMother::operator = (const AliKFConversionMother & /*source*/)
73 {
74   // assignment operator
75   return *this;
76 }
77
78 Double_t AliKFConversionMother::GetRapidity()
79 {
80     Double_t rapidity;
81     if(GetE() - GetPz() <= 0 || GetE() + GetPz() <= 0){
82         cout << "Error: |Pz| > E !!!! " << endl;
83         rapidity=8.;
84     } else {
85         rapidity = 0.5*(TMath::Log((GetE() +GetPz()) / (GetE()-GetPz())));
86     }
87
88 return rapidity;
89 }
90
91 Double_t AliKFConversionMother::Phi() const
92 {
93     Double_t phi = AliKFParticle::GetPhi();
94     if (phi < 0.) phi += 2. * TMath::Pi();
95     return phi;
96 }