Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FemtoCorrFuncAzimuthalKt.cxx
1/*
2 * CorrFuncAzimuthalKt.cxx
3 *
4 * Created on: 4 lip 2019
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "FemtoCorrFuncAzimuthalKt.h"
11
12#include "Array.h"
13#include "Cout.h"
14#include "DividedHisto.h"
15#include "Event.h"
16#include "FemtoPair.h"
17#include "HtmlCore.h"
18#include "HtmlFile.h"
19#include "HtmlTable.h"
20#include "ObjectMatrix.h"
21#include "Track.h"
22
23#include <TMath.h>
24#include <TString.h>
25#include <TSystem.h>
26#include <initializer_list>
27#include <iostream>
28
29
30namespace Hal {
31 /*
32 FemtoCorrFuncAzimuthalKt::FemtoCorrFuncAzimuthalKt(const DividedHisto1D* h,
33 const std::initializer_list<double>& init,
34 Int_t phi) :
35 FemtoCorrFunc2D(h, "k_{T} [GeV/c]", "#phi_{pair}", init.size() - 1, phi) {
36 Double_t dphi = TMath::TwoPi() / Double_t(phi);
37 fPhiCorrection[0] = -0.5 * dphi;
38 fPhiCorrection[1] = TMath::TwoPi() - 0.5 * dphi;
39 if (phi == 0) return;
40 if (fRangeX.GetSize() != (Int_t) init.size()) {
41 Cout::PrintInfo(Form("Wrong size of array during call SetKtBins %i %i", fRangeX.GetSize(), (int) init.size()),
42 EInfo::kError);
43 return;
44 }
45 std::initializer_list<double>::iterator it;
46 Int_t pos = 0;
47 for (it = init.begin(); it != init.end(); ++it) {
48 fRangeX[pos++] = *it;
49 }
50 fRangeY.MakeBigger(phi + 1);
51 for (int i = 0; i <= phi; i++) {
52 fRangeY[i] = dphi * i - dphi * 0.5;
53 }
54 }
55 */
57 fPhiCorrection[0] = fRangeY[0];
58 fPhiCorrection[1] = fPhiCorrection[0] + TMath::TwoPi();
60 }
61
62 FemtoCorrFuncAzimuthalKt::~FemtoCorrFuncAzimuthalKt() {
63 // TODO Auto-generated destructor stub
64 }
65
66 FemtoCorrFuncAzimuthalKt::FemtoCorrFuncAzimuthalKt(const DividedHisto1D& h,
67 const std::initializer_list<double>& init,
68 Int_t phi,
69 Int_t nbins) :
70 FemtoCorrFunc2D(h, "k_{T} [GeV/c]", "#phi_{pair}", init.size() - 1, phi) {
71 fPhiCorrection[0] = 0;
72 fPhiCorrection[1] = TMath::TwoPi();
73 if (phi == 0) return;
74 if (fRangeX.GetSize() != (Int_t) init.size()) {
75 Cout::PrintInfo(Form("Wrong size of array during call SetKtBins %i %i", fRangeX.GetSize(), (int) init.size()),
76 EInfo::kError);
77 return;
78 }
79 std::initializer_list<double>::iterator it;
80 Int_t pos = 0;
81 for (it = init.begin(); it != init.end(); ++it) {
82 fRangeX[pos++] = *it;
83 }
84 Double_t width = TMath::TwoPi() / ((Double_t) phi);
85 for (int i = 0; i <= phi; i++) {
86 fRangeY[i] = width * double(i) - width * 0.5;
87 }
88 }
89
90 std::pair<double, double> FemtoCorrFuncAzimuthalKt::GetPairValNum(Hal::FemtoPair* pair) const {
91 Double_t tpx = pair->GetPx1() + pair->GetPx2();
92 Double_t tpy = pair->GetPy1() + pair->GetPy2();
93 Double_t phi = TMath::ATan2(tpy, tpx);
94 phi -= (fPhiCorrection[0]);
95 phi -= 0; // pair->GetTrack1()->GetEvent()->GetPhi();
96 while (phi < fPhiCorrection[0])
97 phi += TMath::TwoPi();
98 while (phi > fPhiCorrection[1])
99 phi -= TMath::TwoPi();
100 Double_t kt = TMath::Sqrt(tpx * tpx + tpy * tpy) * 0.5;
101 std::pair<double, double> res;
102 res.first = kt;
103 res.second = phi; // TODO is order good?
104 return res;
105 }
106
107 std::pair<double, double> FemtoCorrFuncAzimuthalKt::GetPairValDenRot(Hal::FemtoPair* pair) const {
108 Double_t tpx = pair->GetPx1() - pair->GetPx2();
109 Double_t tpy = pair->GetPy1() - pair->GetPy2();
110 Double_t phi = TMath::ATan2(tpy, tpx);
111 phi -= fPhiCorrection[0];
112 phi -= pair->GetTrack1()->GetEvent()->GetPhi();
113 while (phi < fPhiCorrection[0])
114 phi += TMath::TwoPi();
115 while (phi > fPhiCorrection[1])
116 phi -= TMath::TwoPi();
117 Double_t kt = TMath::Sqrt(tpx * tpx + tpy * tpy) * 0.5;
118 std::pair<double, double> res;
119 res.first = kt;
120 res.second = phi; // TODO is order good?
121 return res;
122 }
123
124 std::pair<double, double> FemtoCorrFuncAzimuthalKt::GetPairValDenHemi(Hal::FemtoPair* pair) const {
125 return GetPairValDenRot(pair);
126 }
127
128 Bool_t FemtoCorrFuncAzimuthalKt::Angle(Char_t opt) const {
129 if (opt == 'y') return kTRUE;
130 return kFALSE;
131 }
132
133} // namespace Hal
Int_t GetSize() const
Definition Array.h:50
static void PrintInfo(TString text, Hal::EInfo status)
Definition Cout.cxx:370
Double_t GetPhi() const
Definition Event.h:251
Double_t GetPy1() const
Definition FemtoPair.h:237
Double_t GetPy2() const
Definition FemtoPair.h:262
Double_t GetPx2() const
Definition FemtoPair.h:257
Track * GetTrack1() const
Definition FemtoPair.h:337
Double_t GetPx1() const
Definition FemtoPair.h:232
Event * GetEvent() const
Definition Track.h:315