diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/doc/METMenuSequences.md b/Trigger/TrigAlgorithms/TrigEFMissingET/doc/METMenuSequences.md index 8e4d09e5c775982801699ce7cc9c498e56a2504c..92bba3f3e4fc492ba1a69d2aef98dc740ac0a0ee 100644 --- a/Trigger/TrigAlgorithms/TrigEFMissingET/doc/METMenuSequences.md +++ b/Trigger/TrigAlgorithms/TrigEFMissingET/doc/METMenuSequences.md @@ -21,7 +21,9 @@ topSequence = AlgSequence() from L1Decoder.L1DecoderConfig import mapThresholdToL1DecisionCollection from DecisionHandling.DecisionHandlingConf import InputMakerForRoI +from ViewAlgs.ViewAlgsConf import ViewCreatorInitialROITool InputMakerAlg = InputMakerForRoI("MetCellInputMaker", RoIsLink="initialRoI") +InputMakerAlg.RoITool = ViewCreatorInitialROITool() InputMakerAlg.RoIs='METCellRoI' InputMakerAlg.InputMakerInputDecisions=[mapThresholdToL1DecisionCollection("XE")] InputMakerAlg.InputMakerOutputDecisions="InputMaker_from_L1MET" @@ -39,7 +41,7 @@ metHypoTool.metThreshold=50 metHypoAlg = MissingETHypoAlgMT("METHypoAlg") metHypoAlg.HypoTools = [metHypoTool] metHypoAlg.METContainerKey="HLT_MET" -metHypoAlg.HypoInputDecisions = InputMakerAlg.InputMakerOutputDecisions[0] +metHypoAlg.HypoInputDecisions = InputMakerAlg.InputMakerOutputDecisions metHypoAlg.HypoOutputDecisions = "EFMETDecisions" topSequence += metHypoAlg diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py index b7354c7de4b14025813422b225fb290ae15b88bd..6b7231da24fe7f1f042f1ceac4864fe3aca8dd0f 100644 --- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py +++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py @@ -119,6 +119,7 @@ def clusterFSInputMaker( ): RoIs = 'FSJETRoI' from AthenaConfiguration.ComponentFactory import CompFactory InputMakerAlg = CompFactory.InputMakerForRoI("IMclusterFS", RoIsLink="initialRoI") + InputMakerAlg.RoITool = CompFactory.ViewCreatorInitialROITool() InputMakerAlg.RoIs=RoIs return InputMakerAlg diff --git a/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt index d746ccc55ce4bbbe92cc756065064fcae0c67904..581a7a3cee4fe46b1474074ae0a7c8f6f11191f0 100644 --- a/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt +++ b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt @@ -3,6 +3,13 @@ # Declare the package name: atlas_subdir( DecisionHandling ) +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Event/xAOD/xAODTracking + Event/xAOD/xAODTrigCalo + ) + + atlas_add_library( DecisionHandlingLib src/*.cxx PUBLIC_HEADERS DecisionHandling @@ -11,7 +18,7 @@ atlas_add_library( DecisionHandlingLib # Component(s) in the package: atlas_add_component( DecisionHandling - src/components/*.cxx - LINK_LIBRARIES DecisionHandlingLib ) + src/*.cxx src/components/*.cxx + LINK_LIBRARIES DecisionHandlingLib xAODTracking xAODTrigCalo ) atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Trigger/TrigSteer/ViewAlgs/ViewAlgs/IViewCreatorROITool.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h similarity index 100% rename from Trigger/TrigSteer/ViewAlgs/ViewAlgs/IViewCreatorROITool.h rename to Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx b/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx index 960c08b4ec4cb97018a5832156719bee9dbfa4e1..6974ee95c010ce9a3e814c6abde766eb81e9523b 100644 --- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx +++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx @@ -82,6 +82,11 @@ StatusCode InputMakerBase::decisionInputToOutput(const EventContext& context, SG } // end of: for ( auto inputKey: decisionInputs() ) + // Print some debug messages summarising the content of the outputHandles. + if (msgLvl(MSG::DEBUG)) { + debugPrintOut(context, outputHandle); + } + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx index 340a2d6adc5fcd5393ded3140c6d2ca0d9da4748..35851da4d7762e1a97c8add88ed6d40ee08bbf49 100644 --- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx +++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx @@ -10,10 +10,8 @@ using TrigCompositeUtils::DecisionContainer; using TrigCompositeUtils::Decision; -using TrigCompositeUtils::linkToPrevious; -using TrigCompositeUtils::getLinkToPrevious; -using TrigCompositeUtils::findLink; using TrigCompositeUtils::createAndStore; +using TrigCompositeUtils::roiString; InputMakerForRoI:: InputMakerForRoI( const std::string& name, ISvcLocator* pSvcLocator ) @@ -22,7 +20,8 @@ InputMakerForRoI:: InputMakerForRoI( const std::string& name, StatusCode InputMakerForRoI::initialize() { ATH_MSG_DEBUG("Will produce output RoI collections: " << m_RoIs); - CHECK( m_RoIs.initialize( SG::AllowEmpty ) ); + ATH_CHECK( m_RoIs.initialize( SG::AllowEmpty ) ); + ATH_CHECK( m_roiTool.retrieve() ); return StatusCode::SUCCESS; } @@ -31,58 +30,69 @@ StatusCode InputMakerForRoI::execute( const EventContext& context ) const { // create the output decisions from the input collections SG::WriteHandle<DecisionContainer> outputHandle = createAndStore( decisionOutputs(), context ); - ATH_CHECK(decisionInputToOutput(context, outputHandle)); ATH_CHECK(outputHandle.isValid()); - - // Prepare Outputs - std::unique_ptr<TrigRoiDescriptorCollection> oneRoIColl = std::make_unique<TrigRoiDescriptorCollection>(); - - // use also this: ElementLinkVector<xAOD::MuonRoIContainer> getMuonRoILinks = obj->objectCollectionLinks<xAOD::MuonRoIContainer>("ManyMuonRoIs"); - std::vector <ElementLink<TrigRoiDescriptorCollection> > RoIsFromDecision; // used to check for duplicate features linked to different inputHandles + ATH_CHECK(decisionInputToOutput(context, outputHandle)); + ATH_MSG_DEBUG("Merging complete"); if( outputHandle->size() == 0) { ATH_MSG_WARNING( "Have no decisions in output handle "<< outputHandle.key() << ". Handle is valid but container is empty. " - << "Check why this EventViewCreatorAlgorithm was unlocked by a Filter, if the Filter then gave it no inputs."); + << "Check why this InputMakerForRoI was unlocked by a Filter, if the Filter then gave it no inputs."); + } else { + ATH_MSG_DEBUG( "Have output " << outputHandle.key() << " with " << outputHandle->size() << " elements" ); + } + + // Find and link to the output Decision objects the ROIs to run over + ATH_CHECK( m_roiTool->attachROILinks(*outputHandle, context) ); + + if (m_RoIs.empty()) { + ATH_MSG_DEBUG("No concrete output ROI collection required from this InputMaker."); return StatusCode::SUCCESS; } - ATH_MSG_DEBUG( "Got output "<< outputHandle.key()<<" with " << outputHandle->size() << " elements" ); - // loop over output decisions in container of outputHandle, follow link to inputDecision - for ( auto outputDecision : *outputHandle){ - ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(outputDecision); - for (auto input: inputLinks){ - const Decision* inputDecision = *input; - auto roiELInfo = findLink<TrigRoiDescriptorCollection>( inputDecision, m_roisLink.value() ); - auto roiEL = roiELInfo.link; - ATH_CHECK( roiEL.isValid() ); - - // avoid adding the same feature multiple times: check if not in container, if not add it - if ( find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL) == RoIsFromDecision.end() ) { - RoIsFromDecision.push_back(roiEL); // just to keep track of which we have used - const TrigRoiDescriptor* roi = *roiEL; - ATH_MSG_DEBUG("Found RoI:" <<*roi<<" FS="<<roi->isFullscan()); - //make a new one: - TrigRoiDescriptor* newroi= new TrigRoiDescriptor(*roi); //use copy constructor - oneRoIColl->push_back(newroi); + // Prepare Outputs + std::unique_ptr<TrigRoiDescriptorCollection> outputRoIColl = std::make_unique<TrigRoiDescriptorCollection>(); + + std::vector <ElementLink<TrigRoiDescriptorCollection> > RoIsFromDecision; // used to check for duplicate RoIs + + if (m_mergeIntoSuperRoI) { + TrigRoiDescriptor* superRoI = new TrigRoiDescriptor(); + superRoI->setComposite(true); + superRoI->manageConstituents(false); + outputRoIColl->push_back(superRoI); + } + + // loop over output decisions in container of outputHandle, collect RoIs to process + for (const Decision* outputDecision : *outputHandle) { + + if (!outputDecision->hasObjectLink(roiString(), ClassID_traits<TrigRoiDescriptorCollection>::ID())) { + ATH_MSG_ERROR("No '" << roiString() << "'link was attached by the ROITool. Decision object dump:" << *outputDecision); + return StatusCode::FAILURE; + } + const ElementLink<TrigRoiDescriptorCollection> roiEL = outputDecision->objectLink<TrigRoiDescriptorCollection>(roiString()); + ATH_CHECK(roiEL.isValid()); + + // Avoid adding the same ROI multiple times: check if not in container, if not add it + if ( find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL) == RoIsFromDecision.end() ) { + RoIsFromDecision.push_back(roiEL); // just to keep track of which we have used + const TrigRoiDescriptor* roi = *roiEL; + ATH_MSG_DEBUG("Found RoI:" <<*roi<<" FS="<<roi->isFullscan()); + + if (m_mergeIntoSuperRoI) { // Append to the single superRoI + outputRoIColl->back()->push_back( roi ); + } else { // Add individually + TrigRoiDescriptor* newroi = new TrigRoiDescriptor(*roi); //use copy constructor + outputRoIColl->push_back(newroi); ATH_MSG_DEBUG("Added RoI:" <<*newroi<<" FS="<<newroi->isFullscan()); } - } // loop over previous input links + } + } // loop over decisions - // Finally, record output - if (m_RoIs.empty()) { - ATH_MSG_DEBUG("No concrete output ROI collection required from this InputMaker."); - } else { - ATH_MSG_DEBUG("Produced "<<oneRoIColl->size() <<" output RoIs"); - auto roi_outputHandle = SG::makeHandle(m_RoIs, context); - ATH_CHECK( roi_outputHandle.record(std::move(oneRoIColl)) ); - } + ATH_MSG_DEBUG("Produced "<<outputRoIColl->size() <<" output RoIs"); + auto roi_outputHandle = SG::makeHandle(m_RoIs, context); + ATH_CHECK( roi_outputHandle.record(std::move(outputRoIColl)) ); - // call base class helper method to print some debug messages summarising the content of the outputHandles. - if (msgLvl(MSG::DEBUG)) { - debugPrintOut(context, outputHandle); - } return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h index 9f5119fd46c7a6a628a24efa4bd3ea233c0fd1ae..aa615baf368f85459fa2649b5687ca5969fadb5d 100644 --- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h +++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h @@ -1,8 +1,8 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#ifndef TRIGUPGRADETEST_INPUTMAKERFORROI_H -#define TRIGUPGRADETEST_INPUTMAKERFORROI_H +#ifndef DESICIONHANDLING_INPUTMAKERFORROI_H +#define DESICIONHANDLING_INPUTMAKERFORROI_H #include <string> @@ -11,6 +11,8 @@ #include "AthContainers/ConstDataVector.h" #include "StoreGate/ReadHandleKeyArray.h" #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" +#include "DecisionHandling/IViewCreatorROITool.h" + /** * @class InputMakerForRoI @@ -26,10 +28,16 @@ virtual StatusCode execute(const EventContext&) const override; private: - SG::WriteHandleKey<TrigRoiDescriptorCollection> m_RoIs {this,"RoIs", "", + SG::WriteHandleKey<TrigRoiDescriptorCollection> m_RoIs {this, "RoIs", "", "Name of the collection of ROI extrated from the input Decision Objects. Used as cocnrete starting handle for step's reconstruction."}; + ToolHandle<IViewCreatorROITool> m_roiTool{this, "RoITool", "", + "Tool used to supply per-Decision Object the RoI which should be processed."}; + + Gaudi::Property<bool> m_mergeIntoSuperRoI{this, "MergeIntoSuperRoI", false, + "If true, the output RoIs collection will contain only one ROI, this will be a SuperRoI encompassing all individual ROIs - one from each of the input Decision Objects."}; + }; -#endif //> !TRIGUPGRADETEST_INPUTMAKERFORROI_H +#endif //> !DESICIONHANDLING_INPUTMAKERFORROI_H diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnClusterROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.cxx similarity index 100% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnClusterROITool.cxx rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.cxx diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnClusterROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h similarity index 88% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnClusterROITool.h rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h index a80cb49c5c1a9e546f3d87f716bacf0a402fae7c..ff39dda85c5171cf09da47427744e489d7ae221b 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnClusterROITool.h +++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h @@ -2,12 +2,12 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef VIEWALGS_VIEWCREATORCENTREDONCLUSTERROITOOL_H -#define VIEWALGS_VIEWCREATORCENTREDONCLUSTERROITOOL_H +#ifndef DESICIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H +#define DESICIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H #include "AthenaBaseComps/AthAlgTool.h" #include "StoreGate/WriteHandleKey.h" -#include "ViewAlgs/IViewCreatorROITool.h" +#include "DecisionHandling/IViewCreatorROITool.h" #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" #include "xAODTrigCalo/TrigEMClusterContainer.h" @@ -49,4 +49,4 @@ public: }; -#endif //> !VIEWALGS_VIEWCREATORCENTREDONCLUSTERROITOOL_H +#endif //> !DESICIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnIParticleROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.cxx similarity index 100% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnIParticleROITool.cxx rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.cxx diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnIParticleROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h similarity index 87% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnIParticleROITool.h rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h index d766bb72d6db773b76bc6680064702d2111c5a73..62eddd373318587464eee926d95852e841aeb297 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnIParticleROITool.h +++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h @@ -2,12 +2,12 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef VIEWALGS_VIEWCREATORCENTREDONIPARTICLEROITOOL_H -#define VIEWALGS_VIEWCREATORCENTREDONIPARTICLEROITOOL_H +#ifndef DESICIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H +#define DESICIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H #include "AthenaBaseComps/AthAlgTool.h" #include "StoreGate/WriteHandleKey.h" -#include "ViewAlgs/IViewCreatorROITool.h" +#include "DecisionHandling/IViewCreatorROITool.h" #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" /** @@ -48,4 +48,4 @@ public: }; -#endif //> !VIEWALGS_VIEWCREATORCENTREDONIPARTICLEROITOOL_H +#endif //> !DESICIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.cxx similarity index 100% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.cxx rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.cxx diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h similarity index 88% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h index cc65588dab5ae44b1c70f421fe6e77973338b700..da690591ae869a15eb5aaf05bd37a7a23983dfba 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h +++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h @@ -2,12 +2,12 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef VIEWALGS_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H -#define VIEWALGS_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H +#ifndef DESICIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H +#define DESICIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H #include "AthenaBaseComps/AthAlgTool.h" #include "StoreGate/WriteHandleKey.h" -#include "ViewAlgs/IViewCreatorROITool.h" +#include "DecisionHandling/IViewCreatorROITool.h" #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" #include "xAODTracking/VertexContainer.h" @@ -62,4 +62,4 @@ public: }; -#endif //> !VIEWALGS_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H +#endif //> !DESICIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFSROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx similarity index 100% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFSROITool.cxx rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFSROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h similarity index 85% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFSROITool.h rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h index c76fb89808468a0e1417c57ba869b7fd12023f8e..73396ecbd12e8daf27a9b4b74622c915ae09e6b0 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFSROITool.h +++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h @@ -2,12 +2,12 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef VIEWALGS_VIEWCREATORFSROITOOL_H -#define VIEWALGS_VIEWCREATORFSROITOOL_H +#ifndef DESICIONHANDLING_VIEWCREATORFSROITOOL_H +#define DESICIONHANDLING_VIEWCREATORFSROITOOL_H #include "AthenaBaseComps/AthAlgTool.h" #include "StoreGate/WriteHandleKey.h" -#include "ViewAlgs/IViewCreatorROITool.h" +#include "DecisionHandling/IViewCreatorROITool.h" #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" /** @@ -39,4 +39,4 @@ public: }; -#endif //> !VIEWALGS_VIEWCREATORFSROITOOL_H +#endif //> !DESICIONHANDLING_VIEWCREATORFSROITOOL_H diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFetchFromViewROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.cxx similarity index 100% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFetchFromViewROITool.cxx rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.cxx diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFetchFromViewROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h similarity index 89% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFetchFromViewROITool.h rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h index cf62f0d8aeca80ad5fdfa665a812c9755bb039e0..705a7a814a02384ac0cce34300a797c1664ce8a0 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorFetchFromViewROITool.h +++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h @@ -2,12 +2,12 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef VIEWALGS_VIEWCREATORFETCHFROMVIEWROITOOL_H -#define VIEWALGS_VIEWCREATORFETCHFROMVIEWROITOOL_H +#ifndef DESICIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H +#define DESICIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H #include "AthenaBaseComps/AthAlgTool.h" #include "StoreGate/WriteHandleKey.h" -#include "ViewAlgs/IViewCreatorROITool.h" +#include "DecisionHandling/IViewCreatorROITool.h" #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" /** @@ -47,4 +47,4 @@ public: }; -#endif //> !VIEWALGS_VIEWCREATORFETCHFROMVIEWROITOOL_H +#endif //> !DESICIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorInitialROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.cxx similarity index 100% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorInitialROITool.cxx rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.cxx diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorInitialROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h similarity index 83% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorInitialROITool.h rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h index bb297e595e36da44e491f726502b3db2a4845bdf..81f2e35843b09a25ddb3305d80d055286c7cb354 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorInitialROITool.h +++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h @@ -2,11 +2,11 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef VIEWALGS_VIEWCREATORINITIALROITOOL_H -#define VIEWALGS_VIEWCREATORINITIALROITOOL_H +#ifndef DESICIONHANDLING_VIEWCREATORINITIALROITOOL_H +#define DESICIONHANDLING_VIEWCREATORINITIALROITOOL_H #include "AthenaBaseComps/AthAlgTool.h" -#include "ViewAlgs/IViewCreatorROITool.h" +#include "DecisionHandling/IViewCreatorROITool.h" /** * @class ViewCreatorInitialROITool @@ -32,4 +32,4 @@ public: }; -#endif //> !VIEWALGS_VIEWCREATORINITIALROITOOL_H +#endif //> !DESICIONHANDLING_VIEWCREATORINITIALROITOOL_H diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorNamedROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.cxx similarity index 100% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorNamedROITool.cxx rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.cxx diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorNamedROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h similarity index 82% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorNamedROITool.h rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h index 34d9849cef1edb9145419887108de88408f59783..1bc3c37da151255f3da9cb3ba730fef5b5732ddf 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorNamedROITool.h +++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h @@ -2,11 +2,11 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef VIEWALGS_VIEWCREATORNAMEDROITOOL_H -#define VIEWALGS_VIEWCREATORNAMEDROITOOL_H +#ifndef DESICIONHANDLING_VIEWCREATORNAMEDROITOOL_H +#define DESICIONHANDLING_VIEWCREATORNAMEDROITOOL_H #include "AthenaBaseComps/AthAlgTool.h" -#include "ViewAlgs/IViewCreatorROITool.h" +#include "DecisionHandling/IViewCreatorROITool.h" /** * @class ViewCreatorNamedROITool @@ -32,4 +32,4 @@ public: }; -#endif //> !VIEWALGS_VIEWCREATORNAMEDROITOOL_H +#endif //> !DESICIONHANDLING_VIEWCREATORNAMEDROITOOL_H diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorPreviousROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.cxx similarity index 100% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorPreviousROITool.cxx rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.cxx diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorPreviousROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h similarity index 95% rename from Trigger/TrigSteer/ViewAlgs/src/ViewCreatorPreviousROITool.h rename to Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h index 3f8d022df75db0ed2254eb408a9b61a4ac952563..95cdb00d6305d0f564ccfb1d8b51482877e4bcce 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorPreviousROITool.h +++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h @@ -6,7 +6,7 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration #define VIEWALGS_VIEWCREATORPREVIOUSROITOOL_H #include "AthenaBaseComps/AthAlgTool.h" -#include "ViewAlgs/IViewCreatorROITool.h" +#include "DecisionHandling/IViewCreatorROITool.h" /** * @class ViewCreatorPreviousROITool diff --git a/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx b/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx index e891afb5dad91b7a401bcb32542fd35d9eced1ec..7a1f0d36154b2180b9fdf99c6db8b3f1c610786f 100644 --- a/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx +++ b/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx @@ -6,6 +6,15 @@ #include "../DeltaRRoIComboHypoTool.h" #include "DecisionHandling/ComboHypoToolBase.h" +#include "../ViewCreatorInitialROITool.h" +#include "../ViewCreatorPreviousROITool.h" +#include "../ViewCreatorNamedROITool.h" +#include "../ViewCreatorFSROITool.h" +#include "../ViewCreatorFetchFromViewROITool.h" +#include "../ViewCreatorCentredOnIParticleROITool.h" +#include "../ViewCreatorCentredOnClusterROITool.h" +#include "../ViewCreatorCentredOnJetWithPVConstraintROITool.h" + DECLARE_COMPONENT( DumpDecisions ) DECLARE_COMPONENT( RoRSeqFilter ) DECLARE_COMPONENT( TriggerSummaryAlg ) @@ -14,4 +23,14 @@ DECLARE_COMPONENT( InputMakerForRoI ) DECLARE_COMPONENT( ComboHypoToolBase ) DECLARE_COMPONENT( DeltaRRoIComboHypoTool ) +DECLARE_COMPONENT( ViewCreatorInitialROITool ) +DECLARE_COMPONENT( ViewCreatorPreviousROITool ) +DECLARE_COMPONENT( ViewCreatorNamedROITool ) +DECLARE_COMPONENT( ViewCreatorFSROITool ) +DECLARE_COMPONENT( ViewCreatorFetchFromViewROITool ) +DECLARE_COMPONENT( ViewCreatorCentredOnIParticleROITool ) +DECLARE_COMPONENT( ViewCreatorCentredOnClusterROITool ) +DECLARE_COMPONENT( ViewCreatorCentredOnJetWithPVConstraintROITool ) + + diff --git a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt index 811d9b89b0be46c42079ae5c078c6a06cace026c..e2c5914873f06c873857f4a19622594caad103ac 100644 --- a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt +++ b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt @@ -11,4 +11,4 @@ atlas_add_library( ViewAlgsLib atlas_add_component( ViewAlgs src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthViews AthenaBaseComps CxxUtils DecisionHandlingLib MuonCombinedEvent StoreGateLib TrigSteeringEvent ViewAlgsLib xAODJet xAODMuon xAODTracking xAODTrigCalo ) + LINK_LIBRARIES AthViews AthenaBaseComps CxxUtils DecisionHandlingLib MuonCombinedEvent StoreGateLib TrigSteeringEvent ViewAlgsLib xAODJet xAODMuon ) diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx index 84292ade21be048a66fba0de3995efae33a6f9d1..11c165c4d7f63b4e6f1e4351e0130838efeb5b65 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx +++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx @@ -55,11 +55,13 @@ StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) con const DecisionContainer* cachedViews = nullptr; if (!m_cachedViewsKey.empty()) { SG::ReadHandle<DecisionContainer> cachedRH = SG::makeHandle(m_cachedViewsKey, context); - ATH_CHECK(cachedRH.isValid()); - cachedViews = cachedRH.ptr(); + // Even if the handle is configured, this precursor EventViewCreatorAlg may not have executed in a given event + if (cachedRH.isValid()) { + cachedViews = cachedRH.ptr(); + } } - // Keep track of the ROIs we spwan a View for, do not spawn duplicates. + // Keep track of the ROIs we spawn a View for, do not spawn duplicates. // For many cases, this will be covered by the Merging operation preceding this. ElementLinkVector<TrigRoiDescriptorCollection> RoIsFromDecision; @@ -83,7 +85,7 @@ StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) con ATH_CHECK(roiEL.isValid()); // We do one of three things here, either... - // a) We realise that an identically configured past EVCA has already run a View on an equivilant ROI. If so we can re-use this. + // a) We realise that an identically configured past EVCA has already run a View on an equivalent ROI. If so we can re-use this. // b) We encounter a new ROI and hence need to spawn a new view. // c) We encounter a ROI that we have already seen in looping over this outputHandle, we can re-use a view. @@ -96,7 +98,7 @@ StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) con if (useCached) { - // Re-use an aready processed view from a previously executed EVCA instance + // Re-use an already processed view from a previously executed EVCA instance const Decision* cached = cachedViews->at(cachedIndex); ElementLink<ViewContainer> cachedViewEL = cached->objectLink<ViewContainer>(viewString()); ElementLink<TrigRoiDescriptorCollection> cachedROIEL = cached->objectLink<TrigRoiDescriptorCollection>(roiString()); @@ -159,9 +161,6 @@ StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) con getScheduler(), // Scheduler to launch with m_reverseViews ) ); // Debug option - if (msgLvl(MSG::DEBUG)) { - debugPrintOut(context, outputHandle); - } return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h index 4e54f68397460153c4cd021ce9ec814aa1517b27..b393b3b8efca212607cd4cfe35b9162fbc065843 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h +++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h @@ -21,7 +21,7 @@ #include "GaudiKernel/IScheduler.h" #include "AthViews/View.h" -#include "ViewAlgs/IViewCreatorROITool.h" +#include "DecisionHandling/IViewCreatorROITool.h" // Muon specifics #include "xAODMuon/MuonContainer.h" diff --git a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx index ba3ed577af455e179ff54d630f9b915e5805b74e..8f1bca845a4815e59632a074da250a3a4b5bbbc1 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx +++ b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx @@ -2,23 +2,8 @@ #include "../EventViewCreatorAlgorithm.h" #include "../MergeViews.h" -#include "../ViewCreatorInitialROITool.h" -#include "../ViewCreatorPreviousROITool.h" -#include "../ViewCreatorNamedROITool.h" -#include "../ViewCreatorFSROITool.h" -#include "../ViewCreatorFetchFromViewROITool.h" -#include "../ViewCreatorCentredOnIParticleROITool.h" -#include "../ViewCreatorCentredOnClusterROITool.h" -#include "../ViewCreatorCentredOnJetWithPVConstraintROITool.h" + DECLARE_COMPONENT( EventViewCreatorAlgorithm ) DECLARE_COMPONENT( MergeViews ) -DECLARE_COMPONENT( ViewCreatorInitialROITool ) -DECLARE_COMPONENT( ViewCreatorPreviousROITool ) -DECLARE_COMPONENT( ViewCreatorNamedROITool ) -DECLARE_COMPONENT( ViewCreatorFSROITool ) -DECLARE_COMPONENT( ViewCreatorFetchFromViewROITool ) -DECLARE_COMPONENT( ViewCreatorCentredOnIParticleROITool ) -DECLARE_COMPONENT( ViewCreatorCentredOnClusterROITool ) -DECLARE_COMPONENT( ViewCreatorCentredOnJetWithPVConstraintROITool ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py index 615dd21fd63edd8cec8ca6c143ed1504342c23b4..1f183f1ad18c871c7f362b855c374b3a736ad5d7 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py @@ -6,7 +6,7 @@ log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.MonitorChain from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep, MenuSequence -from DecisionHandling.DecisionHandlingConf import InputMakerForRoI +from DecisionHandling.DecisionHandlingConf import InputMakerForRoI, ViewCreatorInitialROITool from AthenaCommon.CFElements import seqAND from TrigGenericAlgs.TrigGenericAlgsConfig import TimeBurnerCfg, TimeBurnerHypoToolGen from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable @@ -46,6 +46,7 @@ class MonitorChainConfiguration(ChainConfigurationBase): def getTimeBurnerStep(self): # Input maker - required by the framework, but inputs don't matter for TimeBurner inputMaker = InputMakerForRoI("IM_TimeBurner") + inputMaker.RoITool = ViewCreatorInitialROITool() inputMaker.RoIs="TimeBurnerInputRoIs" inputMakerSeq = seqAND("TimeBurnerSequence", [inputMaker]) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/StreamingChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/StreamingChainConfiguration.py index c8ffd0373c1329e36461a4d4bd58a9f0832ee2a8..e7f587269dfdfb070a4c97223a704ec9434f2527 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/StreamingChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/StreamingChainConfiguration.py @@ -8,7 +8,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigu from TrigStreamerHypo.TrigStreamerHypoConfigMT import StreamerHypoToolMTgenerator from TrigStreamerHypo.TrigStreamerHypoConf import TrigStreamerHypoAlgMT from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence -from DecisionHandling.DecisionHandlingConf import InputMakerForRoI +from DecisionHandling.DecisionHandlingConf import InputMakerForRoI, ViewCreatorInitialROITool from AthenaCommon.CFElements import seqAND @@ -23,6 +23,7 @@ def StreamingSequenceCfg( flags ): def StreamingMenuSequence(): inputMakerAlg = InputMakerForRoI("IM_streamerInputMaker") + inputMakerAlg.RoITool = ViewCreatorInitialROITool() inputMakerAlg.RoIs="streamerInputRoIs" streamingSequence = seqAND("streamerSequence", [inputMakerAlg]) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py index cf8f4b3dec84733af8425ad48ae12a921519c83b..153952c628ebb64b549531652e36e9437146abad 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py @@ -7,7 +7,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu import EventBuildingInfo from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep, MenuSequence from TrigPartialEventBuilding.TrigPartialEventBuildingConf import PEBInfoWriterAlg from TrigPartialEventBuilding.TrigPartialEventBuildingConfig import StaticPEBInfoWriterToolCfg, RoIPEBInfoWriterToolCfg -from DecisionHandling.DecisionHandlingConf import InputMakerForRoI +from DecisionHandling.DecisionHandlingConf import InputMakerForRoI, ViewCreatorInitialROITool from libpyeformat_helper import SubDetector from AthenaCommon.CFElements import seqAND, findAlgorithm from AthenaCommon.Logging import logging @@ -104,6 +104,7 @@ def pebInfoWriterTool(name, eventBuildType): def pebInputMaker(eventBuildType): maker = InputMakerForRoI("IMpeb_"+eventBuildType) + maker.RoITool = ViewCreatorInitialROITool() maker.RoIs = "pebInputRoI_" + eventBuildType return maker diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py index 74c80a054fb0e8b149158bb495c4df2d98338f10..6d322b94600acea926cedb7a39a3581040062f25 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py @@ -320,6 +320,7 @@ class EmptyMenuSequence(object): def __init__(self, name): self._name = name Maker = CompFactory.InputMakerForRoI("IM"+name) + Maker.RoITool = CompFactory.ViewCreatorInitialROITool() self._maker = InputMakerNode( Alg = Maker ) self._seed='' self._sequence = Node( Alg = seqAND(name, [Maker]))