diff --git a/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c8e43278105b8e16ff9077c9b2365b277a98a9a4 --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt @@ -0,0 +1,45 @@ +################################################################################ +# Package: DecisionHandling +################################################################################ + +# Declare the package name: +atlas_subdir( DecisionHandling ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Event/xAOD/xAODTrigger + # GaudiKernel + Control/AthContainers + Control/AthLinks + PRIVATE + #Control/AthViews + # Control/StoreGate + #Control/AthenaBaseComps + # Control/CxxUtils + Trigger/TrigConfiguration/TrigConfHLTData + #Trigger/TrigEvent/TrigSteeringEvent + #Trigger/TrigSteer/L1Decoder + AtlasTest/TestTools + Control/StoreGate + ) + + +atlas_add_library( DecisionHandlingLib + src/*.cxx + PUBLIC_HEADERS DecisionHandling + LINK_LIBRARIES xAODTrigger GaudiKernel + PRIVATE_LINK_LIBRARIES AthenaBaseComps CxxUtils TrigConfHLTData ) + +# Component(s) in the package: +atlas_add_component( DecisionHandling + src/components/*.cxx + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} + ${ROOT_LIBRARIES} GaudiKernel AthViews AthenaBaseComps CxxUtils xAODTrigger DecisionHandlingLib + ) + + +atlas_add_test( TrigCompositeUtils_test + SOURCES test/TrigCompositeUtils_test.cxx + LINK_LIBRARIES TestTools xAODTrigger DecisionHandlingLib + AthContainers ) diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h new file mode 100644 index 0000000000000000000000000000000000000000..76963eb8a8045b32d67d6935e841cf5fcc178f01 --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h @@ -0,0 +1,65 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef DecisionHandling_HLTIdentifier_h +#define DecisionHandling_HLTIdentifier_h + +#include <string> +#include <vector> +#include <set> +#include <map> + + + +#include "GaudiKernel/MsgStream.h" +/* + @brief An trigger identifier class, used to provide mapping fromt the human readable IDs to efficienct unsigned ints + */ +namespace HLT { +class Identifier { +public: + /* + @brief disables reporting human readable names == no debugging, fast execution + */ + static void reportStringIDs(bool report) { s_reportStringIDs = report; } + static bool reportStringIDs() { return s_reportStringIDs; } + /* + @brief constructs identifier from human redable name + */ + Identifier(const std::string& stringID); + + /* + @brief Construct wiht numeric ID + */ + Identifier(unsigned id) : m_id(id) {} + + /* + @brief reports human redable name if it is enabled or, empty string + */ + std::string name() const; + + /* + @brief numeric ID + */ + unsigned numeric() const { return m_id; } + /* + @brief comparisons, for containers + */ + bool operator == ( const Identifier& rhs ) const { return numeric() == rhs.numeric(); } + bool operator < ( const Identifier& rhs ) const { return numeric() < rhs.numeric(); } +private: + unsigned m_id; + static bool s_reportStringIDs; + +}; + typedef std::vector<HLT::Identifier> IDVec; + typedef std::set<HLT::Identifier> IDSet; + typedef std::map<HLT::Identifier, IDVec> IDtoIDVecMap; +} + +MsgStream& operator<< ( MsgStream& m, const HLT::Identifier& id ); + + + +#endif // HLTIdentifier diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h new file mode 100644 index 0000000000000000000000000000000000000000..8355cdf99a4a7ba659e38df1470f47e42ab3345d --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h @@ -0,0 +1,68 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef DecisionHandling_TrigCompositeUtils_h +#define DecisionHandling_TrigCompositeUtils_h + +#include <set> +#include <memory> +#include "GaudiKernel/EventContext.h" +#include "StoreGate/WriteHandleKey.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandle.h" +#include "StoreGate/ReadHandle.h" + +#include "xAODTrigger/TrigCompositeContainer.h" +#include "xAODTrigger/TrigCompositeAuxContainer.h" + +namespace TrigCompositeUtils { + + // alias types, for readability and to simplify future evolution + typedef xAOD::TrigComposite Decision; + typedef xAOD::TrigCompositeContainer DecisionContainer; + typedef xAOD::TrigCompositeAuxContainer DecisionAuxContainer; + + typedef SG::WriteHandle<DecisionContainer> DecisionWriteHandle; + /* + creates and right away stores the DecisionContainer under the key + */ + DecisionWriteHandle createAndStore(const SG::WriteHandleKey<DecisionContainer>& key, const EventContext& ctx); + + + /* + @brief helper method to that created the Decision objects, places it in the container and returns + This is to make this: + auto d = newDecisionIn(output); + instead of: + auto d = new Decision; + output->push_back(d); + */ + + Decision* newDecisionIn (DecisionContainer* dc); + + // aliases for the decision IDs, in fact this are just ints + typedef unsigned int DecisionID; + typedef std::set<DecisionID> DecisionIDContainer; + + /* + @brief Appends the decision (given as ID) to the decision object + */ + void addDecisionID( DecisionID id, Decision* d); + + + /* + @brief Extracts DecisionIDs stored in the Decsion object + */ + void decisionIDs(const Decision* d, DecisionIDContainer& id ); + + + /* + @brief Checks if any of the DecisionIDs passed in arg required is availble in Decision object + */ + bool passingIDs( const Decision* d, const DecisionIDContainer& required); + +} + + +#endif // DecisionHandling_TrigCompositeUtils_h diff --git a/Trigger/TrigSteer/DecisionHandling/src/DumpDecisions.cxx b/Trigger/TrigSteer/DecisionHandling/src/DumpDecisions.cxx new file mode 100644 index 0000000000000000000000000000000000000000..fd607142853220d42ef386f934bac1d81c163101 --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/src/DumpDecisions.cxx @@ -0,0 +1,90 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +// DecisionHandling includes + + +#include "DecisionHandling/HLTIdentifier.h" + +// FrameWork includes +#include "GaudiKernel/Property.h" +#include "DumpDecisions.h" + + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// +DumpDecisions::DumpDecisions( const std::string& name, + ISvcLocator* pSvcLocator ) + : AthReentrantAlgorithm( name, pSvcLocator ) +{ + declareProperty( "Decisions", m_decisionKey, "Input Decisions" ); + declareProperty( "VerbosityLevel", m_verbosityLevel, "3 - tries to print as much possible, 2 - only list of objects and their decisions, 1 - only list of active objets"); +} + +// Destructor +/////////////// +DumpDecisions::~DumpDecisions() +{} + +// Athena Algorithm's Hooks +//////////////////////////// +StatusCode DumpDecisions::initialize() +{ + ATH_MSG_INFO ("Initializing " << name() << "..."); + CHECK( m_decisionKey.initialize() ); + return StatusCode::SUCCESS; +} + +StatusCode DumpDecisions::finalize() { + ATH_MSG_INFO ("Finalizing " << name() << "..."); + + return StatusCode::SUCCESS; +} + +StatusCode DumpDecisions:: execute_r( const EventContext& ctx ) const { + using namespace TrigCompositeUtils; + // DecisionInput decisionInput; + auto decisionInput = SG::makeHandle(m_decisionKey, ctx); + // CHECK( decisionInput.retrieve() ); + // CHECK ( decisionInput.retrieve( m_decisionKey, ctx) ); + ATH_MSG_DEBUG( "Retrieved decision with the key " << m_decisionKey.key() ); + ATH_MSG_DEBUG( "Pointer value " << decisionInput.cptr() ); + for ( auto d: *decisionInput ) { + DecisionIDContainer ids; + TrigCompositeUtils::decisionIDs( d, ids ); + ATH_MSG_DEBUG( "Decision object with " << ids.size() << " decisions" ); + if ( m_verbosityLevel >= 2 ) { + for ( auto id: ids ) { + ATH_MSG_DEBUG( "Passing decision " << HLT::Identifier(id) ); + } + } + } + return StatusCode::SUCCESS; +} + + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + + diff --git a/Trigger/TrigSteer/DecisionHandling/src/DumpDecisions.h b/Trigger/TrigSteer/DecisionHandling/src/DumpDecisions.h new file mode 100644 index 0000000000000000000000000000000000000000..50da48fe7e9fd686cffd27a78a3122450d2ffde9 --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/src/DumpDecisions.h @@ -0,0 +1,49 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef DECISIONHANDLING_DUMPDECISIONS_H +#define DECISIONHANDLING_DUMPDECISIONS_H 1 + +// STL includes +#include <string> +#include "DecisionHandling/TrigCompositeUtils.h" +// FrameWork includes +#include "AthenaBaseComps/AthReentrantAlgorithm.h" + + + +class DumpDecisions + : public ::AthReentrantAlgorithm +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + // Copy constructor: + + /// Constructor with parameters: + DumpDecisions( const std::string& name, ISvcLocator* pSvcLocator ); + + /// Destructor: + virtual ~DumpDecisions(); + + // Athena algorithm's Hooks + StatusCode initialize() override; + StatusCode execute_r( const EventContext& ctx ) const override; + StatusCode finalize() override; + private: + + SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_decisionKey; + size_t m_verbosityLevel = 3; // see docu. of property + /// Default constructor: + DumpDecisions(); + + + + +}; + + +#endif //> !DECISIONHANDLING_DUMPDECISIONS_H diff --git a/Trigger/TrigSteer/DecisionHandling/src/HLTIdentifier.cxx b/Trigger/TrigSteer/DecisionHandling/src/HLTIdentifier.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e3b33f1987362079928a9b69fe88b3fbac5f66ca --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/src/HLTIdentifier.cxx @@ -0,0 +1,27 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#include "TrigConfHLTData/HLTUtils.h" +#include "DecisionHandling/HLTIdentifier.h" + +using namespace HLT; +bool Identifier::s_reportStringIDs = true; // default for now + +Identifier::Identifier(const std::string& stringID) + : m_id( TrigConf::HLTUtils::string2hash(stringID, "Identifier") ) {} + +std::string Identifier::name() const { + if ( Identifier::reportStringIDs() ) { + return TrigConf::HLTUtils::hash2string(numeric(), "Identifier"); + } + return ""; +} + +MsgStream& operator<< ( MsgStream& m, const HLT::Identifier& id ) { + if ( Identifier::reportStringIDs() ) { + m << id.name() << " ID#" << id.numeric(); + } else { + m << "ID#" << id.numeric(); + } + return m; +} diff --git a/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx b/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c1b938ef52df1c8e54ba8905d90b8cd960166c3c --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx @@ -0,0 +1,49 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#include "StoreGate/WriteHandle.h" +#include "StoreGate/ReadHandle.h" +#include "AthContainers/AuxElement.h" + +#include "DecisionHandling/TrigCompositeUtils.h" + + + +static SG::AuxElement::Accessor< std::vector< int > > readWriteAccessor( "decisions" ); +static SG::AuxElement::ConstAccessor< std::vector<int> > readOnlyAccessor( "decisions" ); + +namespace TrigCompositeUtils { + + DecisionWriteHandle createAndStore(const SG::WriteHandleKey<DecisionContainer>& key, const EventContext& ctx) { + SG::WriteHandle<DecisionContainer> handle(key, ctx); + auto data = std::make_unique<DecisionContainer>() ; + auto aux = std::make_unique<DecisionAuxContainer>() ; + data->setStore(aux.get()); + handle.record( std::move( data ), std::move( aux ) ).ignore(); + return handle; + } + + Decision* newDecisionIn (DecisionContainer* dc) { + Decision * x = new Decision; + dc->push_back( x ); + readWriteAccessor( *x ).size(); // fake operation just to make the decsions decoration + return x; + } + + void addDecisionID( DecisionID id, Decision* d) { + readWriteAccessor( *d ).push_back( id ); + } + + void decisionIDs( const Decision* d, DecisionIDContainer& destination ) { + const std::vector<int>& decisions = readOnlyAccessor( *d ); + destination.insert( decisions.begin(), decisions.end() ); + } + + bool passingIDs( const Decision* d, const DecisionIDContainer& required ) { + for ( auto id : readOnlyAccessor( *d ) ) { + if ( required.count( id ) > 0 ) + return true; + } + return false; + } +} diff --git a/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx b/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2df90b72c95ed2bfb2500144907536de1a2e7d09 --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx @@ -0,0 +1,13 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#include "GaudiKernel/DeclareFactoryEntries.h" + +#include "../DumpDecisions.h" + +DECLARE_ALGORITHM_FACTORY( DumpDecisions ) + +DECLARE_FACTORY_ENTRIES( DumpDecisions ) +{ + DECLARE_ALGORITHM( DumpDecisions ) +} diff --git a/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_load.cxx b/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_load.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8c38cd4887168c7785ad8e376d9cb7ba98d75db0 --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_load.cxx @@ -0,0 +1,6 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#include "GaudiKernel/LoadFactoryEntries.h" + +LOAD_FACTORY_ENTRIES( DecisionHandling ) diff --git a/Trigger/TrigSteer/DecisionHandling/test/TrigCompositeUtils_test.cxx b/Trigger/TrigSteer/DecisionHandling/test/TrigCompositeUtils_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4e6f28e74e05e817cca9a5ccf78d868588d501a8 --- /dev/null +++ b/Trigger/TrigSteer/DecisionHandling/test/TrigCompositeUtils_test.cxx @@ -0,0 +1,54 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include <iostream> +//#include "TestTools/expect.h" +#include "DecisionHandling/TrigCompositeUtils.h" + +#include "xAODTrigger/TrigCompositeAuxContainer.h" + +int main() { + using namespace TrigCompositeUtils; + + auto dc = std::make_unique<DecisionContainer>(); + auto decisionAux = std::make_unique<DecisionAuxContainer>(); + dc->setStore(decisionAux.get()); + + + // try insertions + auto d1 = newDecisionIn(dc.get()); + addDecisionID( 1, d1 ); + addDecisionID( 2, d1 ); + + auto d2 = newDecisionIn(dc.get()); + addDecisionID( 1, d2 ); + addDecisionID( 3, d2 ); + + DecisionIDContainer ids; + decisionIDs(d1, ids); + + for (auto id: ids) + std::cout << id << " from d1\n"; + + decisionIDs(d2, ids); + for (auto id: ids) + std::cout << id << " from d1 and d2\n"; + + ids.clear(); + ids.insert(3); + ids.insert(7); + const DecisionIDContainer& cids = ids; + { + bool yn = passingIDs(d1, cids); + std::cout << " 3 or 7 contained in d1 " << (yn ? "YES" : "NO") << std::endl; + } + + { + bool yn = passingIDs(d2, cids); + std::cout << " 3 or 7 contained in d2 " << (yn ? "YES" : "NO") << std::endl; + } + + return 0; + +} diff --git a/Trigger/TrigSteer/L1Decoder/CMakeLists.txt b/Trigger/TrigSteer/L1Decoder/CMakeLists.txt index 792cb6d39b82bfc666f22f55710e6becfcb81db5..7711fd4b891f4b8550f7682403435dcec2f6816b 100644 --- a/Trigger/TrigSteer/L1Decoder/CMakeLists.txt +++ b/Trigger/TrigSteer/L1Decoder/CMakeLists.txt @@ -22,7 +22,8 @@ atlas_depends_on_subdirs( PUBLIC Trigger/TrigEvent/TrigSteeringEvent Trigger/TrigT1/TrigT1Interfaces Trigger/TrigT1/TrigT1Result - Trigger/TrigMonitoring/TrigMonitorBase ) + Trigger/TrigMonitoring/TrigMonitorBase + Trigger/TrigSteer/DecisionHandling ) # External dependencies: find_package( Boost COMPONENTS filesystem thread system ) @@ -33,13 +34,22 @@ atlas_add_library( L1DecoderLib src/*.cxx PUBLIC_HEADERS L1Decoder INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} GaudiKernel AthViews AthenaBaseComps CxxUtils xAODTrigger TrigConfHLTData TrigConfL1Data TrigSteeringEvent TrigT1Interfaces TrigT1Result TrigMonitorBaseLib + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} + GaudiKernel AthViews AthenaBaseComps CxxUtils + xAODTrigger TrigConfHLTData TrigConfL1Data + TrigSteeringEvent TrigT1Interfaces TrigT1Result + TrigMonitorBaseLib DecisionHandlingLib ) atlas_add_component( L1Decoder src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} GaudiKernel AthViews AthenaBaseComps CxxUtils xAODTrigger TrigConfHLTData TrigConfL1Data TrigSteeringEvent TrigT1Interfaces TrigT1Result L1DecoderLib + LINK_LIBRARIES ${Boost_LIBRARIES} + ${ROOT_LIBRARIES} GaudiKernel AthViews + AthenaBaseComps CxxUtils xAODTrigger + TrigConfHLTData TrigConfL1Data TrigSteeringEvent + TrigT1Interfaces TrigT1Result + L1DecoderLib ) # Install files from the package: diff --git a/Trigger/TrigSteer/L1Decoder/L1Decoder/TrigIdentifiers.h b/Trigger/TrigSteer/L1Decoder/L1Decoder/TrigIdentifiers.h index 8e057539f9b649839211ee26b8e6966f2e099f9d..f77d95e95e9251f17e47fa076ad2bd6f08d555ee 100644 --- a/Trigger/TrigSteer/L1Decoder/L1Decoder/TrigIdentifiers.h +++ b/Trigger/TrigSteer/L1Decoder/L1Decoder/TrigIdentifiers.h @@ -1,7 +1,6 @@ /* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ - #ifndef L1Decoder_TrigIdentifiers_h #define L1Decoder_TrigIdentifiers_h diff --git a/Trigger/TrigSteer/L1Decoder/share/decodeBS.py b/Trigger/TrigSteer/L1Decoder/share/decodeBS.py index d279b2cf02f9a9ee1c2f3a80b561488cbf22de74..a99f1cc305572a3ef43808fa71dbaf086490a2ba 100755 --- a/Trigger/TrigSteer/L1Decoder/share/decodeBS.py +++ b/Trigger/TrigSteer/L1Decoder/share/decodeBS.py @@ -5,7 +5,10 @@ # # get_files LVL1config_Physics_pp_v5.xml # ln -s /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data15_13TeV.00266904.physics_EnhancedBias.merge.RAW._lb0452._SFO-1._0001.1 input.data -# +# exact config for this data is: https://atlas-trigconf.cern.ch/run2/smkey/2142/l1key/1077/hltkey/765/ + +import os.path +assert os.path.isfile('input.data'), 'No input file: see the JO to see how to get it' ## @file L1Topo_ReadBS_test.py ## @brief Example job options file to read BS file to test a converter @@ -80,18 +83,45 @@ if nThreads >= 1: topSequence += SGInputLoader( OutputLevel=INFO, ShowEventDump=False ) topSequence.SGInputLoader.Load = [ ('ROIB::RoIBResult','RoIBResult') ] +from L1Decoder.L1DecoderConf import CTPUnpackingTool, EMRoIsUnpackingTool, L1Decoder, MURoIsUnpackingTool +l1Decoder = L1Decoder( OutputLevel=DEBUG ) +l1Decoder.ctpUnpacker = CTPUnpackingTool( OutputLevel = DEBUG, ForceEnableAllChains=True ) + +l1Decoder.ctpUnpacker.CTPToChainMapping = ["0:HLT_e3", "0:HLT_g5", "1:HLT_e7", "15:HLT_mu6", "33:HLT_2mu6", "15:HLT_mu6idperf", "42:HLT_e15mu4"] # this are real IDs of L1_* items in pp_v5 menu + +emUnpacker = EMRoIsUnpackingTool( OutputLevel=DEBUG ) +emUnpacker.ThresholdToChainMapping = ["EM3 : HLT_e3", "EM3 : HLT_g5", "EM7 : HLT_e7", "EM15 : HLT_e15mu4" ] + +muUnpacker = MURoIsUnpackingTool( OutputLevel=DEBUG ) +muUnpacker.ThresholdToChainMapping = ["MU6 : HLT_mu6", "MU6 : HLT_mu6idperf", "MU4 : HLT_e15mu4"] +# do not know yet how to configure the services for it + +l1Decoder.roiUnpackers = [emUnpacker] +l1Decoder.Chains="HLTChainsResult" +topSequence += l1Decoder #Run calo decoder -from L1Decoder.L1DecoderConf import L1CaloDecoder -caloDecoder = L1CaloDecoder() # by default it is steered towards the RoIBResult of the name above -caloDecoder.OutputLevel=VERBOSE -topSequence += caloDecoder - -#Dumper -from ViewAlgs.ViewAlgsConf import DumpDecisions -dumper = DumpDecisions("L1CaloDecisions") -dumper.OutputLevel=VERBOSE -topSequence += dumper + +from DecisionHandling.DecisionHandlingConf import DumpDecisions +emDecisionsDumper = DumpDecisions("DumpEML1RoIs", OutputLevel=DEBUG) +emDecisionsDumper.Decisions = "EMRoIDecisions" +topSequence += emDecisionsDumper + +chainSeedingDumper = DumpDecisions("ChainSeedingDumper", OutputLevel=DEBUG) +chainSeedingDumper.Decisions = "HLTChainsResult" +topSequence += chainSeedingDumper + + + +# caloDecoder = L1CaloDecoder() # by default it is steered towards the RoIBResult of the name above +# caloDecoder.OutputLevel=VERBOSE +# topSequence += caloDecoder + +# #Dumper +# from ViewAlgs.ViewAlgsConf import DumpDecisions +# dumper = DumpDecisions("L1CaloDecisions") +# dumper.OutputLevel=VERBOSE +# topSequence += dumper #-------------------------------------------------------------- diff --git a/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8cafc316730197b5779ddf8209890599055cf514 --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.cxx @@ -0,0 +1,76 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#include "DecisionHandling/HLTIdentifier.h" +#include "TrigT1Result/RoIBResult.h" +#include "CTPUnpackingTool.h" + +using namespace HLT; + + +CTPUnpackingTool::CTPUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ) + : AthAlgTool(type, name, parent) { + declareProperty("CTPToChainMapping", m_ctpToChainProperty, "Mapping of the form: '34:HLT_x', '35:HLT_y', ..., both CTP ID and chain may appear many times"); + declareProperty("ForceEnableAllChains", m_forceEnable=false, "Enables all chains in each event, testing mode"); +} + + +CTPUnpackingTool::~CTPUnpackingTool() +{} + +StatusCode CTPUnpackingTool::decodeCTPToChainMapping() { + std::istringstream input; + for ( auto entry: m_ctpToChainProperty ) { + input.clear(); + input.str(entry); + size_t ctpId; + input >> ctpId; + char delim; + input >> delim; + if ( delim != ':' ) { + ATH_MSG_ERROR( "Error in conf. entry: " << entry << " missing ':'" ); + return StatusCode::FAILURE; + } + std::string chainName; + input >> chainName; + ATH_MSG_DEBUG( "Chain " << chainName << " seeded from CTP item of ID " << ctpId ); + m_ctpToChain[ctpId].push_back( HLT::Identifier(chainName) ); + } + return StatusCode::SUCCESS; +} + + +StatusCode CTPUnpackingTool::decode( const ROIB::RoIBResult& roib, HLT::IDVec& enabledChains ) const { + size_t numberPfActivatedBits= 0; + + auto tav = roib.cTPResult().TAV(); + const size_t tavSize = tav.size(); + + for ( size_t wordCounter = 0; wordCounter < tavSize; ++wordCounter ) { + for ( size_t bitCounter = 0; bitCounter < 32; ++bitCounter ) { + const size_t ctpIndex = 32*wordCounter + bitCounter; + const bool decision = ( tav[wordCounter].roIWord() & (1 << bitCounter) ) > 0; + + if ( decision == true or m_forceEnable ) { + if ( decision ) + ATH_MSG_DEBUG( "L1 item " << ctpIndex << " active, enabling chains"); + numberPfActivatedBits++; + auto itr = m_ctpToChain.find(ctpIndex); + if ( itr != m_ctpToChain.end() ) + enabledChains.insert( enabledChains.end(), itr->second.begin(), itr->second.end() ); + } + } + } + for ( auto chain: enabledChains ) { + ATH_MSG_DEBUG( "Enabling chain: " << chain ); + } + if ( numberPfActivatedBits == 0 ) { + ATH_MSG_ERROR( "All CTP bits were disabled, this event shoudl not have shown here" ); + return StatusCode::FAILURE; + } + return StatusCode::SUCCESS; +} + + diff --git a/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..0deeea131b4188683450436099b891703ace812e --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.h @@ -0,0 +1,60 @@ +// -*- c++ -*- +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef L1DECODER_CTPUNPACKINGTOOL_H +#define L1DECODER_CTPUNPACKINGTOOL_H 1 + +#include "GaudiKernel/IAlgTool.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "DecisionHandling/HLTIdentifier.h" + + +namespace ROIB { + class RoIBResult; +} + + +const InterfaceID IID_CTPUnpackingTool("CTPUnpackingTool", 1, 0); + +class CTPUnpackingTool + : virtual public ::IAlgTool, virtual public AthAlgTool +{ +public: + static const InterfaceID& interfaceID(); + + + CTPUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ); + virtual ~CTPUnpackingTool(); + + + /* + @brief The method decodes CTP bits content of the RoIBResult and fills the list of chains which are activated by those bits + The mapping ctpToChain is expected to contain the CTP bit number mapping to the chain identifiers + @warning if the mapping is empty it means an empty menu. This condition is NOT checked and not reported. + @warning if none of CTP bits is set this is also an error condition, this is the event should not have been passed to HLT + */ + StatusCode decode(const ROIB::RoIBResult& roib, HLT::IDVec& enabledChains) const; + + StatusCode initialize(){ return decodeCTPToChainMapping(); } + + +protected: + StatusCode decodeCTPToChainMapping(); +private: + typedef std::map<size_t, HLT::IDVec> IndexToIdentifiers; + IndexToIdentifiers m_ctpToChain; + std::vector<std::string> m_ctpToChainProperty; + bool m_forceEnable; +}; + +inline const InterfaceID& CTPUnpackingTool::interfaceID() +{ + return IID_CTPUnpackingTool; +} + + +#endif // L1DECODER_CTPUNPACKINGTOOL_H diff --git a/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0f2546bfebeb715c1ac7a0c0d24c82374b1ba196 --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx @@ -0,0 +1,137 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +// L1Decoder includes +#include "EMRoIsUnpackingTool.h" +#include "TrigT1Result/RoIBResult.h" +#include "TrigT1Interfaces/TrigT1CaloDefs.h" + + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// +EMRoIsUnpackingTool::EMRoIsUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ) + : AthAlgTool ( type, name, parent ), + m_configSvc( "TrigConf::LVL1ConfigSvc/LVL1ConfigSvc", name ) { + + declareProperty( "Decisions", m_decisionsKey="EMRoIDecisions", "Decisions for each RoI" ); + declareProperty( "ThresholdToChainMapping", m_thresholdToChainProperty, "Mapping from the threshold name to chain in the form: 'EM3 : HLT_e5', 'EM3 : HLT_e5tight', ..., (note spaces)" ); + declareProperty( "OutputTrigRoIs", m_trigRoIsKey="EMRoIs", "Name of the RoIs object produced by the unpacker" ); + declareProperty( "OutputRecRoIs", m_recRoIsKey="RecEMRoIs", "Name of the RoIs object produced by the unpacker" ); + declareProperty( "RoIWidth", m_roIWidth = 0.1, "Size of RoI in eta/ phi" ); +} + + +EMRoIsUnpackingTool::~EMRoIsUnpackingTool(){ +} + + +StatusCode EMRoIsUnpackingTool::initialize() { + CHECK( m_configSvc.retrieve() ); + CHECK( m_decisionsKey.initialize() ); + CHECK( m_trigRoIsKey.initialize() ); + CHECK( m_recRoIsKey.initialize() ); + + if (decodeMapping().isFailure() ) { + ATH_MSG_ERROR( "Failed to decode threshold to chains mapping, is the format th : chain?" ); + return StatusCode::FAILURE; + } + return StatusCode::SUCCESS; +} + +StatusCode EMRoIsUnpackingTool::updateConfiguration() { + using namespace TrigConf; + + const ThresholdConfig* thresholdConfig = m_configSvc->thresholdConfig(); + auto filteredThresholds= thresholdConfig->getThresholdVector( L1DataDef::EM ); + ATH_MSG_DEBUG( "Number of filtered thresholds " << filteredThresholds.size() ); + for (auto th : filteredThresholds ) { + if ( th != nullptr ) { + ATH_MSG_DEBUG( "Found threshold in the configuration: " << th->name() << " of ID: " << HLT::Identifier(th->name()).numeric() ); + m_emThresholds.push_back(th); + } else { + ATH_MSG_DEBUG( "Nullptr to the threshold" ); + } + } + return StatusCode::SUCCESS; +} + + +StatusCode EMRoIsUnpackingTool::finalize() +{ + return StatusCode::SUCCESS; +} + + +StatusCode EMRoIsUnpackingTool::unpack( const EventContext& ctx, + const ROIB::RoIBResult& roib, + const HLT::IDSet& activeChains ) const { + using namespace TrigCompositeUtils; + auto decisionOutput = std::make_unique<DecisionContainer>(); + auto decisionAux = std::make_unique<DecisionAuxContainer>(); + decisionOutput->setStore(decisionAux.get()); + auto trigRoIs = std::make_unique< TrigRoiDescriptorCollection >(); + auto recRoIs = std::make_unique< DataVector<LVL1::RecEmTauRoI> >(); + + // RoIBResult contains vector of EM fragments + for ( auto& emTauFragment : roib.eMTauResult() ) { + for ( auto& roi : emTauFragment.roIVec() ) { + uint32_t roIWord = roi.roIWord(); + if ( not ( LVL1::TrigT1CaloDefs::EMRoIWordType == roi.roIType() ) ) { + ATH_MSG_DEBUG( "Skipping RoI as it is not EM threshold " << roIWord ); + continue; + } + + auto recRoI = new LVL1::RecEmTauRoI( roIWord, &m_emThresholds ); + recRoIs->push_back( recRoI ); + + auto trigRoI = new TrigRoiDescriptor( roIWord, 0u ,0u, + recRoI->eta(), recRoI->eta()-m_roIWidth, recRoI->eta()+m_roIWidth, + recRoI->phi(), recRoI->phi()-m_roIWidth, recRoI->phi()+m_roIWidth ); + trigRoIs->push_back( trigRoI ); + + ATH_MSG_DEBUG( "RoI word: 0x" << MSG::hex << std::setw(8) << roIWord << MSG::dec ); + + auto decision = TrigCompositeUtils::newDecisionIn( decisionOutput.get() ); + + for ( auto th: m_emThresholds ) { + ATH_MSG_VERBOSE( "Checking if the threshold " << th->name() << " passed" ); + if ( recRoI->passedThreshold( th->thresholdNumber() ) ) { + ATH_MSG_DEBUG("Passed Threshold name " << th->name()); + addChainsToDecision( HLT::Identifier( th->name() ), decision, activeChains ); + } + } + + // TODO would be nice to have this. Requires modifying the TC class: decision->setDetail("Thresholds", passedThresholds); // record passing threshold names (for easy debugging) + decision->setObjectLink( "initialRoI", ElementLink<TrigRoiDescriptorCollection>(m_trigRoIsKey.key(), trigRoIs->size()-1 ) ); + decision->setObjectLink( "initialRecRoI", ElementLink<DataVector<LVL1::RecEmTauRoI>>(m_recRoIsKey.key(), recRoIs->size()-1) ); + } + } + for ( auto roi: *trigRoIs ) { + ATH_MSG_DEBUG("RoI Eta: " << roi->eta() << " Phi: " << roi->phi() << " RoIWord: " << roi->roiWord()); + } + + // recording + { + SG::WriteHandle<TrigRoiDescriptorCollection> handle(m_trigRoIsKey, ctx); + CHECK( handle.record (std::move(trigRoIs)) ); + } + { + SG::WriteHandle<DataVector<LVL1::RecEmTauRoI>> handle(m_recRoIsKey, ctx); + CHECK( handle.record( std::move(recRoIs)) ); + } + { + auto handle = SG::makeHandle(m_decisionsKey, ctx); + CHECK ( handle.record( std::move( decisionOutput ), std::move( decisionAux ) ) ); + } + return StatusCode::SUCCESS; // what else + + + +} + diff --git a/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..cfd48eff417a414bdfa57cf8dc423d127e73d8e0 --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.h @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef L1DECODER_EMROISUNPACKINGTOOL_H +#define L1DECODER_EMROISUNPACKINGTOOL_H 1 + +// STL includes +#include <string> + +#include "TrigConfInterfaces/ILVL1ConfigSvc.h" +#include "TrigConfL1Data/ThresholdConfig.h" +#include "TrigConfL1Data/TriggerThreshold.h" +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" + +// FrameWork includes +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ServiceHandle.h" + +// L1Decoder includes +#include "./IRoIsUnpackingTool.h" + + +class EMRoIsUnpackingTool : virtual public AthAlgTool, virtual public IRoIsUnpackingTool { + + + public: + EMRoIsUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ); + + virtual ~EMRoIsUnpackingTool(); + + StatusCode unpack(const EventContext& ctx, + const ROIB::RoIBResult& roib, + const HLT::IDSet& activeChains) const override; + + // Athena algtool's Hooks + StatusCode initialize() override; + StatusCode updateConfiguration() override; + StatusCode finalize() override; + + private: + EMRoIsUnpackingTool(); + std::vector<TrigConf::TriggerThreshold*> m_emThresholds; + SG::WriteHandleKey< TrigRoiDescriptorCollection > m_trigRoIsKey; + SG::WriteHandleKey< DataVector<LVL1::RecEmTauRoI> > m_recRoIsKey; + ServiceHandle<TrigConf::ILVL1ConfigSvc> m_configSvc; + float m_roIWidth; +}; + +#endif //> !L1DECODER_EMROISUNPACKINGTOOL_H diff --git a/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5b4749c3100ad3adaffbe80c44a887d2c62dc45c --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.cxx @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include <iostream> +// L1Decoder includes +#include "IRoIsUnpackingTool.h" + + + +IRoIsUnpackingTool::~IRoIsUnpackingTool() +{} + + + +StatusCode IRoIsUnpackingTool::decodeMapping() { + std::istringstream input; + for ( auto entry: m_thresholdToChainProperty ) { + input.clear(); + input.str(entry); + std::string thresholdName; + char delim; + std::string chainName; + input >> thresholdName >> delim >> chainName; + if ( delim != ':' ) { + return StatusCode::FAILURE; + } + m_thresholdToChainMapping[HLT::Identifier(thresholdName)].push_back(HLT::Identifier(chainName)); + } + return StatusCode::SUCCESS; +} + +void IRoIsUnpackingTool::addChainsToDecision( HLT::Identifier thresholdId, + TrigCompositeUtils::Decision* d, + const HLT::IDSet& activeChains ) const { + auto chains = m_thresholdToChainMapping.find( thresholdId ); + if ( chains == m_thresholdToChainMapping.end() ) + return; + for ( auto chainId: chains->second ) { + if ( activeChains.find(chainId) != activeChains.end() ) + TrigCompositeUtils::addDecisionID( chainId.numeric(), d ); + } +} + + + + + diff --git a/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..d402cac5839f5b18c73a862aef6644c0e7807c35 --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.h @@ -0,0 +1,66 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef L1DECODER_IROISUNPACKINGTOOL_H +#define L1DECODER_IROISUNPACKINGTOOL_H 1 + +#include "GaudiKernel/IAlgTool.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "DecisionHandling/TrigCompositeUtils.h" +#include "DecisionHandling/HLTIdentifier.h" + +namespace ROIB { + class RoIBResult; +} + + +static const InterfaceID IID_IRoIsUnpackingTool("IRoIsUnpackingTool", 1, 0); + +class IRoIsUnpackingTool + : virtual public ::IAlgTool +{ + + public: + /** Destructor: + */ + virtual ~IRoIsUnpackingTool(); + + typedef HLT::IDtoIDVecMap ThresholdToIdentifiers; + + static const InterfaceID& interfaceID(); + + /* + @brief Invoked when there is a potential change of the configuration. Typically beginRun. + */ + virtual StatusCode updateConfiguration() = 0; + + + /* + @brief The methods reads the RoIB result object and unpacks fragment of it, depending of the implementation (i.e. EM, J..) + In addition to the impl. specific collection a collection of decision objects is created with each decision tagged by the chain ID it relates to. + The mapping of threshold IDs and the chains is provided externally at each call (may be refactored later as this is pure config information). + */ + virtual StatusCode unpack(const EventContext& ctx, + const ROIB::RoIBResult& roib, + const HLT::IDSet& activeChains) const = 0; + + + +protected: + + SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer> m_decisionsKey; + std::vector<std::string> m_thresholdToChainProperty; + std::map<HLT::Identifier, HLT::IDVec> m_thresholdToChainMapping; + + StatusCode decodeMapping(); + void addChainsToDecision( HLT::Identifier thresholdId, + TrigCompositeUtils::Decision* d, + const HLT::IDSet& activeChains ) const; +}; + +inline const InterfaceID& IRoIsUnpackingTool::interfaceID() { + return IID_IRoIsUnpackingTool; +} + + +#endif //> !L1DECODER_IROISUNPACKINGTOOL_H diff --git a/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..44e1e643a45875e4be56ec2d1089dbcfa0eafd87 --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx @@ -0,0 +1,58 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +// L1Decoder includes +#include "JRoIsUnpackingTool.h" + +// STL includes + +// FrameWork includes +#include "GaudiKernel/IToolSvc.h" + +// StoreGate +#include "StoreGate/StoreGateSvc.h" + + + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// +JRoIsUnpackingTool::JRoIsUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ) : + ::AthAlgTool ( type, name, parent ) +{ + // + // Property declaration + // + //declareProperty( "Property", m_nProperty ); + +} + +// Destructor +/////////////// +JRoIsUnpackingTool::~JRoIsUnpackingTool() +{} + +// Athena algtool's Hooks +//////////////////////////// +StatusCode JRoIsUnpackingTool::initialize() +{ + ATH_MSG_INFO ("Initializing " << name() << "..."); + + + return StatusCode::SUCCESS; +} + +StatusCode JRoIsUnpackingTool::finalize() +{ + ATH_MSG_INFO ("Finalizing " << name() << "..."); + + return StatusCode::SUCCESS; +} + + + diff --git a/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..6ec9b71e888255d703921977df1375767b27405a --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.h @@ -0,0 +1,55 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef L1DECODER_JROISUNPACKINGTOOL_H +#define L1DECODER_JROISUNPACKINGTOOL_H 1 + + +#include <string> + +// FrameWork includes +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ServiceHandle.h" + +// L1Decoder includes +#include "./IRoIsUnpackingTool.h" + +// Forward declaration +class StoreGateSvc; + + + +class JRoIsUnpackingTool + : virtual public ::IRoIsUnpackingTool, + public ::AthAlgTool +{ + + + public: + + // Copy constructor: + + /// Constructor with parameters: + JRoIsUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ); + + /// Destructor: + virtual ~JRoIsUnpackingTool(); + StatusCode updateConfiguration() override { return StatusCode::SUCCESS; } + // Athena algtool's Hooks + virtual StatusCode initialize(); + virtual StatusCode finalize(); + + private: + + /// Default constructor: + JRoIsUnpackingTool(); + + + + +}; + + +#endif //> !L1DECODER_JROISUNPACKINGTOOL_H diff --git a/Trigger/TrigSteer/L1Decoder/src/L1CaloDecoder.cxx b/Trigger/TrigSteer/L1Decoder/src/L1CaloDecoder.cxx index f87c22410017e6cd68c04ce5b83125b879d00890..8a9b90d2e275a7964d9775965b8eb8fcde987c15 100644 --- a/Trigger/TrigSteer/L1Decoder/src/L1CaloDecoder.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/L1CaloDecoder.cxx @@ -7,6 +7,7 @@ #include "CxxUtils/make_unique.h" #include "L1Decoder/TrigIdentifiers.h" #include "TrigT1Interfaces/RecEmTauRoI.h" + #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" #include "TrigSteeringEvent/Lvl1Result.h" #include "TrigT1Result/RoIBResult.h" @@ -69,11 +70,7 @@ StatusCode L1CaloDecoder::execute() { return StatusCode::RECOVERABLE; } - // create view (BEN: for now don't do it until we've got the scheduling going) - /* m_view = CxxUtils::make_unique< std::vector<SG::View*>>(); - IProxyDict * view = new SG::View("L1CaloDecoderView"); - m_view->push_back(view); - */ + IProxyDict * view = 0; // redirect handles to that view diff --git a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx index af3662535e6c3854c58aacf46aa1bac7d8fb52fa..2c9bda3fedef7ed5bd33299aae6dfce85da4ee45 100644 --- a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx @@ -1,20 +1,115 @@ /* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ - +#include "xAODTrigger/TrigCompositeAuxContainer.h" #include "./L1Decoder.h" - L1Decoder::L1Decoder(const std::string& name, ISvcLocator* pSvcLocator) - : AthAlgorithm(name, pSvcLocator) {} + : AthReentrantAlgorithm(name, pSvcLocator), + m_ctpUnpacker("CTPUnpackingTool/CTPUnpackingTool", this), + m_roiUnpackers(this) { + + declareProperty("RoIBResult", m_RoIBResultKey="RoIBResult", "Name of RoIBResult"); + declareProperty("Chains", m_chainsKey="HLTChains", "Chains status after L1 and prescaling"); + declareProperty("ctpUnpacker", m_ctpUnpacker, "Tool used to unpack the CTP info"); + declareProperty("roiUnpackers", m_roiUnpackers, "Tools unpacking RoIs"); +} + StatusCode L1Decoder::initialize() { + CHECK( m_RoIBResultKey.initialize() ); + CHECK( m_chainsKey.initialize() ); + + CHECK( m_ctpUnpacker.retrieve() ); + CHECK( m_roiUnpackers.retrieve() ); + // CHECK( m_prescaler.retrieve() ); + + + return StatusCode::SUCCESS; } -StatusCode L1Decoder::execute() { + +StatusCode L1Decoder::beginRun() { + for ( auto t: m_roiUnpackers ) + CHECK( t->updateConfiguration() ); return StatusCode::SUCCESS; } + + +StatusCode L1Decoder::readConfiguration() { + return StatusCode::SUCCESS; +} + +StatusCode L1Decoder::execute_r (const EventContext& ctx) const { + using namespace TrigCompositeUtils; + SG::ReadHandle<ROIB::RoIBResult> roibH( m_RoIBResultKey, ctx ); + ATH_MSG_DEBUG( "Obtained ROIB result" ); + // this should realy be: const ROIB::RoIBResult* roib = SG::INPUT_PTR (m_RoIBResultKey, ctx); + // or const ROIB::RoIBResult& roib = SG::INPUT_REF (m_RoIBResultKey, ctx); + + + + auto chainsInfo = std::make_unique<DecisionContainer>(); + auto chainsAux = std::make_unique<DecisionAuxContainer>(); + chainsInfo->setStore(chainsAux.get()); + + HLT::IDVec l1SeededChains; + CHECK( m_ctpUnpacker->decode( *roibH, l1SeededChains ) ); + sort( l1SeededChains.begin(), l1SeededChains.end() ); // do so that following scaling is reproducable + + HLT::IDVec activeChains; + activeChains.reserve( l1SeededChains.size() ); // an optimisation, max we get as many active chains as were seeded by L1, rarely the condition, but allows to avoid couple of reallocations + CHECK( prescaleChains( l1SeededChains, activeChains) ); + + CHECK( saveChainsInfo( l1SeededChains, chainsInfo.get(), "l1seeded" ) ); + CHECK( saveChainsInfo( activeChains, chainsInfo.get(), "unprescaled" ) ); + + HLT::IDSet activeChainSet( activeChains.begin(), activeChains.end() ); + for ( auto unpacker: m_roiUnpackers ) { + CHECK( unpacker->unpack( ctx, *roibH, activeChainSet ) ); + } + ATH_MSG_DEBUG("Recording chains"); + + auto handle = SG::makeHandle( m_chainsKey, ctx ); + CHECK( handle.record( std::move( chainsInfo ), std::move( chainsAux ) ) ); + + return StatusCode::SUCCESS; +} + StatusCode L1Decoder::finalize() { return StatusCode::SUCCESS; } +StatusCode L1Decoder::prescaleChains( const HLT::IDVec& active, + HLT::IDVec& notPrescaled ) const { + // intention is to use the same RNG scalers as in current steering version but it has to be refactored as follows + // read in the CTP info and get the time + // auto ScalerState state = HLT::RandomScaler::initState(ctx); + // + + for ( auto c: active ) { + auto psInfo = m_prescalingInfo.find( c ); + if ( psInfo == m_prescalingInfo.end() ) { + ATH_MSG_INFO("No prescaling information for the chain, enabling it " << c); + notPrescaled.push_back( c ); + } else { + + // this code should then work + // if ( scaler.decision( state, psInfo.second ) ) { + // notPrescaled.push_back(c); + // ATH_MSG_DEBUG("Chain " << c << " remained active after the HTL prescaling"); + // but for now + notPrescaled.push_back(c); + } + } + return StatusCode::SUCCESS; +} + +StatusCode L1Decoder::saveChainsInfo(const HLT::IDVec& chains, xAOD::TrigCompositeContainer* storage, const std::string& type) const { + using namespace TrigCompositeUtils; + Decision* d = newDecisionIn( storage ); + d->setName(type); + for ( auto c: chains) + addDecisionID(c.numeric(), d); + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.h b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.h index 7bbed704b65f1cd34b7c500d6d5911a5628a1f2d..d58deb74b46cb5941de47db5747f6f6e1ecda793 100644 --- a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.h +++ b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.h @@ -5,19 +5,49 @@ #ifndef L1Decoder_L1Decoder_h #define L1Decoder_L1Decoder_h -#include "AthenaBaseComps/AthAlgorithm.h" -class L1Decoder : public AthAlgorithm { +#include "DecisionHandling/HLTIdentifier.h" +#include "DecisionHandling/TrigCompositeUtils.h" +#include "xAODTrigger/TrigCompositeContainer.h" +#include "TrigT1Result/RoIBResult.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "CTPUnpackingTool.h" +#include "IRoIsUnpackingTool.h" + + +/* + @brief an algorithm used to unpack the RoIB result and provide CTP bits, active chains and RoIs + + All the unpacking is outsourced to tools. However the menu mapping, this is from CTP items to chains + and threshods to chains is maintained in this algorithm and provided to unpacking tools. + */ + +class L1Decoder : public AthReentrantAlgorithm { public: L1Decoder(const std::string& name, ISvcLocator* pSvcLocator); StatusCode initialize(); - StatusCode execute(); + StatusCode beginRun(); + StatusCode execute_r (const EventContext& ctx) const override; StatusCode finalize(); -private: - // RHandle<> m_caloRoIs; - // can demand objects -}; +protected: // protected to support unit testing + // StatusCode flagPassingRoIs(TrigCompositeUtils::DecisionContainer* rois, + // const xAOD::TrigCompositeUtils* chains) const; + virtual StatusCode readConfiguration(); + StatusCode prescaleChains(const HLT::IDVec& active, + HLT::IDVec& prescaled) const; + StatusCode saveChainsInfo(const HLT::IDVec& chains, + xAOD::TrigCompositeContainer* storage, + const std::string& type) const; + +private: + SG::ReadHandleKey<ROIB::RoIBResult> m_RoIBResultKey; + SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_chainsKey; + ToolHandle<CTPUnpackingTool> m_ctpUnpacker; // = ToolHandle<CTPUnpackingTool>("CTPUnpackingTool/CTPUnpackingTool", this); // last arg makes it private tool + // ToolHandle<PrescalingTool> m_prescaler = ToolHandle<PrescalingTool>("PrescalingTool/PrescalingTool", this); + ToolHandleArray<IRoIsUnpackingTool> m_roiUnpackers; // = ToolHandleArray<IRoIsUnpackingTool>(this); + std::map<HLT::Identifier, float> m_prescalingInfo; +}; #endif diff --git a/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..70b364b1094ab48dea43a54e2eea866d0df6194f --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.cxx @@ -0,0 +1,122 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#include "MURoIsUnpackingTool.h" +#include "TrigT1Result/RoIBResult.h" +#include "TrigT1Interfaces/TrigT1CaloDefs.h" + + + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// +MURoIsUnpackingTool::MURoIsUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ) + : AthAlgTool ( type, name, parent ), + m_configSvc( "TrigConf::LVL1ConfigSvc/LVL1ConfigSvc", name ), + m_recRpcRoISvc( "LVL1RPC::RPCRecRoiSvc/RPCRecRoiSvc", name ), + m_recTgcRoISvc( "LVL1TGC::TGCRecRoiSvc/TGCRecRoiSvc", name ) { + + declareProperty( "Decisions", m_decisionsKey="MURoIDecisions", "Decisions for each RoI" ); + declareProperty( "ThresholdToChainMapping", m_thresholdToChainProperty, "Mapping from the threshold name to chain in the form: 'EM3:HLT_e5', 'EM3:HLT_e5tight', ..." ); + declareProperty( "OutputTrigRoIs", m_trigRoIsKey="MURoIs", "Name of the RoIs object produced by the unpacker" ); + declareProperty( "OutputRecRoIs", m_recRoIsKey ="RecMURoIs", "Name of the RoIs object produced by the unpacker" ); + declareProperty( "RoIWidth", m_roIWidth = 0.1, "Size of RoI in eta/ phi" ); +} + +// Destructor +/////////////// +MURoIsUnpackingTool::~MURoIsUnpackingTool(){} + +// Athena algtool's Hooks +//////////////////////////// +StatusCode MURoIsUnpackingTool::initialize() { + CHECK( m_configSvc.retrieve() ); + CHECK( m_decisionsKey.initialize() ); + CHECK( m_trigRoIsKey.initialize() ); + CHECK( m_recRoIsKey.initialize() ); + CHECK( m_recRpcRoISvc.retrieve() ); + CHECK( m_recTgcRoISvc.retrieve() ); + if (decodeMapping().isFailure() ) { + ATH_MSG_ERROR( "Failed to decode threshold to chains mapping, is the format th : chain?" ); + return StatusCode::FAILURE; + } + return StatusCode::SUCCESS; +} + +StatusCode MURoIsUnpackingTool::updateConfiguration() { + using namespace TrigConf; + const ThresholdConfig* thresholdConfig = m_configSvc->thresholdConfig(); + for (TriggerThreshold * th : thresholdConfig->getThresholdVector( L1DataDef::MUON ) ) { + if ( th != nullptr ) { + ATH_MSG_DEBUG( "Found threshold in the configuration: " << th->name() << " of ID: " << HLT::Identifier(th->name()).numeric() ); + m_muonThresholds.push_back(th); + } + } + return StatusCode::SUCCESS; +} + +StatusCode MURoIsUnpackingTool::finalize() { + return StatusCode::SUCCESS; +} + +StatusCode MURoIsUnpackingTool::unpack( const EventContext& ctx, + const ROIB::RoIBResult& roib, + const HLT::IDSet& activeChains ) const { + using namespace TrigCompositeUtils; + auto decisionOutput = std::make_unique<DecisionContainer>(); + auto decisionAux = std::make_unique<DecisionAuxContainer>(); + decisionOutput->setStore(decisionAux.get()); + + auto trigRoIs = std::make_unique< TrigRoiDescriptorCollection >(); + auto recRoIs = std::make_unique< DataVector<LVL1::RecMuonRoI> >(); + + for ( auto& roi : roib.muCTPIResult().roIVec() ) { + const uint32_t roIWord = roi.roIWord(); + int thresholdNumber = roi.pt(); + if ( thresholdNumber < 1 or thresholdNumber > 6 ) { + ATH_MSG_WARNING( "Incorrect threshold number, should be between 1 and 6 but is: " + << thresholdNumber << ", force setting it to 1" ); + thresholdNumber = 1; + } + LVL1::RecMuonRoI* recRoI = new LVL1::RecMuonRoI(roIWord, m_recRpcRoISvc.get(), m_recTgcRoISvc.get(), &m_muonThresholds); + recRoIs->push_back(recRoI); + auto trigRoI = new TrigRoiDescriptor( roIWord, 0u ,0u, + recRoI->eta(), recRoI->eta()-m_roIWidth, recRoI->eta()+m_roIWidth, + recRoI->phi(), recRoI->phi()-m_roIWidth, recRoI->phi()+m_roIWidth ); + trigRoIs->push_back( trigRoI ); + + ATH_MSG_DEBUG( "RoI word: 0x" << MSG::hex << std::setw(8) << roIWord << ", threshold pattern "); + + auto decision = TrigCompositeUtils::newDecisionIn( decisionOutput.get() ); + + for ( auto th: m_muonThresholds ) { + if ( th->thresholdNumber() <= thresholdNumber ) { // TODO verify if here should be <= or < + // this code suggests <= https://gitlab.cern.ch/atlas/athena/blob/master/Trigger/TrigSteer/TrigSteering/src/Lvl1ResultAccessTool.cxx#L654 + addChainsToDecision( HLT::Identifier( th->name() ), decision, activeChains ); + } + } + } + + // recording + { + auto handle = SG::makeHandle( m_trigRoIsKey, ctx ); + CHECK( handle.record( std::move(trigRoIs) ) ); + } + { + auto handle = SG::makeHandle( m_recRoIsKey, ctx ); + CHECK( handle.record( std::move(recRoIs) ) ); + } + { + auto handle = SG::makeHandle( m_decisionsKey, ctx ); + CHECK( handle.record( std::move(decisionOutput) ) ); + } + return StatusCode::SUCCESS; +} + + + diff --git a/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..7ee84dbdf37a6704b6157a314e193edca1e2a915 --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.h @@ -0,0 +1,75 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef L1DECODER_MUROISUNPACKINGTOOL_H +#define L1DECODER_MUROISUNPACKINGTOOL_H 1 + + +#include <string> +#include "TrigConfInterfaces/ILVL1ConfigSvc.h" +#include "TrigConfL1Data/ThresholdConfig.h" +#include "TrigConfL1Data/TriggerThreshold.h" + +#include "TrigT1Interfaces/RecMuonRoI.h" +#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" + + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ServiceHandle.h" +#include "TrigT1Interfaces/RecMuonRoI.h" +#include "TrigT1Interfaces/RecMuonRoiSvc.h" + + +#include "IRoIsUnpackingTool.h" + + +class MURoIsUnpackingTool + : virtual public ::IRoIsUnpackingTool, + public ::AthAlgTool +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + // Copy constructor: + + /// Constructor with parameters: + MURoIsUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ); + + /// Destructor: + virtual ~MURoIsUnpackingTool(); + + // Athena algtool's Hooks + StatusCode initialize() override; + StatusCode updateConfiguration() override; + StatusCode finalize() override; + StatusCode unpack(const EventContext& ctx, + const ROIB::RoIBResult& roib, + const HLT::IDSet& activeChains) const override; +private: + + /// Default constructor: + MURoIsUnpackingTool(); + + std::vector<TrigConf::TriggerThreshold*> m_muonThresholds; + SG::WriteHandleKey< TrigRoiDescriptorCollection > m_trigRoIsKey; + SG::WriteHandleKey< DataVector<LVL1::RecMuonRoI> > m_recRoIsKey; + ServiceHandle<TrigConf::ILVL1ConfigSvc> m_configSvc; + ServiceHandle<LVL1::RecMuonRoiSvc> m_recRpcRoISvc; + ServiceHandle<LVL1::RecMuonRoiSvc> m_recTgcRoISvc; + float m_roIWidth; +}; + +// I/O operators +////////////////////// + +/////////////////////////////////////////////////////////////////// +// Inline methods: +/////////////////////////////////////////////////////////////////// + + +#endif //> !L1DECODER_MUROISUNPACKINGTOOL_H diff --git a/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c2eea8f961713c0fbf69e2e4b8256e03f949d7cf --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.cxx @@ -0,0 +1,83 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +// L1Decoder includes +#include "TAURoIsUnpackingTool.h" + +// STL includes + +// FrameWork includes +#include "GaudiKernel/IToolSvc.h" + +// StoreGate +#include "StoreGate/StoreGateSvc.h" + + + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// +TAURoIsUnpackingTool::TAURoIsUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ) : + ::AthAlgTool ( type, name, parent ), + m_storeGate( "StoreGateSvc", name ) +{ + // + // Property declaration + // + //declareProperty( "Property", m_nProperty ); + +} + +// Destructor +/////////////// +TAURoIsUnpackingTool::~TAURoIsUnpackingTool() +{} + +// Athena algtool's Hooks +//////////////////////////// +StatusCode TAURoIsUnpackingTool::initialize() +{ + ATH_MSG_INFO ("Initializing " << name() << "..."); + + // Get pointer to StoreGateSvc and cache it : + if ( !m_storeGate.retrieve().isSuccess() ) { + ATH_MSG_ERROR ("Unable to retrieve pointer to StoreGateSvc"); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +StatusCode TAURoIsUnpackingTool::finalize() +{ + ATH_MSG_INFO ("Finalizing " << name() << "..."); + + return StatusCode::SUCCESS; +} + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + + diff --git a/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..aeed27a4f01b8b384004b9c00fc4c373509e06ad --- /dev/null +++ b/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.h @@ -0,0 +1,79 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef L1DECODER_TAUROISUNPACKINGTOOL_H +#define L1DECODER_TAUROISUNPACKINGTOOL_H 1 + +// STL includes +#include <string> + +// FrameWork includes +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ServiceHandle.h" + +// L1Decoder includes +#include "IRoIsUnpackingTool.h" + +// Forward declaration +class StoreGateSvc; + + + +class TAURoIsUnpackingTool + : virtual public ::IRoIsUnpackingTool, + public ::AthAlgTool +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + // Copy constructor: + + /// Constructor with parameters: + TAURoIsUnpackingTool( const std::string& type, + const std::string& name, + const IInterface* parent ); + + /// Destructor: + virtual ~TAURoIsUnpackingTool(); + StatusCode updateConfiguration() override { return StatusCode::SUCCESS; } + // Athena algtool's Hooks + virtual StatusCode initialize(); + virtual StatusCode finalize(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Non-const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Private data: + /////////////////////////////////////////////////////////////////// + private: + + /// Default constructor: + TAURoIsUnpackingTool(); + + typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; + /// Pointer to the StoreGate service + StoreGateSvc_t m_storeGate; + + // Containers + + +}; + +// I/O operators +////////////////////// + +/////////////////////////////////////////////////////////////////// +// Inline methods: +/////////////////////////////////////////////////////////////////// + + +#endif //> !L1DECODER_TAUROISUNPACKINGTOOL_H diff --git a/Trigger/TrigSteer/L1Decoder/src/components/L1Decoder_entries.cxx b/Trigger/TrigSteer/L1Decoder/src/components/L1Decoder_entries.cxx index fa1df1eaa6394eeda073902db1eda7498b97666e..d8e559e151899568d583b3d2f244f16ad64bc809 100644 --- a/Trigger/TrigSteer/L1Decoder/src/components/L1Decoder_entries.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/components/L1Decoder_entries.cxx @@ -1,22 +1,36 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ #include "GaudiKernel/DeclareFactoryEntries.h" #include "../L1CaloDecoder.h" #include "../FakeRoI.h" #include "../FakeRoIView.h" //#include "../RoIGraph.h" +#include "../L1Decoder.h" #include "../FakeCTP.h" +#include "../CTPUnpackingTool.h" +#include "../EMRoIsUnpackingTool.h" +#include "../MURoIsUnpackingTool.h" DECLARE_ALGORITHM_FACTORY(L1CaloDecoder) DECLARE_ALGORITHM_FACTORY(FakeRoI) //DECLARE_ALGORITHM_FACTORY(RoIGraph) DECLARE_ALGORITHM_FACTORY(FakeCTP) +DECLARE_ALGORITHM_FACTORY(L1Decoder) DECLARE_NAMESPACE_ALGORITHM_FACTORY( AthViews, FakeRoIView ) +DECLARE_TOOL_FACTORY(CTPUnpackingTool) +DECLARE_TOOL_FACTORY(EMRoIsUnpackingTool) +DECLARE_TOOL_FACTORY(MURoIsUnpackingTool) DECLARE_FACTORY_ENTRIES( L1Decoder ) { DECLARE_ALGORITHM(L1CaloDecoder) DECLARE_ALGORITHM(FakeRoI) - // DECLARE_ALGORITHM(RoIGraph) DECLARE_ALGORITHM(FakeCTP) + DECLARE_ALGORITHM(L1Decoder) DECLARE_NAMESPACE_ALGORITHM( AthViews, FakeRoIView ) + DECLARE_TOOL(CTPUnpackingTool) + DECLARE_TOOL(EMRoIsUnpackingTool) + DECLARE_TOOL(MURoIsUnpackingTool) } diff --git a/Trigger/TrigSteer/L1Decoder/src/components/L1Decoder_load.cxx b/Trigger/TrigSteer/L1Decoder/src/components/L1Decoder_load.cxx index fd7aa8fc3ea34770b86ee1b6e3ee0ea720b93089..22f19fb64cba0ef2bd091c2e030c397d75e5abc8 100644 --- a/Trigger/TrigSteer/L1Decoder/src/components/L1Decoder_load.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/components/L1Decoder_load.cxx @@ -1,3 +1,6 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ #include "GaudiKernel/LoadFactoryEntries.h" LOAD_FACTORY_ENTRIES( L1Decoder ) diff --git a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt index 00eb49d4e4803f6c2ae65a04f09c14362f5e6f37..8bc50dc12b5839c725857dd131ac9e16a51db270 100644 --- a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt +++ b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt @@ -9,8 +9,8 @@ atlas_subdir( ViewAlgs ) atlas_depends_on_subdirs( PUBLIC Event/xAOD/xAODTrigger GaudiKernel - Control/AthContainers - Control/AthLinks + Control/AthContainers + Control/AthLinks PRIVATE Control/AthViews Control/StoreGate @@ -30,4 +30,3 @@ atlas_add_library( ViewAlgsLib atlas_add_component( ViewAlgs src/components/*.cxx LINK_LIBRARIES xAODTrigger GaudiKernel AthViews AthenaBaseComps CxxUtils TrigConfHLTData TrigSteeringEvent ViewAlgsLib ) -