Commit 4cd0f75e authored by Vladimir Gligorov's avatar Vladimir Gligorov
Browse files

resolve conflicts

parents 3d20080d 7c9e2702
Pipeline #933080 passed with stage
in 1 minute and 8 seconds
......@@ -44,51 +44,51 @@ __host__ __device__ float fastfitter(
{
const float ty = velo_state.ty;
const float zKink = PrVeloUTConst::magFieldParams[0] - ty * ty * PrVeloUTConst::magFieldParams[1] -
ty * ty * ty * ty * PrVeloUTConst::magFieldParams[2];
const float xMidField = velo_state.x + velo_state.tx * (zKink - velo_state.z);
const float zDiff = 0.001f * (zKink - UT::Constants::zMidUT);
// -- This is to avoid division by zero...
const float pHelper = std::max(float(std::abs(best_params.qp * qpxz2p)), float(1e-9));
const float invP = pHelper * sqrtf(1.0f + ty * ty);
// these resolution are semi-empirical, could be tuned and might not be correct for low momentum.
// this is the resolution due to multiple scattering between Velo and UT
const float error1 = 0.14f + 10000.0f * invP;
// this is the resolution due to the finite Velo resolution
const float error2 = 0.12f + 3000.0f * invP;
const float error = error1 * error1 + error2 * error2;
const float weight = 1.0f / error;
float mat[6] = {weight, weight * zDiff, weight * zDiff * zDiff, 0.0f, 0.0f, 0.0f};
float rhs[3] = {weight * xMidField, weight * xMidField * zDiff, 0.0f};
const float yyProto = velo_state.y - velo_state.ty * velo_state.z;
for (int i = 0; i < UT::Constants::n_layers; ++i) {
if (best_hits[i] != -1) {
const auto hit = best_hits[i];
const int plane_code = i;
const float dxDy = ut_dxDy[plane_code];
const float yy = yyProto + (velo_state.ty * ut_hits.zAtYEq0[hit]);
const float ui = ut_hits.xAt(hit, yy, dxDy);
const float dz = 0.001f * (ut_hits.zAtYEq0[hit] - UT::Constants::zMidUT);
const float w = ut_hits.weight[hit];
const float t = ut_hits.sinT(hit, dxDy);
mat[0] += w;
mat[1] += w * dz;
mat[2] += w * dz * dz;
mat[3] += w * t;
mat[4] += w * dz * t;
mat[5] += w * t * t;
rhs[0] += w * ui;
rhs[1] += w * ui * dz;
rhs[2] += w * ui * t;
const float zKink = UT::Constants::magFieldParams[0] - ty*ty*UT::Constants::magFieldParams[1] - ty*ty*ty*ty*UT::Constants::magFieldParams[2];
const float xMidField = velo_state.x + velo_state.tx*(zKink-velo_state.z);
const float zDiff = 0.001f * (zKink - UT::Constants::zMidUT);
// -- This is to avoid division by zero...
const float pHelper = std::max( float(std::abs(best_params.qp * qpxz2p)), float(1e-9));
const float invP = pHelper*sqrtf(1.0f+ty*ty);
// these resolution are semi-empirical, could be tuned and might not be correct for low momentum.
// this is the resolution due to multiple scattering between Velo and UT
const float error1 = 0.14f + 10000.0f*invP;
// this is the resolution due to the finite Velo resolution
const float error2 = 0.12f + 3000.0f*invP;
const float error = error1*error1 + error2*error2;
const float weight = 1.0f/error;
float mat[6] = {weight, weight * zDiff, weight * zDiff * zDiff, 0.0f, 0.0f, 0.0f};
float rhs[3] = {weight * xMidField, weight * xMidField * zDiff, 0.0f };
const float yyProto = velo_state.y - velo_state.ty * velo_state.z;
for (int i = 0; i < UT::Constants::n_layers; ++i) {
if (best_hits[i] != -1) {
const auto hit = best_hits[i];
const int plane_code = i;
const float dxDy = ut_dxDy[plane_code];
const float yy = yyProto + (velo_state.ty * ut_hits.zAtYEq0[hit]);
const float ui = ut_hits.xAt(hit, yy, dxDy);
const float dz = 0.001f * (ut_hits.zAtYEq0[hit] - UT::Constants::zMidUT);
const float w = ut_hits.weight[hit];
const float t = ut_hits.sinT(hit, dxDy);
mat[0] += w;
mat[1] += w * dz;
mat[2] += w * dz * dz;
mat[3] += w * t;
mat[4] += w * dz * t;
mat[5] += w * t * t;
rhs[0] += w * ui;
rhs[1] += w * ui * dz;
rhs[2] += w * ui * t;
}
}
}
......
......@@ -40,12 +40,14 @@ namespace Consumers {
struct UTLookupTables final : public Allen::NonEventData::Consumer {
public:
UTLookupTables(PrUTMagnetTool*& tool);
UTLookupTables(UTMagnetTool*& tool);
void consume(std::vector<char> const& data) override;
private:
std::reference_wrapper<PrUTMagnetTool*> m_tool;
std::reference_wrapper<UTMagnetTool*> m_tool;
size_t m_size = 0;
};
......
......@@ -9,7 +9,8 @@ namespace {
using std::to_string;
} // namespace
Consumers::UTLookupTables::UTLookupTables(PrUTMagnetTool*& tool) : m_tool {tool} {}
Consumers::UTLookupTables::UTLookupTables(UTMagnetTool*& tool)
: m_tool{tool} {}
void Consumers::UTLookupTables::consume(std::vector<char> const& data)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment