Skip to content
Snippets Groups Projects
Commit dbf844a8 authored by Stewart Martin-Haugh's avatar Stewart Martin-Haugh
Browse files

Merge branch 'master-trig-decisionhandling-base-classes' into 'master'

first version of InputMakerBase

See merge request atlas/athena!9761

Former-commit-id: 37ce9a288221eda5c1583c815771863784b0dd04
parents a05bb4f8 3b2d138c
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#ifndef DECISIONHANDLING_INPUTMAKERBASE_H
#define DECISIONHANDLING_INPUTMAKERBASE_H 1
#include "DecisionHandling/TrigCompositeUtils.h"
#include "AthenaBaseComps/AthAlgorithm.h"
#include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "StoreGate/ReadHandleKeyArray.h"
class InputMakerBase : public ::AthReentrantAlgorithm {
/**
* @class InputMakerBase
* @brief Input Makers are used at the start of a sequence: retrieve filtered collection via the input decision from the previous step and write it out directly so it can be used as input by the reco alg that follows in sequence.
This is a base class for HLT InputMakers to reduce boilerplate and enforce the common naming scheme for decision handle keys. Derived classes will have to add specific reco data read & write keys to suit their purpose.
**/
public:
/// initialise this base class and renounce input decision key handles
StatusCode initialize() override;
/// execute to be implemented in derived clas
virtual StatusCode execute_r(const EventContext&) const = 0;
//StatusCode execute(){};
virtual StatusCode finalize() = 0;
/// special method for initialisation of derived classes, to be implemented by them, called from base class initialize
virtual StatusCode subInitialize()= 0;
protected:
/// methods for derived classes to access handles of the base class input and output decisions; other read/write handles may be implemented by derived classes
const SG::ReadHandleKeyArray<TrigCompositeUtils::DecisionContainer>& decisionInputs() const;
const SG::WriteHandleKeyArray<TrigCompositeUtils::DecisionContainer>& decisionOutputs() const;
private:
/// input decisions, will be implicit (renounced).
SG::ReadHandleKeyArray<TrigCompositeUtils::DecisionContainer> m_inputs { this, "InputDecisions", {}, "Input Decisions (implicit)" };
/// output decisions
SG::WriteHandleKeyArray<TrigCompositeUtils::DecisionContainer> m_outputs { this, "OutputDecisions", {}, "Ouput Decisions" };
};
#endif // DECISIONHANDLING_INPUTMAKERBASE_H
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#include "DecisionHandling/InputMakerBase.h"
const SG::ReadHandleKeyArray<TrigCompositeUtils::DecisionContainer>& InputMakerBase::decisionInputs() const{
return m_inputs;
}
const SG::WriteHandleKeyArray<TrigCompositeUtils::DecisionContainer>& InputMakerBase::decisionOutputs() const{
return m_outputs;
}
StatusCode InputMakerBase::initialize() {
CHECK( m_inputs.initialize() );
renounceArray(m_inputs); // make inputs implicit, not required by scheduler
ATH_MSG_DEBUG("Will consume implicit decisions:" );
for (auto& input: m_inputs){
ATH_MSG_DEBUG( " "<<input.key() );
}
ATH_MSG_DEBUG(" and produce decisions: " << m_outputs );
for (auto& output: m_outputs){
ATH_MSG_DEBUG( " "<<output.key() );
}
// initialise sub class
CHECK ( subInitialize() );
return StatusCode::SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment