]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/EBYE/PIDFluctuation/task/AliEbyEPidRatioBase.cxx
Update PR task : drathee
[u/mrichter/AliRoot.git] / PWGCF / EBYE / PIDFluctuation / task / AliEbyEPidRatioBase.cxx
CommitLineData
0a28d543 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: ALICE Offline. *
5 * Contributors are mentioned in the code where appropriate. *
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// AliEbyE Analysis for Particle Ratio Fluctuation //
18// Deepika Rathee | Satyajit Jena //
19// drathee@cern.ch | sjena@cern.ch //
20// Date: Wed Jul 9 18:38:30 CEST 2014 //
21// New approch to find particle ratio to reduce memory //
22// (Test Only) //
23//=========================================================================//
24
25#include "TMath.h"
26#include "TAxis.h"
27
28#include "AliESDEvent.h"
29#include "AliESDInputHandler.h"
30#include "AliStack.h"
31#include "AliMCEvent.h"
32#include "AliESDtrackCuts.h"
33
34#include "AliAODEvent.h"
35#include "AliAODInputHandler.h"
36#include "AliAODMCParticle.h"
37#include "AliEbyEPidRatioBase.h"
38
39using namespace std;
40ClassImp(AliEbyEPidRatioBase)
41//________________________________________________________________________
42AliEbyEPidRatioBase::AliEbyEPidRatioBase() :
43 TNamed(),
44 fHelper(NULL),
45
46 fESD(NULL),
47 fESDTrackCuts(NULL),
48 fAOD(NULL),
49 fArrayMC(NULL),
50 fAODtrackCutBit(1024),
51 fIsMC(kFALSE),
52 fMCEvent(NULL),
53 fStack(NULL),
54
55 fCentralityBin(-1.),
f7ea34d2 56 fNTracks(0), fIsRatio(kFALSE) {
0a28d543 57 // Constructor
58
59 AliLog::SetClassDebugLevel("AliEbyEPidRatioBase",10);
60}
61
62//________________________________________________________________________
63AliEbyEPidRatioBase::AliEbyEPidRatioBase(const Char_t* name, const Char_t* title) :
64 TNamed(name, title),
65 fHelper(NULL),
66
67 fESD(NULL),
68 fESDTrackCuts(NULL),
69 fAOD(NULL),
70 fArrayMC(NULL),
71 fAODtrackCutBit(1024),
72 fIsMC(kFALSE),
73 fMCEvent(NULL),
74 fStack(NULL),
75
76 fCentralityBin(-1.),
f7ea34d2 77 fNTracks(0), fIsRatio(kFALSE) {
0a28d543 78 // Constructor
79
80 AliLog::SetClassDebugLevel("AliEbyEPidRatioBase",10);
81}
82
83//________________________________________________________________________
84AliEbyEPidRatioBase::~AliEbyEPidRatioBase() {
85 // Destructor
86}
87
88//________________________________________________________________________
89void AliEbyEPidRatioBase::Initialize(AliEbyEPidRatioHelper* helper, AliESDtrackCuts* cuts) {
90 fHelper = helper;
91 fESDTrackCuts = (cuts) ? cuts : helper->GetESDTrackCuts();
92 fIsMC = helper->GetIsMC();
f7ea34d2 93 fIsRatio = helper->GetIsRatio();
0a28d543 94 fAODtrackCutBit = helper->GetAODtrackCutBit();
95 Init();
96 CreateHistograms();
97
98 return;
99}
100
101//________________________________________________________________________
102Int_t AliEbyEPidRatioBase::SetupEvent() {
103 // -- Setup event
104
105 ResetEvent();
106
107 // -- Get ESD objects
108 if (dynamic_cast<AliESDInputHandler*>(fHelper->GetInputEventHandler())) {
109 fESD = dynamic_cast<AliESDEvent*>(fHelper->GetInputEventHandler()->GetEvent());
110 fNTracks = fESD->GetNumberOfTracks();
111 }
112
113 // -- Get AOD objects
114 else if (dynamic_cast<AliAODInputHandler*>(fHelper->GetInputEventHandler())) {
115 fAOD = dynamic_cast<AliAODEvent*>(fHelper->GetInputEventHandler()->GetEvent());
116 fNTracks = fAOD->GetNumberOfTracks();
117
118 if (fIsMC) {
119 fArrayMC = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
120 if (!fArrayMC)
121 AliFatal("No array of MC particles found !!!"); // MW no AliFatal use return values
122 }
123 }
124
125 if (fIsMC) {
126 fMCEvent = fHelper->GetMCEvent();
127 if (fMCEvent)
128 fStack = fMCEvent->Stack();
129 }
130
131 fCentralityBin = fHelper->GetCentralityBin();
132
133 return Setup();
134}
135
136//________________________________________________________________________
137void AliEbyEPidRatioBase::ResetEvent() {
138 // -- Reset ESD Event
139 fESD = NULL;
140 // -- Reset AOD Event
141 fAOD = NULL;
142 // -- Reset MC Event
143 if (fIsMC)
144 fMCEvent = NULL;
145 // -- Reset in class
146 Reset();
147 return;
148}
149
150