diff --git a/Control/AthViews/src/SimpleView.cxx b/Control/AthViews/src/SimpleView.cxx index 6362c1161f36288102b25f732478cb7d14e2e79e..dcc855168bde4c55d0b8b5c1f68c2b433e6a6996 100644 --- a/Control/AthViews/src/SimpleView.cxx +++ b/Control/AthViews/src/SimpleView.cxx @@ -33,7 +33,7 @@ SimpleView::~SimpleView() */ SG::DataProxy * SimpleView::proxy_exact( SG::sgkey_t sgkey ) const { - cout << "BEN SimpleView::proxy_exact" << endl; + cout << "Not implemented: SimpleView::proxy_exact" << endl; //TODO - view rename return m_store->proxy_exact( sgkey ); } @@ -67,7 +67,7 @@ SG::DataProxy * SimpleView::proxy( const CLID& id, const std::string& key ) cons */ SG::DataProxy * SimpleView::proxy( const void* const pTransient ) const { - cout << "BEN SimpleView::proxy" << endl; + cout << "Not implemented: SimpleView::proxy" << endl; //TODO - view rename return m_store->proxy( pTransient ); } @@ -94,9 +94,7 @@ std::vector< const SG::DataProxy* > SimpleView::proxies() const */ StatusCode SimpleView::addToStore( CLID id, SG::DataProxy * proxy ) { - //TODO - view rename const std::string viewKey = m_name + "_" + proxy->name(); - m_store->addedNewTransObject( id, viewKey ); return m_store->addToStore( id, proxy ); } @@ -113,9 +111,8 @@ StatusCode SimpleView::addToStore( CLID id, SG::DataProxy * proxy ) */ bool SimpleView::tryELRemap( sgkey_t sgkey_in, size_t index_in, sgkey_t & sgkey_out, size_t & index_out ) { - cout << "BEN SimpleView::tryELRemap" << endl; - //TODO - view rename - return m_store->tryELRemap( sgkey_in, index_in, sgkey_out, index_out ); + cout << "Not implemented: SimpleView::tryELRemap" << endl; + return m_store->tryELRemap( sgkey_in, index_in, sgkey_out, index_out ); //TODO } /** @@ -129,13 +126,9 @@ bool SimpleView::tryELRemap( sgkey_t sgkey_in, size_t index_in, sgkey_t & sgkey_ * * Returns the proxy for the recorded object; nullptr on failure. */ -/// TEMPORARY: This method is being added. It eventually should be pure. -//SG::DataProxy * SimpleView::recordObject( std::unique_ptr< DataObject > obj, const std::string& key, bool allowMods ) SG::DataProxy * SimpleView::recordObject( SG::DataObjectSharedPtr<DataObject> obj, const std::string& key, bool allowMods, bool returnExisting ) { const std::string viewKey = m_name + "_" + key; - m_store->addedNewTransObject( obj->clID(), key ); //TODO remove this hack - //return m_store->recordObject( std::move( obj ), viewKey, allowMods ); return m_store->recordObject( obj, viewKey, allowMods, returnExisting ); } @@ -144,7 +137,6 @@ SG::DataProxy * SimpleView::recordObject( SG::DataObjectSharedPtr<DataObject> ob * @param id The CLID of the object. * @param key The key of the object. */ -/// TEMPORARY: This method is being added. It eventually should be pure. StatusCode SimpleView::updatedObject( CLID id, const std::string& key ) { const std::string viewKey = m_name + "_" + key; @@ -173,18 +165,18 @@ void SimpleView::unboundHandle( IResetable * handle ) unsigned long SimpleView::addRef() { - cout << "BEN SimpleView::addRef" << endl; - return 0; //FIX + cout << "Not implemented: SimpleView::addRef" << endl; + return 0; //TODO } unsigned long SimpleView::release() { - cout << "BEN SimpleView::release" << endl; - return 0; //FIX + cout << "Not implemented: SimpleView::release" << endl; + return 0; //TODO } StatusCode SimpleView::queryInterface( const InterfaceID &/*ti*/, void** /*pp*/ ) { - cout << "BEN SimpleView::queryInterface" << endl; - return StatusCode::FAILURE; //FIX + cout << "Not implemented: SimpleView::queryInterface" << endl; + return StatusCode::FAILURE; //TODO } const std::string& SimpleView::name() const { @@ -199,13 +191,13 @@ IStringPool::sgkey_t SimpleView::stringToKey( const std::string& str, CLID clid } const std::string* SimpleView::keyToString( IStringPool::sgkey_t key ) const { - cout << "BEN SimpleView::keyToString" << endl; + cout << "Not implemented: SimpleView::keyToString" << endl; //TODO - view rename maybe? return m_store->keyToString( key ); } const std::string* SimpleView::keyToString( IStringPool::sgkey_t key, CLID& clid ) const { - cout << "BEN SimpleView::keyToString" << endl; + cout << "Not implemented: SimpleView::keyToString" << endl; //TODO - view rename maybe? return m_store->keyToString( key, clid ); } diff --git a/Control/AthViews/src_dflow/RoiCollectionToViews.cxx b/Control/AthViews/src_dflow/RoiCollectionToViews.cxx index cb37367d3ebc3b4def93567db069aa3c7b66410b..d5377bfc2056f92f87328ee65bf40c46ab6bfd4d 100644 --- a/Control/AthViews/src_dflow/RoiCollectionToViews.cxx +++ b/Control/AthViews/src_dflow/RoiCollectionToViews.cxx @@ -93,13 +93,12 @@ StatusCode RoiCollectionToViews::execute() std::vector< TrigRoiDescriptorCollection > outputRoICollectionVector; for ( auto roi: *inputRoIs ) { - ATH_MSG_INFO( "BEN BEN RoI Eta: " << roi->eta() << " Phi: " << roi->phi() << " RoIWord: " << roi->roiWord() ); + ATH_MSG_DEBUG( "RoI Eta: " << roi->eta() << " Phi: " << roi->phi() << " RoIWord: " << roi->roiWord() ); auto oneRoIColl = std::make_unique< TrigRoiDescriptorCollection >(); oneRoIColl->clear( SG::VIEW_ELEMENTS ); //Don't delete the RoIs oneRoIColl->push_back( roi ); outputRoICollectionVector.push_back( *oneRoIColl ); - break; } //Create the views and populate them diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h index d71da8e36c5ec2a36a3c2bbc868aaca68a30329e..f14e2cacb8d5d2231a0fbbc82b83863d0f165a04 100755 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h @@ -127,6 +127,8 @@ namespace InDet { // std::string m_spacePointsOverlapName; SG::ReadHandle<SCT_ClusterContainer> m_Sct_clcontainer; SG::ReadHandle<PixelClusterContainer> m_Pixel_clcontainer; + SG::ReadHandleKey<SCT_ClusterContainer> m_Sct_clcontainerKey; + SG::ReadHandleKey<PixelClusterContainer> m_Pixel_clcontainerKey; bool m_selectPixels; bool m_selectSCTs; bool m_overlap; // process all overlapping SCT pairs if true. @@ -158,9 +160,12 @@ namespace InDet { const PixelID* m_idHelperPixel; SiElementPropertiesTable* m_properties; - SG::WriteHandle<SpacePointContainer> m_SpacePointContainer_SCT; - SG::WriteHandle<SpacePointContainer> m_SpacePointContainerPixel; - SG::WriteHandle<SpacePointOverlapCollection> m_spacepointoverlapCollection; + SG::WriteHandle<SpacePointContainer> m_SpacePointContainer_SCT; + SG::WriteHandle<SpacePointContainer> m_SpacePointContainerPixel; + SG::WriteHandle<SpacePointOverlapCollection> m_spacepointoverlapCollection; + SG::WriteHandleKey<SpacePointContainer> m_SpacePointContainer_SCTKey; + SG::WriteHandleKey<SpacePointContainer> m_SpacePointContainerPixelKey; + SG::WriteHandleKey<SpacePointOverlapCollection> m_spacepointoverlapCollectionKey; ToolHandle< SiSpacePointMakerTool > m_SiSpacePointMakerTool; }; diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx index d6c502ea8c3b033793f7b962601de41333cfec3e..bcccc6897366fa5b99df2b29ca1bde4c78eb4424 100755 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx @@ -48,8 +48,8 @@ SiTrackerSpacePointFinder::SiTrackerSpacePointFinder(const std::string& name, // m_spacePointsSCTName ("SCT_SpacePoints"), // m_spacePointsPixelName ("PixelSpacePoints"), // m_spacePointsOverlapName("OverlapSpacePoints"), - m_Sct_clcontainer("SCT_Clusters"), - m_Pixel_clcontainer("PixelClusters"), + m_Sct_clcontainerKey("SCT_Clusters"), + m_Pixel_clcontainerKey("PixelClusters"), m_selectPixels (true), m_selectSCTs( true), m_overlap (true), // process overlaps of SCT wafers. @@ -70,20 +70,20 @@ SiTrackerSpacePointFinder::SiTrackerSpacePointFinder(const std::string& name, m_idHelper (nullptr), m_idHelperPixel (nullptr), m_properties (nullptr), - m_SpacePointContainer_SCT ("SCT_SpacePoints"), - m_SpacePointContainerPixel ("PixelSpacePoints"), - m_spacepointoverlapCollection ("OverlapSpacePoints"), + m_SpacePointContainer_SCTKey ("SCT_SpacePoints"), + m_SpacePointContainerPixelKey ("PixelSpacePoints"), + m_spacepointoverlapCollectionKey ("OverlapSpacePoints"), m_SiSpacePointMakerTool ("InDet::SiSpacePointMakerTool", this) { //Use the same space point name both for internal use (for graphics) end // for storing in TDS. If a name is the empty string, do not retrieve // those clusters. - declareProperty("SCT_ClustersName", m_Sct_clcontainer, "SCT clContainer" ) ; - declareProperty("PixelsClustersName", m_Pixel_clcontainer, "Pixel clContainer"); + declareProperty("SCT_ClustersName", m_Sct_clcontainerKey, "SCT clContainer" ); + declareProperty("PixelsClustersName", m_Pixel_clcontainerKey, "Pixel clContainer"); - declareProperty("SpacePointsSCTName", m_SpacePointContainer_SCT, "SpacePoint SCT container"); - declareProperty("SpacePointsPixelName", m_SpacePointContainerPixel, "SpacePoint Pixel container"); - declareProperty("SpacePointsOverlapName", m_spacepointoverlapCollection, "Space Point Overlap collection" ); + declareProperty("SpacePointsSCTName", m_SpacePointContainer_SCTKey, "SpacePoint SCT container"); + declareProperty("SpacePointsPixelName", m_SpacePointContainerPixelKey, "SpacePoint Pixel container"); + declareProperty("SpacePointsOverlapName", m_spacepointoverlapCollectionKey, "Space Point Overlap collection" ); declareProperty("SiSpacePointMakerTool", m_SiSpacePointMakerTool); @@ -112,29 +112,40 @@ StatusCode SiTrackerSpacePointFinder::initialize() ATH_MSG_DEBUG( "SiTrackerSpacePointFinder::initialize()" ); // Check that clusters, space points and ids have names - - if (m_selectSCTs && m_Sct_clcontainer.name().empty()){ - ATH_MSG_FATAL( "SCTs selected and no name set for SCT clusters"); - return StatusCode::FAILURE; + if (m_selectSCTs && m_Sct_clcontainerKey.key().empty()){ + ATH_MSG_FATAL( "SCTs selected and no name set for SCT clusters"); + return StatusCode::FAILURE; } - - if (m_SpacePointContainer_SCT.name().empty()){ - ATH_MSG_FATAL( "No name set for SCT space points"); - return StatusCode::FAILURE; + ATH_CHECK( m_Sct_clcontainerKey.initialize() ); + + if (m_selectPixels && m_Pixel_clcontainerKey.key().empty()){ + ATH_MSG_FATAL( "Pixels selected and no name set for Pixel clusters"); + return StatusCode::FAILURE; } - if (m_SpacePointContainerPixel.name().empty()){ - ATH_MSG_FATAL( "No name set for Pixels space points"); - return StatusCode::FAILURE; + ATH_CHECK( m_Pixel_clcontainerKey.initialize() ); + + if (m_SpacePointContainer_SCTKey.key().empty()){ + ATH_MSG_FATAL( "No name set for SCT space points"); + return StatusCode::FAILURE; } - if (m_spacepointoverlapCollection.name().empty()){ - ATH_MSG_FATAL( "No name set for overlap space points"); - return StatusCode::FAILURE; + ATH_CHECK( m_SpacePointContainer_SCTKey.initialize() ); + + if (m_SpacePointContainerPixelKey.key().empty()){ + ATH_MSG_FATAL( "No name set for Pixels space points"); + return StatusCode::FAILURE; } + ATH_CHECK( m_SpacePointContainerPixelKey.initialize() ); + + if (m_spacepointoverlapCollectionKey.key().empty()){ + ATH_MSG_FATAL( "No name set for overlap space points"); + return StatusCode::FAILURE; + } + ATH_CHECK( m_spacepointoverlapCollectionKey.initialize() ); // create containers (requires the Identifier Helpers) if (m_selectPixels){ - ATH_CHECK(detStore()->retrieve(m_idHelperPixel,"PixelID")); -// m_SpacePointContainerPixel = new SpacePointContainer(m_idHelperPixel->wafer_hash_max()); + ATH_CHECK(detStore()->retrieve(m_idHelperPixel,"PixelID")); + // m_SpacePointContainerPixel = new SpacePointContainer(m_idHelperPixel->wafer_hash_max()); } @@ -168,6 +179,12 @@ StatusCode SiTrackerSpacePointFinder::initialize() StatusCode SiTrackerSpacePointFinder::execute() { +#ifdef GAUDI_SYSEXECUTE_WITHCONTEXT + const EventContext& ctx = getContext(); +#else + const EventContext& ctx = *getContext(); +#endif + /* if (msgLvl(MSG::DEBUG)){ ATH_MSG_DEBUG( "SiTrackerSpacePointFinder::execute()" ); @@ -198,6 +215,7 @@ StatusCode SiTrackerSpacePointFinder::execute() // << "' could not be recorded in StoreGate !" ); // return StatusCode::RECOVERABLE; // } + m_SpacePointContainerPixel = SG::WriteHandle<SpacePointContainer>( m_SpacePointContainerPixelKey, ctx ); m_SpacePointContainerPixel = CxxUtils::make_unique<SpacePointContainer>(m_idHelperPixel->wafer_hash_max()); if (! m_SpacePointContainerPixel.isValid() ){ msg(MSG:: FATAL) << "SpacePointContainer " << m_SpacePointContainerPixel.name() << "could not be initialised !"<< endmsg; @@ -210,6 +228,7 @@ StatusCode SiTrackerSpacePointFinder::execute() } if (m_selectSCTs){ + m_SpacePointContainer_SCT = SG::WriteHandle<SpacePointContainer>( m_SpacePointContainer_SCTKey, ctx ); m_SpacePointContainer_SCT = CxxUtils::make_unique<SpacePointContainer>(m_idHelper->wafer_hash_max()); if (! m_SpacePointContainer_SCT.isValid() ){ msg(MSG:: FATAL) << "SpacePointContainer " << m_SpacePointContainer_SCT.name() << "could not be initialised !"<< endmsg; @@ -225,6 +244,7 @@ StatusCode SiTrackerSpacePointFinder::execute() // Note there may not be any, but there could still be pixel clusters. // m_spacepointoverlapCollection = new SpacePointOverlapCollection(); + m_spacepointoverlapCollection = SG::WriteHandle<SpacePointOverlapCollection>( m_spacepointoverlapCollectionKey, ctx ); m_spacepointoverlapCollection = CxxUtils::make_unique<SpacePointOverlapCollection>(); if (! m_spacepointoverlapCollection.isValid() ){ msg(MSG:: FATAL) << "SpacePointOverlapCollection " << m_spacepointoverlapCollection.name() << "could not be initialised !"<< endmsg; @@ -235,7 +255,9 @@ StatusCode SiTrackerSpacePointFinder::execute() ATH_MSG_DEBUG( "Container '" << m_spacepointoverlapCollection.name() << "' initialised" ); if (m_selectSCTs){ + // retrieve SCT cluster container + m_Sct_clcontainer = SG::ReadHandle<SCT_ClusterContainer>( m_Sct_clcontainerKey, ctx ); if (!m_Sct_clcontainer.isValid()){ msg(MSG:: FATAL) << "Could not find the data object "<< m_Sct_clcontainer.name() << " !" << endmsg; return StatusCode::RECOVERABLE; @@ -291,6 +313,7 @@ StatusCode SiTrackerSpacePointFinder::execute() // } // ATH_MSG_DEBUG( "Pixel Cluster container found: " << m_Pixel_clcontainer->size() << " collections" ); + m_Pixel_clcontainer = SG::ReadHandle<PixelClusterContainer>( m_Pixel_clcontainerKey, ctx ); if (!m_Pixel_clcontainer.isValid()){ msg(MSG:: FATAL) << "Could not find the data object "<< m_Pixel_clcontainer.name() << " !" << endmsg; return StatusCode::RECOVERABLE; @@ -489,7 +512,7 @@ checkForSCT_Points(const SCT_ClusterCollection* clusters1, // Get the cluster collections for these two detectors. // Require that (xPhi2 - xPhi1) lie in the range specified. // Used for opposite and eta modules - + SCT_ClusterContainer::const_iterator it(m_Sct_clcontainer->indexFind(id2)); if (it==m_Sct_clcontainer->end()) return; diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/ID_RawDataMT_Trigger.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/ID_RawDataMT_Trigger.withViews.py index 3865771fdb837e02cb1185338cb783e9980ce04a..6deec392f07aba17a9f3065a5dc2389ce9bafeb5 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/ID_RawDataMT_Trigger.withViews.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/ID_RawDataMT_Trigger.withViews.py @@ -139,7 +139,7 @@ from InDetRecExample.InDetKeys import InDetKeys include ("InDetRecExample/InDetRecCabling.py") -#BEN +### Begin view setup # Make a separate alg pool for the view algs from GaudiHive.GaudiHiveConf import AlgResourcePool @@ -159,7 +159,6 @@ viewMaker.ViewBaseName = "testView" viewMaker.AlgPoolName = viewAlgPoolName viewMaker.InputRoICollection = "OutputRoIs" viewMaker.OutputRoICollection = "ViewRoIs" -viewMaker.AlgorithmNameSequence = [ "viewTest" ] #Eventually scheduler will do this topSequence += viewMaker # Filter to stop view algs from running on whole event @@ -169,11 +168,14 @@ allViewAlgorithms.alwaysFail.PercentPass = 0.0 # dummy alg that just says you're running in a view allViewAlgorithms += CfgMgr.AthViews__ViewTestAlg( "viewTest" ) svcMgr.ViewAlgPool.TopAlg += [ "viewTest" ] +viewMaker.AlgorithmNameSequence = [ "viewTest" ] #Eventually scheduler will do this - +# test setup viewTest = True +topSequence += allViewAlgorithms +theApp.EvtMax = 10 -#end BEN +### End view setup #Pixel @@ -358,7 +360,6 @@ if ( viewTest ): allViewAlgorithms += InDetSCT_Clusterization allViewAlgorithms.InDetSCT_Clusterization.isRoI_Seeded = True allViewAlgorithms.InDetSCT_Clusterization.RoIs = "ViewRoIs" - allViewAlgorithms.InDetSCT_Clusterization.OutputLevel = VERBOSE svcMgr.ViewAlgPool.TopAlg += [ "InDetSCT_Clusterization" ] topSequence.viewMaker.AlgorithmNameSequence += [ "InDetSCT_Clusterization" ] else: @@ -388,18 +389,14 @@ InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_eGamma theFTF = TrigFastTrackFinder_eGamma() -theFTF.outputLevel=VERBOSE if ( viewTest ): allViewAlgorithms += InDetSiTrackerSpacePointFinder allViewAlgorithms += theFTF + allViewAlgorithms.TrigFastTrackFinder_eGamma.isRoI_Seeded = True + allViewAlgorithms.TrigFastTrackFinder_eGamma.RoIs = "ViewRoIs" svcMgr.ViewAlgPool.TopAlg += [ "InDetSiTrackerSpacePointFinder", "TrigFastTrackFinder_eGamma" ] topSequence.viewMaker.AlgorithmNameSequence += [ "InDetSiTrackerSpacePointFinder", "TrigFastTrackFinder_eGamma" ] - svcMgr.StoreGateSvc.Dump = True else: topSequence += InDetSiTrackerSpacePointFinder topSequence += theFTF - -#BEN -topSequence += allViewAlgorithms -theApp.EvtMax = 10