Cuts in 2 pair functions only on reconstructed pair
[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
14AliHBTCorrFitFctn::AliHBTCorrFitFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
15 AliHBTTwoPairFctn1D(nbins,maxXval,minXval),
16 fNtuple(new TNtuple("pair", "pair", "px1:py1:pz1:e1:px2:py2:pz2:e2")),
17 fNPairsFitArea(0),
18 fNPairsNormArea(0)
19{
20//ctor
21 fWriteNumAndDen = kTRUE;//change default behaviour
22 Rename("wqinvcfCorrFit","Lednicky Weught Theoretical Q_{inv} Correlation Function");
23}
24/*****************************************************************/
25
26void AliHBTCorrFitFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
27{
28 //Fills the numerator using pair from the same event
55d46048 29// partpair = CheckPair(partpair);
8bcc1321 30 if(partpair == 0x0) return;
0bb07108 31 trackpair = CheckPair(trackpair);
32 if(trackpair == 0x0) return;
8bcc1321 33
34 Double_t q = trackpair->GetQInv();
35 Bool_t fill = kFALSE;
36
dd82cadc 37 Double_t weight = partpair->GetWeight();
0bb07108 38 fNumerator->Fill(q,weight);
39
8bcc1321 40 if ( (q < 0.15) && (fNPairsFitArea < 2.e+5))
41 {
42 fNPairsFitArea++;
43 fill = kTRUE;
44 }
45
46 if ( (q > 0.15) && (q < 0.3) && (fNPairsFitArea < 1.e+5))
47 {
48 fNPairsNormArea++;
49 fill = kTRUE;
50 }
51
52 if (fill)
53 {
78d7c6d3 54 const AliVAODParticle& p1 = *(trackpair->Particle1());
55 const AliVAODParticle& p2 = *(trackpair->Particle2());
56 fNtuple->Fill(p1.Px(),p1.Py(),p1.Pz(),p1.E(),
57 p2.Px(),p2.Py(),p2.Pz(),p2.E());
8bcc1321 58 }
59}
60/****************************************************************/
61
62void AliHBTCorrFitFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
63{
64 // Fills the denominator using mixed pairs
65 trackpair = CheckPair(trackpair);
55d46048 66// partpair = CheckPair(partpair);
8bcc1321 67 if ( trackpair && partpair)
68 {
69 fDenominator->Fill(trackpair->GetQInv());
70 }
71}
72/*****************************************************************/
73
74TH1* AliHBTCorrFitFctn::GetResult()
75{
76//returns ratio of numerator and denominator
77 return GetRatio(Scale());
78}
79/**************************************************************/
80
81void AliHBTCorrFitFctn::WriteFunction()
82{
83 //writes a function
84 AliHBTFunction::WriteFunction();
85 fNtuple->Write(0,TObject::kOverwrite);
86}