37 Int_t np, Double_t logEkin[], Double_t
response[],
const char *opt,
38 Double_t valbeg, Double_t valend) {
39 TSpline3 initspline(GetName(), logEkin,
response, np, opt, valbeg, valend);
120 const int Graph0_n = 9;
121 Double_t Graph0_fx1001[Graph0_n] = {1.024, 2.048, 4.094, 8.192, 16.384,
122 32.768, 65.536, 131.072, 262.144};
123 for (
int i = 0; i < Graph0_n; ++i)
124 Graph0_fx1001[i] *= 1000;
126 Double_t Graph0_fy1001[Graph0_n] = {0.6535402, 0.6571529, 0.6843001,
127 0.7172835, 0.7708416, 0.798819,
128 0.8187628, 0.8332745, 0.8443931};
129 grspline =
new TGraph(Graph0_n, Graph0_fx1001, Graph0_fy1001);
132 TGraph *grdraw = (TGraph *)grspline->Clone();
133 grdraw->SetMarkerColor(46);
134 grdraw->SetMarkerStyle(8);
137 "test TFCSEnergyInterpolationSpline");
139 test.set_Ekin_nominal(
140 0.5 * (grdraw->GetX()[0] + grdraw->GetX()[grdraw->GetN() - 1]));
141 test.set_Ekin_min(grdraw->GetX()[0]);
142 test.set_Ekin_max(grdraw->GetX()[grdraw->GetN() - 1]);
143 test.set_eta_nominal(0.225);
144 test.set_eta_min(0.2);
145 test.set_eta_max(0.25);
146 test.InitFromArrayInEkin(grspline->GetN(), grspline->GetX(), grspline->GetY(),
153 TGraph *
gr =
new TGraph();
154 gr->SetNameTitle(
"testTFCSEnergyInterpolationSplineLogX",
155 "test TFCSEnergyInterpolationSpline log x-axis");
156 gr->GetXaxis()->SetTitle(
"Ekin [MeV]");
157 gr->GetYaxis()->SetTitle(
"<E(reco)>/Ekin(true)");
160 for (
float Ekin = test.Ekin_min() * 0.25; Ekin <= test.Ekin_max() * 4;
163 truth->SetPxPyPzE(Ekin, 0, 0, Ekin);
164 simulstate->
set_E(Ekin);
165 if (test.simulate(*simulstate, truth, extrapol) !=
FCSSuccess) {
168 gr->SetPoint(ip, Ekin, simulstate->
E() / Ekin);
174#if defined(__FastCaloSimStandAlone__)
175 TCanvas *c =
new TCanvas(
gr->GetName(),
gr->GetTitle());
177 grdraw->Draw(
"Psame");
virtual FCSReturnCode simulate(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
Initialize simulstate with the mean reconstructed energy in the calorimater expeted from the true kin...
void InitFromArrayInEkin(Int_t np, Double_t Ekin[], Double_t response[], const char *opt=nullptr, Double_t valbeg=0, Double_t valend=0)
Initialize spline interpolation from arrays in Ekin and response=<E(reco)/Ekin(true)> opt,...
void InitFromArrayInLogEkin(Int_t np, Double_t logEkin[], Double_t response[], const char *opt=nullptr, Double_t valbeg=0, Double_t valend=0)
Initialize spline interpolation from arrays in log(Ekin) and response=<E(reco)/Ekin(true)> opt,...