]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HBTAN/AliHBTPositionRandomizer.h
Improved version of online detector-algorithm makefile
[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
415b66b5 13#include "AliReader.h"
88cb7938 14class AliHBTRndm;
6e1592b9 15class TH1I;
88cb7938 16
415b66b5 17class AliHBTPositionRandomizer: public AliReader
88cb7938 18{
19 public:
94a709e1 20 enum EModelTypes{kGausBall,kCylinder,kCylinderSurf,kEllipse};
88cb7938 21 AliHBTPositionRandomizer();
415b66b5 22 AliHBTPositionRandomizer(AliReader* reader);
abe00f6f 23 AliHBTPositionRandomizer(const AliHBTPositionRandomizer& in);
24
25 virtual ~AliHBTPositionRandomizer();
26
34914285 27 AliHBTPositionRandomizer& operator=(const AliHBTPositionRandomizer& in);
88cb7938 28
efaf00f8 29 Int_t Next(){return (fReader)?fReader->Next():1;}
30 void Rewind(){if(fReader) fReader->Rewind();}
31
415b66b5 32 Bool_t ReadsRec() const {return (fReader)?fReader->ReadsRec():kFALSE;}
33 Bool_t ReadsSim() const {return (fReader)?fReader->ReadsSim():kFALSE;}
efaf00f8 34
1c654289 35 AliAOD* GetEventSim() const ;
36 AliAOD* GetEventRec() const ;
88cb7938 37
415b66b5 38 AliAOD* GetEventSim(Int_t n);
39 AliAOD* GetEventRec(Int_t n){return (fReader)?fReader->GetEventRec(n):0x0;}
40
41 Int_t GetNumberOfSimEvents(){return (fReader)?fReader->GetNumberOfSimEvents():0;}
42 Int_t GetNumberOfRecEvents(){return (fReader)?fReader->GetNumberOfRecEvents():0;}
6e1592b9 43 virtual TH1I* GetTrackCounter() const {return (fReader)?fReader->GetTrackCounter():0x0;}
44 virtual void WriteTrackCounter() const {if(fReader) fReader->WriteTrackCounter();}
45
415b66b5 46 void Randomize(AliAOD* event) const;
88cb7938 47 void SetEventVertex(Double_t x, Double_t y,Double_t z);
48
a296aa84 49 void SetRandomizer(Int_t pid,AliHBTRndm* rndm);
50
51 void SetGaussianBall(Int_t pid, Double_t r, Double_t meantime, Double_t sigmatime);
52 void SetGaussianBall(Int_t pid, Double_t rx, Double_t ry, Double_t rz, Double_t meantime, Double_t sigmatime);
53 void SetCyllinderSurface(Int_t pid, Double_t r, Double_t l);
54 void SetEllipse(Int_t pid, Double_t rmin, Double_t rmax);
88cb7938 55
3a3bc78a 56 void AddToPosition(Bool_t flag){fAddToExistingPos = flag;}
57 void RandomizeTracks(Bool_t flag){fRandomizeTracks = flag;}
58
a296aa84 59 AliHBTRndm* GetRandomizer(Int_t pdg) const;
60 Int_t GetRandomizerIndex(Int_t pdg) const;
3a3bc78a 61
88cb7938 62 protected:
94a709e1 63 void Randomize(Double_t& x,Double_t& y,Double_t&z,AliVAODParticle*p);
efaf00f8 64 Int_t ReadNext(){return (fReader)?fReader->Next():1;}
abe00f6f 65
88cb7938 66 private:
a296aa84 67 AliReader* fReader; // Pointer to reader
68 AliHBTRndm* fDefaultRandomizer; // Pointer to class that performs randomization according to some model - default one
69 TObjArray* fRandomizers;//array with randomizers - each particle type can have different randomization parameters/model
70 Int_t fNPid;//number of randomizers defined in fPid and fRandomizers
71 Int_t* fPids;//[fgkNumberOfPids]
72
73 Bool_t fAddToExistingPos; //Determines if randomized position should be added to previous one, or overwrite old one
74 Bool_t fOnlyParticlesFromVertex; //Determines if randomization should be performed for particles from vertex
88cb7938 75
a296aa84 76 Bool_t fRandomizeTracks; //Determines if tracks should also be randimized
77
78 Double_t fVX; //vertex position
79 Double_t fVY; //vertex position
80 Double_t fVZ; //vertex position
3a3bc78a 81
a296aa84 82 static const Int_t fgkNumberOfPids;//size of fPid array
88cb7938 83
84 ClassDef(AliHBTPositionRandomizer,1)
85};
86
a296aa84 87/*********************************************************************/
88/*********************************************************************/
89/*********************************************************************/
90
88cb7938 91class AliHBTRndm: public TObject
92{
93 public:
94 AliHBTRndm(){}
abe00f6f 95 virtual ~AliHBTRndm(){}
a296aa84 96 virtual void Randomize(Double_t& x, Double_t& y, Double_t& z, Double_t& t, AliVAODParticle*p) const = 0;
94a709e1 97 ClassDef(AliHBTRndm,1)
88cb7938 98};
99
a296aa84 100/*********************************************************************/
101/*********************************************************************/
102/*********************************************************************/
103
88cb7938 104class AliHBTRndmGaussBall: public AliHBTRndm
105{
106 public:
107 AliHBTRndmGaussBall();
a296aa84 108 AliHBTRndmGaussBall(Float_t r, Double_t meantime, Double_t sigmatime);
109 AliHBTRndmGaussBall(Float_t rx, Float_t ry, Float_t rz, Double_t meantime, Double_t sigmatime);
abe00f6f 110 virtual ~AliHBTRndmGaussBall(){}
a296aa84 111 void Randomize(Double_t& x,Double_t& y,Double_t&z, Double_t& t, AliVAODParticle*/*particle*/) const;
88cb7938 112 private:
abe00f6f 113 Float_t fRx; //Dispertion in x
114 Float_t fRy; //Dispertion in y
115 Float_t fRz; //Dispertion in z
a296aa84 116 Float_t fTmean; //Mean emision time in t
117 Float_t fTsigma; //Dispertion in t
88cb7938 118 ClassDef(AliHBTRndmGaussBall,1)
119};
120
a296aa84 121/*********************************************************************/
122/*********************************************************************/
123/*********************************************************************/
124
88cb7938 125class AliHBTRndmCyllSurf: public AliHBTRndm
126{
127 public:
128 AliHBTRndmCyllSurf():fR(0.0){}
129 AliHBTRndmCyllSurf(Float_t r, Float_t l):fR(r),fL(l){}
abe00f6f 130 virtual ~AliHBTRndmCyllSurf(){}
88cb7938 131
a296aa84 132 void Randomize(Double_t& x,Double_t& y,Double_t&z, Double_t& /*t*/t, AliVAODParticle* particle) const;
88cb7938 133 private:
abe00f6f 134 Float_t fR; //Redius of cylinder
135 Float_t fL; //Length of cylinder
88cb7938 136
137 ClassDef(AliHBTRndmCyllSurf,1)
138};
139
a296aa84 140/*********************************************************************/
141/*********************************************************************/
142/*********************************************************************/
143
94a709e1 144class AliHBTRndmEllipse: public AliHBTRndm
145{
146 public:
147 AliHBTRndmEllipse():fRmin(0.),fRmax(0.){};
148 AliHBTRndmEllipse(Float_t rmin, Float_t rmax);
149 virtual ~AliHBTRndmEllipse(){}
150
a296aa84 151 void Randomize(Double_t& x,Double_t& y, Double_t& z, Double_t& , AliVAODParticle* particle) const;
94a709e1 152 private:
153 Float_t fRmin; //Radius in x direction
154 Float_t fRmax; //Radius in y direction
155
a296aa84 156 ClassDef(AliHBTRndmEllipse,2)
94a709e1 157};
158
159
160
88cb7938 161#endif
162