]>
Commit | Line | Data |
---|---|---|
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 | 35 | ClassImp(AliEventPoolOTF) |
36 | ||
37 | ||
38 | //////////////////////////////////////////////////////////////////////// | |
39 | ||
40 | AliEventPoolOTF::AliEventPoolOTF(): | |
41 | AliVEventPool(), | |
42 | fTagAnalysis(0), | |
43 | fRunCuts(0), | |
44 | fLHCCuts(0), | |
45 | fDetectorCuts(0), | |
46 | fEventCuts(0), | |
21b8dea4 | 47 | fGridTags(0), |
2d0a3a45 | 48 | fTagDirectory(0), |
df5036f6 | 49 | fValueMin(), |
50 | fValueMax(), | |
51 | fValueStep(), | |
52 | fValue(), | |
53 | fBinNumber(0), | |
54 | fNoMore(0) | |
55 | ||
2d0a3a45 | 56 | { |
57 | // Default constructor | |
df5036f6 | 58 | InitArrays(); |
2d0a3a45 | 59 | } |
60 | ||
61 | AliEventPoolOTF::AliEventPoolOTF(const char* name, const char* title): | |
62 | AliVEventPool(name, title), | |
c08c82c3 | 63 | fTagAnalysis(new AliTagAnalysis(title)), |
2d0a3a45 | 64 | fRunCuts(new AliRunTagCuts()), |
65 | fLHCCuts(new AliLHCTagCuts()), | |
66 | fDetectorCuts(new AliDetectorTagCuts()), | |
67 | fEventCuts(new AliEventTagCuts()), | |
21b8dea4 | 68 | fGridTags(0), |
2d0a3a45 | 69 | fTagDirectory("."), |
df5036f6 | 70 | fValueMin(), |
71 | fValueMax(), | |
72 | fValueStep(), | |
73 | fValue(), | |
74 | fBinNumber(0), | |
75 | fNoMore(0) | |
76 | ||
2d0a3a45 | 77 | { |
78 | // Constructor | |
df5036f6 | 79 | InitArrays(); |
2d0a3a45 | 80 | } |
81 | ||
82 | ||
83 | AliEventPoolOTF::AliEventPoolOTF(const AliEventPoolOTF& obj): | |
84 | AliVEventPool(obj), | |
85 | fTagAnalysis(0), | |
86 | fRunCuts(0), | |
87 | fLHCCuts(0), | |
88 | fDetectorCuts(0), | |
89 | fEventCuts(0), | |
90 | fTagDirectory(0), | |
df5036f6 | 91 | fValueMin(), |
92 | fValueMax(), | |
93 | fValueStep(), | |
94 | fValue(), | |
95 | fBinNumber(0), | |
96 | fNoMore(0) | |
2d0a3a45 | 97 | { |
98 | // Copy constructor | |
df5036f6 | 99 | InitArrays(); |
2d0a3a45 | 100 | } |
101 | ||
102 | AliEventPoolOTF& AliEventPoolOTF::operator=(const AliEventPoolOTF& other) | |
103 | { | |
104 | // Assignment operator | |
105 | AliVEventPool::operator=(other); | |
106 | return *this; | |
107 | } | |
108 | ||
109 | ||
110 | void AliEventPoolOTF::Init() | |
111 | { | |
112 | // | |
21b8dea4 | 113 | if (!fGridTags) { |
114 | fTagAnalysis->ChainLocalTags(fTagDirectory); | |
115 | } else { | |
116 | fTagAnalysis->ChainGridTags(fGridTags); | |
117 | } | |
118 | ||
119 | ||
df5036f6 | 120 | for (Int_t i = 0; i < 4; i++) fValue[i] = fValueMin[i]; |
2d0a3a45 | 121 | } |
122 | ||
123 | TChain* AliEventPoolOTF::GetNextChain() | |
124 | { | |
125 | // | |
126 | TChain* chain = 0; | |
a065d8ed | 127 | fBinNumber++; |
df5036f6 | 128 | if (fNoMore) { |
2d0a3a45 | 129 | return 0; |
130 | } else { | |
df5036f6 | 131 | printf("Current bin (lower) %13.3f %13.3f %13.3f \n", fValue[kMultiplicity], fValue[kZVertex], fValue[kEventPlane]); |
132 | printf("Current bin (upper) %13.3f %13.3f %13.3f \n", fValue[kMultiplicity] + fValueStep[kMultiplicity], | |
133 | fValue[kZVertex] + fValueStep[kZVertex], | |
134 | fValue[kEventPlane] + fValueStep[kEventPlane]); | |
135 | ||
136 | fEventCuts->SetMultiplicityRange(Int_t(fValue[kMultiplicity]) , Int_t(fValue[kMultiplicity] + fValueStep[kMultiplicity])); | |
137 | fEventCuts->SetPrimaryVertexZRange(fValue[kZVertex] , fValue[kZVertex] + fValueStep[kZVertex]); | |
138 | fEventCuts->SetEventPlaneAngleRange(fValue[kEventPlane] , fValue[kEventPlane] + fValueStep[kEventPlane]); | |
2d0a3a45 | 139 | chain = fTagAnalysis->QueryTags(fRunCuts, fLHCCuts, fDetectorCuts, fEventCuts); |
df5036f6 | 140 | // |
141 | // Next bin | |
142 | // | |
143 | for (Int_t i = 2; i >= 0; i--) | |
144 | { | |
145 | fValue[i] += fValueStep[i]; | |
146 | if (i > 0 && fValue[i] >= fValueMax[i]) { | |
147 | fValue[i] = fValueMin[i]; | |
148 | } else if (i == 0 && fValue[i] >= fValueMax[i]) { | |
149 | fNoMore = kTRUE; | |
150 | } else { | |
151 | break; | |
152 | } | |
153 | } | |
2d0a3a45 | 154 | return chain; |
155 | } | |
156 | } | |
157 | ||
158 | void AliEventPoolOTF::GetCurrentBin(Float_t* /*bin*/) | |
159 | { | |
160 | // | |
161 | } | |
162 | ||
163 | Int_t AliEventPoolOTF::GetDimension() | |
164 | { | |
165 | // | |
df5036f6 | 166 | return (3); |
2d0a3a45 | 167 | } |
168 | ||
df5036f6 | 169 | void AliEventPoolOTF::InitArrays() |
170 | { | |
171 | // Initializes the pool axis | |
172 | ||
173 | SetMultiplicityBinning(0, 20000, 20000); | |
174 | SetZVertexBinning(-1000., 1000., 2000.); | |
175 | SetEventPlaneBinning(-1000., 1000., 2000.); | |
176 | SetLeadingParticleEtaBinning(-1.0, 1.0, 2.); | |
177 | for (Int_t i = 0; i < 4; i++) fValue[i] = fValueMin[i]; | |
178 | } | |
179 | ||
180 |