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