Added commet to explain AliAODTrack::fType, AliAODTrack::XAtDCA(), YAtDCA(), ZAtDCA...
[u/mrichter/AliRoot.git] / ANALYSIS / AliEventPoolOTF.cxx
CommitLineData
2d0a3a45 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
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/* $Id$ */
17
18
19// Realisation of an AliVEventPool via
20// on the flight (OTF) generation of the bin using AliTagAnalysis.
21// Author Andreas Morsch
22// andreas.morsch@cern.ch
23
24#include "AliEventPoolOTF.h"
25
26#include "AliRunTagCuts.h"
27#include "AliLHCTagCuts.h"
28#include "AliDetectorTagCuts.h"
29#include "AliEventTagCuts.h"
30#include "AliTagAnalysis.h"
31
df5036f6 32#include <TMath.h>
422a88eb 33#include <TChain.h>
21b8dea4 34#include <TGridResult.h>
df5036f6 35
2d0a3a45 36ClassImp(AliEventPoolOTF)
37
38
39////////////////////////////////////////////////////////////////////////
40
41AliEventPoolOTF::AliEventPoolOTF():
42 AliVEventPool(),
43 fTagAnalysis(0),
44 fRunCuts(0),
45 fLHCCuts(0),
46 fDetectorCuts(0),
47 fEventCuts(0),
21b8dea4 48 fGridTags(0),
9ce6b490 49 fChain(0),
2d0a3a45 50 fTagDirectory(0),
df5036f6 51 fValueMin(),
52 fValueMax(),
53 fValueStep(),
54 fValue(),
55 fBinNumber(0),
56 fNoMore(0)
57
2d0a3a45 58{
59 // Default constructor
df5036f6 60 InitArrays();
2d0a3a45 61}
62
63AliEventPoolOTF::AliEventPoolOTF(const char* name, const char* title):
64 AliVEventPool(name, title),
c08c82c3 65 fTagAnalysis(new AliTagAnalysis(title)),
2d0a3a45 66 fRunCuts(new AliRunTagCuts()),
67 fLHCCuts(new AliLHCTagCuts()),
68 fDetectorCuts(new AliDetectorTagCuts()),
69 fEventCuts(new AliEventTagCuts()),
21b8dea4 70 fGridTags(0),
9ce6b490 71 fChain(0),
2d0a3a45 72 fTagDirectory("."),
df5036f6 73 fValueMin(),
74 fValueMax(),
75 fValueStep(),
76 fValue(),
77 fBinNumber(0),
78 fNoMore(0)
79
2d0a3a45 80{
81 // Constructor
df5036f6 82 InitArrays();
2d0a3a45 83}
84
85
86AliEventPoolOTF::AliEventPoolOTF(const AliEventPoolOTF& obj):
87 AliVEventPool(obj),
88 fTagAnalysis(0),
89 fRunCuts(0),
90 fLHCCuts(0),
91 fDetectorCuts(0),
92 fEventCuts(0),
d7ed11c3 93 fGridTags(0),
9ce6b490 94 fChain(0),
2d0a3a45 95 fTagDirectory(0),
df5036f6 96 fValueMin(),
97 fValueMax(),
98 fValueStep(),
99 fValue(),
100 fBinNumber(0),
101 fNoMore(0)
2d0a3a45 102{
103 // Copy constructor
df5036f6 104 InitArrays();
2d0a3a45 105}
106
2e33f655 107
108AliEventPoolOTF::~AliEventPoolOTF()
109{
110 // Destructor
111 delete fTagAnalysis;
112 delete fRunCuts;
113 delete fEventCuts;
114 delete fLHCCuts;
115 delete fDetectorCuts;
116 delete fChain;
117}
118
2d0a3a45 119AliEventPoolOTF& AliEventPoolOTF::operator=(const AliEventPoolOTF& other)
120{
121// Assignment operator
122 AliVEventPool::operator=(other);
123 return *this;
124}
125
126
127void AliEventPoolOTF::Init()
128{
f690bf48 129 // Initialisation
21b8dea4 130 if (!fGridTags) {
131 fTagAnalysis->ChainLocalTags(fTagDirectory);
132 } else {
133 fTagAnalysis->ChainGridTags(fGridTags);
134 }
135
136
2e33f655 137 for (Int_t i = 0; i < 5; i++) fValue[i] = fValueMin[i];
2d0a3a45 138}
139
140TChain* AliEventPoolOTF::GetNextChain()
141{
f690bf48 142 // Get Next Chain
9ce6b490 143 if (fChain) {
144 delete fChain;
145 fChain = 0;
146 }
2e33f655 147
a065d8ed 148 fBinNumber++;
df5036f6 149 if (fNoMore) {
2e33f655 150 return 0;
2d0a3a45 151 } else {
a01e4203 152 printf("Current bin (lower) %13.3f %13.3f %13.3f %13.3f %13.3f \n", fValue[kMultiplicity], fValue[kZVertex], fValue[kEventPlane],fValue[kLeadingParticleEta],fValue[kLeadingParticlePhi]);
bb11a60b 153 printf("Current bin (upper) %13.3f %13.3f %13.3f %13.3f %13.3f \n", fValue[kMultiplicity] + fValueStep[kMultiplicity] - 1,
a01e4203 154 fValue[kZVertex] + fValueStep[kZVertex],
155 fValue[kEventPlane] + fValueStep[kEventPlane],
156 fValue[kLeadingParticleEta] + fValueStep[kLeadingParticleEta],
157 fValue[kLeadingParticlePhi] + fValueStep[kLeadingParticlePhi]
158
159 );
160
bb11a60b 161 fEventCuts->SetMultiplicityRange(Int_t(fValue[kMultiplicity]) , Int_t(fValue[kMultiplicity] + fValueStep[kMultiplicity] - 1));
df5036f6 162 fEventCuts->SetPrimaryVertexZRange(fValue[kZVertex] , fValue[kZVertex] + fValueStep[kZVertex]);
a01e4203 163 fEventCuts->SetEtaLeadingParticleRange(fValue[kLeadingParticleEta] , fValue[kLeadingParticleEta] + fValueStep[kLeadingParticleEta]);
164 fEventCuts->SetPhiLeadingParticleRange(fValue[kLeadingParticlePhi] , fValue[kLeadingParticlePhi] + fValueStep[kLeadingParticlePhi]);
165 fEventCuts->SetEventPlaneAngleRange(fValue[kEventPlane] , fValue[kEventPlane] + fValueStep[kEventPlane]);
166
9ce6b490 167 fChain = fTagAnalysis->QueryTags(fRunCuts, fLHCCuts, fDetectorCuts, fEventCuts);
df5036f6 168//
169// Next bin
170//
a01e4203 171 for (Int_t i = 5; i >= 0; i--)
df5036f6 172 {
173 fValue[i] += fValueStep[i];
174 if (i > 0 && fValue[i] >= fValueMax[i]) {
175 fValue[i] = fValueMin[i];
176 } else if (i == 0 && fValue[i] >= fValueMax[i]) {
177 fNoMore = kTRUE;
178 } else {
179 break;
180 }
181 }
9ce6b490 182 return fChain;
2d0a3a45 183 }
184}
185
186void AliEventPoolOTF::GetCurrentBin(Float_t* /*bin*/)
187{
188 //
189}
190
191Int_t AliEventPoolOTF::GetDimension()
192{
193 //
a01e4203 194 return (5);
2d0a3a45 195}
196
df5036f6 197void AliEventPoolOTF::InitArrays()
198{
199 // Initializes the pool axis
2e33f655 200
df5036f6 201 SetMultiplicityBinning(0, 20000, 20000);
202 SetZVertexBinning(-1000., 1000., 2000.);
203 SetEventPlaneBinning(-1000., 1000., 2000.);
89c3bfe8 204 SetLeadingParticleEtaBinning(-13.0, 13.0, 27.);
205 SetLeadingParticlePhiBinning(0., 2*(TMath::Pi()),2*(TMath::Pi()));
206 for (Int_t i = 0; i < 5; i++) fValue[i] = fValueMin[i];
df5036f6 207}
208
209