From a6e499852574f14fd91db20166f123d0fd413eb0 Mon Sep 17 00:00:00 2001 From: skowron Date: Thu, 31 Oct 2002 13:37:06 +0000 Subject: [PATCH] Initial Revision. --- HBTAN/AliHBTLLWeightTheorFctn.cxx | 41 +++++++ HBTAN/AliHBTLLWeightTheorFctn.h | 39 ++++++ HBTAN/AliHBTLLWeightsPID.cxx | 191 ++++++++++++++++++++++++++++++ HBTAN/AliHBTLLWeightsPID.h | 54 +++++++++ 4 files changed, 325 insertions(+) create mode 100644 HBTAN/AliHBTLLWeightTheorFctn.cxx create mode 100644 HBTAN/AliHBTLLWeightTheorFctn.h create mode 100644 HBTAN/AliHBTLLWeightsPID.cxx create mode 100644 HBTAN/AliHBTLLWeightsPID.h diff --git a/HBTAN/AliHBTLLWeightTheorFctn.cxx b/HBTAN/AliHBTLLWeightTheorFctn.cxx new file mode 100644 index 00000000000..0e35a711b4b --- /dev/null +++ b/HBTAN/AliHBTLLWeightTheorFctn.cxx @@ -0,0 +1,41 @@ +///////////////////////////////////////////////////////////// +// +//This class introduces the weights calculated according +//with functions of efficiency of identification (TPC+TOF) +//(calculated by B.V. Batyunia). +// +//Author: Ludmila Malinina, JINR (malinina@sunhe.jinr.ru) +// +///////////////////////////////////////////////////////////// + +#include "AliHBTLLWeightTheorFctn.h" +#include "AliHBTLLWeights.h" + +//--for test--AliHBTLLWeightQInvFctn* yyy= new AliHBTLLWeightQInvFctn(); + +ClassImp(AliHBTLLWeightTheorQInvFctn) +/*************************************************************/ + +AliHBTLLWeightTheorQInvFctn:: +AliHBTLLWeightTheorQInvFctn(Int_t nbins, Double_t maxXval, Double_t minXval): + AliHBTOnePairFctn1D(nbins,maxXval,minXval) +{ +//ctor + +} +/****************************************************************/ +void AliHBTLLWeightTheorQInvFctn::ProcessSameEventParticles(AliHBTPair* partpair) +{ +//Processes Particles and tracks Same different even + partpair = CheckPair(partpair); + Double_t weight = AliHBTLLWeights::Instance()->GetWeight(partpair); + if(TMath::Abs(weight)<=10.) fNumerator->Fill(partpair->GetQInv(),weight); +} + +/**************************************************************/ +TH1* AliHBTLLWeightTheorQInvFctn::GetResult() +{ +//returns ratio of numerator and denominator + return GetRatio(Scale()); +} + diff --git a/HBTAN/AliHBTLLWeightTheorFctn.h b/HBTAN/AliHBTLLWeightTheorFctn.h new file mode 100644 index 00000000000..3d09c9af615 --- /dev/null +++ b/HBTAN/AliHBTLLWeightTheorFctn.h @@ -0,0 +1,39 @@ +#ifndef ALIHBTLLWEIGHTTHEORFCTN_H +#define ALIHBTLLWEIGHTTHEORFCTN_H +//Author: Ludmila Malinina, JINR (malinina@sunhe.jinr.ru) + +#include "AliHBTFunction.h" + + +class AliHBTLLWeights; + +class AliHBTLLWeightTheorQInvFctn: public AliHBTOnePairFctn1D +{ +//This function allows to obtain Q_inv correlation function with weights +//calculated by Lednicky's alghorithm. +//Numerator is filled with weighted events. Weights are attributed to simulated particles. +//Weights are calculated with corresponding simulated particles momenta. +//Denominator is filled with mixing unweighted simulated particles. +//One needs only simulated pairs, so +//this function is of class AliHBTOnePairFctn1D. +//Author Ludmila Malinina JINR (malinina@sunhe.jinr.ru) + + public: + AliHBTLLWeightTheorQInvFctn(Int_t nbins = 100, Double_t maxXval = 0.15, Double_t minXval = 0.0); + + virtual ~AliHBTLLWeightTheorQInvFctn(){}; + TH1* GetResult(); + + void ProcessSameEventParticles(AliHBTPair* partpair); + void ProcessDiffEventParticles(AliHBTPair* partpair); + + Double_t GetValue(AliHBTPair* partpair){ return partpair->GetQInv();} //isn't used + + protected: + + private: + public: + ClassDef(AliHBTLLWeightTheorQInvFctn,1) +}; + +#endif diff --git a/HBTAN/AliHBTLLWeightsPID.cxx b/HBTAN/AliHBTLLWeightsPID.cxx new file mode 100644 index 00000000000..b51de8e6000 --- /dev/null +++ b/HBTAN/AliHBTLLWeightsPID.cxx @@ -0,0 +1,191 @@ +//Author: Ludmila Malinina, JINR (malinina@sunhe.jinr.ru) +#include "AliHBTLLWeightsPID.h" +#include "AliPDG.h" +#include "AliHBTPair.h" +#include "AliHBTParticle.h" +#include +#include +#include + + +ClassImp(AliHBTLLWeightsPID) + +AliHBTLLWeightsPID* AliHBTLLWeightsPID::fWeightsPID=NULL; + +AliHBTLLWeightsPID::AliHBTLLWeightsPID() +{ +//ctor +//initial parameters of model + + ptK = new TH1F("ptK"," pt of K+- ",40,0,4); + ptKefftpc = new TH1F("ptEfficKpos"," pt of K+ after efficiency cut ",40,0,4); + ptKefftpcboth = new TH1F("ptEfficKneg"," pt of K- after efficiency cut ",40,0,4); + +// efficiency functions (from pt) for K+- in the TPC + effic1pol = new TF1("effic1pol4","pol4",100.,480.); + // for -0.9 < eta < -0.7 + // for 0.7 < eta < 0.9 + effic1pol->SetParameter(0,-0.266362); + effic1pol->SetParameter(1,0.00565461); + effic1pol->SetParameter(2,-4.06686e-05); + effic1pol->SetParameter(3,1.39387e-07); + effic1pol->SetParameter(4,-1.59674e-10); + + effic2pol = new TF1("effic2pol4","pol4",100.,540.); + + effic2pol->SetParameter(0,-0.324881); + effic2pol->SetParameter(1,0.00565381); + effic2pol->SetParameter(2,-3.23633e-05); + effic2pol->SetParameter(3,9.72523e-08); + effic2pol->SetParameter(4,-1.01013e-10); + + effic3pol = new TF1("effic3pol4","pol4",100.,585.); + // for -0.5 < eta < -0.3 + // for 0.3 < eta < 0.5 + effic3pol->SetParameter(0,-0.306572); + effic3pol->SetParameter(1,0.00557472); + effic3pol->SetParameter(2,-3.33752e-05); + effic3pol->SetParameter(3,9.83241e-08); + effic3pol->SetParameter(4,-9.5827e-11); + + effic4pol = new TF1("effic4pol4","pol4",100.,600.); // for -0.3 < eta < 0.3 + effic4pol->SetParameter(0,-0.168648); + effic4pol->SetParameter(1,0.00252021); + effic4pol->SetParameter(2,-1.09113e-05); + effic4pol->SetParameter(3,3.34871e-08); + effic4pol->SetParameter(4,-3.31691e-11); + + // efficiency functions (from pt) for K+- in the TOF + effic1polTOF = new TF1("effic1pol4TOF","pol4",0.2,2.0); + // for -0.9 < eta < -0.7 + // for 0.7 < eta < 0.9 + effic1polTOF->SetParameter(0,-0.165885); + effic1polTOF->SetParameter(1,0.717459); + effic1polTOF->SetParameter(2,-0.457131); + effic1polTOF->SetParameter(3,0.284753); + effic1polTOF->SetParameter(4,-0.105215); + + effic2polTOF = new TF1("effic2pol4TOF","pol4",0.2,2.4); + // for -0.7 < eta < -0.5 + // for 0.5 < eta < 0.7 + + effic2polTOF->SetParameter(0,-0.165947); + effic2polTOF->SetParameter(1,0.702475); + effic2polTOF->SetParameter(2,-0.300313); + effic2polTOF->SetParameter(3,0.127047); + effic2polTOF->SetParameter(4,-0.0489395); + + + effic3polTOF = new TF1("effic3pol4TOF","pol4",0.2,2.4); + // for -0.5 < eta < -0.3 + // for 0.3 < eta < 0.5 + effic3polTOF->SetParameter(0,-0.339516); + effic3polTOF->SetParameter(1,1.56942); + effic3polTOF->SetParameter(2,-1.43132); + effic3polTOF->SetParameter(3,0.727148); + effic3polTOF->SetParameter(4,-0.158444); + + effic4polTOF = new TF1("effic4pol4TOF","pol4",0.2,2.6); // for -0.3 < eta < 0.3 + effic4polTOF->SetParameter(0,-0.243435); + effic4polTOF->SetParameter(1,1.00928); + effic4polTOF->SetParameter(2,-0.594597); + effic4polTOF->SetParameter(3,0.212601); + effic4polTOF->SetParameter(4,-0.0453419); + +} + + +AliHBTLLWeightsPID* AliHBTLLWeightsPID::Instance() +{ + if (fWeightsPID) { + return fWeightsPID; + } else { + fWeightsPID = new AliHBTLLWeightsPID(); + return fWeightsPID; + } +} + + + +Double_t AliHBTLLWeightsPID::GetWeightPID(const AliHBTPair* trackpair) +{ + + AliHBTParticle *track1 = trackpair->Particle1(); + AliHBTParticle *track2 = trackpair->Particle2(); + + Double_t Pt1=track1->Pt(); + Double_t eta1=track1->Eta(); + + ptK->Fill(Pt1); + + if(TMath::Abs(eta1) > 0.7 && TMath::Abs(eta1) < 0.9 && Pt1 < 0.48) { + efficTPC1 = effic1pol->Eval(Pt1*1000.); + }else if(TMath::Abs(eta1) > 0.5 && TMath::Abs(eta1) < 0.7 && Pt1 < 0.54) { + efficTPC1 = effic2pol->Eval(Pt1*1000.); + }else if(TMath::Abs(eta1) > 0.3 && TMath::Abs(eta1) < 0.5 && Pt1 < 0.585) { + efficTPC1 = effic3pol->Eval(Pt1*1000.); + }else if(eta1 > -0.3 && eta1 < 0.3 && Pt1 < 0.6) { + efficTPC1 = effic4pol->Eval(Pt1*1000.); + } + + // TOF efficiency + + if(Pt1 > 0.2) { + if(TMath::Abs(eta1) > 0.7 && TMath::Abs(eta1) < 0.9 && Pt1 < 2.0) { + efficTOF1 = effic1polTOF->Eval(Pt1); + }else if(TMath::Abs(eta1) > 0.5 && TMath::Abs(eta1) < 0.7 && Pt1 < 2.4) { + efficTOF1 = effic2polTOF->Eval(Pt1); + }else if(TMath::Abs(eta1) > 0.3 && TMath::Abs(eta1) < 0.5 && Pt1 < 2.4) { + efficTOF1 = effic3polTOF->Eval(Pt1); + }else if(eta1 > -0.3 && eta1 < 0.3 && Pt1 < 2.6) { + efficTOF1 = effic4polTOF->Eval(Pt1); + } + } + + Double_t rndmtpc=gRandom->Rndm(); + Double_t rndmtof=gRandom->Rndm(); + Double_t weightPID1=1.; + if(efficTPC1 < rndmtpc && efficTOF1 < rndmtof) { weightPID1=0.;} + ptKefftpc->Fill(Pt1,weightPID1); + + + Double_t Pt2=track2->Pt(); + Double_t eta2=track2->Eta(); + +// TPC efficiency + + if(TMath::Abs(eta2) > 0.7 && TMath::Abs(eta2) < 0.9 && Pt2 < 0.48) { + efficTPC1 = effic1pol->Eval(Pt2*1000.); + }else if(TMath::Abs(eta2) > 0.5 && TMath::Abs(eta2) < 0.7 && Pt2 < 0.54) { + efficTPC1 = effic2pol->Eval(Pt2*1000.); + }else if(TMath::Abs(eta2) > 0.3 && TMath::Abs(eta2) < 0.5 && Pt2 < 0.585) { + efficTPC1 = effic3pol->Eval(Pt2*1000.); + }else if(eta2 > -0.3 && eta2 < 0.3 && Pt2 < 0.6) { + efficTPC1 = effic4pol->Eval(Pt2*1000.); + } + + // TOF efficiency + + if(Pt2 > 0.2) { + if(TMath::Abs(eta2) > 0.7 && TMath::Abs(eta2) < 0.9 && Pt2 < 2.0) { + efficTOF1 = effic1polTOF->Eval(Pt2); + }else if(TMath::Abs(eta2) > 0.5 && TMath::Abs(eta2) < 0.7 && Pt2 < 2.4) { + efficTOF1 = effic2polTOF->Eval(Pt2); + }else if(TMath::Abs(eta2) > 0.3 && TMath::Abs(eta2) < 0.5 && Pt2 < 2.4) { + efficTOF1 = effic3polTOF->Eval(Pt2); + }else if(eta2 > -0.3 && eta2 < 0.3 && Pt2 < 2.6) { + efficTOF1 = effic4polTOF->Eval(Pt2); + } + } + + rndmtpc=gRandom->Rndm(); + rndmtof=gRandom->Rndm(); + + Double_t weightPID2=1.; + if(efficTPC1 < rndmtpc && efficTOF1 < rndmtof) { weightPID2=0.;} + + Double_t weightPID=weightPID1*weightPID2; + ptKefftpcboth->Fill(Pt1,weightPID); + + return weightPID; +} diff --git a/HBTAN/AliHBTLLWeightsPID.h b/HBTAN/AliHBTLLWeightsPID.h new file mode 100644 index 00000000000..cf7c64799ba --- /dev/null +++ b/HBTAN/AliHBTLLWeightsPID.h @@ -0,0 +1,54 @@ +#ifndef ALIHBTLLWEIGHTSPID_H +#define ALIHBTLLWEIGHTSPID_H +///////////////////////////////////////////////////////////// +// +//This class introduces the weights calculated according +//with functions of efficiency of identification (TPC+TOF) +//(calculated by B.V. Batyunia). +// +//Author: Ludmila Malinina, JINR (malinina@sunhe.jinr.ru) +// +///////////////////////////////////////////////////////////// + +#include "TH1.h" +#include "TH2.h" +#include +#include "TCanvas.h" +#include "TPad.h" + +#include + +class AliHBTPair; +class AliHBTLLWeightsPID: public TObject + { + public: + AliHBTLLWeightsPID(); + virtual ~AliHBTLLWeightsPID(){;} + static AliHBTLLWeightsPID* Instance(); + + Double_t GetWeightPID(const AliHBTPair* trackpair); //get weight calculated Batyunia's algorithm + Float_t efficTPC1,efficTPC2,efficTOF1,efficTOF2; + + protected: + + static AliHBTLLWeightsPID *fWeightsPID;// pointer to wrapper of Fortran Lednicky code + TH1 *ptK; //comment? + TH1 *ptKefftpc;//comment? + TH1 *ptKefftpcboth;//comment? + TF1 *effic1pol;//comment? + TF1 *effic2pol;//comment? + TF1 *effic3pol;//comment? + TF1 *effic4pol;//comment? + + TF1 *effic1polTOF;//comment? + TF1 *effic2polTOF;//comment? + TF1 *effic3polTOF;//comment? + TF1 *effic4polTOF;//comment? + + private: + + public: + ClassDef(AliHBTLLWeightsPID,1) + }; + +#endif -- 2.43.0