3 //__________________________________________________________
4 /////////////////////////////////////////////////////////////
6 // class AliGenHBTosl //
8 // Genarator simulating particle correlations //
10 // The main idea of the generator is to produce particles //
11 // according to some distribution of two particle //
12 // property. In HBT they are qout,qsie and qlong. //
13 // In order to be able to generate signal that produces //
14 // given two particle correlation background must be //
15 // known before in order to produce the shape of signal //
16 // to randomize given distribution from. //
18 // The generator works as follows: //
19 // 1. Coarse Background (fQCoarseBackground) is generated //
20 // ade from the particles //
21 // given by the external generator (variable //
22 // fGenerator) by the mixing technique. //
23 // 2. Coarse signal is prduced by multiplying Coarse //
24 // background by a required function //
25 // See method FillCoarseSignal //
26 // 3. Signal is randomized out of the coarse signal //
27 // histogram (two particle property). First particle //
28 // is taken from the external generator, and the //
29 // second one is CALCULATED on the basis of the first //
30 // one and the two particle property (qout,qside,qlong)//
31 // Background is made by the mixing out of the //
32 // genereted signal events. //
33 // This step is cotinued up to the moment signal //
34 // histogram has enough statistics (data member //
36 // See method StartSignalPass1() //
37 // 4. chi is calculated for each bin (chiarray variqable) //
38 // (not the chi2 because sign is important) //
39 // Two particle prioperty //
40 // (qout,qside,qlong) is chosen at the points that //
41 // chi is the smallest. First particle is taken from //
42 // the the external generator (fGenerator) and second's /
43 // momenta are caclulated out of their momenta and //
44 // (qout,qside,qlong). Background is updated //
45 // continuesely for all the events. This step is //
46 // continued until stability conditions are fullfiled //
47 // or maximum number of iteration is reached. //
48 // 5. The same as step 4 but events are stored. //
50 ////////////////////////////////////////////////////////////
52 #include "AliGenerator.h"
59 class AliGenHBTosl: public AliGenerator
63 AliGenHBTosl(Int_t n,Int_t pid = 211);
64 virtual ~AliGenHBTosl();
69 void SetGenerator(AliGenerator* gen){fGenerator = gen;}
70 void SetDebug(Int_t debug){fDebug = debug;}
71 Int_t GetDebug() const {return fDebug;}
73 void Rotate(TVector3& relvector, TVector3& vector);
74 Double_t Rotate(Double_t x,Double_t y,Double_t z);
75 void SetSamplePhiRange(Float_t min,Float_t max){fSamplePhiMin = min; fSamplePhiMax = max;}
77 Int_t GetThreeD(TParticle* first,TParticle* second, Double_t qout, Double_t qside, Double_t qlong);
82 void GetOneD(TParticle* first, TParticle* second,Double_t qinv);
85 void FillCoarseSignal();
87 void StartSignalPass1();
88 void Mix(TList* eventbuffer,TH3D* denominator,TH3D* denominator2);
89 void Mix(AliStack* stack, TH3D* numerator, TH3D* numerator2);
90 Double_t GetQInv(TParticle* f, TParticle* s);
91 void GetQOutQSideQLong(TParticle* f, TParticle* s,Double_t& out, Double_t& side, Double_t& lon);
92 Double_t GetQInvCorrTheorValue(Double_t qinv) const;
93 Double_t GetQOutQSideQLongCorrTheorValue(Double_t& out, Double_t& side, Double_t& lon) const;
95 Double_t Scale(TH3D* num,TH3D* den);
96 void SetTrack(TParticle* p, Int_t& ntr);
97 void SetTrack(TParticle* p, Int_t& ntr, AliStack* stack);
99 AliStack* RotateStack();
100 void SwapGeneratingHistograms();
101 void TestCoarseSignal();
103 Bool_t CheckParticle(TParticle* p, TParticle* aupair,AliStack* stack);
105 TH3D* fQCoarseBackground;//Initial Background
106 TH3D* fQCoarseSignal;//
110 TH3D* fQSecondSignal;
111 TH3D* fQSecondBackground;
115 AliGenerator* fGenerator;
121 Bool_t fSignalShapeCreated;
123 Int_t fMaxIterations; //maximal nuber of iterations on startup
124 Float_t fMaxChiSquereChange;//value of ChiSqr change in %, when sturtup process in stable
125 Float_t fMaxChiSquerePerNDF;//value of the chi2 where generating histograms are considered as good
131 //we limit mixing to some finit phi range to make it faster
132 Float_t fSamplePhiMin;//
133 Float_t fSamplePhiMax;//
135 Float_t fSignalRegion;
141 ClassDef(AliGenHBTosl,1)