1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt, Svein Lindal *
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 **************************************************************************/
16 ////////////////////////////////////////////////
17 //---------------------------------------------
18 // Class containing the aod information we need
19 //---------------------------------------------
20 ////////////////////////////////////////////////
22 #include "AliAODConversionParticle.h"
23 //#include "AliAODv0.h"
25 #include "AliESDEvent.h"
26 //#include "AliESDtrack.h"
27 #include "TParticle.h"
34 ClassImp(AliAODConversionParticle)
38 AliAODConversionParticle::AliAODConversionParticle() :
51 AliAODConversionParticle::AliAODConversionParticle(TLorentzVector & momentum) :
52 AliAODPhoton(momentum),
64 AliAODConversionParticle::AliAODConversionParticle(const AliAODConversionParticle & original) :
65 AliAODPhoton(original),
66 fChi2(original.fChi2),
67 fIMass(original.fIMass),
68 //fTagged(original.fTagged),
69 fMCStack(original.fMCStack),
70 fESDEvent(original.fESDEvent)
73 fLabel[0] = original.fLabel[0];
74 fLabel[1] = original.fLabel[1];
78 AliAODConversionParticle & AliAODConversionParticle::operator = (const AliAODConversionParticle & /*source*/)
80 // assignment operator
85 Int_t AliAODConversionParticle::GetGammaMCLabel() const{
86 // returns the MC label of the gamma (if both electrons have the same mother)
89 Int_t mcLabel1= GetElectronMCLabel1();
90 Int_t mcLabel2= GetElectronMCLabel2();
91 if(mcLabel1>=0 && mcLabel2>=0){
92 TParticle *electron1 = fMCStack->Particle(mcLabel1);
93 TParticle *electron2 = fMCStack->Particle(mcLabel2);
94 if(electron1->GetMother(0) == electron2->GetMother(0)){
95 iResult = electron1->GetMother(0);
102 Int_t AliAODConversionParticle::GetElectronUniqueID(Int_t mcLabel1, Int_t mcLabel2) const{
104 if(fMCStack != NULL){
105 if(mcLabel1>=0 && mcLabel2>=0){
106 TParticle *electron1 = fMCStack->Particle(mcLabel1);
107 TParticle *electron2 = fMCStack->Particle(mcLabel2);
108 if(electron1->GetMother(0) == electron2->GetMother(0)){
109 if(electron1->GetUniqueID() == electron2->GetUniqueID()){
110 iResult = (Int_t)electron1->GetUniqueID();
119 Int_t AliAODConversionParticle::GetElectronUniqueID() const{
120 // returns the unique id of the electrons if they have the same mother and unique id
121 if(fMCStack != NULL){
122 return GetElectronUniqueID(GetElectronMCLabel1(), GetElectronMCLabel2());
128 Int_t AliAODConversionParticle::GetMCLabel(Int_t label) const {
129 //returns the MC label of the first electron
131 if(fESDEvent != NULL){
133 iResult = fESDEvent->GetTrack(label)->GetLabel();
139 Int_t AliAODConversionParticle::GetElectronMCLabel1() const{
140 //returns the MC label of the first electron
142 return GetMCLabel(fLabel[0]);
148 Int_t AliAODConversionParticle::GetElectronMCLabel2() const{
149 //returns the MC label of the first electron
151 return GetMCLabel(fLabel[1]);