Skip to content
Snippets Groups Projects

InteractionRegion information in additional algorithms

Merged Rosen Matev requested to merge cherry-pick-303217d7 into master
Files
7
@@ -28,6 +28,7 @@
#include "Kernel/LHCbID.h"
#include "Kernel/STLExtensions.h"
#include "Kernel/VPConstants.h"
#include "LHCbDet/InteractionRegion.h"
#include "VPDAQ/VPRetinaClusterConstants.h"
#include "VPDet/DeVP.h"
#include "VPDet/VPDetPaths.h"
@@ -639,19 +640,30 @@ namespace LHCb::Pr::Velo {
*/
template <RawBank::BankType VP_banktype, SearchMode searchMode>
class ClusterTrackingSIMD
: public LHCb::Algorithm::MultiTransformer<std::tuple<VP::Hits, Tracks, Tracks>(
const EventContext&, const RawBank::View&, const DeVP& ),
LHCb::Algorithm::Traits::usesConditions<DeVP>> {
: public Algorithm::MultiTransformer<std::tuple<VP::Hits, Tracks, Tracks>( const EventContext&,
const RawBank::View&, const DeVP&,
const Conditions::InteractionRegion& ),
Algorithm::Traits::usesConditions<DeVP, Conditions::InteractionRegion>> {
public:
//=============================================================================
// Standard constructor, initializes variables
//=============================================================================
ClusterTrackingSIMD( const std::string& name, ISvcLocator* pSvcLocator )
: MultiTransformer(
name, pSvcLocator, {KeyValue{"RawBanks", "DAQ/RawBanks/VP"}, KeyValue{"DEVP", LHCb::Det::VP::det_path}},
{KeyValue{"HitsLocation", "Raw/VP/Hits"}, KeyValue{"TracksBackwardLocation", "Rec/Track/VeloBackward"},
KeyValue{"TracksLocation", "Rec/Track/Velo"}} ) {}
: MultiTransformer( name, pSvcLocator,
{KeyValue{"RawBanks", "DAQ/RawBanks/VP"}, KeyValue{"DEVP", Det::VP::det_path},
KeyValue{"InteractionRegionCache", "AlgorithmSpecific-" + name + "-InteractionRegion"}},
{KeyValue{"HitsLocation", "Raw/VP/Hits"},
KeyValue{"TracksBackwardLocation", "Rec/Track/VeloBackward"},
KeyValue{"TracksLocation", "Rec/Track/Velo"}} ) {}
StatusCode initialize() override {
return MultiTransformer::initialize().andThen( [&]() {
// This is only needed to have a fallback in case the IR condition does not exist. In that case, the information
// is taken from DeVP and thus the Velo motion system which is not exactly the same.
Conditions::InteractionRegion::addConditionDerivation( this, inputLocation<Conditions::InteractionRegion>() );
} );
}
[[gnu::flatten]] void TrackSeeding( HitsPlane* P0, HitsPlane* P1, HitsPlane* P2, LightTracksSoA* tracks ) const {
using simd = SIMDWrapper::best::types;
@@ -896,7 +908,8 @@ namespace LHCb::Pr::Velo {
// Main execution
//=============================================================================
std::tuple<VP::Hits, Velo::Tracks, Velo::Tracks>
operator()( const EventContext& evtCtx, const RawBank::View& tBanks, const DeVP& devp ) const override {
operator()( const EventContext& evtCtx, const RawBank::View& tBanks, const DeVP& devp,
const LHCb::Conditions::InteractionRegion& region ) const override {
using Tracks = Velo::Tracks;
using Hits = VP::Hits;
@@ -1184,7 +1197,7 @@ namespace LHCb::Pr::Velo {
F z_beam = p1.z();
F denom = tx * tx + ty * ty;
z_beam = select( denom < 0.001f * 0.001f, z_beam,
( ( devp.beamSpot().x() - x0 ) * tx + ( devp.beamSpot().y() - y0 ) * ty ) / denom );
( ( region.avgPosition.x() - x0 ) * tx + ( region.avgPosition.y() - y0 ) * ty ) / denom );
const auto hitproxy = hits.simd();
auto n_hits = track.get<LightTrackTag::nHits>();
@@ -1229,7 +1242,7 @@ namespace LHCb::Pr::Velo {
auto dir = track.StateDir( 1 );
auto vp_index = track.vp_indices();
auto closestToBeam = fitBackward<F, I>( loop_mask, nhits, hits, dir, vp_index );
closestToBeam.transportTo( closestToBeam.zBeam( devp.beamSpot().x(), devp.beamSpot().y() ) );
closestToBeam.transportTo( closestToBeam.zBeam( region.avgPosition.x(), region.avgPosition.y() ) );
track.StatePosDir( 0 ).setPosition( closestToBeam.pos() );
track.StatePosDir( 0 ).setDirection( closestToBeam.dir() );
track.setStateCovXY( 0, closestToBeam.covX(), closestToBeam.covY() );
@@ -1242,7 +1255,7 @@ namespace LHCb::Pr::Velo {
auto dir = track.StateDir( 0 );
auto vp_index = track.vp_indices();
auto closestToBeam = fitForward<F, I>( loop_mask, nhits, hits, dir, vp_index );
closestToBeam.transportTo( closestToBeam.zBeam( devp.beamSpot().x(), devp.beamSpot().y() ) );
closestToBeam.transportTo( closestToBeam.zBeam( region.avgPosition.x(), region.avgPosition.y() ) );
track.StatePosDir( 0 ).setPosition( closestToBeam.pos() );
track.StatePosDir( 0 ).setDirection( closestToBeam.dir() );
track.setStateCovXY( 0, closestToBeam.covX(), closestToBeam.covY() );
@@ -1266,7 +1279,6 @@ namespace LHCb::Pr::Velo {
Gaudi::Property<float> m_max_scatter_3hits{this, "MaxScatter3hits", 0.02f};
Gaudi::Property<int> m_skip_forward{this, "SkipForward", SearchModeParam<searchMode>::skip_forward_default};
};
using VeloClusterTrackingSIMD = ClusterTrackingSIMD<RawBank::VP, SearchMode::Default>;
using VeloClusterTrackingSIMDFaster = ClusterTrackingSIMD<RawBank::VP, SearchMode::Fast>;
using VeloClusterTrackingSIMDFull = ClusterTrackingSIMD<RawBank::VP, SearchMode::Full>;
Loading