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)
201 TString numstr = fName + " Result"; //title and name of the
203 fResult = new TH1D(numstr.Data(),numstr.Data(),nbins,minXval,maxXval);
207 AliHBTMonOneParticleFctn1D::AliHBTMonOneParticleFctn1D(const Char_t *name, const Char_t *title,
208 Int_t nbins, Double_t maxXval, Double_t minXval)
209 :AliHBTMonOneParticleFctn(name,title)
212 TString numstr = fName + " Result"; //title and name of the
215 fResult = new TH1D(numstr.Data(),numstr.Data(),nbins,minXval,maxXval);
217 fResult->SetDirectory(0x0);
220 /******************************************************************/
221 AliHBTMonOneParticleFctn1D::~AliHBTMonOneParticleFctn1D()
226 /******************************************************************/
228 void AliHBTMonOneParticleFctn1D::Process(AliVAODParticle* particle)
231 particle = CheckParticle(particle);
232 if(particle) fResult->Fill(GetValue(particle));
234 /******************************************************************/
235 /******************************************************************/
237 ClassImp( AliHBTMonOneParticleFctn2D )
239 AliHBTMonOneParticleFctn2D::AliHBTMonOneParticleFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval ,
240 Int_t nYbins, Double_t maxYval, Double_t minYval)
244 TString numstr = fName + " Result"; //title and name of the
247 fResult = new TH2D(numstr.Data(),numstr.Data(),
248 nXbins,minXval,maxXval,
249 nYbins,minYval,maxYval);
251 fResult->SetDirectory(0x0);
253 /******************************************************************/
255 AliHBTMonOneParticleFctn2D::~AliHBTMonOneParticleFctn2D()
260 void AliHBTMonOneParticleFctn2D::Process(AliVAODParticle* particle)
262 //fills the function for one particle
263 particle = CheckParticle(particle);
267 GetValues(particle,x,y);
272 /******************************************************************/
273 /******************************************************************/
274 /******************************************************************/
276 ClassImp( AliHBTMonOneParticleFctn3D)
278 AliHBTMonOneParticleFctn3D::
279 AliHBTMonOneParticleFctn3D(Int_t nXbins, Double_t maxXval, Double_t minXval,
280 Int_t nYbins, Double_t maxYval, Double_t minYval,
281 Int_t nZbins, Double_t maxZval, Double_t minZval)
285 TString numstr = fName + " Result"; //title and name of the
288 fResult = new TH3D(numstr.Data(),numstr.Data(),
289 nXbins,minXval,maxXval,
290 nYbins,minYval,maxYval,
291 nZbins,minZval,maxZval);
293 fResult->SetDirectory(0x0);
296 /******************************************************************/
298 AliHBTMonOneParticleFctn3D::~AliHBTMonOneParticleFctn3D()
303 /******************************************************************/
306 /******************************************************************/
307 /******************************************************************/
308 /******************************************************************/
309 ClassImp( AliHBTMonTwoParticleFctn1D)
311 AliHBTMonTwoParticleFctn1D::
312 AliHBTMonTwoParticleFctn1D(Int_t nbins, Double_t maxval, Double_t minval)
315 TString numstr = fName + " Result"; //title and name of the
318 fResult = new TH1D(numstr.Data(),numstr.Data(),
319 nbins,minval,maxval);
321 fResult->SetDirectory(0x0);
324 AliHBTMonTwoParticleFctn1D::
325 AliHBTMonTwoParticleFctn1D(const Char_t* name, const Char_t* title,
326 Int_t nbins, Double_t maxval, Double_t minval)
327 :AliHBTMonTwoParticleFctn(name,title)
330 TString numstr = fName + " Result"; //title and name of the
333 fResult = new TH1D(numstr.Data(),numstr.Data(),
334 nbins,minval,maxval);
336 fResult->SetDirectory(0x0);
340 /******************************************************************/
341 AliHBTMonTwoParticleFctn1D::~AliHBTMonTwoParticleFctn1D()
346 /******************************************************************/
347 void AliHBTMonTwoParticleFctn1D::
348 Process(AliVAODParticle* trackparticle, AliVAODParticle* partparticle)
350 //fills the function for one particle
351 partparticle = CheckParticle(partparticle);
352 trackparticle = CheckParticle(trackparticle);
353 if( partparticle && trackparticle)
355 Double_t x = GetValue(trackparticle,partparticle);
359 /******************************************************************/
360 /******************************************************************/
361 /******************************************************************/
362 ClassImp( AliHBTMonTwoParticleFctn2D)
365 AliHBTMonTwoParticleFctn2D::
366 AliHBTMonTwoParticleFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval ,
367 Int_t nYbins, Double_t maxYval, Double_t minYval)
371 TString numstr = fName + " Result"; //title and name of the
374 fResult = new TH2D(numstr.Data(),numstr.Data(),
375 nXbins,minXval,maxXval,
376 nYbins,minYval,maxYval);
378 fResult->SetDirectory(0x0);
380 /******************************************************************/
381 AliHBTMonTwoParticleFctn2D::~AliHBTMonTwoParticleFctn2D()
386 /******************************************************************/
387 void AliHBTMonTwoParticleFctn2D::
388 Process(AliVAODParticle* trackparticle, AliVAODParticle* partparticle)
390 //fills the function for one particle
391 partparticle = CheckParticle(partparticle);
392 trackparticle = CheckParticle(trackparticle);
393 if( partparticle && trackparticle)
396 GetValues(trackparticle,partparticle,x,y);
400 /******************************************************************/
401 /******************************************************************/
402 /******************************************************************/
403 ClassImp(AliHBTMonTwoParticleFctn3D)
405 void AliHBTMonTwoParticleFctn3D::
406 Process(AliVAODParticle* trackparticle, AliVAODParticle* partparticle)
408 //fills the function for one particle
409 partparticle = CheckParticle(partparticle);
410 trackparticle = CheckParticle(trackparticle);
411 if( partparticle && trackparticle)
414 GetValues(trackparticle,partparticle,x,y,z);
415 fResult->Fill(x,y,z);
418 /******************************************************************/
419 /******************************************************************/
420 /******************************************************************/
421 /******************************************************************/