44 TH1D hTestDiffX(
"hTestDiffX",
"", 500, posEle.X() - 10., posEle.X() + 10.);
45 TH1D hTestDiffY(
"hTestDiffY",
"", 500, posEle.Y() - 10., posEle.Y() + 10.);
46 TH1D hTestDiffZ(
"hTestDiffZ",
"", 500, posEle.Z() - 10., posEle.Z() + 10.);
48 TF1 gausX(
"gausX",
"gaus");
49 TF1 gausY(
"gausY",
"gaus");
50 TF1 gausZ(
"gausZ",
"gaus");
53 float driftTime = 0.f;
55 for (
int i = 0;
i < 500000; ++
i) {
57 hTestDiffX.Fill(posEleDiff.X());
58 hTestDiffY.Fill(posEleDiff.Y());
59 hTestDiffZ.Fill(posEleDiff.Z());
62 hTestDiffX.Fit(
"gausX",
"Q0");
63 hTestDiffY.Fit(
"gausY",
"Q0");
64 hTestDiffZ.Fit(
"gausZ",
"Q0");
67 BOOST_CHECK_CLOSE(gausX.GetParameter(1), posEle.X(), 0.5);
68 BOOST_CHECK_CLOSE(gausY.GetParameter(1), posEle.Y(), 0.5);
69 BOOST_CHECK_CLOSE(gausZ.GetParameter(1), posEle.Z(), 0.5);
72 const float sigT = std::sqrt(detParam.TPClength - posEle.Z()) * gasParam.DiffT;
73 const float sigL = std::sqrt(detParam.TPClength - posEle.Z()) * gasParam.DiffL;
75 BOOST_CHECK_CLOSE(gausX.GetParameter(2), sigT, 0.5);
76 BOOST_CHECK_CLOSE(gausY.GetParameter(2), sigT, 0.5);
77 BOOST_CHECK_CLOSE(gausZ.GetParameter(2), sigL, 0.5);
91 TH1D hTestDiffX(
"hTestDiffX",
"", 500, posEle.X() - 1., posEle.X() + 1.);
92 TH1D hTestDiffY(
"hTestDiffY",
"", 500, posEle.Y() - 1., posEle.Y() + 1.);
93 TH1D hTestDiffZ(
"hTestDiffZ",
"", 500, posEle.Z() - 1., posEle.Z() + 1.);
95 TF1 gausX(
"gausX",
"gaus");
96 TF1 gausY(
"gausY",
"gaus");
97 TF1 gausZ(
"gausZ",
"gaus");
100 float driftTime = 0.f;
102 for (
int i = 0;
i < 500000; ++
i) {
104 hTestDiffX.Fill(posEleDiff.X());
105 hTestDiffY.Fill(posEleDiff.Y());
106 hTestDiffZ.Fill(posEleDiff.Z());
109 hTestDiffX.Fit(
"gausX",
"Q0");
110 hTestDiffY.Fit(
"gausY",
"Q0");
111 hTestDiffZ.Fit(
"gausZ",
"Q0");
114 BOOST_CHECK_CLOSE(gausX.GetParameter(1), posEle.X(), 0.5);
115 BOOST_CHECK_CLOSE(gausY.GetParameter(1), posEle.Y(), 0.5);
116 BOOST_CHECK_CLOSE(gausZ.GetParameter(1), posEle.Z(), 0.5);
119 BOOST_CHECK_CLOSE(gausX.GetParameter(2), gasParam.DiffT, 0.5);
120 BOOST_CHECK_CLOSE(gausY.GetParameter(2), gasParam.DiffT, 0.5);
121 BOOST_CHECK_CLOSE(gausZ.GetParameter(2), gasParam.DiffL, 0.5);