 |
ATLAS Offline Software
|
Go to the documentation of this file.
28 CHECK( m_input.initialize() );
29 ATH_MSG_DEBUG(
"HypoBase::sysInitialize() Will consume decision: " << m_input.key() );
30 CHECK( m_output.initialize() );
31 ATH_MSG_DEBUG(
"HypoBase::sysInitialize() And produce decision: " << m_output.key() );
32 return StatusCode::SUCCESS;
37 ATH_CHECK( printDebugInformation(outputHandle, lvl) );
39 if (m_runtimeValidation) {
43 return StatusCode::SUCCESS;
49 bool onlyValidateOneStep,
50 bool runTwoConversion)
53 std::set<const Decision*> fullyExploredFrom;
58 msg << MSG::ERROR <<
"Invalid seed element link in recursiveValidateGraph" <<
endmsg;
59 return StatusCode::FAILURE;
63 if (recursiveValidateGraph(dEL,
msg, onlyValidateOneStep, runTwoConversion, 0, fullyExploredFrom).isFailure()) {
64 return StatusCode::FAILURE;
67 return StatusCode::SUCCESS;
73 bool onlyValidateOneStep,
74 bool runTwoConversion,
76 std::set<const Decision*>& fullyExploredFrom)
78 if (onlyValidateOneStep && callDepth > 0) {
82 return StatusCode::SUCCESS;
89 if ( validateLogicalFlow(dEL,
msg, kRequireAll).isFailure() ) {
90 return StatusCode::FAILURE;
94 if ( validateLogicalFlow(dEL,
msg, kRequireOne).isFailure() ) {
95 return StatusCode::FAILURE;
100 if ( validateDecisionIDs(dEL,
msg).isFailure() ) {
101 return StatusCode::FAILURE;
103 if ( validateDuplicatedDecisionID(dEL,
msg).isFailure() ) {
104 return StatusCode::FAILURE;
108 if( validateParentLinking(dEL,
msg, runTwoConversion).isFailure() ) {
109 return StatusCode::FAILURE;
111 if ( validateHasLinks(dEL,
msg).isFailure() ) {
112 return StatusCode::FAILURE;
118 if (fullyExploredFrom.count( (*seed) ) == 1) {
121 if ( not seed.isValid() ) {
122 msg << MSG::ERROR <<
"Invalid seed element link in recursiveValidateGraph" <<
endmsg;
123 return StatusCode::FAILURE;
125 if ( recursiveValidateGraph(seed,
msg, onlyValidateOneStep, runTwoConversion, callDepth + 1, fullyExploredFrom).isFailure() ) {
126 return StatusCode::FAILURE;
130 fullyExploredFrom.insert( *dEL );
131 return StatusCode::SUCCESS;
137 bool runTwoConversion)
141 const std::string&
name = (*dEL)->name();
143 printErrorHeader(dEL,
msg);
144 msg << MSG::ERROR <<
"! Decision has zero parents. This is only allowed for the initial Decisions created by the HLTSeeding." <<
endmsg;
145 msg << MSG::ERROR <<
"! SOLUTION: Attach parent Decision(s) with TrigCompositeUtils::linkToPrevious" <<
endmsg;
147 return StatusCode::FAILURE;
151 if (seeds.size() > 0) {
152 printErrorHeader(dEL,
msg);
153 msg << MSG::ERROR <<
"! Decision has parents. This is not allowed for the initial Decisions created by the HLTSeeding." <<
endmsg;
154 msg << MSG::ERROR <<
"! SOLUTION: Check HLTSeeding, no where should it be adding a parent link." <<
endmsg;
156 return StatusCode::FAILURE;
158 return StatusCode::SUCCESS;
162 static const std::set<std::string> expectedParentsInputMaker = {
filterNodeName()};
168 const std::set<std::string>* expectedParentsPtr =
nullptr;
170 expectedParentsPtr = &expectedParentsFilter;
172 expectedParentsPtr = &expectedParentsInputMaker;
174 expectedParentsPtr = &expectedParentsFilter;
176 expectedParentsPtr = &expectedParentsHypoAlg;
178 expectedParentsPtr = &expectedParentsComboHypoAlg;
180 expectedParentsPtr = &expectedParentsSummaryFilter;
182 expectedParentsPtr = &expectedParentsSummaryPassed;
184 printErrorHeader(dEL,
msg);
185 msg << MSG::ERROR <<
"! Invalid Node name '" <<
name <<
"'." <<
endmsg;
186 msg << MSG::ERROR <<
"! SOLUTION: Find the alg which made a node with this name. Allowed named may be found in TrigCompositeUtils.h, See:'Constant string literals used within the HLT'." <<
endmsg;
188 return StatusCode::FAILURE;
192 if (!expectedParentsPtr->contains( (*seed)->name() )) {
193 printErrorHeader(dEL,
msg);
194 msg << MSG::ERROR <<
"! Invalid linking from node with name '" <<
name <<
"' to one with name '"<< (*seed)->name() <<
"'." <<
endmsg;
195 msg << MSG::ERROR <<
"! Allowed seed names are:" <<
endmsg;
196 for (
const std::string& allowed : *expectedParentsPtr) {
197 msg << MSG::ERROR <<
"! " << allowed <<
endmsg;
199 msg << MSG::ERROR <<
"! SOLUTION: Find where this invalid parent was added and correct it." <<
endmsg;
201 return StatusCode::FAILURE;
205 return StatusCode::SUCCESS;
218 printErrorHeader(dEL,
msg);
219 msg << MSG::ERROR <<
"! Decision contains an ID which does not correspond to a configured chain or a configured chain-leg: " <<
HLT::Identifier(
id ) <<
endmsg;
220 msg << MSG::ERROR <<
"! SOLUTION: Locate the producer of the collection, investigate how this bad ID could have been added." <<
endmsg;
222 return StatusCode::FAILURE;
225 return StatusCode::SUCCESS;
235 if (decisionIDSet.size() != (*dEL)->decisions().size()) {
236 printErrorHeader(dEL,
msg);
237 msg << MSG::ERROR <<
"! Decision contains duplicate DecisionIDs." <<
endmsg;
238 msg << MSG::ERROR <<
"! SOLUTION: If combining DecisionIDs from multiple parents, de-duplicate the internal std::vector<DecisionID> of 'Decision* d' with:" <<
endmsg;
239 msg << MSG::ERROR <<
"! TrigCompositeUtils::insertDecisionIDs(DecisionIDContainer(), d);" <<
endmsg;
241 return StatusCode::FAILURE;
243 return StatusCode::SUCCESS;
253 return StatusCode::SUCCESS;
262 size_t parentsWithDecision = 0;
264 if ( not seed.isValid() ) {
265 msg << MSG::ERROR <<
"Invalid seed element link in recursiveValidateGraph" <<
endmsg;
266 return StatusCode::FAILURE;
274 ++parentsWithDecision;
277 for (
auto sid: seedIDSet){
279 ++parentsWithDecision;
286 if (
mode == kRequireOne && parentsWithDecision == 0) {
289 printErrorHeader(dEL,
msg);
290 msg << MSG::ERROR <<
"! This Decision object is not respecting logical flow of DecisionIDs for chain: " <<
HLT::Identifier(
id ) <<
endmsg;
291 msg << MSG::ERROR <<
"! This chain's DecisionID can not be found in any parents of this Decision object:" <<
endmsg;
294 msg << MSG::ERROR <<
"! Index:" << (*seed)->index() <<
" from collection:" << seed.dataID() <<
endmsg;
295 msg << MSG::ERROR <<
"! " << **seed <<
endmsg;
303 msg << MSG::ERROR <<
"! SOLUTION: Ensure that the producer of this Decision object only adds DecisionIDs"
304 " which were present in at least one of its parents." <<
endmsg;
306 return StatusCode::FAILURE;
307 }
else if (
mode == kRequireAll && parentsWithDecision != seeds.size()) {
313 printErrorHeader(dEL,
msg);
314 msg << MSG::ERROR <<
"! This Decision object is not respecting logical flow of DecisionIDs for chain: " <<
HLT::Identifier(
id ) <<
endmsg;
315 msg << MSG::ERROR <<
"! As this Decision object represents the output of a HypoAlg, it must respect logical flow on all "
316 << seeds.size() <<
" of its parent(s):" <<
endmsg;
319 msg << MSG::ERROR <<
"! Index:" << (*seed)->index() <<
" from collection:" << seed.dataID() <<
endmsg;
320 msg << MSG::ERROR <<
"! " << **seed <<
endmsg;
328 msg << MSG::ERROR <<
"! SOLUTION: Ensure that the HypoTool responsible for " <<
HLT::Identifier(
id )
329 <<
" in this HypoAlg only runs if this ID is present in all parent decisions." <<
endmsg;
331 return StatusCode::FAILURE;
334 return StatusCode::SUCCESS;
341 const std::string&
name = (*dEL)->name();
346 return StatusCode::SUCCESS;
348 printErrorHeader(dEL,
msg);
350 msg << MSG::ERROR <<
"! Every Decision created by a HypoAlg must correspond to some physics object, and be linked to the object." <<
endmsg;
351 msg << MSG::ERROR <<
"! SOLUTION: Ensure that all produced Decision objects are assigned their feature:" <<
endmsg;
352 msg << MSG::ERROR <<
"! SOLUTION: decision->setObjectLink<MY_FEATURE_CONTANER_TYPE>(featureString(), MY_FEATURE_ELEMENT_LINK);" <<
endmsg;
354 return StatusCode::FAILURE;
360 if ((*dEL)->hasDetail<int32_t>(
"isEmpty") and (*dEL)->getDetail<int32_t>(
"isEmpty") == 1) {
364 if (not (*dEL)->hasObjectLink(
roiString() ) and not exempt) {
365 printErrorHeader(dEL,
msg);
366 msg << MSG::ERROR <<
"! Decision has no '" <<
roiString() <<
"' ElementLink." <<
endmsg;
367 msg << MSG::ERROR <<
"! Every Decision created by a InputMaker must link to the ROI which reconstruction will run on for that Decision object in this Step." <<
endmsg;
368 msg << MSG::ERROR <<
"! It can be the FullScan ROI created by the HLTSeeding (FSNOSEED) if no other suitable ROI exists." <<
endmsg;
369 msg << MSG::ERROR <<
"! SOLUTION: Check the configuration of InputMakerForRoI or EventViewCreatorAlgorithm responsible for creating this Decision Object" <<
endmsg;
370 msg << MSG::ERROR <<
"! SOLUTION: The algorithm must have an ROITool which must attach an '"<<
roiString() <<
"' link to each Decision Object" <<
endmsg;
377 printErrorHeader(dEL,
msg);
379 msg << MSG::ERROR <<
"! Every Decision created by the HLTSeeding must link to the initial ROI which caused it to be created." <<
endmsg;
380 msg << MSG::ERROR <<
"! This includes the Decision Object created to represent the Full-Scan/NoSeed (FSNOSEED) ROI." <<
endmsg;
381 msg << MSG::ERROR <<
"! SOLUTION: Check the configuration of the HLTSeeding tool responsible for creating this Decision Object" <<
endmsg;
386 return StatusCode::SUCCESS;
391 msg << MSG::ERROR <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" <<
endmsg;
399 msg << MSG::ERROR <<
"! RUNTIME TRIGGER NAVIGATION VALIDATION ERROR" <<
endmsg;
400 msg << MSG::ERROR <<
"! Caused by Decision with index:" << (*dEL)->index() <<
endmsg;
402 msg << MSG::ERROR <<
"! " << **dEL <<
endmsg;
409 msg() <<
"Exiting with " << outputHandle->
size() <<
" Decision objects" <<
endmsg;
414 msg() <<
"Number of positive decisions for Decision object #" <<
count++ <<
": " << objDecisions.size() <<
endmsg;
420 return StatusCode::SUCCESS;
const std::string & featureString()
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
const std::string & summaryFilterNodeName()
const std::string & summaryPassNodeName()
const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & decisionInput() const
methods for derived classes to access handles of the base class input other read/write handles may be...
static void printBangs(MsgStream &msg)
Print header line.
const std::string & comboHypoAlgNodeName()
Property holding a SG store/key/clid from which a ReadHandle is made.
const std::string & roiString()
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutput() const
methods for derived classes to access handles of the base class output other read/write handles may b...
bool isValid() const
Test to see if the link can be dereferenced.
const ID_type & dataID() const
Get the key that we reference, as a string.
An algorithm that can be simultaneously executed in multiple threads.
static StatusCode recursiveValidateGraph(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool onlyValidateOneStep, bool runTwoConversion, size_t callDepth, std::set< const TrigCompositeUtils::Decision * > &fullyExploredFrom)
Execute all checks on one node in the graph, d, then recursive call self on all parent nodes up to L1...
Property holding a SG store/key/clid from which a WriteHandle is made.
const std::string & filterNodeName()
static StatusCode validateDuplicatedDecisionID(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure that no space is being wasted by duplicated DecisionIDs in any Decision objects.
StatusCode hypoBaseOutputProcessing(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl=MSG::DEBUG) const
Base class function to be called once slice specific code has finished. Handles debug printing and va...
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
static StatusCode validateLogicalFlow(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, const LogicalFlowCheckMode mode)
Ensure that all DecisionIDs have propagated correctly from their parent.
static StatusCode validateDecisionIDs(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure that all present IDs correspond to configured chains.
Class used to describe composite objects in the HLT.
const std::string & initialRoIString()
const std::string & hltSeedingNodeName()
ElementLink implementation for ROOT usage.
bool isChainId(const HLT::Identifier &chainIdentifier)
Recognise whether the HLT identifier corresponds to a whole chain.
virtual ~HypoBase()
destructor
const std::string & seedString()
std::set< DecisionID > DecisionIDContainer
StatusCode printDebugInformation(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl) const
Common base function to print information on chains passed by objects considered in the hypo.
static StatusCode validateParentLinking(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool runTwoConversion)
Ensure that the Decision has at least one valid parent, unless it is a initial Decision from the HLTS...
const std::string & hypoAlgNodeName()
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
std::string name() const
reports human redable name
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual StatusCode sysInitialize() override
initialise this base class
static StatusCode runtimeValidation(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MsgStream &msg, bool onlyValidateOneStep=true, bool runTwoConversion=false)
Executes all individual runtime tests.
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
static StatusCode validateHasLinks(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure all Decisions have the named ElementLink graph edges which they are required to by spec.
const std::string & inputMakerNodeName()
size_type size() const noexcept
Returns the number of elements in the collection.
static void printErrorHeader(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
A problem was found, print common output data.