Retrofeed from 4-01-Release
[u/mrichter/AliRoot.git] / HBTAN / AliHBTCorrFitFctn.cxx
CommitLineData
8bcc1321 1#include "AliHBTCorrFitFctn.h"
2//____________________________________________________________
3///////////////////////////////////////////////////////////////
4// //
5// class AliHBTCorrFitFctn //
6// //
7// //
8///////////////////////////////////////////////////////////////
9
8bcc1321 10ClassImp(AliHBTCorrFitFctn)
11
12/*****************************************************************/
13
62e1b4fe 14AliHBTCorrFitFctn::AliHBTCorrFitFctn():
15 AliHBTOnePairFctn1D(),
16 fNtuple(0x0),
17 fNPairsFitArea(0),
18 fNMaxPairsFitArea(3000000),
19 fFitRangeMax(0.05),
20 fNPairsNormArea(0),
21 fNMaxPairsNormArea(1000000),
22 fNormRangeMin(0.05),
23 fNormRangeMax(0.1)
24{
25//ctor
26 fWriteNumAndDen = kTRUE;//change default behaviour
27 Rename("wqinvcfCorrFit","Lednicky Weught Theoretical Q_{inv} Correlation Function");
28}
29/*****************************************************************/
30
31AliHBTCorrFitFctn::AliHBTCorrFitFctn(Int_t fit, Int_t norm):
32 AliHBTOnePairFctn1D(100,0.1,0.0),
8bcc1321 33 fNtuple(new TNtuple("pair", "pair", "px1:py1:pz1:e1:px2:py2:pz2:e2")),
34 fNPairsFitArea(0),
62e1b4fe 35 fNMaxPairsFitArea(fit),
36 fFitRangeMax(0.05),
37 fNPairsNormArea(0),
38 fNMaxPairsNormArea(norm),
39 fNormRangeMin(0.05),
40 fNormRangeMax(0.1)
8bcc1321 41{
42//ctor
43 fWriteNumAndDen = kTRUE;//change default behaviour
44 Rename("wqinvcfCorrFit","Lednicky Weught Theoretical Q_{inv} Correlation Function");
45}
46/*****************************************************************/
47
62e1b4fe 48void AliHBTCorrFitFctn::ProcessSameEventParticles(AliHBTPair* /*trackpair*/)
8bcc1321 49{
50 //Fills the numerator using pair from the same event
55d46048 51// partpair = CheckPair(partpair);
62e1b4fe 52 return;
8bcc1321 53
8bcc1321 54}
55/****************************************************************/
56
62e1b4fe 57void AliHBTCorrFitFctn::ProcessDiffEventParticles(AliHBTPair* trackpair)
8bcc1321 58{
59 // Fills the denominator using mixed pairs
60 trackpair = CheckPair(trackpair);
62e1b4fe 61 if ( trackpair == 0x0) return;
62
63 Double_t q = 2.* trackpair->GetKStar();
387dd2d0 64
62e1b4fe 65 Bool_t fill = kFALSE;
387dd2d0 66
62e1b4fe 67 if ( q < fFitRangeMax )
68 {
69 if (fNPairsFitArea < fNMaxPairsFitArea)
70 {
71 fNPairsFitArea++;
72 fill = kTRUE;
73 }
74 else
75 {
76 Info("ProcessDiffEventParticles","Fit area already full");
77 }
78 }
79
80 if ( (q > fNormRangeMin) && (q < fNormRangeMax) )
81 {
82 if ( fNPairsNormArea < fNMaxPairsNormArea)
83 {
84 fNPairsNormArea++;
85 fill = kTRUE;
86 }
87 }
88 if (fill)
89 {
90 const AliVAODParticle& p1 = *(trackpair->Particle1());
91 const AliVAODParticle& p2 = *(trackpair->Particle2());
92 fNtuple->Fill(p1.Px(),p1.Py(),p1.Pz(),p1.E(),
93 p2.Px(),p2.Py(),p2.Pz(),p2.E());
387dd2d0 94
62e1b4fe 95 fDenominator->Fill(q);
387dd2d0 96 }
62e1b4fe 97
98
8bcc1321 99}
100/*****************************************************************/
101
102TH1* AliHBTCorrFitFctn::GetResult()
103{
62e1b4fe 104//returns denominator
105 return fDenominator;
8bcc1321 106}
107/**************************************************************/
108
109void AliHBTCorrFitFctn::WriteFunction()
110{
111 //writes a function
112 AliHBTFunction::WriteFunction();
113 fNtuple->Write(0,TObject::kOverwrite);
114}