From 963893bf967a002d97b4b52e8b8932240e49b840 Mon Sep 17 00:00:00 2001 From: akisiel Date: Tue, 12 May 2009 12:05:21 +0000 Subject: [PATCH] Add option to use LCMS --- .../AliFemtoCorrFctnDirectYlm.cxx | 38 ++++++++++--- .../AliFemtoUser/AliFemtoCorrFctnDirectYlm.h | 7 ++- .../AliFemtoModelCorrFctnDirectYlm.cxx | 53 +++++++++++++++---- .../AliFemtoModelCorrFctnDirectYlm.h | 7 ++- 4 files changed, 86 insertions(+), 19 deletions(-) diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.cxx b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.cxx index b5a713fb557..86531358197 100644 --- a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.cxx +++ b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.cxx @@ -14,7 +14,7 @@ using namespace std; -AliFemtoCorrFctnDirectYlm::AliFemtoCorrFctnDirectYlm(const char *name, int maxl, int ibin=30, double vmin=0.0, double vmax=0.3): +AliFemtoCorrFctnDirectYlm::AliFemtoCorrFctnDirectYlm(const char *name, int maxl, int ibin=30, double vmin=0.0, double vmax=0.3, int aUseLCMS=0): fnumsreal(0), fnumsimag(0), fdensreal(0), @@ -35,7 +35,8 @@ AliFemtoCorrFctnDirectYlm::AliFemtoCorrFctnDirectYlm(const char *name, int maxl, factorials(0), fSout(0.0), fSside(0.0), - fSlong(0.0) + fSlong(0.0), + fUseLCMS(aUseLCMS) { // Main constructor fMaxL = maxl; @@ -149,7 +150,8 @@ AliFemtoCorrFctnDirectYlm::AliFemtoCorrFctnDirectYlm(): factorials(0), fSout(0.0), fSside(0.0), - fSlong(0.0) + fSlong(0.0), + fUseLCMS(0) { // Default constructor AliFemtoCorrFctnDirectYlm("AliFemtoCorrFctnDirectYlm",2); @@ -177,7 +179,8 @@ AliFemtoCorrFctnDirectYlm::AliFemtoCorrFctnDirectYlm(const AliFemtoCorrFctnDirec factorials(0), fSout(0.0), fSside(0.0), - fSlong(0.0) + fSlong(0.0), + fUseLCMS(0) { // Copy constructor int ibin = aCorrFctn.fbinctn->GetNbinsX(); @@ -274,6 +277,8 @@ AliFemtoCorrFctnDirectYlm::AliFemtoCorrFctnDirectYlm(const AliFemtoCorrFctnDirec if (aCorrFctn.fPairCut) fPairCut = aCorrFctn.fPairCut; + + fUseLCMS = aCorrFctn.fUseLCMS; } AliFemtoCorrFctnDirectYlm& AliFemtoCorrFctnDirectYlm::operator=(const AliFemtoCorrFctnDirectYlm& aCorrFctn) @@ -377,6 +382,8 @@ AliFemtoCorrFctnDirectYlm& AliFemtoCorrFctnDirectYlm::operator=(const AliFemtoCo if (aCorrFctn.fPairCut) fPairCut = aCorrFctn.fPairCut; + fUseLCMS = aCorrFctn.fUseLCMS; + return *this; } @@ -932,16 +939,35 @@ AliFemtoString AliFemtoCorrFctnDirectYlm::Report() void AliFemtoCorrFctnDirectYlm::AddRealPair(AliFemtoPair* aPair) { + // Fill in the numerator if (fPairCut) if (!fPairCut->Pass(aPair)) return; - AddRealPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), 1.0); + if (fUseLCMS) + AddRealPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), 1.0); + else + AddRealPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), 1.0); } + void AliFemtoCorrFctnDirectYlm::AddMixedPair(AliFemtoPair* aPair) { + // Fill in the denominator if (fPairCut) if (!fPairCut->Pass(aPair)) return; - AddMixedPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), 1.0); + if (fUseLCMS) + AddMixedPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), 1.0); + else + AddMixedPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), 1.0); +} + +void AliFemtoCorrFctnDirectYlm::SetUseLCMS(int aUseLCMS) +{ + fUseLCMS = aUseLCMS; +} + +int AliFemtoCorrFctnDirectYlm::GetUseLCMS() +{ + return fUseLCMS; } diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.h b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.h index b1ae2395591..e0533bfcabd 100644 --- a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.h +++ b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.h @@ -4,6 +4,7 @@ // directly. Provides a way to store the numerator and denominator // // in Ylms directly and correctly calculate the correlation // // function from them. // +// Added the option to use q components in LCMS for identical particles // // // // Authors: Adam Kisiel kisiel@mps.ohio-state.edu // // // @@ -25,7 +26,7 @@ using namespace std; class AliFemtoCorrFctnDirectYlm: public AliFemtoCorrFctn { public: AliFemtoCorrFctnDirectYlm(); - AliFemtoCorrFctnDirectYlm(const char *name, int maxl, int ibin, double vmin, double vmax); + AliFemtoCorrFctnDirectYlm(const char *name, int maxl, int ibin, double vmin, double vmax, int aUseLCMS); AliFemtoCorrFctnDirectYlm(const AliFemtoCorrFctnDirectYlm& aCorrFctn); ~AliFemtoCorrFctnDirectYlm(); @@ -55,6 +56,9 @@ class AliFemtoCorrFctnDirectYlm: public AliFemtoCorrFctn { TH1D *GetDenRealHist(int el, int em); TH1D *GetDenImagHist(int el, int em); + void SetUseLCMS(int aUseLCMS); + int GetUseLCMS(); + private: double ClebschGordan(double aJot1, double aEm1, double aJot2, double aEm2, double aJot, double aEm); double DeltaJ(double aJot1, double aJot2, double aJot); @@ -104,6 +108,7 @@ class AliFemtoCorrFctnDirectYlm: public AliFemtoCorrFctn { double fSside; // Save last calculated qside double fSlong; // Save last calculated qlong + int fUseLCMS; // 0 - Use PRF, 1 - Use LCMS }; #endif diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx index 43c7d7631eb..b57c0cd5ea4 100644 --- a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx +++ b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx @@ -18,33 +18,39 @@ AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(): AliFemtoModelCorrFctn(), fCYlmTrue(0), - fCYlmFake(0) + fCYlmFake(0), + fUseLCMS(0) { // default constructor fCYlmTrue = new AliFemtoCorrFctnDirectYlm(); fCYlmFake = new AliFemtoCorrFctnDirectYlm(); + fCYlmTrue->SetUseLCMS(fUseLCMS); + fCYlmFake->SetUseLCMS(fUseLCMS); } //_______________________ -AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(const char *title, Int_t aMaxL, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi): +AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(const char *title, Int_t aMaxL, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi, int aUseLCMS=0): AliFemtoModelCorrFctn(title, aNbins, aQinvLo, aQinvHi), fCYlmTrue(0), - fCYlmFake(0) + fCYlmFake(0), + fUseLCMS(aUseLCMS) { // basic constructor char fname[1000]; sprintf(fname, "%s%s", title, "True"); - fCYlmTrue = new AliFemtoCorrFctnDirectYlm(fname, aMaxL, aNbins, aQinvLo, aQinvHi); + fCYlmTrue = new AliFemtoCorrFctnDirectYlm(fname, aMaxL, aNbins, aQinvLo, aQinvHi, fUseLCMS); sprintf(fname, "%s%s", title, "Fake"); - fCYlmFake = new AliFemtoCorrFctnDirectYlm(fname, aMaxL, aNbins, aQinvLo, aQinvHi); + fCYlmFake = new AliFemtoCorrFctnDirectYlm(fname, aMaxL, aNbins, aQinvLo, aQinvHi, fUseLCMS); } //_______________________ AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(const AliFemtoModelCorrFctnDirectYlm& aCorrFctn): AliFemtoModelCorrFctn(aCorrFctn), fCYlmTrue(0), - fCYlmFake(0) + fCYlmFake(0), + fUseLCMS(0) { // copy constructor + fUseLCMS = aCorrFctn.fUseLCMS; fCYlmTrue = dynamic_cast(aCorrFctn.fCYlmTrue->Clone()); fCYlmFake = dynamic_cast(aCorrFctn.fCYlmFake->Clone()); } @@ -66,6 +72,8 @@ AliFemtoModelCorrFctnDirectYlm& AliFemtoModelCorrFctnDirectYlm::operator=(const if (this == &aCorrFctn) return *this; + fUseLCMS = aCorrFctn.fUseLCMS; + if (aCorrFctn.fCYlmTrue) fCYlmTrue = dynamic_cast(aCorrFctn.fCYlmTrue->Clone()); else fCYlmTrue = 0; @@ -94,7 +102,10 @@ void AliFemtoModelCorrFctnDirectYlm::AddRealPair(AliFemtoPair* aPair) Double_t weight = fManager->GetWeight(aPair); - fCYlmTrue->AddRealPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), weight); + if (fUseLCMS) + fCYlmTrue->AddRealPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), weight); + else + fCYlmTrue->AddRealPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), weight); } //_______________________ void AliFemtoModelCorrFctnDirectYlm::AddMixedPair(AliFemtoPair* aPair) @@ -105,9 +116,16 @@ void AliFemtoModelCorrFctnDirectYlm::AddMixedPair(AliFemtoPair* aPair) Double_t weight = fManager->GetWeight(aPair); - fCYlmTrue->AddMixedPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), 1.0); - fCYlmFake->AddRealPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), weight); - fCYlmFake->AddMixedPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), 1.0); + if (fUseLCMS) { + fCYlmTrue->AddMixedPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), 1.0); + fCYlmFake->AddRealPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), weight); + fCYlmFake->AddMixedPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), 1.0); + } + else { + fCYlmTrue->AddMixedPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), 1.0); + fCYlmFake->AddRealPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), weight); + fCYlmFake->AddMixedPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), 1.0); + } } //_______________________ void AliFemtoModelCorrFctnDirectYlm::Write() @@ -150,9 +168,22 @@ AliFemtoModelCorrFctn* AliFemtoModelCorrFctnDirectYlm::Clone() return tCopy; } - +//_______________________ void AliFemtoModelCorrFctnDirectYlm::Finish() { fCYlmTrue->Finish(); fCYlmFake->Finish(); } +//_______________________ +void AliFemtoModelCorrFctnDirectYlm::SetUseLCMS(int aUseLCMS) +{ + fUseLCMS = aUseLCMS; + fCYlmTrue->SetUseLCMS(fUseLCMS); + fCYlmFake->SetUseLCMS(fUseLCMS); +} +//_______________________ +int AliFemtoModelCorrFctnDirectYlm::GetUseLCMS() +{ + return fUseLCMS; +} + diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.h b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.h index 773ad141de2..ee07e897c84 100644 --- a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.h +++ b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.h @@ -19,7 +19,7 @@ class AliFemtoModelCorrFctnDirectYlm: public AliFemtoModelCorrFctn { public: AliFemtoModelCorrFctnDirectYlm(); - AliFemtoModelCorrFctnDirectYlm(const char *title, Int_t aMaxL, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi); + AliFemtoModelCorrFctnDirectYlm(const char *title, Int_t aMaxL, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi, int aUseLCMS); AliFemtoModelCorrFctnDirectYlm(const AliFemtoModelCorrFctnDirectYlm& aCorrFctn); virtual ~AliFemtoModelCorrFctnDirectYlm(); @@ -36,11 +36,16 @@ public: virtual AliFemtoModelCorrFctn* Clone(); + void SetUseLCMS(int aUseLCMS); + int GetUseLCMS(); + protected: AliFemtoCorrFctnDirectYlm* fCYlmTrue; // True Correlation function in spherical harmonics AliFemtoCorrFctnDirectYlm* fCYlmFake; // Fake Correlation function in spherical harmonics + int fUseLCMS; // 0 - Use k* in PRF, 1 - use q in LCMS + private: #ifdef __ROOT__ -- 2.43.0