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