ATLAS Offline Software
Loading...
Searching...
No Matches
InputMakerBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef DECISIONHANDLING_INPUTMAKERBASE_H
6#define DECISIONHANDLING_INPUTMAKERBASE_H 1
7
11
21
22 public:
24 InputMakerBase( const std::string& name, ISvcLocator* pSvcLocator );
26 virtual ~InputMakerBase();
28 virtual StatusCode sysInitialize() override;
29
30 protected:
36 void setMatchingHash(const TrigCompositeUtils::Decision* inputDecision, const uint64_t matchingHash);
37 void linkOutputToInput(const TrigCompositeUtils::Decision* outputDecision, const TrigCompositeUtils::Decision* inputDecision);
38 uint64_t getMatchingHash(const TrigCompositeUtils::Decision* outputDecision) const;
39 std::map<const TrigCompositeUtils::Decision*, const TrigCompositeUtils::Decision*> m_outputDecToInputDec;
40 std::map<const TrigCompositeUtils::Decision*, uint64_t> m_inputDecToMatchingHash;
41 };
42
45
48
49 // name of link to the RoI
50 StringProperty m_roisLink {this, "RoIsLink", "initialRoI",
51 "Name of EL to RoI object linked to the decision, used in merging input Decision objects when mergeUsingFeature=False." };
52
53 Gaudi::Property<bool> m_mergeUsingFeature {this, "mergeUsingFeature", false,
54 "True=the IParicle-derived feature from the previous step is used to determine identical inputs. False=the ROI located with the RoIsLink property is used to determine identical inputs" };
55
56 Gaudi::Property<bool> m_isEmptyStep {this, "isEmptyStep", false,
57 "True if this InputMaker instance is being used in an empty step. Forgoes the requirement to link an ROI, and auto-configures the 'mergeUsingFeature' property at runtime." };
58
59 // helper methods for derived classes to reduce boiler plate code //
61
63 void debugPrintOut(const EventContext& context, SG::WriteHandle<TrigCompositeUtils::DecisionContainer>& outputHandle) const;
64
66 StatusCode decisionInputToOutput(const EventContext& context, SG::WriteHandle<TrigCompositeUtils::DecisionContainer>& outputHandle) const;
67
69 size_t matchDecision(const TrigCompositeUtils::DecisionContainer* outDecisions,
70 const TrigCompositeUtils::Decision* toMatch,
71 const std::string& linkNameToMatch,
72 MatchingCache& matchingCache) const;
73
76 const TrigCompositeUtils::Decision* toMatch,
77 size_t& matchIndex,
78 bool& usedROIMatchingFlag,
79 MatchingCache& matchingCache) const;
80
82 uint64_t getMatchingHashForDecision(const TrigCompositeUtils::Decision* toMatch, const std::string& linkNameToMatch) const;
83
84 private:
85
87 SG::ReadHandleKeyArray<TrigCompositeUtils::DecisionContainer> m_inputs { this, "InputMakerInputDecisions", {}, "Input Decisions (implicit)" };
88
90 SG::WriteHandleKey<TrigCompositeUtils::DecisionContainer> m_outputs { this, "InputMakerOutputDecisions", "", "Output Decisions" };
91
92};
93
94#endif // DECISIONHANDLING_INPUTMAKERBASE_H
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Property< bool > m_isEmptyStep
bool matchInCollection(const TrigCompositeUtils::DecisionContainer *outDecisions, const TrigCompositeUtils::Decision *toMatch, size_t &matchIndex, bool &usedROIMatchingFlag, MatchingCache &matchingCache) const
Wrapper around matchDecision. Returns boolean if the match was successful.
uint64_t getMatchingHashForDecision(const TrigCompositeUtils::Decision *toMatch, const std::string &linkNameToMatch) const
Searches from toMatch to locate a single (type-less) Element Link with given edge name....
StatusCode decisionInputToOutput(const EventContext &context, SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle) const
does the standard handling of input decisions: read from handles with all the checks,...
StringProperty m_roisLink
virtual StatusCode sysInitialize() override
initialise this base class and renounce input decision key handles
size_t matchDecision(const TrigCompositeUtils::DecisionContainer *outDecisions, const TrigCompositeUtils::Decision *toMatch, const std::string &linkNameToMatch, MatchingCache &matchingCache) const
Checks for merge-able Decision objects coming from N upstream filters. Check based on most-recent ele...
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutputs() const
methods for derived classes to access handles of the base class input and output decisions; other rea...
virtual ~InputMakerBase()
destructor
void debugPrintOut(const EventContext &context, SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle) const
provides debug printout of the output of the algorithm
InputMakerBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > m_inputs
input decisions array, will be implicit (renounced).
const SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > & decisionInputs() const
methods for derived classes to access handles of the base class input and output decisions; other rea...
Gaudi::Property< bool > m_mergeUsingFeature
SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_outputs
output decisions
Property holding a SG store/key/clid from which a WriteHandle is made.
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
Used to cache each incoming Decision object's ElementLink which is being used to identify the Decisio...
std::map< const TrigCompositeUtils::Decision *, const TrigCompositeUtils::Decision * > m_outputDecToInputDec
void linkOutputToInput(const TrigCompositeUtils::Decision *outputDecision, const TrigCompositeUtils::Decision *inputDecision)
void setMatchingHash(const TrigCompositeUtils::Decision *inputDecision, const uint64_t matchingHash)
uint64_t getMatchingHash(const TrigCompositeUtils::Decision *outputDecision) const
std::map< const TrigCompositeUtils::Decision *, uint64_t > m_inputDecToMatchingHash