]>
Commit | Line | Data |
---|---|---|
1 | /************************************************************************** | |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt, Svein Lindal * | |
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" | |
23 | //#include "AliAODv0.h" | |
24 | #include "AliStack.h" | |
25 | #include "AliESDEvent.h" | |
26 | //#include "AliESDtrack.h" | |
27 | #include "TParticle.h" | |
28 | ||
29 | class AliAODv0; | |
30 | class AliESDtrack; | |
31 | ||
32 | using namespace std; | |
33 | ||
34 | ClassImp(AliGammaConversionAODObject) | |
35 | ||
36 | ||
37 | ||
38 | AliGammaConversionAODObject::AliGammaConversionAODObject() : | |
39 | TObject(), | |
40 | fPx(0), | |
41 | fPy(0), | |
42 | fPz(0), | |
43 | fLabel1(-1), | |
44 | fLabel2(-1), | |
45 | fChi2(0), | |
46 | fMCStack(NULL), | |
47 | fESDEvent(NULL) | |
48 | { | |
49 | //Default constructor | |
50 | } | |
51 | ||
52 | ||
53 | AliGammaConversionAODObject::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), | |
60 | fChi2(original.fChi2), | |
61 | fMCStack(original.fMCStack), | |
62 | fESDEvent(original.fESDEvent) | |
63 | { | |
64 | //Copy constructor | |
65 | } | |
66 | ||
67 | ||
68 | AliGammaConversionAODObject & AliGammaConversionAODObject::operator = (const AliGammaConversionAODObject & /*source*/) | |
69 | { | |
70 | // assignment operator | |
71 | return *this; | |
72 | } | |
73 | ||
74 | Int_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 | ||
91 | Int_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 | ||
110 | Int_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 | ||
121 | Int_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 | } |