changed Resolution, Material, and PhotonQA task to be able to run on the grid
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliAODConversionPhoton.cxx
CommitLineData
2eedd4ed 1#include "AliAODConversionPhoton.h"
2#include "AliKFConversionPhoton.h"
3
4using namespace std;
5
6ClassImp(AliAODConversionPhoton)
7
8AliAODConversionPhoton::AliAODConversionPhoton() :
9AliAODConversionParticle(),
4803eb1f 10AliConversionPhotonBase(),
11fDCArPrimVtx(0),
12fDCAzPrimVtx(0)
2eedd4ed 13{
3b77b2d1 14 //Standard constructor
2eedd4ed 15}
16
17AliAODConversionPhoton::AliAODConversionPhoton(AliKFConversionPhoton *kfphoton) :
3b77b2d1 18AliAODConversionParticle(kfphoton),
4803eb1f 19AliConversionPhotonBase(*((AliConversionPhotonBase*)kfphoton)),
20fDCArPrimVtx(0),
21fDCAzPrimVtx(0)
2eedd4ed 22{
92efd725 23 //Constructor from kfphoton
24
25 // puts the mass to zero and store dilepton mass
ae947965 26 SetMass(kfphoton->M());
27 //SetE(P());
2eedd4ed 28}
29
92efd725 30AliAODConversionPhoton::AliAODConversionPhoton(TLorentzVector *vec) :
31AliAODConversionParticle(vec),
4803eb1f 32AliConversionPhotonBase(),
33fDCArPrimVtx(0),
34fDCAzPrimVtx(0)
92efd725 35{
36 //Constructor from TLorentzVector
37}
38
39
40
2eedd4ed 41AliAODConversionPhoton::AliAODConversionPhoton(const AliAODConversionPhoton & original) :
42AliAODConversionParticle(original),
4803eb1f 43AliConversionPhotonBase(original),
44fDCArPrimVtx(original.fDCArPrimVtx),
45fDCAzPrimVtx(original.fDCAzPrimVtx)
2eedd4ed 46{
3b77b2d1 47 //Copy constructor
2eedd4ed 48}
49
3b77b2d1 50AliAODConversionPhoton::~AliAODConversionPhoton()
51{
52 // empty standard destructor
2eedd4ed 53}
54
55AliAODConversionPhoton & AliAODConversionPhoton::operator = (const AliAODConversionPhoton & /*source*/)
56{
57 // assignment operator
58 return *this;
59}
4803eb1f 60
61///________________________________________________________________________
62void AliAODConversionPhoton::CalculateDistanceOfClossetApproachToPrimVtx(const AliVVertex* primVertex ){
63
64 Double_t primCo[3] = {primVertex->GetX(),primVertex->GetY(),primVertex->GetZ()};
65
66 Double_t absoluteP = TMath::Sqrt(TMath::Power(GetPx(),2) + TMath::Power(GetPy(),2) + TMath::Power(GetPz(),2));
67 Double_t p[3] = {GetPx()/absoluteP,GetPy()/absoluteP,GetPz()/absoluteP};
68 Double_t CP[3];
69
70 CP[0] = fConversionPoint[0] - primCo[0];
71 CP[1] = fConversionPoint[1] - primCo[1];
72 CP[2] = fConversionPoint[2] - primCo[2];
73
74 Double_t Lambda = - (CP[0]*p[0]+CP[1]*p[1]+CP[2]*p[2])/(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
75
76 Double_t S[3];
77 S[0] = fConversionPoint[0] + p[0]*Lambda;
78 S[1] = fConversionPoint[1] + p[1]*Lambda;
79 S[2] = fConversionPoint[2] + p[2]*Lambda;
80
81 fDCArPrimVtx = TMath::Sqrt( TMath::Power(primCo[0]-S[0],2) + TMath::Power(primCo[1]-S[1],2));
82 fDCAzPrimVtx = primCo[2]-S[2];
83
84 return;
85}
86