diff --git a/Control/AthViews/share/SingleViewSequence.py b/Control/AthViews/share/SingleViewSequence.py deleted file mode 100644 index 5d71b49a493959b224c6d57b7a5dae600ab8a969..0000000000000000000000000000000000000000 --- a/Control/AthViews/share/SingleViewSequence.py +++ /dev/null @@ -1,62 +0,0 @@ -# -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# - -############################################################### -# -# Job options file to demonstrate encapsulating algorithms -# within a single view, and retrieving data from that view -# -# Potentially useful for conflicting HLT sequences -# -#============================================================== - -# Configure the scheduler -from AthenaCommon.AlgScheduler import AlgScheduler -AlgScheduler.ShowControlFlow( True ) -AlgScheduler.ShowDataDependencies( True ) - -# Show the contents of StoreGate -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -svcMgr.StoreGateSvc.Dump = True - -# Control flow -from AthenaCommon.AlgSequence import AthSequencer -allViewAlgorithms = AthSequencer( "allViewAlgorithms" ) -allViewAlgorithms.ModeOR = False -allViewAlgorithms.Sequential = False -allViewAlgorithms.StopOverride = False -makeViewSequence = AthSequencer( "makeViewSequence" ) -makeViewSequence.ModeOR = False -makeViewSequence.Sequential = True -makeViewSequence.StopOverride = False - -# Event-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -job = AlgSequence() - -# Make views -makeViewAlg = CfgMgr.AthViews__MinimalViewAlg( "makeViewAlg" ) -makeViewAlg.ViewNodeName = allViewAlgorithms.name() -makeViewAlg.Scheduler = AlgScheduler.getScheduler() -makeViewSequence += makeViewAlg - -# View algorithm -viewTestAlg = CfgMgr.AthViews__ViewTestAlg( "viewTestAlg" ) -viewTestAlg.Output = "TestOutput" -allViewAlgorithms += viewTestAlg - -# Add the view algorithms to the job -makeViewSequence += allViewAlgorithms - -# Retrieve data from the view -viewOutputAlg = CfgMgr.AthViews__AliasOutOfView( "viewOutputAlg" ) -viewOutputAlg.ViewName = allViewAlgorithms.name() -viewOutputAlg.OutputLevel = DEBUG -viewOutputAlg.DataObjects = [ ( "int", "TestOutput" ) ] -makeViewSequence += viewOutputAlg - -job += makeViewSequence - -theApp.EvtMax = 10 - diff --git a/Control/AthViews/src/AliasOutOfView.cxx b/Control/AthViews/src/AliasOutOfView.cxx deleted file mode 100644 index 18eda6e9fadc79d2534809a8a2e25dbeec5699fb..0000000000000000000000000000000000000000 --- a/Control/AthViews/src/AliasOutOfView.cxx +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -// AliasOutOfView.cxx -// Implementation file for class AliasOutOfView -// Author: B. Wynne <bwynne@cern.ch> -/////////////////////////////////////////////////////////////////// - -#include "AliasOutOfView.h" -#include "AthenaKernel/ExtendedEventContext.h" -#include "AthViews/View.h" - -namespace AthViews { - -AliasOutOfView::AliasOutOfView( const std::string& name, ISvcLocator* pSvcLocator ) : - AthAlgorithm( name, pSvcLocator ) -{ -} - -AliasOutOfView::~AliasOutOfView() -{ -} - -StatusCode AliasOutOfView::initialize() -{ - for ( auto& obj : m_dataObjects.value() ) { - - // Check for misconfiguration - if ( obj.key() == "" ) { - ATH_MSG_ERROR( "Empty key " << obj << " not permitted" ); - return StatusCode::FAILURE; - } - - ATH_MSG_DEBUG( "Will alias " << m_viewName.value() << "_" << obj.key() << " to " << obj.key() ); - } - - // Inform the scheduler that these containers will be available - if ( !setProperty( "ExtraOutputs", m_dataObjects.toString() ).isSuccess() ) { - - ATH_MSG_ERROR( "Failed setting property ExtraOutputs" ); - return StatusCode::FAILURE; - } - - return StatusCode::SUCCESS; -} - -StatusCode AliasOutOfView::execute() -{ - // Retrieve the current view from the EventContext - auto viewProxy = Atlas::getExtendedEventContext( getContext() ).proxy(); - - ATH_MSG_DEBUG( "Executing " << name() << " with store " << viewProxy->name() ); - - // Test each container - for ( auto& obj : m_dataObjects.value() ) { - - // Create a VarHandleKey for the object inside the view - SG::VarHandleKey vhk( obj.clid(), m_viewName + "_" + obj.key(), Gaudi::DataHandle::Reader ); - - // Create a test proxy - SG::DataProxy* dp = viewProxy->proxy( obj.clid(), vhk.key() ); - - // Test if the proxy is valid - if ( dp ) { - ATH_MSG_DEBUG( "Found " << vhk.key() << " in " << viewProxy->name() ); - CHECK( evtStore()->setAlias( dp, obj.key() ) ); - } else { - ATH_MSG_ERROR( "Did not find " << vhk.key() << " in " << viewProxy->name() ); - return StatusCode::FAILURE; - } - } - - return StatusCode::SUCCESS; -} - -} //> end namespace AthViews diff --git a/Control/AthViews/src/AliasOutOfView.h b/Control/AthViews/src/AliasOutOfView.h deleted file mode 100644 index 120976537ef5651215e327296231fd97e18bc870..0000000000000000000000000000000000000000 --- a/Control/AthViews/src/AliasOutOfView.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -// AliasOutOfView.h -// Header file for class AliasOutOfView -// Author: B. Wynne <bwynne@cern.ch> -/////////////////////////////////////////////////////////////////// - -#ifndef ATHVIEWS_COPYOUTOFVIEW_H -#define ATHVIEWS_COPYOUTOFVIEW_H 1 - -#include <string> -#include "AthenaBaseComps/AthAlgorithm.h" -#include "GaudiKernel/DataObjID.h" - -namespace AthViews { - -class AliasOutOfView : public AthAlgorithm -{ - public: - // Constructor with parameters - AliasOutOfView( const std::string& name, ISvcLocator* pSvcLocator ); - - // Destructor - virtual ~AliasOutOfView(); - - // Athena algorithm hooks - virtual StatusCode initialize() override; - virtual StatusCode execute() override; - - private: - - // Default constructor - AliasOutOfView(); - - // Configurable properties - Gaudi::Property< std::string > m_viewName{ this, "ViewName", "", "Name of view containing objects" }; - Gaudi::Property< DataObjIDColl > m_dataObjects{ this, "DataObjects", DataObjIDColl(), "Objects to alias out of this view" }; -}; - -} //> end namespace AthViews - -#endif //> !ATHVIEWS_ALIASOUTOFVIEW_H diff --git a/Control/AthViews/src/MinimalViewAlg.cxx b/Control/AthViews/src/MinimalViewAlg.cxx deleted file mode 100644 index 144a571f735fdcfcf2dfb6775c6d3413aa4b580b..0000000000000000000000000000000000000000 --- a/Control/AthViews/src/MinimalViewAlg.cxx +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MinimalViewAlg.h" -#include "AthViews/ViewHelper.h" -#include "StoreGate/WriteHandle.h" - -namespace AthViews { - -// Constructor -MinimalViewAlg::MinimalViewAlg( const std::string& name, ISvcLocator* pSvcLocator ) : AthAlgorithm( name, pSvcLocator ) -{ -} - -// Destructor -MinimalViewAlg::~MinimalViewAlg() -{ -} - -// Athena Algorithm hooks -StatusCode MinimalViewAlg::initialize() -{ - ATH_MSG_DEBUG( "Initializing " << name() << "..." ); - - CHECK( m_scheduler.retrieve() ); - - return StatusCode::SUCCESS; -} - -StatusCode MinimalViewAlg::finalize() -{ - ATH_MSG_DEBUG( "Finalizing " << name() << "..." ); - - return StatusCode::SUCCESS; -} - -StatusCode MinimalViewAlg::execute() -{ - ATH_MSG_DEBUG( "Executing " << name() << "..." ); - - // Create the view - auto theView = ViewHelper::makeView( m_viewNodeName, -1, true ); - - // Schedule the algorithms in the view - const EventContext& ctx = getContext(); - return ViewHelper::scheduleSingleView( theView, - m_viewNodeName, //Name of node to attach views to - ctx, //Context to attach the views to - Atlas::getExtendedEventContext( ctx ).conditionsRun(), - m_scheduler.get() ); //ServiceHandle for the scheduler -} - -} //> end namespace AthViews diff --git a/Control/AthViews/src/MinimalViewAlg.h b/Control/AthViews/src/MinimalViewAlg.h deleted file mode 100644 index 1acf50d1abee66f21711ba6c374d16c20d48766e..0000000000000000000000000000000000000000 --- a/Control/AthViews/src/MinimalViewAlg.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ATHVIEWS_ATHVIEWS_MINIMALVIEWALG_H -#define ATHVIEWS_ATHVIEWS_MINIMALVIEWALG_H 1 - -#include <string> -#include "AthenaBaseComps/AthAlgorithm.h" -#include "AthViews/View.h" -#include "GaudiKernel/IScheduler.h" - -namespace AthViews { - -class MinimalViewAlg : public AthAlgorithm -{ - public: - - // Constructor with parameters - MinimalViewAlg( const std::string& name, ISvcLocator* pSvcLocator ); - - // Destructor - virtual ~MinimalViewAlg(); - - // Athena algorithm hooks - virtual StatusCode initialize(); - virtual StatusCode execute(); - virtual StatusCode finalize(); - - private: - - // Default constructor - MinimalViewAlg(); - - // Configurables - ServiceHandle< IScheduler > m_scheduler{ this, "Scheduler", "AvalancheSchedulerSvc", "The Athena scheduler" }; - Gaudi::Property< std::string > m_viewNodeName{ this, "ViewNodeName", "", "Name of CF node to attach views to" }; -}; - -} //> end namespace AthViews - -#endif //> !ATHVIEWS_ATHVIEWS_MINIMALVIEWALG_H diff --git a/Control/AthViews/src/RoiCollectionToViews.cxx b/Control/AthViews/src/RoiCollectionToViews.cxx deleted file mode 100644 index a2e33ce3767302770899a3a27335fa33ea4fad00..0000000000000000000000000000000000000000 --- a/Control/AthViews/src/RoiCollectionToViews.cxx +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "RoiCollectionToViews.h" -#include "AthViews/ViewHelper.h" -#include "AthContainers/ConstDataVector.h" - -namespace AthViews { - -RoiCollectionToViews::RoiCollectionToViews( const std::string& name, ISvcLocator* pSvcLocator ) : - AthAlgorithm( name, pSvcLocator ) -{ -} - -RoiCollectionToViews::~RoiCollectionToViews() -{ -} - -StatusCode RoiCollectionToViews::initialize() -{ - ATH_MSG_DEBUG ("Initializing " << name() << "..."); - - CHECK( m_trigRoIs.initialize() ); - CHECK( m_viewRoIs.initialize() ); - CHECK( m_w_views.initialize() ); - - return StatusCode::SUCCESS; -} - -StatusCode RoiCollectionToViews::execute() -{ - ATH_MSG_DEBUG ("Executing " << name() << "..."); - - const EventContext& ctx = getContext(); - - //Load the collection of RoI descriptors - SG::ReadHandle< TrigRoiDescriptorCollection > inputRoIs( m_trigRoIs, ctx ); - ATH_CHECK( inputRoIs.isValid() ); - - std::vector< ConstDataVector< TrigRoiDescriptorCollection> > outputRoICollectionVector; - for ( auto roi: *inputRoIs ) - { - ATH_MSG_DEBUG( "RoI Eta: " << roi->eta() << " Phi: " << roi->phi() << " RoIWord: " << roi->roiWord() ); - - ConstDataVector<TrigRoiDescriptorCollection> oneRoIColl (SG::VIEW_ELEMENTS); - oneRoIColl.push_back( roi ); - outputRoICollectionVector.push_back( std::move(oneRoIColl) ); - } - - //Create the views and populate them - auto viewVector = std::make_unique<ViewContainer>(); - CHECK( ViewHelper::makeAndPopulate( m_viewBaseName, //Base name for all views to use - viewVector.get(), //Vector to store views - m_viewRoIs, //A writehandlekey to use to access the views - ctx, //The context of this algorithm - outputRoICollectionVector, //Data to initialise each view - one view will be made per entry - m_viewFallThrough ) ); //Allow fall through from view to storegate - - //Run the algorithms in views - CHECK( ViewHelper::scheduleViews( viewVector.get(), //View vector - m_viewNodeName, //CF node to attach views to - ctx, //Context to attach the views to - svcLoc()->service<IScheduler>(m_schedulerName,false) ) ); //Scheduler - - //Store the collection of views - SG::WriteHandle< ViewContainer > outputViewHandle( m_w_views, ctx ); - CHECK( outputViewHandle.record( std::move( viewVector ) ) ); - - return StatusCode::SUCCESS; -} - -} //> end namespace AthViews diff --git a/Control/AthViews/src/RoiCollectionToViews.h b/Control/AthViews/src/RoiCollectionToViews.h deleted file mode 100644 index 23ea0a03aeefa4b23169eedf994360bd085ff717..0000000000000000000000000000000000000000 --- a/Control/AthViews/src/RoiCollectionToViews.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ATHVIEWS_ATHVIEWS_ROICOLLECTIONTOVIEWS_H -#define ATHVIEWS_ATHVIEWS_ROICOLLECTIONTOVIEWS_H - -// STL includes -#include <string> -#include <vector> - -// FrameWork includes -#include "AthenaBaseComps/AthAlgorithm.h" -#include "AthViews/View.h" -#include "StoreGate/WriteHandleKey.h" -#include "StoreGate/ReadHandleKey.h" -#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" -#include "AthContainers/ConstDataVector.h" -#include "GaudiKernel/IScheduler.h" - -namespace AthViews { - -class RoiCollectionToViews - : public ::AthAlgorithm -{ - - /////////////////////////////////////////////////////////////////// - // Public methods: - /////////////////////////////////////////////////////////////////// - public: - - // Copy constructor: - - /// Constructor with parameters: - RoiCollectionToViews( const std::string& name, ISvcLocator* pSvcLocator ); - - /// Destructor: - virtual ~RoiCollectionToViews(); - - // Athena algorithm's Hooks - virtual StatusCode initialize() override; - virtual StatusCode execute() override; - - private: - - /// Default constructor: - RoiCollectionToViews(); - - /// Containers - - // vars - SG::ReadHandleKey< TrigRoiDescriptorCollection > m_trigRoIs { this, "InputRoICollection", "input_rois", "Collection of RoIs to split into views" }; - SG::WriteHandleKey< ViewContainer > m_w_views { this, "AllViews", "all_views", "Output view collection" }; - SG::WriteHandleKey< ConstDataVector<TrigRoiDescriptorCollection> > m_viewRoIs { this, "OutputRoICollection", "output_rois", "RoI collection to use inside views" }; - Gaudi::Property< std::string > m_schedulerName { this, "SchedulerName", "AvalancheSchedulerSvc", "Name of the scheduler" }; - Gaudi::Property< std::string > m_viewBaseName { this, "ViewBaseName", "", "Name to use for all views - number will be appended" }; - Gaudi::Property< std::string > m_viewNodeName { this, "ViewNodeName", "", "Name of the CF node to attach views to" }; - Gaudi::Property< bool > m_viewFallThrough { this, "ViewFallThrough", true, "Set whether views may access StoreGate directly to retrieve data" }; - -}; - -} //> end namespace AthViews - -#endif //> !ATHVIEWS_ATHVIEWS_ROICOLLECTIONTOVIEWS_H diff --git a/Control/AthViews/src/components/AthViews_entries.cxx b/Control/AthViews/src/components/AthViews_entries.cxx index 5b969bdf9d2994ad77c33afad003434e471eec4e..9dc52be92e668c6db2e80fba1d45c92176786494 100644 --- a/Control/AthViews/src/components/AthViews_entries.cxx +++ b/Control/AthViews/src/components/AthViews_entries.cxx @@ -1,12 +1,6 @@ #include "../ViewDataVerifier.h" #include "../ViewTestAlg.h" -#include "../MinimalViewAlg.h" -#include "../AliasOutOfView.h" -#include "../RoiCollectionToViews.h" DECLARE_COMPONENT( AthViews::ViewDataVerifier ) DECLARE_COMPONENT( AthViews::ViewTestAlg ) -DECLARE_COMPONENT( AthViews::MinimalViewAlg ) -DECLARE_COMPONENT( AthViews::AliasOutOfView ) -DECLARE_COMPONENT( AthViews::RoiCollectionToViews ) diff --git a/Control/AthViews/test/test_single_view_sequence.sh b/Control/AthViews/test/test_single_view_sequence.sh deleted file mode 100755 index c5366d37bc72ec5d675340849257b5419892d409..0000000000000000000000000000000000000000 --- a/Control/AthViews/test/test_single_view_sequence.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# art-type: build -# art-include: master/Athena -# art-ci: master - -athena.py --threads=1 AthViews/SingleViewSequence.py diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/IDCalo.py b/Trigger/TrigValidation/TrigUpgradeTest/share/IDCalo.py index 96d2da063893b11051d696d81c8c559501423138..55540059ec5ab585a325a341882af25f263534bd 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/IDCalo.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/IDCalo.py @@ -16,19 +16,24 @@ from AthenaCommon.AlgSequence import AthSequencer viewSeq = AthSequencer("AthViewSeq", Sequential=True, ModeOR=False, StopOverride=False) topSequence += viewSeq -from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection +from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection, mapThresholdToL1DecisionCollection roiCollectionName = mapThresholdToL1RoICollection("EM") # View maker alg -from AthenaCommon import CfgMgr viewNodeName = "allViewAlgorithms" -viewMaker = CfgMgr.AthViews__RoiCollectionToViews("viewMaker") -viewMaker.ViewBaseName = "testView" -viewMaker.InputRoICollection = roiCollectionName -viewMaker.ViewNodeName = viewNodeName -viewMaker.OutputRoICollection = "EMViewRoIs" -viewMaker.ViewFallThrough = True -viewSeq += viewMaker +from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm +from DecisionHandling.DecisionHandlingConf import ViewCreatorInitialROITool + +inputMakerAlg = EventViewCreatorAlgorithm("viewMaker") +inputMakerAlg.ViewFallThrough = True +inputMakerAlg.RoIsLink = roiCollectionName +inputMakerAlg.InViewRoIs = "EMViewRoIs" +inputMakerAlg.Views = "testView" +inputMakerAlg.RoITool = ViewCreatorInitialROITool() +inputMakerAlg.InputMakerInputDecisions = [ mapThresholdToL1DecisionCollection("EM") ] +inputMakerAlg.ViewNodeName = viewNodeName +inputMakerAlg.InputMakerOutputDecisions = 'DUMMYOUTDEC' +viewSeq += inputMakerAlg # Set of view algs allViewAlgorithms = AthSequencer(viewNodeName, Sequential=False, ModeOR=False, StopOverride=False)