Commit c5b85380 authored by CI Runner's avatar CI Runner
Browse files

Add support for CALO objects in the vertex fitter

parent fdac514c
Pipeline #3206500 passed with stage
in 32 seconds
......@@ -118,12 +118,17 @@ namespace Sel::Fitters {
enum struct ChildType : unsigned char {
TrackWithVelo = 0,
TrackWithoutVelo,
Track,
Composite,
Resonance,
Other,
NumTypes
};
template <ChildType C>
static constexpr bool has_full_state_v = ( C == ChildType::Composite || C == ChildType::Resonance ||
C == ChildType::Other );
/** Indirectly stolen from TrackVertexUtils::poca
*/
template <typename float_v, typename mask_v>
......@@ -180,12 +185,12 @@ namespace Sel::Fitters {
}
// Class for daughters with a straight-line trajectory
template <typename particle_t, bool represents_composite>
template <typename particle_t, ChildType child_type>
struct VertexTraj final {
using simd_t = typename particle_t::simd_t;
using int_v = typename simd_t::int_v;
using float_v = typename simd_t::float_v;
using state_t = std::conditional_t<represents_composite, State4<float_v>, MiniState<float_v>>;
using state_t = std::conditional_t<has_full_state_v<child_type>, State4<float_v>, MiniState<float_v>>;
private:
particle_t m_particle; // TODO maybe just cache some information from this?
......@@ -252,10 +257,11 @@ namespace Sel::Fitters {
// ParticleVertexFitter this was done with a full specialisation, but
// now it would have to be a partial specialisation and it all gets a
// bit messy.
if constexpr ( represents_composite ) {
if constexpr ( child_type == ChildType::Composite ) {
addToFourVector_Composite( vertexpos, p4, p4cov, gainmatrix );
} else {
} else if constexpr ( child_type == ChildType::Track ) {
addToFourVector_Track( vertexpos, p4, p4cov, gainmatrix );
} else {
}
}
......@@ -450,7 +456,7 @@ namespace Sel::Fitters {
child_t const& child ) {
assert( type == ChildType::TrackWithVelo || type == ChildType::TrackWithoutVelo );
using VertexTrack =
VertexTraj<child_t, false /* flag this represents a track not a weakly-decaying composite */>;
VertexTraj<child_t, ChildType::Track /* flag this represents a track not a weakly-decaying composite */>;
return VertexTrack{child, child.state( child_t::StateLocation::ClosestToBeam )};
}
};
......@@ -504,7 +510,8 @@ namespace Sel::Fitters {
child_t const& child ) {
assert( type == ChildType::Composite || type == ChildType::Resonance );
using VertexComposite =
VertexTraj<child_t, true /* flag this represents a weakly-decaying composite and not a track */>;
VertexTraj<child_t,
ChildType::Composite /* flag this represents a weakly-decaying composite and not a track */>;
return VertexComposite{child, stateVectorFromComposite( child )};
}
};
......@@ -527,9 +534,11 @@ namespace Sel::Fitters {
template <typename mask_v, typename float_v>
static auto prepareChild( [[maybe_unused]] VecN<3, float_v> const& vertex_position,
[[maybe_unused]] mask_v const& vertex_position_mask, [[maybe_unused]] ChildType type,
[[maybe_unused]] child_t const& child ) {
child_t const& child ) {
assert( type == ChildType::Other );
return bool{};
using VertexOther =
VertexTraj<child_t, ChildType::Other /* flag this represents a track not a weakly-decaying composite */>;
return VertexOther{child, stateVectorFromOther( child )};
}
};
......
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