14 ISvcLocator* pSvcLocator )
26 return StatusCode::SUCCESS;
32 return StatusCode::SUCCESS;
44 auto reco_output = std::make_unique<xAOD::TrigCompositeContainer>();
45 auto aux = std::make_unique<xAOD::TrigCompositeAuxContainer>();
46 reco_output->setStore(
aux.get() );
47 std::vector<const FeatureOBJ*> featuresFromDecision;
50 if( not outputHandle.
isValid() ) {
51 ATH_MSG_ERROR(
"TestInputMaker: Got no decisions from output "<< outputHandle.
key() <<
" because handle not valid");
52 return StatusCode::FAILURE;
54 if( outputHandle->size() == 0){
55 ATH_MSG_ERROR(
"TestInputMaker: Got no decisions from output "<< outputHandle.
key()<<
": handle is valid but container is empty.");
56 return StatusCode::FAILURE;
59 ATH_MSG_DEBUG(
"TestInputMaker: Got output "<< outputHandle.
key()<<
" with " << outputHandle->size() <<
" elements" );
62 for (
const auto outputDecision : *outputHandle){
63 const std::vector<ElementLink<DecisionContainer>> inputLinks =
getLinkToPrevious(outputDecision);
65 for (
const auto& input: inputLinks){
66 ATH_MSG_DEBUG(
" -- Got seed link to input "<<input.dataID() <<
" and index "<< input.index() );
67 const Decision* inputDecision = *input;
69 CHECK( roiELInfo.isValid() );
73 CHECK( featureLinkInfo.isValid() );
76 const auto featureLink = featureLinkInfo.link;
83 if (
find(featuresFromDecision.begin(), featuresFromDecision.end(), feature) == featuresFromDecision.end() ){
84 featuresFromDecision.push_back(feature);
87 reco_output->push_back(newFeature);
88 newFeature->setObjectLink(
m_linkName.value(), featureLink);
100 CHECK( reco_outputHandle.record(std::move(reco_output), std::move(
aux)) );
105 return StatusCode::SUCCESS;
#define CHECK(...)
Evaluate an expression and check for errors.
bool msgLvl(const MSG::Level lvl) const
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
xAOD::TrigComposite Decision
const Decision * find(const Decision *start, const std::function< bool(const Decision *)> &filter)
traverses Decision object links for another Decision object fulfilling the prerequisite specified by ...
const std::vector< ElementLink< DecisionContainer > > getLinkToPrevious(const Decision *d)
returns links to previous decision object 'seed'
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
LinkInfo< T > findLink(const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision obj...
TrigComposite_v1 TrigComposite
Declare the latest version of the class.