]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/AliEventPoolOTF.cxx
matching performance ITS-TPC-TRD class
[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),
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
61AliEventPoolOTF::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
83AliEventPoolOTF::AliEventPoolOTF(const AliEventPoolOTF& obj):
84 AliVEventPool(obj),
85 fTagAnalysis(0),
86 fRunCuts(0),
87 fLHCCuts(0),
88 fDetectorCuts(0),
89 fEventCuts(0),
d7ed11c3 90 fGridTags(0),
2d0a3a45 91 fTagDirectory(0),
df5036f6 92 fValueMin(),
93 fValueMax(),
94 fValueStep(),
95 fValue(),
96 fBinNumber(0),
97 fNoMore(0)
2d0a3a45 98{
99 // Copy constructor
df5036f6 100 InitArrays();
2d0a3a45 101}
102
103AliEventPoolOTF& AliEventPoolOTF::operator=(const AliEventPoolOTF& other)
104{
105// Assignment operator
106 AliVEventPool::operator=(other);
107 return *this;
108}
109
110
111void AliEventPoolOTF::Init()
112{
113 //
21b8dea4 114 if (!fGridTags) {
115 fTagAnalysis->ChainLocalTags(fTagDirectory);
116 } else {
117 fTagAnalysis->ChainGridTags(fGridTags);
118 }
119
120
df5036f6 121 for (Int_t i = 0; i < 4; i++) fValue[i] = fValueMin[i];
2d0a3a45 122}
123
124TChain* AliEventPoolOTF::GetNextChain()
125{
126 //
127 TChain* chain = 0;
a065d8ed 128 fBinNumber++;
df5036f6 129 if (fNoMore) {
2d0a3a45 130 return 0;
131 } else {
df5036f6 132 printf("Current bin (lower) %13.3f %13.3f %13.3f \n", fValue[kMultiplicity], fValue[kZVertex], fValue[kEventPlane]);
133 printf("Current bin (upper) %13.3f %13.3f %13.3f \n", fValue[kMultiplicity] + fValueStep[kMultiplicity],
134 fValue[kZVertex] + fValueStep[kZVertex],
135 fValue[kEventPlane] + fValueStep[kEventPlane]);
136
137 fEventCuts->SetMultiplicityRange(Int_t(fValue[kMultiplicity]) , Int_t(fValue[kMultiplicity] + fValueStep[kMultiplicity]));
138 fEventCuts->SetPrimaryVertexZRange(fValue[kZVertex] , fValue[kZVertex] + fValueStep[kZVertex]);
139 fEventCuts->SetEventPlaneAngleRange(fValue[kEventPlane] , fValue[kEventPlane] + fValueStep[kEventPlane]);
2d0a3a45 140 chain = fTagAnalysis->QueryTags(fRunCuts, fLHCCuts, fDetectorCuts, fEventCuts);
df5036f6 141//
142// Next bin
143//
144 for (Int_t i = 2; i >= 0; i--)
145 {
146 fValue[i] += fValueStep[i];
147 if (i > 0 && fValue[i] >= fValueMax[i]) {
148 fValue[i] = fValueMin[i];
149 } else if (i == 0 && fValue[i] >= fValueMax[i]) {
150 fNoMore = kTRUE;
151 } else {
152 break;
153 }
154 }
2d0a3a45 155 return chain;
156 }
157}
158
159void AliEventPoolOTF::GetCurrentBin(Float_t* /*bin*/)
160{
161 //
162}
163
164Int_t AliEventPoolOTF::GetDimension()
165{
166 //
df5036f6 167 return (3);
2d0a3a45 168}
169
df5036f6 170void AliEventPoolOTF::InitArrays()
171{
172 // Initializes the pool axis
173
174 SetMultiplicityBinning(0, 20000, 20000);
175 SetZVertexBinning(-1000., 1000., 2000.);
176 SetEventPlaneBinning(-1000., 1000., 2000.);
177 SetLeadingParticleEtaBinning(-1.0, 1.0, 2.);
178 for (Int_t i = 0; i < 4; i++) fValue[i] = fValueMin[i];
179}
180
181