Added tasks for full jet analysis in pp (R. Ma)
[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(),
12fOpeningAngle(-1),
13fAlpha(-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) :
22AliKFParticle(d1,d2),
23fOpeningAngle(-1),
24fAlpha(-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
41AliKFConversionMother::AliKFConversionMother(const AliKFConversionPhoton& d1, const AliKFConversionPhoton& d2) :
42AliKFParticle(d1,d2),
43fOpeningAngle(-1),
44fAlpha(-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
61AliKFConversionMother::AliKFConversionMother(const AliKFConversionMother & original) :
62AliKFParticle(original),
63fOpeningAngle(original.fOpeningAngle),
64fAlpha(original.fAlpha)
65{
66 //Copy constructor
67 fLabel[0] = original.fLabel[0];
68 fLabel[1] = original.fLabel[1];
69}
70
71
72AliKFConversionMother & AliKFConversionMother::operator = (const AliKFConversionMother & /*source*/)
73{
74 // assignment operator
75 return *this;
76}
77
78Double_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
88return rapidity;
89}
90
91Double_t AliKFConversionMother::Phi() const
92{
93 Double_t phi = AliKFParticle::GetPhi();
94 if (phi < 0.) phi += 2. * TMath::Pi();
95 return phi;
96}