Primary vertex reconstruction and standalone ITS tracking in the reconstruction chain
[u/mrichter/AliRoot.git] / HBTAN / AliHBTMonitorFunction.cxx
CommitLineData
b98bda8e 1#include "AliHBTMonitorFunction.h"
20527eee 2//__________________________________________________________________
3////////////////////////////////////////////////////////////////////
4//
5// class AliHBTMonitorFunction
6//
7// class AliHBTMonOneParticleFctn
8// class AliHBTMonTwoParticleFctn
9//
10// class AliHBTMonOneParticleFctn1D
11// class AliHBTMonOneParticleFctn2D
12// class AliHBTMonOneParticleFctn3D
13//
14// class AliHBTMonTwoParticleFctn1D
15// class AliHBTMonTwoParticleFctn2D
16// class AliHBTMonTwoParticleFctn3D
17//
18// Base Classes for monitoring functions
19// author: chajecki@if.pw.edu.pl
20//
a57afe91 21/******************************************************************/
22/*
23Base classes for monitor functions
24
25 monitor function
26 / \
27 / \
28 / \
29 / \
30 / \
31 / \
32 / \
33 one particle two particle
34 / | \ / | \
35 / | \ / | \
36 1D 2D 3D 1D 2D 3D
37
38Zbigniew.Chajecki@cern.ch
39
40*/
20527eee 41///////////////////////////////////////////////////////////////////////
42
a57afe91 43
a57afe91 44ClassImp( AliHBTMonitorFunction )
45
89c60e9f 46AliHBTMonitorFunction::AliHBTMonitorFunction():
47 fParticleCut(new AliHBTEmptyParticleCut())
a57afe91 48{
89c60e9f 49 //ctor
a57afe91 50}
51/******************************************************************/
89c60e9f 52AliHBTMonitorFunction::AliHBTMonitorFunction(const char* name,const char* title):
53 TNamed(name,title),
54 fParticleCut(new AliHBTEmptyParticleCut())
a57afe91 55{
89c60e9f 56 //ctor
a57afe91 57}
58/******************************************************************/
89c60e9f 59AliHBTMonitorFunction::AliHBTMonitorFunction(const AliHBTMonitorFunction& /*in*/):
60 TNamed(),
61 fParticleCut(new AliHBTEmptyParticleCut())
62{
63 //cpy ctor
20527eee 64 // We cannot copy because it is a mess with names (histogram and functions)
89c60e9f 65 MayNotUse("AliHBTMonitorFunction(const AliHBTMonitorFunction&");
66}
67/******************************************************************/
34914285 68AliHBTMonitorFunction& AliHBTMonitorFunction::operator=(const AliHBTMonitorFunction& /*in*/)
89c60e9f 69{
20527eee 70 //assigment operator
71 // We cannot copy because it is a mess with names (histogram and functions)
89c60e9f 72 MayNotUse("operator=");
73 return *this;
74}
20527eee 75/******************************************************************/
a57afe91 76
77AliHBTMonitorFunction::~AliHBTMonitorFunction()
78 {
89c60e9f 79 //dtor
20527eee 80 delete fParticleCut;
a57afe91 81 }
82/******************************************************************/
83
89c60e9f 84void AliHBTMonitorFunction::Write()
a57afe91 85 {
89c60e9f 86 //Writes an function to disk
a57afe91 87 if (GetResult()) GetResult()->Write();
88 }
89/******************************************************************/
90
d289329c 91void AliHBTMonitorFunction::Init()
92 {
93 //Writes an function to disk
94 if (AliHBTParticle::GetDebug()>0) Info("Init","%s",GetName());
95
96 if (GetResult() == 0x0)
97 {
98 Warning("Init","Function has NULL result histogram!");
99 return;
100 }
101 GetResult()->Reset();
102 GetResult()->SetDirectory(0x0);
103 if (AliHBTParticle::GetDebug()>0) Info("Init","%s Done.",GetName());
104 }
a57afe91 105/******************************************************************/
d289329c 106
a57afe91 107void AliHBTMonitorFunction::SetParticleCut(AliHBTParticleCut* cut)
108{
109//Sets new Particle Cut. Old one is deleted
110//Note that it is created new object instead of simple pointer set
111//I do not want to have pointer
112//to object created somewhere else
113//because in that case I could not believe that
114//it would always exist (sb could delete it)
115//so we have always own copy
116
117 if(!cut)
118 {
119 Error("AliHBTMonitorFunction::SetParticleCut","argument is NULL");
120 return;
121 }
122 delete fParticleCut;
123 fParticleCut = (AliHBTParticleCut*)cut->Clone();
124
125}
a57afe91 126/******************************************************************/
127
89c60e9f 128void AliHBTMonitorFunction::Rename(const Char_t * name)
a57afe91 129 {
130 //renames the function and histograms
131 SetName(name);
132 SetTitle(name);
133
134 TString numstr = fName + " Result"; //title and name of the
135 //result histogram
136 GetResult()->SetName(numstr.Data());
137 GetResult()->SetTitle(numstr.Data());
a57afe91 138 }
89c60e9f 139/******************************************************************/
a57afe91 140
89c60e9f 141void AliHBTMonitorFunction::Rename(const Char_t * name, const Char_t * title)
a57afe91 142 {
143 //renames and retitle the function and histograms
144
145 SetName(name);
146 SetTitle(title);
147
148 TString numstrn = fName + " Result"; //name of the
149 //result histogram
150
151 TString numstrt = fTitle + " Result"; //title of the
152 //result histogram
153
154
155 GetResult()->SetName(numstrn.Data());
156 GetResult()->SetTitle(numstrt.Data());
157
158 }
159
160/******************************************************************/
161/******************************************************************/
162/******************************************************************/
163ClassImp( AliHBTMonOneParticleFctn ) //z.ch.
164/******************************************************************/
165/******************************************************************/
166ClassImp( AliHBTMonTwoParticleFctn ) //z.ch.
167/******************************************************************/
168/******************************************************************/
169/******************************************************************/
170ClassImp( AliHBTMonOneParticleFctn1D )
89c60e9f 171AliHBTMonOneParticleFctn1D::AliHBTMonOneParticleFctn1D():
172 fResult(0x0)
a57afe91 173 {
89c60e9f 174 //ctor
a57afe91 175 }
89c60e9f 176/******************************************************************/
a57afe91 177
89c60e9f 178AliHBTMonOneParticleFctn1D::AliHBTMonOneParticleFctn1D(Int_t nbins, Double_t maxXval, Double_t minXval)
a57afe91 179 {
89c60e9f 180 //ctor
a57afe91 181 TString numstr = fName + " Result"; //title and name of the
182 //result histogram
a57afe91 183 fResult = new TH1D(numstr.Data(),numstr.Data(),nbins,minXval,maxXval);
184 }
185
89c60e9f 186AliHBTMonOneParticleFctn1D::AliHBTMonOneParticleFctn1D(const Char_t *name, const Char_t *title,
a57afe91 187 Int_t nbins, Double_t maxXval, Double_t minXval)
188 :AliHBTMonOneParticleFctn(name,title)
189{
89c60e9f 190 //ctor
a57afe91 191 TString numstr = fName + " Result"; //title and name of the
192 //result histogram
193
194 fResult = new TH1D(numstr.Data(),numstr.Data(),nbins,minXval,maxXval);
195}
196/******************************************************************/
197AliHBTMonOneParticleFctn1D::~AliHBTMonOneParticleFctn1D()
198{
89c60e9f 199 //dtor
200 delete fResult;
a57afe91 201}
202/******************************************************************/
203
e4f2b1da 204void AliHBTMonOneParticleFctn1D::Process(AliHBTParticle* particle)
a57afe91 205{
206 //Fills the result
207 particle = CheckParticle(particle);
208 if(particle) fResult->Fill(GetValue(particle));
209}
210/******************************************************************/
211/******************************************************************/
212
213ClassImp( AliHBTMonOneParticleFctn2D )
214
89c60e9f 215AliHBTMonOneParticleFctn2D::AliHBTMonOneParticleFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval ,
a57afe91 216 Int_t nYbins, Double_t maxYval, Double_t minYval)
217
218{
89c60e9f 219 //ctor
a57afe91 220 TString numstr = fName + " Result"; //title and name of the
221 //result histogram
222
223 fResult = new TH2D(numstr.Data(),numstr.Data(),
224 nXbins,minXval,maxXval,
225 nYbins,minYval,maxYval);
a57afe91 226}
89c60e9f 227/******************************************************************/
a57afe91 228
229AliHBTMonOneParticleFctn2D::~AliHBTMonOneParticleFctn2D()
230{
89c60e9f 231 //dtor
a57afe91 232 delete fResult;
233}
e4f2b1da 234void AliHBTMonOneParticleFctn2D::Process(AliHBTParticle* particle)
a57afe91 235{
89c60e9f 236 //fills the function for one particle
a57afe91 237 particle = CheckParticle(particle);
238 if(particle)
239 {
240 Double_t x,y;
241 GetValues(particle,x,y);
242 fResult->Fill(x,y);
243 }
244}
245
246/******************************************************************/
247/******************************************************************/
248/******************************************************************/
249
250ClassImp( AliHBTMonOneParticleFctn3D)
251
252AliHBTMonOneParticleFctn3D::
253AliHBTMonOneParticleFctn3D(Int_t nXbins, Double_t maxXval, Double_t minXval,
254 Int_t nYbins, Double_t maxYval, Double_t minYval,
255 Int_t nZbins, Double_t maxZval, Double_t minZval)
256
257{
89c60e9f 258 //ctor
a57afe91 259 TString numstr = fName + " Result"; //title and name of the
260 //result histogram
261
262 fResult = new TH3D(numstr.Data(),numstr.Data(),
263 nXbins,minXval,maxXval,
264 nYbins,minYval,maxYval,
265 nZbins,minZval,maxZval);
266
267}
268/******************************************************************/
269
270AliHBTMonOneParticleFctn3D::~AliHBTMonOneParticleFctn3D()
271{
89c60e9f 272 //dtor
a57afe91 273 delete fResult;
274}
275/******************************************************************/
276
277
278/******************************************************************/
279/******************************************************************/
280/******************************************************************/
281ClassImp( AliHBTMonTwoParticleFctn1D)
282
283AliHBTMonTwoParticleFctn1D::
284AliHBTMonTwoParticleFctn1D(Int_t nbins, Double_t maxval, Double_t minval)
285 {
89c60e9f 286 //ctor
a57afe91 287 TString numstr = fName + " Result"; //title and name of the
288 //result histogram
289
290 fResult = new TH1D(numstr.Data(),numstr.Data(),
291 nbins,minval,maxval);
292
293 }
294
295AliHBTMonTwoParticleFctn1D::
296AliHBTMonTwoParticleFctn1D(const Char_t* name, const Char_t* title,
297 Int_t nbins, Double_t maxval, Double_t minval)
298 :AliHBTMonTwoParticleFctn(name,title)
299 {
89c60e9f 300 //ctor
a57afe91 301 TString numstr = fName + " Result"; //title and name of the
302 //result histogram
303
304 fResult = new TH1D(numstr.Data(),numstr.Data(),
305 nbins,minval,maxval);
306
307 }
308
309
310/******************************************************************/
311AliHBTMonTwoParticleFctn1D::~AliHBTMonTwoParticleFctn1D()
312{
89c60e9f 313 //dtor
a57afe91 314 delete fResult;
315}
316/******************************************************************/
317void AliHBTMonTwoParticleFctn1D::
e4f2b1da 318Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle)
a57afe91 319{
89c60e9f 320 //fills the function for one particle
a57afe91 321 partparticle = CheckParticle(partparticle);
322 trackparticle = CheckParticle(trackparticle);
323 if( partparticle && trackparticle)
324 {
325 Double_t x = GetValue(trackparticle,partparticle);
326 fResult->Fill(x);
327 }
328}
329/******************************************************************/
330/******************************************************************/
331/******************************************************************/
332ClassImp( AliHBTMonTwoParticleFctn2D)
333
334
335AliHBTMonTwoParticleFctn2D::
336AliHBTMonTwoParticleFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval ,
337 Int_t nYbins, Double_t maxYval, Double_t minYval)
338
339{
89c60e9f 340 //ctor
a57afe91 341 TString numstr = fName + " Result"; //title and name of the
342 //result histogram
343
344 fResult = new TH2D(numstr.Data(),numstr.Data(),
345 nXbins,minXval,maxXval,
346 nYbins,minYval,maxYval);
347
348}
349/******************************************************************/
350AliHBTMonTwoParticleFctn2D::~AliHBTMonTwoParticleFctn2D()
351{
89c60e9f 352 //dtor
a57afe91 353 delete fResult;
354}
355/******************************************************************/
356void AliHBTMonTwoParticleFctn2D::
e4f2b1da 357Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle)
a57afe91 358{
89c60e9f 359 //fills the function for one particle
a57afe91 360 partparticle = CheckParticle(partparticle);
361 trackparticle = CheckParticle(trackparticle);
362 if( partparticle && trackparticle)
363 {
364 Double_t x,y;
365 GetValues(trackparticle,partparticle,x,y);
366 fResult->Fill(x,y);
367 }
368}
369/******************************************************************/
370/******************************************************************/
371/******************************************************************/
372ClassImp(AliHBTMonTwoParticleFctn3D)
373
374void AliHBTMonTwoParticleFctn3D::
e4f2b1da 375Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle)
a57afe91 376{
89c60e9f 377 //fills the function for one particle
a57afe91 378 partparticle = CheckParticle(partparticle);
379 trackparticle = CheckParticle(trackparticle);
380 if( partparticle && trackparticle)
381 {
382 Double_t x,y,z;
383 GetValues(trackparticle,partparticle,x,y,z);
384 fResult->Fill(x,y,z);
385 }
386}
387/******************************************************************/
388/******************************************************************/
389/******************************************************************/
390/******************************************************************/
391