]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/GammaConv/AliGammaConversionAODObject.cxx
Updated gamma jet task
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / AliGammaConversionAODObject.cxx
CommitLineData
d7d7e825 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
332f1f44 4 * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt, Svein Lindal *
d7d7e825 5 * Version 1.0 *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16////////////////////////////////////////////////
17//---------------------------------------------
18// Class containing the aod information we need
19//---------------------------------------------
20////////////////////////////////////////////////
21
22#include "AliGammaConversionAODObject.h"
4a6157dc 23//#include "AliAODv0.h"
d7d7e825 24#include "AliStack.h"
25#include "AliESDEvent.h"
4a6157dc 26//#include "AliESDtrack.h"
d7d7e825 27#include "TParticle.h"
28
4a6157dc 29class AliAODv0;
30class AliESDtrack;
31
d7d7e825 32using namespace std;
33
34ClassImp(AliGammaConversionAODObject)
35
36
37
38AliGammaConversionAODObject::AliGammaConversionAODObject() :
39 TObject(),
40 fPx(0),
41 fPy(0),
42 fPz(0),
43 fLabel1(-1),
44 fLabel2(-1),
332f1f44 45 fChi2(0),
d7d7e825 46 fMCStack(NULL),
47 fESDEvent(NULL)
48{
332f1f44 49 //Default constructor
d7d7e825 50}
51
52
53AliGammaConversionAODObject::AliGammaConversionAODObject(const AliGammaConversionAODObject & original) :
54 TObject(original),
55 fPx(original.fPx),
56 fPy(original.fPy),
57 fPz(original.fPz),
58 fLabel1(original.fLabel1),
59 fLabel2(original.fLabel2),
332f1f44 60 fChi2(original.fChi2),
d7d7e825 61 fMCStack(original.fMCStack),
62 fESDEvent(original.fESDEvent)
63{
332f1f44 64 //Copy constructor
d7d7e825 65}
66
67
68AliGammaConversionAODObject & AliGammaConversionAODObject::operator = (const AliGammaConversionAODObject & /*source*/)
69{
70 // assignment operator
71 return *this;
72}
73
74Int_t AliGammaConversionAODObject::GetGammaMCLabel() const{
75 // returns the MC label of the gamma (if both electrons have the same mother)
76 Int_t iResult = -1;
77 if(fMCStack != NULL){
78 Int_t mcLabel1= GetElectronMCLabel1();
79 Int_t mcLabel2= GetElectronMCLabel2();
80 if(mcLabel1>=0 && mcLabel2>=0){
81 TParticle *electron1 = fMCStack->Particle(mcLabel1);
82 TParticle *electron2 = fMCStack->Particle(mcLabel2);
83 if(electron1->GetMother(0) == electron2->GetMother(0)){
84 iResult = electron1->GetMother(0);
85 }
86 }
87 }
88 return iResult;
89}
90
91Int_t AliGammaConversionAODObject::GetElectronUniqueID() const{
92 // returns the unique id of the electrons if they have the same mother and unique id
93 Int_t iResult = -1;
94 if(fMCStack != NULL){
95 Int_t mcLabel1= GetElectronMCLabel1();
96 Int_t mcLabel2= GetElectronMCLabel2();
97 if(mcLabel1>=0 && mcLabel2>=0){
98 TParticle *electron1 = fMCStack->Particle(mcLabel1);
99 TParticle *electron2 = fMCStack->Particle(mcLabel2);
100 if(electron1->GetMother(0) == electron2->GetMother(0)){
101 if(electron1->GetUniqueID() == electron2->GetUniqueID()){
102 iResult = (Int_t)electron1->GetUniqueID();
103 }
104 }
105 }
106 }
107 return iResult;
108}
109
110Int_t AliGammaConversionAODObject::GetElectronMCLabel1() const{
111 //returns the MC label of the first electron
112 Int_t iResult=-1;
113 if(fESDEvent != NULL){
114 if(fLabel1>=0){
115 iResult = (fESDEvent->GetTrack(fLabel1))->GetLabel();
116 }
117 }
118 return iResult;
119}
120
121Int_t AliGammaConversionAODObject::GetElectronMCLabel2() const{
122 //returns the MC label of the first electron
123 Int_t iResult=-1;
124 if(fESDEvent != NULL){
125 if(fLabel2>=0){
126 iResult = (fESDEvent->GetTrack(fLabel2))->GetLabel();
127 }
128 }
129 return iResult;
130}