1 #ifndef ALIHBTPOSITIONRANDOMIZER_H
2 #define ALIHBTPOSITIONRANDOMIZER_H
3 //___________________________________________________
4 ////////////////////////////////////////////////////////////////////////////////
6 // class AliHBTPositionRandomizer
8 // These class randomizes particle vertex positions
9 // Piotr.Skowronski@cern.ch
11 ////////////////////////////////////////////////////////////////////////////////
13 #include "AliReader.h"
17 class AliHBTPositionRandomizer: public AliReader
20 enum EModelTypes{kGausBall,kCylinder,kCylinderSurf};
21 AliHBTPositionRandomizer();
22 AliHBTPositionRandomizer(AliReader* reader);
23 AliHBTPositionRandomizer(const AliHBTPositionRandomizer& in);
25 virtual ~AliHBTPositionRandomizer();
27 AliHBTPositionRandomizer& operator=(const AliHBTPositionRandomizer& in);
29 Int_t Next(){return (fReader)?fReader->Next():1;}
30 void Rewind(){if(fReader) fReader->Rewind();}
32 Bool_t ReadsRec() const {return (fReader)?fReader->ReadsRec():kFALSE;}
33 Bool_t ReadsSim() const {return (fReader)?fReader->ReadsSim():kFALSE;}
35 AliAOD* GetEventSim() const ;
36 AliAOD* GetEventRec() const ;
38 AliAOD* GetEventSim(Int_t n);
39 AliAOD* GetEventRec(Int_t n){return (fReader)?fReader->GetEventRec(n):0x0;}
41 Int_t GetNumberOfSimEvents(){return (fReader)?fReader->GetNumberOfSimEvents():0;}
42 Int_t GetNumberOfRecEvents(){return (fReader)?fReader->GetNumberOfRecEvents():0;}
43 virtual TH1I* GetTrackCounter() const {return (fReader)?fReader->GetTrackCounter():0x0;}
44 virtual void WriteTrackCounter() const {if(fReader) fReader->WriteTrackCounter();}
46 void Randomize(AliAOD* event) const;
47 void SetEventVertex(Double_t x, Double_t y,Double_t z);
49 void SetGaussianBall(Double_t r);
50 void SetGaussianBall(Double_t rx, Double_t ry, Double_t rz);
51 void SetCyllinderSurface(Double_t r, Double_t l);
53 void AddToPosition(Bool_t flag){fAddToExistingPos = flag;}
54 void RandomizeTracks(Bool_t flag){fRandomizeTracks = flag;}
58 void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*p);
59 Int_t ReadNext(){return (fReader)?fReader->Next():1;}
62 AliReader* fReader; // Pointer to reader
63 AliHBTRndm* fRandomizer; // Pointer to class that performs randomization according to some model
65 Int_t fModel; //Defines what model is used
67 Bool_t fAddToExistingPos; //Determines if randomized position should be added to previous one, or overwrite old one
68 Bool_t fOnlyParticlesFromVertex; //Determines if randomization should be performed for particles from vertex
70 Bool_t fRandomizeTracks; //Determines if tracks should also be randimized
72 Double_t fVX; //vertex position
73 Double_t fVY; //vertex position
74 Double_t fVZ; //vertex position
76 ClassDef(AliHBTPositionRandomizer,1)
79 class AliHBTRndm: public TObject
83 virtual ~AliHBTRndm(){}
84 virtual void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*p) const = 0;
85 ClassDef(AliHBTRndm,1)
88 class AliHBTRndmGaussBall: public AliHBTRndm
91 AliHBTRndmGaussBall();
92 AliHBTRndmGaussBall(Float_t r);
93 AliHBTRndmGaussBall(Float_t rx, Float_t ry, Float_t rz);
94 virtual ~AliHBTRndmGaussBall(){}
95 void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*/*particle*/) const;
97 Float_t fRx; //Dispertion in x
98 Float_t fRy; //Dispertion in y
99 Float_t fRz; //Dispertion in z
100 ClassDef(AliHBTRndmGaussBall,1)
103 class AliHBTRndmCyllSurf: public AliHBTRndm
106 AliHBTRndmCyllSurf():fR(0.0){}
107 AliHBTRndmCyllSurf(Float_t r, Float_t l):fR(r),fL(l){}
108 virtual ~AliHBTRndmCyllSurf(){}
110 void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle* particle) const;
112 Float_t fR; //Redius of cylinder
113 Float_t fL; //Length of cylinder
115 ClassDef(AliHBTRndmCyllSurf,1)