diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/ATLAS_CHECK_THREAD_SAFETY deleted file mode 100644 index 4e5f0f12eb54c3318c5f84d4e97c65e1199b2a1f..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/ATLAS_CHECK_THREAD_SAFETY +++ /dev/null @@ -1 +0,0 @@ -InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/CMakeLists.txt b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/CMakeLists.txt deleted file mode 100644 index ba1a4a1143218c1ed44d938150e11cdfb9c5e86f..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -# Declare the package name: -atlas_subdir( InDetTrigParticleCreation ) - -# Component(s) in the package: -atlas_add_component( InDetTrigParticleCreation - src/*.cxx - src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel StoreGateLib TrkToolInterfaces TrkTrack TrkTrackSummary xAODTracking ) diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/doc/packagedoc.h b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/doc/packagedoc.h deleted file mode 100644 index 73b6602bedef178f9bd6d1f48dab42c3b45bd2e6..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/doc/packagedoc.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** -@page InDetTrigParticleCreation_page InDetTrigParticleCreation - -@section InDetTrigParticleCreation_introduction Introduction: - -InDetTrigParticleCreation is the last algorithm of the Event Filter -InnerDetector software chain. It combines information from previous -algorithms and creates TrackParticles. - -@section InDetTrigParticleCreation_howitworks How it works: - -The only algorithm of the package is TrigParticleCreator. For each RoI -it reads all tracks from StoreGate, all tracks used in the primary -vertex fit and creates TrackParticles. The TrackParticle is always -constructed with the primary vertex. If its track has been used for -the primary vertex fit the TrackParticleOrigin enum will be set to -Rec::PriVtx, if not it will be set to Rec::NoVtx. - -@section InDetTrigParticleCreation_packagecontent Package Contents: -InDetTrigParticleCreation contains the following files/classes: -- TrigParticleCreator.cxx ... the algoritm which creates particles - - - -\namespace PCreate -*/ diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnvMT.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnvMT.cxx deleted file mode 100644 index b424485b9e93dc1a462c1b6729bd324089988827..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnvMT.cxx +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TrigTrackingxAODCnvMT.h" -#include "xAODTracking/TrackParticleAuxContainer.h" -#include "xAODTracking/TrackParticleContainer.h" -#include "TrkTrack/Track.h" -#include "TrkTrackSummary/TrackSummary.h" - -#include <cmath> -#include <algorithm> - - -namespace InDet -{ - - - TrigTrackingxAODCnvMT::TrigTrackingxAODCnvMT(const std::string &name, - ISvcLocator *pSvcLocator) - : AthReentrantAlgorithm (name, pSvcLocator), - m_particleCreatorTool("Trk::ParticleCreatorTool"), - m_trackKey(""), - m_trackParticleKey("") - { - declareProperty("ParticleCreatorTool", m_particleCreatorTool); - declareProperty("TrackParticlesName", - m_trackParticleKey = std::string("TrackParticles"), - "TrackParticle container"); - declareProperty("TrackName", - m_trackKey = std::string("Tracks"), - "Track Collection"); - } - - /////////////////////////////////////////////////////////////////// - // Initialisation - /////////////////////////////////////////////////////////////////// - StatusCode TrigTrackingxAODCnvMT::initialize() { - - ATH_CHECK(m_particleCreatorTool.retrieve()); - - ATH_CHECK( m_trackKey.initialize() ); - ATH_CHECK( m_trackParticleKey.initialize() ); - - return StatusCode::SUCCESS; - } - - /////////////////////////////////////////////////////////////////// - // Execute HLT Algorithm - /////////////////////////////////////////////////////////////////// - StatusCode TrigTrackingxAODCnvMT::execute(const EventContext& ctx) const { - - - auto tpHandle = SG::makeHandle (m_trackParticleKey, ctx); - - ATH_CHECK( tpHandle.record (std::make_unique<xAOD::TrackParticleContainer>(), - std::make_unique<xAOD::TrackParticleAuxContainer>()) ); - xAOD::TrackParticleContainer* tpCont=tpHandle.ptr(); - - auto tracks = SG::makeHandle(m_trackKey, ctx); - - ATH_MSG_VERBOSE(" Input track collection has size " << tracks->size()); - if ( tracks->size() == 0 ) { - ATH_MSG_DEBUG(" Input track collection has 0 size. Algorithm not executed!"); - return StatusCode::SUCCESS; - } - - //convert tracks - tpCont->reserve(tracks->size()); - for(unsigned int idtr=0; idtr< tracks->size(); ++idtr) { - const ElementLink<TrackCollection> trackLink(*tracks, idtr); - - xAOD::TrackParticle* tp = m_particleCreatorTool->createParticle( trackLink, tpCont); - - if(msgLvl(MSG::DEBUG) && (tp != nullptr)){ - int npix, nsct, ntrt, npixh, nscth; - npix = nsct = ntrt = npixh = nscth = -1; - const Trk::Track *tr = tp->track(); - if (tr){ - const Trk::TrackSummary *ts = tr->trackSummary(); - if (ts){ - npix = ts->get(Trk::numberOfPixelHits); - nsct = ts->get(Trk::numberOfSCTHits); - ntrt = ts->get(Trk::numberOfTRTHits); - nscth= ts->get(Trk::numberOfSCTHoles); - npixh= ts->get(Trk::numberOfPixelHoles); - - } - } - - msg() << MSG::DEBUG << "REGTEST: " << std::setw(5) << idtr - << " pT: " << std::setw(10) << tp->pt() - << " eta: " << tp->eta() - << " phi: " << tp->phi() - << " d0: " << tp->d0() - << " z0: " << tp->z0() - << "\t" << npix << "/" << nsct << "/" << ntrt << "//" << npixh << "/" << nscth - << endmsg; - - } - } - - - ATH_MSG_DEBUG("REGTEST container size = " << tpCont->size()); - return StatusCode::SUCCESS; - } -} // end namespace - - diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnvMT.h b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnvMT.h deleted file mode 100644 index 6d717120db20c5480e1ca48e3b3507e90079ad4e..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnvMT.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -///////////////////////////////////////////////////////////////////////////// -/** -// filename: TrigTrackingxAODCnvMT.h -// -// author: Jiri Masik -// Jiri.Masik@manchester.ac.uk -// -// -// ------------------------------- -// ATLAS Collaboration -*/ -//////////////////////////////////////////////////////////////////////////// - -#ifndef INDETTRIGPARTICLECREATION_TRACKINGXAODCNVMT_H -#define INDETTRIGPARTICLECREATION_TRACKINGXAODCNVMT_H - -#include "AthenaBaseComps/AthReentrantAlgorithm.h" -#include "StoreGate/ReadHandleKey.h" -#include "StoreGate/WriteHandleKey.h" -#include "GaudiKernel/ToolHandle.h" - -#include "TrkToolInterfaces/ITrackParticleCreatorTool.h" -#include "TrkTrack/TrackCollection.h" -#include "xAODTracking/TrackParticleContainer.h" - -#include <string> - -namespace InDet -{ - - class TrigTrackingxAODCnvMT : public AthReentrantAlgorithm - { - public: - TrigTrackingxAODCnvMT(const std::string &name, ISvcLocator *pSvcLocator); - virtual StatusCode initialize() override; - virtual StatusCode execute(const EventContext& ctx) const override; - - private: - ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool; - - SG::ReadHandleKey<TrackCollection> m_trackKey; - SG::WriteHandleKey<xAOD::TrackParticleContainer> m_trackParticleKey; - - }; - -} - -#endif diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/components/InDetTrigParticleCreation_entries.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/components/InDetTrigParticleCreation_entries.cxx deleted file mode 100644 index c6932e062aa9ee6f61688ec051cbc763199b8925..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/components/InDetTrigParticleCreation_entries.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "../TrigTrackingxAODCnvMT.h" - -DECLARE_COMPONENT( InDet::TrigTrackingxAODCnvMT ) diff --git a/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigSequence.py b/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigSequence.py index 11c7ae8d840edd47fb3df7c84f624fee89cd1726..b7556912ee6e3401fdd453bddca40f9d29f39bd5 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigSequence.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigSequence.py @@ -374,8 +374,22 @@ class InDetTrigSequence: TrackContainerName = self.__flags.Tracking.ActiveConfig.trkTracks_FTF, xAODTrackParticlesFromTracksContainerName = self.__flags.Tracking.ActiveConfig.tracks_FTF)) else: - from TrigInDetConfig.TrigInDetConfig import trackFTFConverterCfg - acc.merge(trackFTFConverterCfg(flags, signature)) + + from TrkConfig.TrkParticleCreatorConfig import InDetTrigParticleCreatorToolFTFCfg + creatorTool = acc.popToolsAndMerge(InDetTrigParticleCreatorToolFTFCfg(flags)) + acc.addPublicTool(creatorTool) + + from xAODTrackingCnv.xAODTrackingCnvConfig import TrigTrackParticleCnvAlgCfg + prefix = "InDet" + acc.merge( + TrigTrackParticleCnvAlgCfg( + self.__flags, + name = prefix+'xAODParticleCreatorAlg'+self.__flags.Tracking.ActiveConfig.input_name+'_FTF', + TrackParticleCreator = creatorTool, + TrackContainerName = self.__lastTrkCollection, + xAODTrackParticlesFromTracksContainerName = self.__flags.Tracking.ActiveConfig.tracks_FTF, + ) + ) return acc diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py index 5eadbe56795a8ce064b457334deb06023d5cba1c..6da50de13f443e32625554288210395676a2691a 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py @@ -42,26 +42,6 @@ def InDetIDCCacheCreatorCfg(flags): acc.addEventAlgo( InDetCacheCreatorTrig ) return acc -def _trackConverterCfg(flags, signature, inputTracksKey, outputTrackParticleKey): - acc = ComponentAccumulator() - - from TrkConfig.TrkParticleCreatorConfig import InDetTrigParticleCreatorToolFTFCfg - creatorTool = acc.popToolsAndMerge(InDetTrigParticleCreatorToolFTFCfg(flags)) - acc.addPublicTool(creatorTool) - - trackParticleCnv=CompFactory.InDet.TrigTrackingxAODCnvMT(name = "InDetTrigTrackParticleCreatorAlg" + signature, - TrackName = inputTracksKey, - TrackParticlesName = outputTrackParticleKey, - ParticleCreatorTool = creatorTool) - acc.addEventAlgo(trackParticleCnv, primary=True) - - return acc - -def trackFTFConverterCfg(flags, signature): - return _trackConverterCfg(flags, signature, - flags.Tracking.ActiveConfig.trkTracks_FTF, - flags.Tracking.ActiveConfig.tracks_FTF) - @AccumulatorCache def trigInDetFastTrackingCfg( inflags, roisKey="EMRoIs", signatureName='', in_view=True ):