Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
Femto1DCFAnaMap.cxx
1/*
2 * Femto1DCFAnaMap.cpp
3 *
4 * Created on: 8 gru 2015
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "Femto1DCFAnaMap.h"
11
12#include <TAxis.h>
13#include <TH1.h>
14#include <TMath.h>
15#include <TString.h>
16
17#include "Array.h"
18#include "CorrFitMapKstarRstar.h"
19#include "Cout.h"
20#include "DividedHisto.h"
21#include "Femto1DCF.h"
22#include "FemtoCorrFunc.h"
23#include "FemtoCorrFuncKt.h"
24#include "FemtoFreezoutGenerator.h"
25#include "FemtoPair.h"
26#include "FemtoSourceModel.h"
27#include "FemtoWeightGenerator.h"
28#include "ObjectMatrix.h"
29#include "Std.h"
30
31
32namespace Hal {
33 FemtoCorrFuncMap::FemtoCorrFuncMap(const Femto1DCF& h, Int_t Rbins, Double_t Rmin, Double_t Rmax) : FemtoCorrFunc0D(), fR(0) {
34 fArray = new ObjectMatrix_1();
35 auto kin = h.GetFrame();
36 Int_t bins = h.GetNum()->GetNbinsX();
37 Double_t min = h.GetNum()->GetXaxis()->GetBinLowEdge(1);
38 Double_t max = h.GetNum()->GetXaxis()->GetBinUpEdge(bins);
39 TString XTitle, YTitle, ZTitle;
40 if (kin == Femto::EKinematics::kPRF) {
41 XTitle = "K* [GeV/c]";
42 YTitle = "R_{source}";
43 ZTitle = "dN_{pairs}/dK*";
44 } else if (kin == Femto::EKinematics::kLCMS) {
45 XTitle = " Q_{inv} [GeV/c]";
46 YTitle = "R_{source}";
47 ZTitle = "dN_{pairs}/dQ_{inv}";
48 }
49 DividedHisto2D* map = new DividedHisto2D("Map", bins, min, max, Rbins, Rmin, Rmax, 'D');
50 map->GetNum()->GetXaxis()->SetTitle(XTitle);
51 map->GetDen()->GetXaxis()->SetTitle(XTitle);
52 map->GetNum()->GetYaxis()->SetTitle(YTitle);
53 map->GetDen()->GetYaxis()->SetTitle(YTitle);
54 map->GetNum()->GetZaxis()->SetTitle(ZTitle);
55 map->GetDen()->GetZaxis()->SetTitle(ZTitle);
56 fArray->Init(1, map);
57 }
58
59 void FemtoCorrFuncMap::FillNum(FemtoPair* pair) {
60 ((DividedHisto2D*) fArray->At(0))->FillNum(pair->GetT(), fR, pair->GetWeight());
61 }
62
63 void FemtoCorrFuncMap::FillDenMixed(FemtoPair* pair) {
64 ((DividedHisto2D*) fArray->At(0))->FillDen(pair->GetT(), fR, pair->GetWeight());
65 }
66
67 CorrFitMapKstarRstar* FemtoCorrFuncMap::GetKstarMap(Int_t kt_bin) {
68 DividedHisto2D* hist = (DividedHisto2D*) fArray->At(kt_bin);
69 TH2D* h = (TH2D*) hist->GetHist(kFALSE);
70 Femto::EKinematics kin = Femto::EKinematics::kPRF;
71 TString tit = h->GetXaxis()->GetTitle();
72 if (tit.Contains("inv")) kin = Femto::EKinematics::kLCMS;
73 CorrFitMapKstarRstar* map = new CorrFitMapKstarRstar(*h, kin);
74 delete h;
75 map->SetName(Form("kt_%i", kt_bin));
76 return map;
77 }
78
79 FemtoCorrFuncMap::~FemtoCorrFuncMap() {
80 // TODO Auto-generated destructor stub
81 }
82
83 /*******************************************************************************/
84
85 Femto1DCFAnaMap::Femto1DCFAnaMap() : FemtoBasicAna(), fRbins(0), fRMinEff(0), fRStep(0), fRmin(1), fRmax(10) {}
86
90 for (Double_t i = 0; i < fRbins; i++) {
91 Double_t R = fRMinEff + i * fRStep;
92 map->SetR(R);
95 Double_t weight = fCalc->GenerateWeight(fFemtoPair);
96 fFemtoPair->SetWeight(weight);
97 map->FillNum(fFemtoPair);
98 }
99 }
100
104 fFemtoPair->SetWeight(1.0);
105 for (Double_t i = 0; i < fRbins; i++) {
106 Double_t R = fRMinEff + i * fRStep;
107 map->SetR(R);
108 map->FillDenPerfect(fFemtoPair);
109 }
110 }
111
115 for (Double_t i = 0; i < fRbins; i++) {
116 Double_t R = fRMinEff + i * fRStep;
117 map->SetR(R);
120 Double_t weight = fCalc->GenerateWeight(fFemtoPair);
121 fFemtoPair->SetWeight(weight);
122 map->FillDenRotated(fFemtoPair);
123 }
124 }
125
129 for (Double_t i = 0; i < fRbins; i++) {
130 Double_t R = fRMinEff + i * fRStep;
131 map->SetR(R);
134 Double_t weight = fCalc->GenerateWeight(fFemtoPair);
135 fFemtoPair->SetWeight(weight);
136 map->FillDenHemisphere(fFemtoPair);
137 }
138 }
139
143 fFemtoPair->SetWeight(1.0);
144 for (Double_t i = 0; i < fRbins; i++) {
145 Double_t R = fRMinEff + i * fRStep;
146 map->SetR(R);
147 map->FillDenMixed(fFemtoPair);
148 }
149 }
150
154 for (Double_t i = 0; i < fRbins; i++) {
155 Double_t R = fRMinEff + i * fRStep;
156 map->SetR(R);
159 Double_t weight = fCalc->GenerateWeight(fFemtoPair);
160 fFemtoPair->SetWeight(weight);
161 map->FillDenCharged(fFemtoPair);
162 }
163 }
164
165 Task::EInitFlag Femto1DCFAnaMap::Init() {
166 if (fRbins == 0) {
167 fRbins = 22;
168 fRmin = 0.5;
169 fRmax = 10.5;
170 }
171 fRStep = (fRmax - fRmin) / ((Double_t) fRbins);
172 fRMinEff = fRmin + 0.5 * fRStep;
173 Task::EInitFlag stat = FemtoBasicAna::Init();
174 if (stat == Task::EInitFlag::kFATAL) return Task::EInitFlag::kFATAL;
175
176 if (fFreezoutGenerator == NULL) {
177 Cout::PrintInfo("No freezoug generator", EInfo::kError);
178 return Task::EInitFlag::kFATAL;
179 }
180 return stat;
181 }
182
185 return pack;
186 }
187
188 void Femto1DCFAnaMap::SetRadiusRange(Int_t r_bins, Double_t r_min, Double_t r_max) {
189 fRbins = r_bins;
190 fRmin = r_min;
191 fRmax = r_max;
192 }
193
195
196 Femto1DCFAnaMap::~Femto1DCFAnaMap() {
197 // TODO Auto-generated destructor stub
198 }
199
201 fCFs = new ObjectMatrix_2();
202 auto cf = dynamic_cast<Femto1DCF*>(fCFTemp->GetCF(0));
203 if (!cf) return kFALSE;
204 FemtoCorrFuncMap* map_cf = new FemtoCorrFuncMap(*cf, fRbins, fRmin, fRmax);
206 delete map_cf;
207 for (int i = 0; i < fEventCollectionsNo; i++) {
208 for (int j = 0; j < fTwoTrackCollectionsNo; j++) {
209 FemtoCorrFuncMap* corrfunc = (FemtoCorrFuncMap*) fCFs->At(i, j);
210 corrfunc->SetEventCollID(i);
211 corrfunc->SetPairCollID(j);
212 corrfunc->Check();
213 }
214 }
215 return kTRUE;
216 }
217} // namespace Hal
static void PrintInfo(TString text, Hal::EInfo status)
Definition Cout.cxx:370
Int_t fEventCollectionsNo
Definition EventAna.h:61
Int_t fCurrentEventCollectionID
Definition EventAna.h:65
virtual void ProcessFemtoPair_Perfect()
virtual void CheckCutContainerCollections()
void SetRadiusRange(Int_t r_bins, Double_t r_min, Double_t r_max)
virtual void ProcessFemtoPair_Mixed()
virtual void ProcessFemtoPair_Hemisphere()
virtual Task::EInitFlag Init()
virtual void ProcessFemtoPair()
virtual void ProcessFemtoPair_Rotated()
virtual Package * Report() const
virtual Bool_t InitArray()
virtual void ProcessFemtoPair_Charged()
FemtoFreezoutGenerator * fFreezoutGenerator
virtual Package * Report() const
virtual void CheckCutContainerCollections()
virtual Task::EInitFlag Init()
FemtoPair * fFemtoPair
ObjectMatrix_2 * fCFs
FemtoWeightGenerator * fCalc
FemtoCorrFunc * fCFTemp
virtual void FillNum(FemtoPair *pair)
virtual Bool_t Check()
void SetEventCollID(Int_t no)
void SetPairCollID(Int_t no)
DividedHisto1D * GetCF(Int_t i) const
void GenerateFreezoutCooordinates(FemtoPair *Pair)
FemtoSourceModel * GetSourceModel() const
Double_t GetT() const
Definition FemtoPair.h:322
virtual void Compute_Mixed()
Definition FemtoPair.h:497
virtual void Compute_Hemisphere()=0
Double_t GetWeight() const
Definition FemtoPair.h:282
virtual void Compute_Charged()
Definition FemtoPair.h:493
virtual void Compute_Rotated()=0
virtual void Compute()=0
void SetWeight(Double_t weight)
Definition FemtoPair.h:397
virtual void SetRadius(Double_t)
virtual Double_t GenerateWeight(FemtoPair *pair)
TObject * At(Int_t i, Int_t j) const
virtual void Init(Int_t sizeX, Int_t sizeY, const TObject *temp)
Int_t fTwoTrackCollectionsNo
Int_t fCurrentPairCollectionID