95 if (fCFs)
delete fCFs;
96 if (Hal::Std::FindParam(option,
"krmap")) {
100 Cout::Text(Form(
"Safe range of k* is %4.2f", h->GetXaxis()->GetBinUpEdge(h->GetNbinsX())),
"M", kWhite);
101 Cout::Text(Form(
"Safe range of r* is %4.2f", 0.125 * TMath::Abs(h->GetYaxis()->GetBinUpEdge(h->GetNbinsY()))),
"M", kWhite);
103 Double_t map_step = 0.5;
106 Double_t r_max = h->GetYaxis()->GetBinUpEdge(h->GetNbinsY()) * 0.125;
107 Int_t r_bins = r_max / map_step;
108 TH2D* cf_map =
new TH2D(
"cf_map",
111 h->GetXaxis()->GetBinLowEdge(1),
112 h->GetXaxis()->GetBinUpEdge(h->GetNbinsX()),
116 Cout::Text(
"calculating integrals",
"M", kWhite);
117 Double_t dr2 = fCFs->
GetYaxis()->GetBinWidth(1) * 0.5;
118 Double_t r_steps = fCFs->
GetYaxis()->GetNbins();
120 Double_t sqrtpi = TMath::Sqrt(TMath::Pi());
121 for (
int r_bin = 0; r_bin <= r_bins; r_bin++) {
122 Double_t R = cf_map->GetYaxis()->GetBinCenter(r_bin);
123 Double_t norm = 1.0 / (sqrtpi * TMath::Power(R, 3) * 4.0);
130 for (
int i = 1; i <= cf_map->GetNbinsX(); i++) {
131 Double_t k = cf_map->GetXaxis()->GetBinCenter(i);
133 for (
int j = 1; j <= r_steps; j++) {
134 Double_t r_temp = fCFs->
GetYaxis()->GetBinCenter(j);
135 Double_t m_dr = fCFs->
Eval(k, r_temp - dr2) * norm * Gaus(r_temp - dr2, R);
136 Double_t dr = fCFs->
Eval(k, r_temp) * norm * Gaus(r_temp, R);
137 Double_t p_dr = fCFs->
Eval(k, r_temp + dr2) * norm * Gaus(r_temp + dr2, R);
143 integ += (m_dr + 2.0 * dr + p_dr) * dr2 * 0.5;
157 cf_map->SetBinContent(i, r_bin, integ);
161 if (cf_map->GetXaxis()->GetBinUpEdge(0) == 1)
162 for (
int r_bin = 0; r_bin <= r_bins; r_bin++) {
163 cf_map->SetBinContent(0, r_bin, 0);
167 fCFs =
new Spline2D(cf_map,
"linear");
169 if (Hal::Std::FindParam(option,
"dump")) {
170 TFile* dump =
new TFile(
"dump.root",
"recreate");
177 if (Hal::Std::FindParam(option,
"lcms")) {
178 TH2D* h2 =
new TH2D(
"kstarMap",
181 h->GetXaxis()->GetBinLowEdge(1) * 0.5,
182 h->GetXaxis()->GetBinUpEdge(h->GetNbinsX()) * 0.5,
184 h->GetYaxis()->GetBinLowEdge(1),
185 h->GetYaxis()->GetBinUpEdge(h->GetNbinsY()));
186 h2->GetYaxis()->SetTitle(
"R*");
187 h2->GetXaxis()->SetTitle(
"k*");
188 for (
int i = 0; i <= h->GetNbinsX() + 1; i++) {
189 for (
int j = 0; j <= h->GetNbinsY() + 1; j++) {
190 h2->SetBinContent(i, j, h->GetBinContent(i, j));
191 h2->SetBinError(i, j, h->GetBinError(i, j));
197 TH2D* temp = (TH2D*) h->Clone();
198 Hal::Std::HistogramEdges(temp,
"x+uv", 0);
199 Hal::Std::HistogramEdges(temp,
"y+uv", 0);
200 Hal::Std::HistogramEdges(temp,
"z+uv", 0);
205 Cout::Text(Form(
"Safe range of k* is %4.2f", h->GetXaxis()->GetBinUpEdge(h->GetNbinsX())),
"M", kWhite);
206 Cout::Text(Form(
"Safe range of r* is %4.2f", TMath::Abs(h->GetYaxis()->GetBinUpEdge(h->GetNbinsY()))),
"M", kWhite);