]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/GammaConv/AliGammaConversionAODObject.cxx
Filling the EventQuality histogram for book keeping
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / AliGammaConversionAODObject.cxx
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   fE(0), 
44   fLabel1(-1),
45   fLabel2(-1),
46   fChi2(0),
47   fIMass(0), 
48   fTagged(kFALSE),
49   fMCStack(NULL),
50   fESDEvent(NULL)
51 {
52   //Default constructor
53 }
54
55
56 AliGammaConversionAODObject::AliGammaConversionAODObject(const AliGammaConversionAODObject & original) :
57   TObject(original),
58   fPx(original.fPx),
59   fPy(original.fPy),
60   fPz(original.fPz),
61   fE(original.fE), 
62   fLabel1(original.fLabel1),
63   fLabel2(original.fLabel2),
64   fChi2(original.fChi2),
65   fIMass(original.fIMass),
66   fTagged(original.fTagged),
67   fMCStack(original.fMCStack),
68   fESDEvent(original.fESDEvent)
69 {
70   //Copy constructor
71 }
72
73
74 AliGammaConversionAODObject & AliGammaConversionAODObject::operator = (const AliGammaConversionAODObject & /*source*/)
75 {
76   // assignment operator
77   return *this;
78 }
79
80 Int_t AliGammaConversionAODObject::GetGammaMCLabel() const{
81   // returns the MC label of the gamma (if both electrons have the same mother)
82   Int_t iResult = -1;
83   if(fMCStack != NULL){
84     Int_t mcLabel1= GetElectronMCLabel1();
85     Int_t mcLabel2= GetElectronMCLabel2();
86     if(mcLabel1>=0 && mcLabel2>=0){
87       TParticle *electron1 = fMCStack->Particle(mcLabel1);
88       TParticle *electron2 = fMCStack->Particle(mcLabel2);
89       if(electron1->GetMother(0) == electron2->GetMother(0)){
90         iResult = electron1->GetMother(0);
91       }
92     }
93   }
94   return iResult;
95 }
96
97 Int_t AliGammaConversionAODObject::GetElectronUniqueID() const{
98   // returns the unique id of the electrons if they have the same mother and unique id
99   Int_t iResult = -1;
100   if(fMCStack != NULL){
101     Int_t mcLabel1= GetElectronMCLabel1();
102     Int_t mcLabel2= GetElectronMCLabel2();
103     if(mcLabel1>=0 && mcLabel2>=0){
104       TParticle *electron1 = fMCStack->Particle(mcLabel1);
105       TParticle *electron2 = fMCStack->Particle(mcLabel2);
106       if(electron1->GetMother(0) == electron2->GetMother(0)){
107         if(electron1->GetUniqueID() == electron2->GetUniqueID()){
108           iResult = (Int_t)electron1->GetUniqueID();
109         }
110       }
111     }
112   }
113   return iResult;
114 }
115
116 Int_t AliGammaConversionAODObject::GetElectronMCLabel1() const{
117   //returns the MC label of the first electron
118   Int_t iResult=-1;
119   if(fESDEvent != NULL){
120     if(fLabel1>=0){
121       iResult = (fESDEvent->GetTrack(fLabel1))->GetLabel();
122     }
123   }
124   return iResult;
125 }
126
127 Int_t AliGammaConversionAODObject::GetElectronMCLabel2() const{
128   //returns the MC label of the first electron
129   Int_t iResult=-1;
130   if(fESDEvent != NULL){
131     if(fLabel2>=0){
132       iResult = (fESDEvent->GetTrack(fLabel2))->GetLabel();
133     }
134   }
135   return iResult;
136 }