Skip to content

RobustTrackingGeometryBuilder : Move the common Svc/Cond part under Impl . Templated

Let me ping @jchapman ...

This is the last (or at least I could see) of the major factoring of code between Svc and Cond. This is a bit more special as the Layer/BeamPipe Cond/Svc were used in various places.

Basically we have a template where we have an enum/ tag Cond/Svc.

  enum ToolType {
    Cond = 0,
    Svc = 1,
  };
  template <ToolType type, typename LayerBuilders, typename PipeBuilder>
  std::unique_ptr<Trk::TrackingGeometry> trackingGeometryImpl(
      const LayerBuilders& layerHandles, const PipeBuilder& pipeHandle,
      const EventContext* ctx = nullptr,
      SG::WriteCondHandle<Trk::TrackingGeometry>* whandle = nullptr) const;

Ignoring the other 500 lines of code (the common ones that we move into one place) and some "shuffling".

The trick is in lines like these

if constexpr (type == Cond) {
      cylinderLayers = layerHandles[ilb]->cylindricalLayers(*ctx, *whandle);
    } else {
      cylinderLayers = layerHandles[ilb]->cylindricalLayers();
    }

The short idea I exchanged with @jchapman is this https://godbolt.org/z/66dsf51Ks

Edited by Christos Anastopoulos

Merge request reports

Loading