Skip to content
Snippets Groups Projects
Commit 01a0d628 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'removeNeedOfConvertion' into 'main'

Remove need for internal conversion in Acts SiSpacePointSeedMaker

See merge request !64435
parents 509844a3 92a25053
No related branches found
No related tags found
7 merge requests!66406ZDC & ZDC LED monitoring updates,!66102ZDC & RPD monitoring update,!65937Draft: Updated post-processing and plotting scripts for 2023 data in ZLumi_Scripts directory,!65537ZDC - Fix problem with swapping of low and high gain data,!64732Add hypo for time-significance based selection of HLT jets,!64579Draft: Replace status() with functions from TruthUtils,!64435Remove need for internal conversion in Acts SiSpacePointSeedMaker
...@@ -55,6 +55,8 @@ namespace InDet { ...@@ -55,6 +55,8 @@ namespace InDet {
StatusCode InDetToXAODSpacePointConversion::convertPixel(const EventContext& ctx) const StatusCode InDetToXAODSpacePointConversion::convertPixel(const EventContext& ctx) const
{ {
static const SG::AuxElement::Accessor< ElementLink< ::SpacePointCollection > > linkAcc("pixelSpacePointLink");
// Input // Input
SG::ReadHandle< ::SpacePointContainer > pixel_handle = SG::makeHandle( m_inSpacepointsPixel, ctx ); SG::ReadHandle< ::SpacePointContainer > pixel_handle = SG::makeHandle( m_inSpacepointsPixel, ctx );
ATH_CHECK( pixel_handle.isValid() ); ATH_CHECK( pixel_handle.isValid() );
...@@ -77,6 +79,10 @@ namespace InDet { ...@@ -77,6 +79,10 @@ namespace InDet {
pixel_xaod_container->push_back( new xAOD::SpacePoint() ); pixel_xaod_container->push_back( new xAOD::SpacePoint() );
ATH_CHECK( TrackingUtilities::convertTrkToXaodPixelSpacePoint(*indetSP, *pixel_xaod_container->back()) ); ATH_CHECK( TrackingUtilities::convertTrkToXaodPixelSpacePoint(*indetSP, *pixel_xaod_container->back()) );
pixel_xaod_container->back()->setMeasurementIndexes({counter++}); pixel_xaod_container->back()->setMeasurementIndexes({counter++});
// Add link to this space point
ElementLink< ::SpacePointCollection > link(indetSP, *spc);
linkAcc(*pixel_xaod_container->back()) = link;
} }
} }
...@@ -90,6 +96,8 @@ namespace InDet { ...@@ -90,6 +96,8 @@ namespace InDet {
StatusCode InDetToXAODSpacePointConversion::convertStrip(const EventContext& ctx, StatusCode InDetToXAODSpacePointConversion::convertStrip(const EventContext& ctx,
const Amg::Vector3D& vertex) const const Amg::Vector3D& vertex) const
{ {
static const SG::AuxElement::Accessor< ElementLink< ::SpacePointCollection > > linkAcc("sctSpacePointLink");
// Input // Input
SG::ReadHandle< ::SpacePointContainer > strip_handle = SG::makeHandle( m_inSpacepointsStrip, ctx ); SG::ReadHandle< ::SpacePointContainer > strip_handle = SG::makeHandle( m_inSpacepointsStrip, ctx );
ATH_CHECK( strip_handle.isValid() ); ATH_CHECK( strip_handle.isValid() );
...@@ -111,7 +119,11 @@ namespace InDet { ...@@ -111,7 +119,11 @@ namespace InDet {
strip_xaod_container->push_back( new xAOD::SpacePoint() ); strip_xaod_container->push_back( new xAOD::SpacePoint() );
ATH_CHECK( TrackingUtilities::convertTrkToXaodStripSpacePoint(*indetSP, vertex, *strip_xaod_container->back()) ); ATH_CHECK( TrackingUtilities::convertTrkToXaodStripSpacePoint(*indetSP, vertex, *strip_xaod_container->back()) );
strip_xaod_container->back()->setMeasurementIndexes({counter, counter++}); strip_xaod_container->back()->setMeasurementIndexes({counter, counter++});
// Add link to this space point
ElementLink< ::SpacePointCollection > link(indetSP, *spc);
linkAcc(*strip_xaod_container->back()) = link;
} }
} }
......
...@@ -320,7 +320,6 @@ def ActsTrkSeedingAlgorithmAnalysisAlgCfg(flags, name="ActsTrkSeedingAlgorithmAn ...@@ -320,7 +320,6 @@ def ActsTrkSeedingAlgorithmAnalysisAlgCfg(flags, name="ActsTrkSeedingAlgorithmAn
from ActsConfig.ActsTrkSeedingConfig import ActsTrkSiSpacePointsSeedMakerCfg from ActsConfig.ActsTrkSeedingConfig import ActsTrkSiSpacePointsSeedMakerCfg
ActsITkSiSpacePointsSeedMaker = result.popToolsAndMerge(ActsTrkSiSpacePointsSeedMakerCfg(flags)) ActsITkSiSpacePointsSeedMaker = result.popToolsAndMerge(ActsTrkSiSpacePointsSeedMakerCfg(flags))
ActsITkSiSpacePointsSeedMaker.doSpacePointConversion = False
ActsITkSiSpacePointsSeedMaker.doSeedConversion = False ActsITkSiSpacePointsSeedMaker.doSeedConversion = False
MonitoringGroupNames.append("ActsITkSiSpacePointSeedMaker") MonitoringGroupNames.append("ActsITkSiSpacePointSeedMaker")
...@@ -330,7 +329,6 @@ def ActsTrkSeedingAlgorithmAnalysisAlgCfg(flags, name="ActsTrkSeedingAlgorithmAn ...@@ -330,7 +329,6 @@ def ActsTrkSeedingAlgorithmAnalysisAlgCfg(flags, name="ActsTrkSeedingAlgorithmAn
result.popToolsAndMerge(ActsTrkSiSpacePointsSeedMakerCfg(flags, result.popToolsAndMerge(ActsTrkSiSpacePointsSeedMakerCfg(flags,
name="ActsTrkSiSpacePointsSeedMakerOrthogonal", name="ActsTrkSiSpacePointsSeedMakerOrthogonal",
SeedToolPixel=orthogonal_seeding_tool)) SeedToolPixel=orthogonal_seeding_tool))
ActsITkSiSpacePointsSeedMakerOrthogonal.doSpacePointConversion = False
ActsITkSiSpacePointsSeedMakerOrthogonal.doSeedConversion = False ActsITkSiSpacePointsSeedMakerOrthogonal.doSeedConversion = False
MonitoringGroupNames.append("ActsOrthogonalITkSiSpacePointSeedMaker") MonitoringGroupNames.append("ActsOrthogonalITkSiSpacePointSeedMaker")
......
...@@ -113,13 +113,7 @@ def ActsTrkSiSpacePointsSeedMakerCfg(flags, ...@@ -113,13 +113,7 @@ def ActsTrkSiSpacePointsSeedMakerCfg(flags,
kwargs['name'] = name kwargs['name'] = name
# Main properties # Main properties
from ActsConfig.TrackingComponentConfigurer import TrackingComponentConfigurer kwargs.setdefault('usePixel',
configuration_settings = TrackingComponentConfigurer(flags)
kwargs.setdefault('SpacePointsPixelName', 'ITkPixelSpacePoints')
kwargs.setdefault('SpacePointsStripName', 'ITkStripSpacePoints')
kwargs.setdefault('SpacePointsOverlapName', 'ITkOverlapSpacePoints')
kwargs.setdefault('usePixel',
flags.Tracking.ActiveConfig.useITkPixel and flags.Tracking.ActiveConfig.useITkPixel and
flags.Tracking.ActiveConfig.useITkPixelSeeding) flags.Tracking.ActiveConfig.useITkPixelSeeding)
kwargs.setdefault('useStrip', kwargs.setdefault('useStrip',
...@@ -128,12 +122,26 @@ def ActsTrkSiSpacePointsSeedMakerCfg(flags, ...@@ -128,12 +122,26 @@ def ActsTrkSiSpacePointsSeedMakerCfg(flags,
kwargs.setdefault('useOverlapSpCollection', kwargs.setdefault('useOverlapSpCollection',
flags.Tracking.ActiveConfig.useITkStrip and flags.Tracking.ActiveConfig.useITkStrip and
flags.Tracking.ActiveConfig.useITkStripSeeding) flags.Tracking.ActiveConfig.useITkStripSeeding)
kwargs.setdefault('doSpacePointConversion', not (configuration_settings.doActsSpacePoint and configuration_settings.doAthenaToActsCluster))
kwargs.setdefault('ActsTrkSpacePointsPixelName' , "ITkPixelSpacePoints") kwargs.setdefault('ActsTrkSpacePointsPixelName' , "ITkPixelSpacePoints")
kwargs.setdefault('ActsTrkSpacePointsStripName' , "ITkStripSpacePoints") kwargs.setdefault('ActsTrkSpacePointsStripName' , "ITkStripSpacePoints")
kwargs.setdefault('ActsTrkSpacePointsOverlapName' , "ITkStripOverlapSpacePoints") kwargs.setdefault('ActsTrkSpacePointsOverlapName' , "ITkStripOverlapSpacePoints")
kwargs.setdefault('PixelClusterContainerKey', "ITkPixelClusters")
kwargs.setdefault('StripClusterContainerKey', "ITkStripClusters") from ActsConfig.TrackingComponentConfigurer import TrackingComponentConfigurer
configuration_settings = TrackingComponentConfigurer(flags)
# The code will need to use Trk::SpacePoint object for downstream Athena tracking
# If we run this tool we have two options to retrieve this:
# (1) Have the Athena->Acts Space Point Converter scheduled beforehand
# (2) Have the Athena->Acts Cluster Converter scheduled beforehand
# In case (1) the link xAOD -> Trk Space Point will be used to retrieve the Trk::SpacePoints
# In case (2) the link xAOD -> InDet Cluster will be used to create the Trk::SpacePoints
# If none of the above conditions are met, it means there is a misconfiguration of the algorithms
useClusters = configuration_settings.doAthenaToActsCluster and not configuration_settings.doAthenaToActsSpacePoint
if useClusters and kwargs['usePixel']:
kwargs.setdefault('PixelClusterContainerKey', 'ITkPixelClusters')
if useClusters and kwargs['useStrip']:
kwargs.setdefault('StripClusterContainerKey', 'ITkStripClusters')
if flags.Tracking.ActiveConfig.usePrdAssociationTool: if flags.Tracking.ActiveConfig.usePrdAssociationTool:
# not all classes have that property !!! # not all classes have that property !!!
......
...@@ -144,9 +144,6 @@ namespace ActsTrk { ...@@ -144,9 +144,6 @@ namespace ActsTrk {
private: private:
void buildBeamFrameWork(const EventContext& ctx, void buildBeamFrameWork(const EventContext& ctx,
InDet::SiSpacePointsSeedMakerEventData& data) const; InDet::SiSpacePointsSeedMakerEventData& data) const;
void
newSpacePoint(InDet::SiSpacePointsSeedMakerEventData& data,
const Trk::SpacePoint* const& sp) const;
void void
newSpacePoint(InDet::SiSpacePointsSeedMakerEventData& data, newSpacePoint(InDet::SiSpacePointsSeedMakerEventData& data,
const xAOD::SpacePoint* const& sp) const; const xAOD::SpacePoint* const& sp) const;
...@@ -156,7 +153,15 @@ namespace ActsTrk { ...@@ -156,7 +153,15 @@ namespace ActsTrk {
static void stripInform(InDet::SiSpacePointsSeedMakerEventData& data, static void stripInform(InDet::SiSpacePointsSeedMakerEventData& data,
const Trk::SpacePoint* const& sp, const Trk::SpacePoint* const& sp,
float* r) ; float* r) ;
bool convertPixelSeed(const EventContext& ctx,
InDet::SiSpacePointsSeedMakerEventData& data,
const ActsTrk::SeedContainer& seedPtrs) const;
bool convertStripSeed(const EventContext& ctx,
InDet::SiSpacePointsSeedMakerEventData& data,
const ActsTrk::SeedContainer& seedPtrs) const;
// Retrieve // Retrieve
StatusCode retrievePixel(const EventContext& ctx, StatusCode retrievePixel(const EventContext& ctx,
InDet::SiSpacePointsSeedMakerEventData& data, InDet::SiSpacePointsSeedMakerEventData& data,
...@@ -179,16 +184,14 @@ namespace ActsTrk { ...@@ -179,16 +184,14 @@ namespace ActsTrk {
ToolHandle< ActsTrk::ISeedingTool > m_seedsToolPixel {this, "SeedToolPixel", "","Seed Tool for Pixel detector"}; ToolHandle< ActsTrk::ISeedingTool > m_seedsToolPixel {this, "SeedToolPixel", "","Seed Tool for Pixel detector"};
ToolHandle< ActsTrk::ISeedingTool > m_seedsToolStrip {this, "SeedToolStrip", "","Seed Tool for Strip detector"}; ToolHandle< ActsTrk::ISeedingTool > m_seedsToolStrip {this, "SeedToolStrip", "","Seed Tool for Strip detector"};
SG::ReadHandleKey< ::SpacePointContainer > m_spacepointsPixel {this, "SpacePointsPixelName", "ITkPixelSpacePoints", "Pixel space points container"};
SG::ReadHandleKey< ::SpacePointContainer > m_spacepointsStrip {this, "SpacePointsStripName", "ITkStripSpacePoints", "Strip space points container"};
SG::ReadHandleKey< ::SpacePointOverlapCollection > m_spacepointsOverlap {this, "SpacePointsOverlapName", "OverlapSpacePoints"};
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap {this, "PRDtoTrackMap", "", "option PRD-to-track association"}; SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap {this, "PRDtoTrackMap", "", "option PRD-to-track association"};
SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsPixel {this, "ActsTrkSpacePointsPixelName", "ITkPixelSpacePoints", "Pixel space points container"}; SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsPixel {this, "ActsTrkSpacePointsPixelName", "ITkPixelSpacePoints", "Pixel space points container"};
SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsStrip {this, "ActsTrkSpacePointsStripName", "ITkStripSpacePoints", "Strip space points container"}; SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsStrip {this, "ActsTrkSpacePointsStripName", "ITkStripSpacePoints", "Strip space points container"};
SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsOverlap {this, "ActsTrkSpacePointsOverlapName", "ITkStripOverlapSpacePoints", "Strip overlap space points container"}; SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsOverlap {this, "ActsTrkSpacePointsOverlapName", "ITkStripOverlapSpacePoints", "Strip overlap space points container"};
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_pixelClusterContainerKey {this, "PixelClusterContainerKey", "ITkPixelClusters", "Key of input pixel clusters"};
SG::ReadHandleKey< xAOD::StripClusterContainer > m_stripClusterContainerKey {this, "StripClusterContainerKey", "ITkStripClusters", "Key of input strip clusters"}; SG::ReadHandleKey< xAOD::PixelClusterContainer > m_pixelClusterContainerKey {this, "PixelClusterContainerKey", "", "Key of input pixel clusters"};
SG::ReadHandleKey< xAOD::StripClusterContainer > m_stripClusterContainerKey {this, "StripClusterContainerKey", "", "Key of input strip clusters"};
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"}; SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj",
...@@ -198,7 +201,6 @@ namespace ActsTrk { ...@@ -198,7 +201,6 @@ namespace ActsTrk {
Gaudi::Property< bool > m_strip {this, "useStrip", true }; Gaudi::Property< bool > m_strip {this, "useStrip", true };
Gaudi::Property< bool > m_useOverlap {this, "useOverlapSpCollection", true}; Gaudi::Property< bool > m_useOverlap {this, "useOverlapSpCollection", true};
Gaudi::Property< bool > m_fastTracking {this, "useFastTracking", false}; Gaudi::Property< bool > m_fastTracking {this, "useFastTracking", false};
Gaudi::Property< bool > m_doSpacePointConversion {this, "doSpacePointConversion", true, "Convert Trk::SpacePoint container into xAOD::SpacePoint container"};
Gaudi::Property< bool > m_doSeedConversion {this, "doSeedConversion", true, "Convert ActsTrk::Seed into ITk::SiSpacePointsProSeed"}; Gaudi::Property< bool > m_doSeedConversion {this, "doSeedConversion", true, "Convert ActsTrk::Seed into ITk::SiSpacePointsProSeed"};
private: private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment