C++ interface to Lednicky's algorithm. Initial revision
[u/mrichter/AliRoot.git] / HBTAN / AliHBTLLWeightFctn.cxx
1 #include <iostream.h>
2 #include "AliHBTLLWeightFctn.h"
3 #include "AliHBTLLWeights.h"
4
5 //--for test--AliHBTLLWeightQInvFctn* yyy= new AliHBTLLWeightQInvFctn();
6
7 ClassImp( AliHBTLLWeightQInvFctn )  
8 /****************************************************************/
9 AliHBTLLWeightQInvFctn::AliHBTLLWeightQInvFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
10            AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
11 {
12   Rename("Correlation function, method of weights(Lednicky's algorithm)");
13 }
14 /****************************************************************/
15 void  AliHBTLLWeightQInvFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
16 {
17
18   trackpair = CheckPair(trackpair);
19   partpair  = CheckPair(partpair);
20   if ( trackpair && partpair)     
21   {
22      fNumerator->Fill(trackpair->GetQInv(),
23           AliHBTLLWeights::Instance()->GetWeight(partpair));
24   }
25   
26
27                 
28
29 /****************************************************************/
30  void  AliHBTLLWeightQInvFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
31 {
32   trackpair = CheckPair(trackpair);
33   partpair  = CheckPair(partpair);
34   if ( trackpair && partpair)  
35   {
36      fDenominator->Fill(trackpair->GetQInv());
37   }
38 }
39 /**************************************************************/
40 TH1* AliHBTLLWeightQInvFctn::GetResult() 
41                                                                                
42
43 //returns ratio of numerator and denominator                                    
44  TH1* res = GetRatio(Scale());                                                  
45   
46  if(res)
47    {                                                                             
48     res->GetXaxis()->SetTitle("Qinv [GeV/c]");                                       
49     res->GetYaxis()->SetTitle("C(Qinv)");                                          
50     res->SetTitle(GetTitle());
51    }                                                                             
52   return res;                                                                     
53 }                    
54