ATLAS Offline Software
Loading...
Searching...
No Matches
LinkInfo.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGCOMPOSITEUTILS_LINKINFO_H
6#define TRIGCOMPOSITEUTILS_LINKINFO_H
7
9#include "AthLinks/ElementLink.h"
11#include "ActiveState.h"
12#include "TypelessLinkInfo.h"
13
14#include <optional>
15#include <unordered_set>
16
17namespace TrigCompositeUtils {
21 template<typename T>
22 struct LinkInfo {
23 LinkInfo() = default;
25 : source{s}, link{l}, state{as} {
26 if (s) decisions.emplace(s->decisions().begin(), s->decisions().end());
27 }
28
30 : source{s}, link{l}, state{as} {
31 decisions.emplace(decisionIDs.begin(), decisionIDs.end());
32 }
33
35 }
36
37 bool isValid() const {
38 return source && link.isValid();
39 }
40
43 operator StatusCode () {
44 return (isValid() ? StatusCode::SUCCESS : StatusCode::FAILURE);
45 }
46
53 const Decision* source{nullptr};
60 std::optional<std::unordered_set<DecisionID>> decisions;
61 };
62} //> end namespace TrigCompositeUtils
63
64#endif //> !TRIGCOMPOSITEUTILS_LINKINFO_H
ActiveState
Additional information returned by the TrigerDecisionTool's feature retrieval, contained within the L...
Definition ActiveState.h:18
@ UNSET
Default property of state.
Definition ActiveState.h:19
std::set< DecisionID > DecisionIDContainer
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
LinkInfo()=default
LinkInfo(const Decision *s, const ElementLink< T > &l, ActiveState as, const DecisionIDContainer &decisionIDs)
Definition LinkInfo.h:29
LinkInfo(const Decision *s, const ElementLink< T > &l, ActiveState as=ActiveState::UNSET)
Definition LinkInfo.h:24
LinkInfo(const TypelessLinkInfo &li, const ElementLink< T > &l)
Definition LinkInfo.h:34
std::optional< std::unordered_set< DecisionID > > decisions
Definition LinkInfo.h:60
ElementLink< TrigRoiDescriptorCollection > link
Definition LinkInfo.h:55
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...