diff --git a/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.cxx index 1b49500cd6046b8d30c7f06d0489dfef19e22426..5ea15e158eb32b025764051420109a3e78716860 100644 --- a/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.cxx +++ b/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.cxx @@ -19,13 +19,11 @@ EventViewCreatorAlgorithm::EventViewCreatorAlgorithm( const std::string& name, I m_inputKey( "InputCollection" ), m_inputAuxKey( "InputCollectionAux" ), m_outputKey( "OutputCollection" ), - m_outputAuxKey( "OutputCollectionAux" ), m_viewAlgorithmPool( "ViewAlgPool" ) { //VarHandleKeys declareProperty( "OutputViewCollection", m_viewsKey, "Name of output event view collection" ); declareProperty( "WithinViewCollection", m_outputKey, "Name of the collection to make inside views" ); - declareProperty( "WithinViewAuxCollection", m_outputAuxKey, "Name of the aux collection to make inside views" ); declareProperty( "InputCollection", m_inputKey, "Name of the collection to split into views" ); declareProperty( "InputAuxCollection", m_inputAuxKey, "Name of the aux collection to split into views" ); @@ -39,7 +37,6 @@ StatusCode EventViewCreatorAlgorithm::initialize() //Initialize VarHandleKeys CHECK( m_viewsKey.initialize() ); CHECK( m_outputKey.initialize() ); - CHECK( m_outputAuxKey.initialize() ); CHECK( m_inputKey.initialize() ); CHECK( m_inputAuxKey.initialize() ); @@ -66,32 +63,22 @@ StatusCode EventViewCreatorAlgorithm::execute() //Split into views std::vector< SG::View* > viewVector; - std::vector< xAOD::TrigCompositeContainer > viewCollections; - std::vector< xAOD::TrigCompositeAuxContainer > viewAuxCollections; + std::vector< ConstDataVector<xAOD::TrigCompositeContainer> > viewCollections; for ( const auto input: *inputHandle.cptr() ) { - xAOD::TrigCompositeContainer oneInput; - xAOD::TrigCompositeAuxContainer oneAuxInput; - oneInput.setStore( oneAuxInput ); + ConstDataVector<xAOD::TrigCompositeContainer> oneInput; oneInput.clear( SG::VIEW_ELEMENTS ); oneInput.push_back( input ); viewCollections.push_back( oneInput ); - viewAuxCollections.push_back( oneAuxInput ); } //Make the views - SG::WriteHandle< xAOD::TrigCompositeContainer > viewHandle( m_outputKey, ctx ); + SG::WriteHandle< ConstDataVector<xAOD::TrigCompositeContainer> > viewHandle( m_outputKey, ctx ); CHECK( ViewHelper::MakeAndPopulate( name() + "_view", // Base name for all views to use viewVector, // Vector to store views viewHandle, // A writehandle to use to access the views (the handle itself, not the contents) viewCollections ) ); // Data to initialise each view - one view will be made per entry - //Add the aux collections - SG::WriteHandle< xAOD::TrigCompositeAuxContainer > viewAuxHandle( m_outputAuxKey, ctx ); - CHECK( ViewHelper::Populate( viewVector, // Vector containing views - viewAuxHandle, // A writehandle to use to access the views (the handle itself, not the contents) - viewAuxCollections ) ); // Data to add to each view - vector must be same length as view vector - // Run the views CHECK( ViewHelper::RunViews( viewVector, // Vector containing views m_viewAlgorithmNames, // Algorithms to run in each view diff --git a/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.h b/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.h index 87720929ddf6b0cc68c2ba046b4415278c221755..243ee60d40745b8ebd5ee1128f598bdd8984a91c 100644 --- a/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.h +++ b/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.h @@ -16,6 +16,7 @@ #include "xAODTrigger/TrigCompositeContainer.h" #include "xAODTrigger/TrigCompositeAuxContainer.h" #include "AthViews/View.h" +#include "AthContainers/ConstDataVector.h" class EventViewCreatorAlgorithm : public AthAlgorithm { @@ -33,8 +34,7 @@ class EventViewCreatorAlgorithm : public AthAlgorithm SG::ReadHandleKey< xAOD::TrigCompositeAuxContainer > m_inputAuxKey; //Output the split composite collection into views - SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_outputKey; - SG::WriteHandleKey< xAOD::TrigCompositeAuxContainer > m_outputAuxKey; + SG::WriteHandleKey< ConstDataVector<xAOD::TrigCompositeContainer> > m_outputKey; //Algorithms to run in views std::vector< std::string > m_viewAlgorithmNames;