|
ATLAS Offline Software
|
Go to the documentation of this file.
38 return StatusCode::SUCCESS;
50 size_t usedROIMatching = 0, usedFeatureMatching = 0;
53 size_t totalInput = 0;
57 if( not inputHandle.isValid() ) {
58 ATH_MSG_DEBUG(
"Got no decisions from input "<<
inputKey.key() <<
" because implicit handle not valid");
61 if( inputHandle->size() == 0){
62 ATH_MSG_DEBUG(
"Got no decisions from input "<<
inputKey.key()<<
": implicit handle is valid but container is empty.");
65 ATH_MSG_DEBUG(
"Running on input "<<
inputKey.key()<<
" with " << inputHandle->size() <<
" elements" );
68 size_t input_counter = 0;
72 bool usedROIMatchingFlag =
false;
74 const bool alreadyAdded =
matchInCollection(outDecisions, inputDecision, alreadyAddedIndex, usedROIMatchingFlag, matchingCache);
78 if (usedROIMatchingFlag) {
81 ++usedFeatureMatching;
83 outputDecision = outDecisions->
at( alreadyAddedIndex );
84 ATH_MSG_DEBUG(
" -- Matched to existing, " <<
inputKey.key() <<
" index " << input_counter <<
" is merged into existing output index " << alreadyAddedIndex << (usedROIMatchingFlag ?
" Matched using ROI" :
" Matched using Feature"));
90 ATH_MSG_DEBUG(
" -- Did not match to existing, " <<
inputKey.key() <<
" index " << input_counter <<
" creates output index " << outDecisions->
size()-1);
99 totalInput+=input_counter;
102 if (usedROIMatching and usedFeatureMatching) {
103 ATH_MSG_DEBUG(
"This input maker used Feature-based mapping on " << usedFeatureMatching <<
" inputs and ROI-based mapping on " << usedROIMatching
111 ATH_MSG_DEBUG(
"Merging complete: from "<<totalInput<<
" input decision to "<<outputHandle->
size()<<
" output decisions");
113 return StatusCode::SUCCESS;
118 std::set<const Decision*> cache;
119 std::vector<SG::sgkey_t>
keys;
120 std::vector<uint32_t> clids;
121 std::vector<Decision::index_type> indicies;
122 std::vector<const Decision*> sources;
124 bool hasFeature =
false;
125 if (
keys.size() != 0) hasFeature=
true;
135 usedROIMatchingFlag =
true;
142 ATH_MSG_DEBUG(
"matchDecision "<<linkNameToMatch<<
" with matchingHash="<<matchingHash);
151 if (checkHash == matchingHash) {
160 std::set<const Decision*> cache;
161 std::vector<SG::sgkey_t>
keys;
162 std::vector<uint32_t> clids;
163 std::vector<Decision::index_type> indicies;
164 std::vector<const Decision*> sources;
167 if (
keys.size() != 1) {
168 bool suppressError =
false;
171 suppressError =
true;
175 if (
keys.size() > 1) {
176 suppressError =
false;
178 if (not suppressError) {
179 ATH_MSG_ERROR(
"InputMakerBase::getMatchingHashForDecision Did not locate exactly one object having searched for a link named '" << linkNameToMatch
180 <<
"', found " <<
keys.size() <<
". Unable to match this Decision object.");
181 for (
size_t i = 0;
i <
keys.size(); ++
i) {
182 const std::string* sgKeyStr =
evtStore()->keyToString(
keys.at(
i));
183 ATH_MSG_ERROR(
" -- Key:" <<
keys.at(
i) <<
" KeyStr:" << (sgKeyStr ? *sgKeyStr :
"UNKNOWN") <<
" Index:" << indicies.at(
i) <<
" CLID:" << clids.at(
i));
195 const uint64_t matchingHash =
keys.at(0) + clids.at(0) + indicies.at(0);
205 if (inputHandle.isValid()) {
206 if (inputHandle->size() > 0) {
215 ATH_MSG_DEBUG(
"Output " << outputHandle.
key() <<
" with "<< outputHandle->
size() <<
" decisions:");
216 for (
const auto outdecision : *outputHandle){
219 ATH_MSG_DEBUG(
"Number of positive decisions for this output: " << objDecisions.size() );
233 m_outputDecToInputDec[outputDecision] = inputDecision;
238 if (!outputDecision) {
239 throw std::runtime_error(
"InputMakerBase::MatchingCache::getMatchingHash: Called with nullptr.");
242 auto it_inDec = m_outputDecToInputDec.find(outputDecision);
243 if (it_inDec == m_outputDecToInputDec.end()) {
244 throw std::runtime_error(
"InputMakerBase::MatchingCache::getMatchingHash: No matching input Decision* for the supplied output Decision*");
246 const Decision* inputDecision = it_inDec->second;
248 auto it_hash = m_inputDecToMatchingHash.find(inputDecision);
249 if (it_hash == m_inputDecToMatchingHash.end()) {
250 throw std::runtime_error(
"InputMakerBase::MatchingCache::getMatchingHash: No matching hash for this input Decision*");
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
void recursiveGetDecisions(const Decision *start, NavGraph &navGraph, const DecisionIDContainer &ids, const bool enforceDecisionOnStartNode)
Search back in time from "node" and locate all paths back through Decision objects for a given chain.
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
void insertDecisionIDs(const Decision *src, Decision *dest)
Appends the decision IDs of src to the dest decision object.
bool msgLvl(const MSG::Level lvl) const
void printAllPaths(MsgStream &log, MSG::Level msgLevel=MSG::VERBOSE) const
Helper function.
void renounceArray(SG::VarHandleKeyArray &handlesArray)
remove all handles from I/O resolution
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Property holding a SG store/key/clid from which a WriteHandle is made.
const std::vector< ElementLink< DecisionContainer > > getLinkToPrevious(const Decision *d)
returns links to previous decision object 'seed'
bool typelessFindLinks(const Decision *start, const std::string &linkName, std::vector< sgkey_t > &keyVec, std::vector< uint32_t > &clidVec, std::vector< Decision::index_type > &indexVec, std::vector< const Decision * > &sourceVec, const unsigned int behaviour, std::set< const Decision * > *fullyExploredFrom)
search back the TC links for the object of type T linked to the one of TC (recursively) Returns the l...
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
void setName(const std::string &name)
Set a human-readable name for the object.
Structure to hold a transient Directed Acyclic Graph (DAG) structure. NavGraph is populated from,...
const std::vector< TrigCompositeUtils::DecisionID > & decisions() const
Get positive HLT chain decisions associated with this TrigComposite. Navigation use.
#define CHECK(...)
Evaluate an expression and check for errors.
Class used to describe composite objects in the HLT.
const std::string & featureString()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
std::set< DecisionID > DecisionIDContainer
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
const std::string & inputMakerNodeName()