ATLAS Offline Software
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 
19 #include "./DebugInfoCollector.h"
20 #include "./xAODJetCollector.h"
21 
25 
31 
33  const std::string& name,
34  const IInterface* parent) :
36  m_decisionId(HLT::Identifier::fromToolName(name)){
37 
38 }
39 
40 
42 }
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 
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 
98  return m_decisionId;
99 }
TrigJetTLAHypoTool::m_visitDebug
Gaudi::Property< bool > m_visitDebug
Definition: TrigJetTLAHypoTool.h:76
lineSplitter.h
DebugInfoCollector::toString
virtual std::string toString() const override
Definition: DebugInfoCollector.cxx:70
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition: TrigComposite_v1.h:27
TrigCompositeUtils::DecisionContainer
xAOD::TrigCompositeContainer DecisionContainer
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigCompositeContainer.h:21
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TrigCompositeUtils.h
HLT::Identifier::numeric
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:47
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition: TrigCompositeUtilsRoot.cxx:61
lineSplitter
std::vector< std::string > lineSplitter(const std::string &s, char delimiter)
Definition: lineSplitter.cxx:8
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
ITrigJetHypoInfoCollector::write
virtual void write() const =0
ITrigJetHypoInfoCollector::collect
virtual void collect(const std::string &, const std::string &)=0
TrigJetTLAHypoTool::~TrigJetTLAHypoTool
~TrigJetTLAHypoTool()
Definition: TrigJetTLAHypoTool.cxx:41
TrigJetTLAHypoTool::finalize
StatusCode finalize()
Definition: TrigJetTLAHypoTool.cxx:60
TrigJetTLAHypoTool::getId
const HLT::Identifier & getId() const
Definition: TrigJetTLAHypoTool.cxx:97
TrigJetTLAHypoTool::decide
StatusCode decide(TrigCompositeUtils::DecisionContainer *outputDecisions) const
Definition: TrigJetTLAHypoTool.cxx:65
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
TrigCompositeUtils::getLinkToPrevious
const std::vector< ElementLink< DecisionContainer > > getLinkToPrevious(const Decision *d)
returns links to previous decision object 'seed'
Definition: TrigCompositeUtilsRoot.cxx:156
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DebugInfoCollector.h
DebugInfoCollector
Definition: DebugInfoCollector.h:13
xAODJetCollector.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
TrigCompositeContainer.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:20
xAODJetAsIJetFactory.h
TrigJetTLAHypoTool::initialize
StatusCode initialize()
Definition: TrigJetTLAHypoTool.cxx:44
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigJetTLAHypoTool.h
HLTIdentifier.h
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:67
AthAlgTool
Definition: AthAlgTool.h:26
TrigJetTLAHypoTool::TrigJetTLAHypoTool
TrigJetTLAHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigJetTLAHypoTool.cxx:32
TrigJetTLAHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigJetTLAHypoTool.h:70
TrigJetTLAHypoTool::m_helper
ToolHandle< ITrigJetHypoToolHelper > m_helper
Definition: TrigJetTLAHypoTool.h:72