]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/EBYE/PIDFluctuation/task/AliEbyEPidRatioBase.cxx
Minor fix pr task: sjena
[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
e146cc53 34
0a28d543 35#include "AliAODEvent.h"
36#include "AliAODInputHandler.h"
37#include "AliAODMCParticle.h"
38#include "AliEbyEPidRatioBase.h"
39
40using namespace std;
41ClassImp(AliEbyEPidRatioBase)
42//________________________________________________________________________
43AliEbyEPidRatioBase::AliEbyEPidRatioBase() :
44 TNamed(),
45 fHelper(NULL),
46
47 fESD(NULL),
48 fESDTrackCuts(NULL),
49 fAOD(NULL),
50 fArrayMC(NULL),
51 fAODtrackCutBit(1024),
52 fIsMC(kFALSE),
53 fMCEvent(NULL),
54 fStack(NULL),
55
56 fCentralityBin(-1.),
56a3fc5b 57 fNTracks(0), fIsRatio(kFALSE), fIsPtBin(kFALSE), fIsDetectorWise(kFALSE) {
0a28d543 58 // Constructor
59
60 AliLog::SetClassDebugLevel("AliEbyEPidRatioBase",10);
61}
62
63//________________________________________________________________________
64AliEbyEPidRatioBase::AliEbyEPidRatioBase(const Char_t* name, const Char_t* title) :
65 TNamed(name, title),
66 fHelper(NULL),
67
68 fESD(NULL),
69 fESDTrackCuts(NULL),
70 fAOD(NULL),
71 fArrayMC(NULL),
72 fAODtrackCutBit(1024),
73 fIsMC(kFALSE),
56a3fc5b 74
75
0a28d543 76 fMCEvent(NULL),
77 fStack(NULL),
78
79 fCentralityBin(-1.),
56a3fc5b 80 fNTracks(0), fIsRatio(kFALSE),fIsPtBin(kFALSE), fIsDetectorWise(kFALSE){
0a28d543 81 // Constructor
82
83 AliLog::SetClassDebugLevel("AliEbyEPidRatioBase",10);
84}
85
86//________________________________________________________________________
87AliEbyEPidRatioBase::~AliEbyEPidRatioBase() {
88 // Destructor
89}
90
91//________________________________________________________________________
92void AliEbyEPidRatioBase::Initialize(AliEbyEPidRatioHelper* helper, AliESDtrackCuts* cuts) {
93 fHelper = helper;
94 fESDTrackCuts = (cuts) ? cuts : helper->GetESDTrackCuts();
95 fIsMC = helper->GetIsMC();
f7ea34d2 96 fIsRatio = helper->GetIsRatio();
1648d22e 97 fIsPtBin = helper->GetIsPtBin();
56a3fc5b 98 fIsDetectorWise = helper->GetDetWise();
0a28d543 99 fAODtrackCutBit = helper->GetAODtrackCutBit();
100 Init();
101 CreateHistograms();
1648d22e 102
6ce4ad92 103 Float_t ptRange[2];
104 fESDTrackCuts->GetPtRange(ptRange[0],ptRange[1]);
b49fc434 105 Printf(">>>> Pt Initialisation: [%f,%f]",ptRange[0],ptRange[1]);
106 fESDTrackCuts->GetEtaRange(ptRange[0],ptRange[1]);
107 Printf(">>>> Eta Initialisation: [%f,%f]",ptRange[0],ptRange[1]);
6ce4ad92 108
0a28d543 109 return;
110}
111
112//________________________________________________________________________
113Int_t AliEbyEPidRatioBase::SetupEvent() {
114 // -- Setup event
115
e146cc53 116
0a28d543 117 ResetEvent();
118
119 // -- Get ESD objects
120 if (dynamic_cast<AliESDInputHandler*>(fHelper->GetInputEventHandler())) {
121 fESD = dynamic_cast<AliESDEvent*>(fHelper->GetInputEventHandler()->GetEvent());
122 fNTracks = fESD->GetNumberOfTracks();
123 }
124
125 // -- Get AOD objects
126 else if (dynamic_cast<AliAODInputHandler*>(fHelper->GetInputEventHandler())) {
127 fAOD = dynamic_cast<AliAODEvent*>(fHelper->GetInputEventHandler()->GetEvent());
128 fNTracks = fAOD->GetNumberOfTracks();
129
130 if (fIsMC) {
131 fArrayMC = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
132 if (!fArrayMC)
133 AliFatal("No array of MC particles found !!!"); // MW no AliFatal use return values
134 }
135 }
136
137 if (fIsMC) {
138 fMCEvent = fHelper->GetMCEvent();
139 if (fMCEvent)
140 fStack = fMCEvent->Stack();
141 }
142
143 fCentralityBin = fHelper->GetCentralityBin();
144
145 return Setup();
146}
147
148//________________________________________________________________________
149void AliEbyEPidRatioBase::ResetEvent() {
150 // -- Reset ESD Event
151 fESD = NULL;
152 // -- Reset AOD Event
153 fAOD = NULL;
154 // -- Reset MC Event
155 if (fIsMC)
156 fMCEvent = NULL;
157 // -- Reset in class
158 Reset();
159 return;
160}
161
162