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