|
ATLAS Offline Software
|
Go to the documentation of this file.
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){
68 const auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( inputDecision,
m_roisLink.value());
69 CHECK( roiELInfo.isValid() );
72 const auto featureLinkInfo = TrigCompositeUtils::findLink<FeatureContainer>( inputDecision,
m_linkName.value());
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);
100 CHECK( reco_outputHandle.record(std::move(reco_output), std::move(aux)) );
105 return StatusCode::SUCCESS;
std::string find(const std::string &s)
return a remapped string
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
bool msgLvl(const MSG::Level lvl) const
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
const std::vector< ElementLink< DecisionContainer > > getLinkToPrevious(const Decision *d)
returns links to previous decision object 'seed'
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
Class used to describe composite objects in the HLT.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
size_type size() const noexcept
Returns the number of elements in the collection.