|
ATLAS Offline Software
|
Go to the documentation of this file.
26 CHECK( m_input.initialize() );
27 ATH_MSG_DEBUG(
"HypoBase::sysInitialize() Will consume decision: " << m_input.key() );
28 CHECK( m_output.initialize() );
29 ATH_MSG_DEBUG(
"HypoBase::sysInitialize() And produce decision: " << m_output.key() );
30 return StatusCode::SUCCESS;
35 ATH_CHECK( printDebugInformation(outputHandle, lvl) );
37 if (m_runtimeValidation) {
41 return StatusCode::SUCCESS;
47 bool onlyValidateOneStep,
48 bool runTwoConversion)
51 std::set<const Decision*> fullyExploredFrom;
56 msg << MSG::ERROR <<
"Invalid seed element link in recursiveValidateGraph" <<
endmsg;
57 return StatusCode::FAILURE;
61 if (recursiveValidateGraph(dEL,
msg, onlyValidateOneStep, runTwoConversion, 0, fullyExploredFrom).isFailure()) {
62 return StatusCode::FAILURE;
65 return StatusCode::SUCCESS;
71 bool onlyValidateOneStep,
72 bool runTwoConversion,
74 std::set<const Decision*>& fullyExploredFrom)
76 if (onlyValidateOneStep && callDepth > 0) {
80 return StatusCode::SUCCESS;
87 if ( validateLogicalFlow(dEL,
msg, kRequireAll).isFailure() ) {
88 return StatusCode::FAILURE;
92 if ( validateLogicalFlow(dEL,
msg, kRequireOne).isFailure() ) {
93 return StatusCode::FAILURE;
98 if ( validateDecisionIDs(dEL,
msg).isFailure() ) {
99 return StatusCode::FAILURE;
101 if ( validateDuplicatedDecisionID(dEL,
msg).isFailure() ) {
102 return StatusCode::FAILURE;
106 if( validateParentLinking(dEL,
msg, runTwoConversion).isFailure() ) {
107 return StatusCode::FAILURE;
109 if ( validateHasLinks(dEL,
msg).isFailure() ) {
110 return StatusCode::FAILURE;
116 if (fullyExploredFrom.count( (*seed) ) == 1) {
119 if ( not seed.isValid() ) {
120 msg << MSG::ERROR <<
"Invalid seed element link in recursiveValidateGraph" <<
endmsg;
121 return StatusCode::FAILURE;
123 if ( recursiveValidateGraph(seed,
msg, onlyValidateOneStep, runTwoConversion, callDepth + 1, fullyExploredFrom).isFailure() ) {
124 return StatusCode::FAILURE;
128 fullyExploredFrom.insert( *dEL );
129 return StatusCode::SUCCESS;
135 bool runTwoConversion)
139 const std::string&
name = (*dEL)->name();
141 printErrorHeader(dEL,
msg);
142 msg << MSG::ERROR <<
"! Decision has zero parents. This is only allowed for the initial Decisions created by the HLTSeeding." <<
endmsg;
143 msg << MSG::ERROR <<
"! SOLUTION: Attach parent Decision(s) with TrigCompositeUtils::linkToPrevious" <<
endmsg;
145 return StatusCode::FAILURE;
149 if (seeds.size() > 0) {
150 printErrorHeader(dEL,
msg);
151 msg << MSG::ERROR <<
"! Decision has parents. This is not allowed for the initial Decisions created by the HLTSeeding." <<
endmsg;
152 msg << MSG::ERROR <<
"! SOLUTION: Check HLTSeeding, no where should it be adding a parent link." <<
endmsg;
154 return StatusCode::FAILURE;
156 return StatusCode::SUCCESS;
160 static const std::set<std::string> expectedParentsInputMaker = {
filterNodeName()};
164 static const std::set<std::string> expectedParentsSummaryPassed = {
"SF"};
166 const std::set<std::string>* expectedParentsPtr =
nullptr;
168 expectedParentsPtr = &expectedParentsFilter;
170 expectedParentsPtr = &expectedParentsInputMaker;
172 expectedParentsPtr = &expectedParentsFilter;
174 expectedParentsPtr = &expectedParentsHypoAlg;
176 expectedParentsPtr = &expectedParentsComboHypoAlg;
177 }
else if (
name ==
"SF") {
178 expectedParentsPtr = &expectedParentsSummaryFilter;
179 }
else if (
name ==
"HLTPassRaw") {
180 expectedParentsPtr = &expectedParentsSummaryPassed;
182 printErrorHeader(dEL,
msg);
183 msg << MSG::ERROR <<
"! Invalid Node name '" <<
name <<
"'." <<
endmsg;
184 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;
186 return StatusCode::FAILURE;
190 if (expectedParentsPtr->count( (*seed)->name() ) == 0) {
191 printErrorHeader(dEL,
msg);
192 msg << MSG::ERROR <<
"! Invalid linking from node with name '" <<
name <<
"' to one with name '"<< (*seed)->name() <<
"'." <<
endmsg;
193 msg << MSG::ERROR <<
"! Allowed seed names are:" <<
endmsg;
194 for (
const std::string& allowed : *expectedParentsPtr) {
195 msg << MSG::ERROR <<
"! " << allowed <<
endmsg;
197 msg << MSG::ERROR <<
"! SOLUTION: Find where this invalid parent was added and correct it." <<
endmsg;
199 return StatusCode::FAILURE;
203 return StatusCode::SUCCESS;
216 printErrorHeader(dEL,
msg);
217 msg << MSG::ERROR <<
"! Decision contains an ID which does not correspond to a configured chain or a configured chain-leg: " <<
HLT::Identifier(
id ) <<
endmsg;
218 msg << MSG::ERROR <<
"! SOLUTION: Locate the producer of the collection, investigate how this bad ID could have been added." <<
endmsg;
220 return StatusCode::FAILURE;
223 return StatusCode::SUCCESS;
233 if (decisionIDSet.size() != (*dEL)->decisions().size()) {
234 printErrorHeader(dEL,
msg);
235 msg << MSG::ERROR <<
"! Decision contains duplicate DecisionIDs." <<
endmsg;
236 msg << MSG::ERROR <<
"! SOLUTION: If combining DecisionIDs from multiple parents, de-duplicate the internal std::vector<DecisionID> of 'Decision* d' with:" <<
endmsg;
237 msg << MSG::ERROR <<
"! TrigCompositeUtils::insertDecisionIDs(DecisionIDContainer(), d);" <<
endmsg;
239 return StatusCode::FAILURE;
241 return StatusCode::SUCCESS;
251 return StatusCode::SUCCESS;
260 size_t parentsWithDecision = 0;
262 if ( not seed.isValid() ) {
263 msg << MSG::ERROR <<
"Invalid seed element link in recursiveValidateGraph" <<
endmsg;
264 return StatusCode::FAILURE;
272 ++parentsWithDecision;
275 for (
auto sid: seedIDSet){
277 ++parentsWithDecision;
284 if (
mode == kRequireOne && parentsWithDecision == 0) {
287 printErrorHeader(dEL,
msg);
288 msg << MSG::ERROR <<
"! This Decision object is not respecting logical flow of DecisionIDs for chain: " <<
HLT::Identifier(
id ) <<
endmsg;
289 msg << MSG::ERROR <<
"! This chain's DecisionID can not be found in any parents of this Decision object:" <<
endmsg;
292 msg << MSG::ERROR <<
"! Index:" << (*seed)->index() <<
" from collection:" << seed.dataID() <<
endmsg;
293 msg << MSG::ERROR <<
"! " << **seed <<
endmsg;
301 msg << MSG::ERROR <<
"! SOLUTION: Ensure that the producer of this Decision object only adds DecisionIDs"
302 " which were present in at least one of its parents." <<
endmsg;
304 return StatusCode::FAILURE;
305 }
else if (
mode == kRequireAll && parentsWithDecision != seeds.size()) {
311 printErrorHeader(dEL,
msg);
312 msg << MSG::ERROR <<
"! This Decision object is not respecting logical flow of DecisionIDs for chain: " <<
HLT::Identifier(
id ) <<
endmsg;
313 msg << MSG::ERROR <<
"! As this Decision object represents the output of a HypoAlg, it must respect logical flow on all "
314 << seeds.size() <<
" of its parent(s):" <<
endmsg;
317 msg << MSG::ERROR <<
"! Index:" << (*seed)->index() <<
" from collection:" << seed.dataID() <<
endmsg;
318 msg << MSG::ERROR <<
"! " << **seed <<
endmsg;
326 msg << MSG::ERROR <<
"! SOLUTION: Ensure that the HypoTool responsible for " <<
HLT::Identifier(
id )
327 <<
" in this HypoAlg only runs if this ID is present in all parent decisions." <<
endmsg;
329 return StatusCode::FAILURE;
332 return StatusCode::SUCCESS;
339 const std::string&
name = (*dEL)->name();
344 return StatusCode::SUCCESS;
346 printErrorHeader(dEL,
msg);
348 msg << MSG::ERROR <<
"! Every Decision created by a HypoAlg must correspond to some physics object, and be linked to the object." <<
endmsg;
349 msg << MSG::ERROR <<
"! SOLUTION: Ensure that all produced Decision objects are assigned their feature:" <<
endmsg;
350 msg << MSG::ERROR <<
"! SOLUTION: decision->setObjectLink<MY_FEATURE_CONTANER_TYPE>(featureString(), MY_FEATURE_ELEMENT_LINK);" <<
endmsg;
352 return StatusCode::FAILURE;
358 if ((*dEL)->hasDetail<int32_t>(
"isEmpty") and (*dEL)->getDetail<int32_t>(
"isEmpty") == 1) {
362 if (not (*dEL)->hasObjectLink(
roiString() ) and not exempt) {
363 printErrorHeader(dEL,
msg);
364 msg << MSG::ERROR <<
"! Decision has no '" <<
roiString() <<
"' ElementLink." <<
endmsg;
365 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;
366 msg << MSG::ERROR <<
"! It can be the FullScan ROI created by the HLTSeeding (FSNOSEED) if no other suitable ROI exists." <<
endmsg;
367 msg << MSG::ERROR <<
"! SOLUTION: Check the configuration of InputMakerForRoI or EventViewCreatorAlgorithm responsible for creating this Decision Object" <<
endmsg;
368 msg << MSG::ERROR <<
"! SOLUTION: The algorithm must have an ROITool which must attach an '"<<
roiString() <<
"' link to each Decision Object" <<
endmsg;
375 printErrorHeader(dEL,
msg);
377 msg << MSG::ERROR <<
"! Every Decision created by the HLTSeeding must link to the initial ROI which caused it to be created." <<
endmsg;
378 msg << MSG::ERROR <<
"! This includes the Decision Object created to represent the Full-Scan/NoSeed (FSNOSEED) ROI." <<
endmsg;
379 msg << MSG::ERROR <<
"! SOLUTION: Check the configuration of the HLTSeeding tool responsible for creating this Decision Object" <<
endmsg;
384 return StatusCode::SUCCESS;
389 msg << MSG::ERROR <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" <<
endmsg;
397 msg << MSG::ERROR <<
"! RUNTIME TRIGGER NAVIGATION VALIDATION ERROR" <<
endmsg;
398 msg << MSG::ERROR <<
"! Caused by Decision with index:" << (*dEL)->index() <<
endmsg;
400 msg << MSG::ERROR <<
"! " << **dEL <<
endmsg;
407 msg() <<
"Exiting with " << outputHandle->
size() <<
" Decision objects" <<
endmsg;
412 msg() <<
"Number of positive decisions for Decision object #" <<
count++ <<
": " << objDecisions.size() <<
endmsg;
418 return StatusCode::SUCCESS;
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
const std::string & hltSeedingNodeName()
const std::string & hypoAlgNodeName()
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 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.
static StatusCode validateDuplicatedDecisionID(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure that no space is being wasted by duplicated DecisionIDs in any Decision objects.
const std::string & initialRoIString()
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.
ElementLink implementation for ROOT usage.
const std::string & featureString()
bool isChainId(const HLT::Identifier &chainIdentifier)
Recognise whether the HLT identifier corresponds to a whole chain.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual ~HypoBase()
destructor
const std::string & filterNodeName()
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...
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 if it is enabled or, empty string
virtual StatusCode sysInitialize() override
initialise this base class
const std::string & roiString()
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.
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.
const std::string & inputMakerNodeName()