5 #include "CLHEP/Random/RandGaussZiggurat.h"
44 hit.
eta() += delta_eta;
61 TFile *
f =
new TFile(filepath);
62 if (
f ==
nullptr)
return false;
65 TH2D *inputShape = (TH2D*)
f->Get(
histname);
66 if (inputShape ==
nullptr)
return false;
69 double hiEdge = inputShape->GetYaxis()->GetBinLowEdge( inputShape->GetNbinsY() );
70 TF1 *x_func =
new TF1(
"fx",
"gaus",-hiEdge,hiEdge);
71 TF1 *y_func =
new TF1(
"fy",
"gaus",-hiEdge,hiEdge);
74 TH1F *h_xrms =
new TH1F(
"h_xrms",
"h_xrms",100,-hiEdge,hiEdge);
75 TH1F *h_yrms =
new TH1F(
"h_yrms",
"h_yrms",100,-hiEdge,hiEdge);
84 for (
int xbin = 1; xbin < inputShape->GetNbinsX() + 1; xbin++)
86 a = inputShape->GetXaxis()->GetBinCenter(xbin);
88 for (
int ybin = 1; ybin < inputShape->GetNbinsY() + 1; ybin++)
90 val = inputShape->GetBinContent(xbin,ybin);
92 r = inputShape->GetYaxis()->GetBinCenter(ybin);
94 ypos =
r * TMath::Sin(
a );
95 xpos =
r * TMath::Cos(
a );
97 h_xrms->Fill( xpos,
val);
98 h_yrms->Fill( ypos,
val);
103 h_xrms->Fit(x_func,
"0");
104 TF1 *fitx = h_xrms->GetFunction(
"fx");
107 h_yrms->Fit(y_func,
"0");
108 TF1 *fity = h_yrms->GetFunction(
"fy");
129 x = CLHEP::RandGaussZiggurat::shoot(engine, 0,
m_sigmaX);
130 y = CLHEP::RandGaussZiggurat::shoot(engine, 0,
m_sigmaY);