1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 #include "AliHBTMonitorFunction.h"
21 //__________________________________________________________________
22 ////////////////////////////////////////////////////////////////////
24 // class AliHBTMonitorFunction
26 // class AliHBTMonOneParticleFctn
27 // class AliHBTMonTwoParticleFctn
29 // class AliHBTMonOneParticleFctn1D
30 // class AliHBTMonOneParticleFctn2D
31 // class AliHBTMonOneParticleFctn3D
33 // class AliHBTMonTwoParticleFctn1D
34 // class AliHBTMonTwoParticleFctn2D
35 // class AliHBTMonTwoParticleFctn3D
37 // Base Classes for monitoring functions
38 // author: chajecki@if.pw.edu.pl
40 /******************************************************************/
42 Base classes for monitor functions
52 one particle two particle
57 Zbigniew.Chajecki@cern.ch
60 ///////////////////////////////////////////////////////////////////////
63 ClassImp( AliHBTMonitorFunction )
65 AliHBTMonitorFunction::AliHBTMonitorFunction():
66 fParticleCut(new AliAODParticleEmptyCut())
70 /******************************************************************/
71 AliHBTMonitorFunction::AliHBTMonitorFunction(const char* name,const char* title):
73 fParticleCut(new AliAODParticleEmptyCut())
77 /******************************************************************/
78 AliHBTMonitorFunction::AliHBTMonitorFunction(const AliHBTMonitorFunction& /*in*/):
80 fParticleCut(new AliAODParticleEmptyCut())
83 // We cannot copy because it is a mess with names (histogram and functions)
84 MayNotUse("AliHBTMonitorFunction(const AliHBTMonitorFunction&");
86 /******************************************************************/
87 AliHBTMonitorFunction& AliHBTMonitorFunction::operator=(const AliHBTMonitorFunction& /*in*/)
90 // We cannot copy because it is a mess with names (histogram and functions)
91 MayNotUse("operator=");
94 /******************************************************************/
96 AliHBTMonitorFunction::~AliHBTMonitorFunction()
101 /******************************************************************/
103 Int_t AliHBTMonitorFunction::Write(const char*,Int_t, Int_t)
105 //Writes an function to disk
106 if (GetResult()) GetResult()->Write();
109 /******************************************************************/
111 void AliHBTMonitorFunction::Init()
113 //Writes an function to disk
114 AliDebug(1,"Entering");
116 if (GetResult() == 0x0)
118 Warning("Init","Function has NULL result histogram!");
121 GetResult()->Reset();
122 GetResult()->SetDirectory(0x0);
125 /******************************************************************/
127 void AliHBTMonitorFunction::SetParticleCut(AliAODParticleCut* cut)
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
139 Error("AliHBTMonitorFunction::SetParticleCut","argument is NULL");
143 fParticleCut = (AliAODParticleCut*)cut->Clone();
146 /******************************************************************/
148 void AliHBTMonitorFunction::Rename(const Char_t * name)
150 //renames the function and histograms
154 TString numstr = fName + " Result"; //title and name of the
156 GetResult()->SetName(numstr.Data());
157 GetResult()->SetTitle(numstr.Data());
159 /******************************************************************/
161 void AliHBTMonitorFunction::Rename(const Char_t * name, const Char_t * title)
163 //renames and retitle the function and histograms
168 TString numstrn = fName + " Result"; //name of the
171 TString numstrt = fTitle + " Result"; //title of the
175 GetResult()->SetName(numstrn.Data());
176 GetResult()->SetTitle(numstrt.Data());
180 /******************************************************************/
181 /******************************************************************/
182 /******************************************************************/
183 ClassImp( AliHBTMonOneParticleFctn ) //z.ch.
184 /******************************************************************/
185 /******************************************************************/
186 ClassImp( AliHBTMonTwoParticleFctn ) //z.ch.
187 /******************************************************************/
188 /******************************************************************/
189 /******************************************************************/
190 ClassImp( AliHBTMonOneParticleFctn1D )
191 AliHBTMonOneParticleFctn1D::AliHBTMonOneParticleFctn1D():
196 /******************************************************************/
198 AliHBTMonOneParticleFctn1D::AliHBTMonOneParticleFctn1D(Int_t nbins, Double_t maxXval, Double_t minXval) :
202 TString numstr = fName + " Result"; //title and name of the
204 fResult = new TH1D(numstr.Data(),numstr.Data(),nbins,minXval,maxXval);
208 AliHBTMonOneParticleFctn1D::AliHBTMonOneParticleFctn1D(const Char_t *name, const Char_t *title,
209 Int_t nbins, Double_t maxXval, Double_t minXval) :
210 AliHBTMonOneParticleFctn(name,title),
215 TString numstr = fName + " Result"; //title and name of the
218 fResult = new TH1D(numstr.Data(),numstr.Data(),nbins,minXval,maxXval);
220 fResult->SetDirectory(0x0);
223 /******************************************************************/
224 AliHBTMonOneParticleFctn1D::~AliHBTMonOneParticleFctn1D()
229 /******************************************************************/
231 void AliHBTMonOneParticleFctn1D::Process(AliVAODParticle* particle)
234 particle = CheckParticle(particle);
235 if(particle) fResult->Fill(GetValue(particle));
237 /******************************************************************/
238 /******************************************************************/
240 ClassImp( AliHBTMonOneParticleFctn2D )
242 AliHBTMonOneParticleFctn2D::AliHBTMonOneParticleFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval ,
243 Int_t nYbins, Double_t maxYval, Double_t minYval) :
247 TString numstr = fName + " Result"; //title and name of the
250 fResult = new TH2D(numstr.Data(),numstr.Data(),
251 nXbins,minXval,maxXval,
252 nYbins,minYval,maxYval);
254 fResult->SetDirectory(0x0);
256 /******************************************************************/
258 AliHBTMonOneParticleFctn2D::~AliHBTMonOneParticleFctn2D()
263 void AliHBTMonOneParticleFctn2D::Process(AliVAODParticle* particle)
265 //fills the function for one particle
266 particle = CheckParticle(particle);
270 GetValues(particle,x,y);
275 /******************************************************************/
276 /******************************************************************/
277 /******************************************************************/
279 ClassImp( AliHBTMonOneParticleFctn3D)
281 AliHBTMonOneParticleFctn3D::
282 AliHBTMonOneParticleFctn3D(Int_t nXbins, Double_t maxXval, Double_t minXval,
283 Int_t nYbins, Double_t maxYval, Double_t minYval,
284 Int_t nZbins, Double_t maxZval, Double_t minZval) :
288 TString numstr = fName + " Result"; //title and name of the
291 fResult = new TH3D(numstr.Data(),numstr.Data(),
292 nXbins,minXval,maxXval,
293 nYbins,minYval,maxYval,
294 nZbins,minZval,maxZval);
296 fResult->SetDirectory(0x0);
299 /******************************************************************/
301 AliHBTMonOneParticleFctn3D::~AliHBTMonOneParticleFctn3D()
306 /******************************************************************/
309 /******************************************************************/
310 /******************************************************************/
311 /******************************************************************/
312 ClassImp( AliHBTMonTwoParticleFctn1D)
314 AliHBTMonTwoParticleFctn1D::
315 AliHBTMonTwoParticleFctn1D(Int_t nbins, Double_t maxval, Double_t minval) :
319 TString numstr = fName + " Result"; //title and name of the
322 fResult = new TH1D(numstr.Data(),numstr.Data(),
323 nbins,minval,maxval);
325 fResult->SetDirectory(0x0);
328 AliHBTMonTwoParticleFctn1D::
329 AliHBTMonTwoParticleFctn1D(const Char_t* name, const Char_t* title,
330 Int_t nbins, Double_t maxval, Double_t minval)
331 :AliHBTMonTwoParticleFctn(name,title),
335 TString numstr = fName + " Result"; //title and name of the
338 fResult = new TH1D(numstr.Data(),numstr.Data(),
339 nbins,minval,maxval);
341 fResult->SetDirectory(0x0);
345 /******************************************************************/
346 AliHBTMonTwoParticleFctn1D::~AliHBTMonTwoParticleFctn1D()
351 /******************************************************************/
352 void AliHBTMonTwoParticleFctn1D::
353 Process(AliVAODParticle* trackparticle, AliVAODParticle* partparticle)
355 //fills the function for one particle
356 partparticle = CheckParticle(partparticle);
357 trackparticle = CheckParticle(trackparticle);
358 if( partparticle && trackparticle)
360 Double_t x = GetValue(trackparticle,partparticle);
364 /******************************************************************/
365 /******************************************************************/
366 /******************************************************************/
367 ClassImp( AliHBTMonTwoParticleFctn2D)
370 AliHBTMonTwoParticleFctn2D::
371 AliHBTMonTwoParticleFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval ,
372 Int_t nYbins, Double_t maxYval, Double_t minYval) :
376 TString numstr = fName + " Result"; //title and name of the
379 fResult = new TH2D(numstr.Data(),numstr.Data(),
380 nXbins,minXval,maxXval,
381 nYbins,minYval,maxYval);
383 fResult->SetDirectory(0x0);
385 /******************************************************************/
386 AliHBTMonTwoParticleFctn2D::~AliHBTMonTwoParticleFctn2D()
391 /******************************************************************/
392 void AliHBTMonTwoParticleFctn2D::
393 Process(AliVAODParticle* trackparticle, AliVAODParticle* partparticle)
395 //fills the function for one particle
396 partparticle = CheckParticle(partparticle);
397 trackparticle = CheckParticle(trackparticle);
398 if( partparticle && trackparticle)
401 GetValues(trackparticle,partparticle,x,y);
405 /******************************************************************/
406 /******************************************************************/
407 /******************************************************************/
408 ClassImp(AliHBTMonTwoParticleFctn3D)
410 void AliHBTMonTwoParticleFctn3D::
411 Process(AliVAODParticle* trackparticle, AliVAODParticle* partparticle)
413 //fills the function for one particle
414 partparticle = CheckParticle(partparticle);
415 trackparticle = CheckParticle(trackparticle);
416 if( partparticle && trackparticle)
419 GetValues(trackparticle,partparticle,x,y,z);
420 fResult->Fill(x,y,z);
423 /******************************************************************/
424 /******************************************************************/
425 /******************************************************************/
426 /******************************************************************/