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