ATLAS Offline Software
Loading...
Searching...
No Matches
TrigJetTLAHypoTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5// ********************************************************************
6//
7// NAME: TrigJetTLAHypoTool.cxx
8// PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo
9//
10//
11// ********************************************************************
12
13#include "TrigJetTLAHypoTool.h"
14
15#include "GaudiKernel/StatusCode.h"
16
20#include "./xAODJetCollector.h"
21
25
31
33 const std::string& name,
34 const IInterface* parent) :
35 AthAlgTool(type, name, parent),
36 m_decisionId(HLT::Identifier::fromToolName(name)){
37
38}
39
40
43
45
46 if (m_visitDebug){
47
48 DebugInfoCollector collector(name());
49 CHECK(m_helper->getDescription(collector));
50 auto s = collector.toString();
51
52 for(const auto& l : lineSplitter(s)){
53 ATH_MSG_INFO(l);
54 }
55 }
56
57 return StatusCode::SUCCESS;
58}
59
61 return StatusCode::SUCCESS;
62}
63
64StatusCode
66
67 int decision_count=0;
68
69 std::unique_ptr<ITrigJetHypoInfoCollector> infocollector(nullptr);
70
71 // jet hypo inputs:
72 // pairs of const xAOD::Jet* (first) and mutable Decision* (second)
73
74 for (auto decision : *outputDecisions) {
75
76 //check that the previous decision comes from the appropriate chain
77 DecisionIDContainer previousDecisionIDs;
78 const auto previousDecisionEL = TrigCompositeUtils::getLinkToPrevious(decision).at(0); // We know that the parent HypoAlg added exactly one parent.
79 decisionIDs(*previousDecisionEL, previousDecisionIDs);
80 //check that the previous decision corresponding to this decisionId was positive
81 if ( previousDecisionIDs.count( m_decisionId.numeric() ) > 0) {
82 TrigCompositeUtils::addDecisionID(getId().numeric(), decision);
83 ++decision_count;
84 }
85 }
86
87
88 ATH_MSG_DEBUG("TrigJetTLAHypoTool: Passthrough decision count " + std::to_string(decision_count));
89
90 if (infocollector){
91 infocollector->collect("TrigJetTLAHypoTool", "TrigJetTLAHypoTool: Passthrough decision count " + std::to_string(decision_count));
92 infocollector->write();
93 }
94 return StatusCode::SUCCESS;
95}
96
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
void decisionIDs(const Decision *d, DecisionIDContainer &id)
Extracts DecisionIDs stored in the Decision object.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual std::string toString() const override
HLT::Identifier m_decisionId
StatusCode decide(TrigCompositeUtils::DecisionContainer *outputDecisions) const
const HLT::Identifier & getId() const
ToolHandle< ITrigJetHypoToolHelper > m_helper
TrigJetTLAHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< bool > m_visitDebug
std::vector< std::string > lineSplitter(const std::string &s, char delimiter)
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
unsigned int DecisionID
const std::vector< ElementLink< DecisionContainer > > getLinkToPrevious(const Decision *d)
returns links to previous decision object 'seed'
std::set< DecisionID > DecisionIDContainer
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.