Update by Ludmila Malinina
[u/mrichter/AliRoot.git] / HBTAN / AliHBTLLWeightFctn.cxx
1 #include "AliHBTLLWeightFctn.h"
2 #include "AliHBTLLWeights.h"
3 #include "AliHBTLLWeightsPID.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 //ctor
13 }
14 /****************************************************************/
15 void  AliHBTLLWeightQInvFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
16 {
17 //Processes Particles and tracks Same different even
18   trackpair = CheckPair(trackpair);
19   partpair  = CheckPair(partpair);
20   if ( trackpair && partpair)     
21   {
22     Double_t weightPID=1.;
23     Double_t weightHBT=AliHBTLLWeights::Instance()->GetWeight(partpair);
24     Double_t weight=weightHBT*weightPID;
25     if(TMath::Abs(weight)<=10.) fNumerator->Fill(trackpair->GetQInv(),weight);
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("Correlation function, method of weights(Lednicky's algorithm).");              
51      }                                                                             
52   return res;                                                                     
53 }                    
54