]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/AliEventPoolOTF.cxx
Updating Strange tasks (by H.Ricaud, hricaud@gsi.de)
[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>
21b8dea4 33#include <TGridResult.h>
df5036f6 34
2d0a3a45 35ClassImp(AliEventPoolOTF)
36
37
38////////////////////////////////////////////////////////////////////////
39
40AliEventPoolOTF::AliEventPoolOTF():
41 AliVEventPool(),
42 fTagAnalysis(0),
43 fRunCuts(0),
44 fLHCCuts(0),
45 fDetectorCuts(0),
46 fEventCuts(0),
21b8dea4 47 fGridTags(0),
9ce6b490 48 fChain(0),
2d0a3a45 49 fTagDirectory(0),
df5036f6 50 fValueMin(),
51 fValueMax(),
52 fValueStep(),
53 fValue(),
54 fBinNumber(0),
55 fNoMore(0)
56
2d0a3a45 57{
58 // Default constructor
df5036f6 59 InitArrays();
2d0a3a45 60}
61
62AliEventPoolOTF::AliEventPoolOTF(const char* name, const char* title):
63 AliVEventPool(name, title),
c08c82c3 64 fTagAnalysis(new AliTagAnalysis(title)),
2d0a3a45 65 fRunCuts(new AliRunTagCuts()),
66 fLHCCuts(new AliLHCTagCuts()),
67 fDetectorCuts(new AliDetectorTagCuts()),
68 fEventCuts(new AliEventTagCuts()),
21b8dea4 69 fGridTags(0),
9ce6b490 70 fChain(0),
2d0a3a45 71 fTagDirectory("."),
df5036f6 72 fValueMin(),
73 fValueMax(),
74 fValueStep(),
75 fValue(),
76 fBinNumber(0),
77 fNoMore(0)
78
2d0a3a45 79{
80 // Constructor
df5036f6 81 InitArrays();
2d0a3a45 82}
83
84
85AliEventPoolOTF::AliEventPoolOTF(const AliEventPoolOTF& obj):
86 AliVEventPool(obj),
87 fTagAnalysis(0),
88 fRunCuts(0),
89 fLHCCuts(0),
90 fDetectorCuts(0),
91 fEventCuts(0),
d7ed11c3 92 fGridTags(0),
9ce6b490 93 fChain(0),
2d0a3a45 94 fTagDirectory(0),
df5036f6 95 fValueMin(),
96 fValueMax(),
97 fValueStep(),
98 fValue(),
99 fBinNumber(0),
100 fNoMore(0)
2d0a3a45 101{
102 // Copy constructor
df5036f6 103 InitArrays();
2d0a3a45 104}
105
106AliEventPoolOTF& AliEventPoolOTF::operator=(const AliEventPoolOTF& other)
107{
108// Assignment operator
109 AliVEventPool::operator=(other);
110 return *this;
111}
112
113
114void AliEventPoolOTF::Init()
115{
116 //
21b8dea4 117 if (!fGridTags) {
118 fTagAnalysis->ChainLocalTags(fTagDirectory);
119 } else {
120 fTagAnalysis->ChainGridTags(fGridTags);
121 }
122
123
df5036f6 124 for (Int_t i = 0; i < 4; i++) fValue[i] = fValueMin[i];
2d0a3a45 125}
126
127TChain* AliEventPoolOTF::GetNextChain()
128{
129 //
9ce6b490 130 if (fChain) {
131 delete fChain;
132 fChain = 0;
133 }
134
a065d8ed 135 fBinNumber++;
df5036f6 136 if (fNoMore) {
2d0a3a45 137 return 0;
138 } else {
a01e4203 139 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]);
140 printf("Current bin (upper) %13.3f %13.3f %13.3f %13.3f %13.3f \n", fValue[kMultiplicity] + fValueStep[kMultiplicity],
141 fValue[kZVertex] + fValueStep[kZVertex],
142 fValue[kEventPlane] + fValueStep[kEventPlane],
143 fValue[kLeadingParticleEta] + fValueStep[kLeadingParticleEta],
144 fValue[kLeadingParticlePhi] + fValueStep[kLeadingParticlePhi]
145
146 );
147
df5036f6 148 fEventCuts->SetMultiplicityRange(Int_t(fValue[kMultiplicity]) , Int_t(fValue[kMultiplicity] + fValueStep[kMultiplicity]));
149 fEventCuts->SetPrimaryVertexZRange(fValue[kZVertex] , fValue[kZVertex] + fValueStep[kZVertex]);
a01e4203 150 fEventCuts->SetEtaLeadingParticleRange(fValue[kLeadingParticleEta] , fValue[kLeadingParticleEta] + fValueStep[kLeadingParticleEta]);
151 fEventCuts->SetPhiLeadingParticleRange(fValue[kLeadingParticlePhi] , fValue[kLeadingParticlePhi] + fValueStep[kLeadingParticlePhi]);
152 fEventCuts->SetEventPlaneAngleRange(fValue[kEventPlane] , fValue[kEventPlane] + fValueStep[kEventPlane]);
153
9ce6b490 154 fChain = fTagAnalysis->QueryTags(fRunCuts, fLHCCuts, fDetectorCuts, fEventCuts);
df5036f6 155//
156// Next bin
157//
a01e4203 158 for (Int_t i = 5; i >= 0; i--)
df5036f6 159 {
160 fValue[i] += fValueStep[i];
161 if (i > 0 && fValue[i] >= fValueMax[i]) {
162 fValue[i] = fValueMin[i];
163 } else if (i == 0 && fValue[i] >= fValueMax[i]) {
164 fNoMore = kTRUE;
165 } else {
166 break;
167 }
168 }
9ce6b490 169 return fChain;
2d0a3a45 170 }
171}
172
173void AliEventPoolOTF::GetCurrentBin(Float_t* /*bin*/)
174{
175 //
176}
177
178Int_t AliEventPoolOTF::GetDimension()
179{
180 //
a01e4203 181 return (5);
2d0a3a45 182}
183
df5036f6 184void AliEventPoolOTF::InitArrays()
185{
186 // Initializes the pool axis
187
188 SetMultiplicityBinning(0, 20000, 20000);
189 SetZVertexBinning(-1000., 1000., 2000.);
190 SetEventPlaneBinning(-1000., 1000., 2000.);
a01e4203 191 SetEventPlaneBinning(-1000., 1000., 2000.);
192 SetLeadingParticleEtaBinning(-13.0, 13.0, 26.);
193 SetLeadingParticlePhiBinning(0, 2*(TMath::Pi()),2*(TMath::Pi()));
df5036f6 194 for (Int_t i = 0; i < 4; i++) fValue[i] = fValueMin[i];
195}
196
197