]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HBTAN/AliHBTPositionRandomizer.h
const X& X::operator=(const X&) --> X& X::operator=(const X&)
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPositionRandomizer.h
CommitLineData
88cb7938 1#ifndef ALIHBTPOSITIONRANDOMIZER_H
2#define ALIHBTPOSITIONRANDOMIZER_H
abe00f6f 3//___________________________________________________
4////////////////////////////////////////////////////////////////////////////////
5//
6// class AliHBTPositionRandomizer
7//
8// These class randomizes particle vertex positions
9// Piotr.Skowronski@cern.ch
10//
11////////////////////////////////////////////////////////////////////////////////
88cb7938 12
13#include "AliHBTReader.h"
14
15class AliHBTRndm;
16class AliHBTEvent;
17class AliHBTRun;
18class AliHBTParticle;
6e1592b9 19class TH1I;
88cb7938 20
21class AliHBTPositionRandomizer: public AliHBTReader
22{
23 public:
24 enum EModelTypes{kGausBall,kCylinder,kCylinderSurf};
25 AliHBTPositionRandomizer();
26 AliHBTPositionRandomizer(AliHBTReader* reader);
abe00f6f 27 AliHBTPositionRandomizer(const AliHBTPositionRandomizer& in);
28
29 virtual ~AliHBTPositionRandomizer();
30
34914285 31 AliHBTPositionRandomizer& operator=(const AliHBTPositionRandomizer& in);
88cb7938 32
efaf00f8 33 Int_t Next(){return (fReader)?fReader->Next():1;}
34 void Rewind(){if(fReader) fReader->Rewind();}
35
36 Bool_t ReadsTracks() const {return (fReader)?fReader->ReadsTracks():kFALSE;}
37 Bool_t ReadsParticles() const {return (fReader)?fReader->ReadsParticles():kFALSE;}
38
39 Int_t Read(AliHBTRun* particles, AliHBTRun *tracks);
40
41 AliHBTEvent* GetParticleEvent() ;
42 AliHBTEvent* GetTrackEvent() ;
88cb7938 43
44 AliHBTEvent* GetParticleEvent(Int_t n);
45 AliHBTEvent* GetTrackEvent(Int_t n){return (fReader)?fReader->GetTrackEvent(n):0x0;}
46 Int_t GetNumberOfPartEvents(){return (fReader)?fReader->GetNumberOfPartEvents():0;}
47 Int_t GetNumberOfTrackEvents(){return (fReader)?fReader->GetNumberOfTrackEvents():0;}
6e1592b9 48 virtual TH1I* GetTrackCounter() const {return (fReader)?fReader->GetTrackCounter():0x0;}
49 virtual void WriteTrackCounter() const {if(fReader) fReader->WriteTrackCounter();}
50
abe00f6f 51 void Randomize(AliHBTEvent* event) const;
52 void Randomize(AliHBTRun* run) const;
88cb7938 53 void SetEventVertex(Double_t x, Double_t y,Double_t z);
54
55 void SetGaussianBall(Double_t r);
56 void SetGaussianBall(Double_t rx, Double_t ry, Double_t rz);
57 void SetCyllinderSurface(Double_t r, Double_t l);
58
59 protected:
60 void Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle*p);
efaf00f8 61 Int_t ReadNext(){return (fReader)?fReader->Next():1;}
abe00f6f 62
88cb7938 63 private:
abe00f6f 64 AliHBTReader* fReader; // Pointer to reader
65 AliHBTRndm* fRandomizer; // Pointer to class that performs randomization according to some model
88cb7938 66
abe00f6f 67 Int_t fModel; //Defines what model is used
88cb7938 68
abe00f6f 69 Bool_t fAddToExistingPos; //Determines if randomized position should be added to previous one, or overwrite old one
70 Bool_t fOnlyParticlesFromVertex; //Determines if randomization should be performed for particles from vertex
88cb7938 71
72 Double_t fVX; //vertex position
73 Double_t fVY; //vertex position
74 Double_t fVZ; //vertex position
75
76 ClassDef(AliHBTPositionRandomizer,1)
77};
78
79class AliHBTRndm: public TObject
80{
81 public:
82 AliHBTRndm(){}
abe00f6f 83 virtual ~AliHBTRndm(){}
84 virtual void Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle*p) const = 0;
88cb7938 85 ClassDef(AliHBTRndm,1)
86};
87
88class AliHBTRndmGaussBall: public AliHBTRndm
89{
90 public:
91 AliHBTRndmGaussBall();
92 AliHBTRndmGaussBall(Float_t r);
93 AliHBTRndmGaussBall(Float_t rx, Float_t ry, Float_t rz);
abe00f6f 94 virtual ~AliHBTRndmGaussBall(){}
95 void Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle*/*particle*/) const;
88cb7938 96 private:
abe00f6f 97 Float_t fRx; //Dispertion in x
98 Float_t fRy; //Dispertion in y
99 Float_t fRz; //Dispertion in z
88cb7938 100 ClassDef(AliHBTRndmGaussBall,1)
101};
102
103class AliHBTRndmCyllSurf: public AliHBTRndm
104{
105 public:
106 AliHBTRndmCyllSurf():fR(0.0){}
107 AliHBTRndmCyllSurf(Float_t r, Float_t l):fR(r),fL(l){}
abe00f6f 108 virtual ~AliHBTRndmCyllSurf(){}
88cb7938 109
abe00f6f 110 void Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle* particle) const;
88cb7938 111 private:
abe00f6f 112 Float_t fR; //Redius of cylinder
113 Float_t fL; //Length of cylinder
88cb7938 114
115 ClassDef(AliHBTRndmCyllSurf,1)
116};
117
118#endif
119