|
ATLAS Offline Software
|
Go to the documentation of this file.
20 return StatusCode::SUCCESS;
25 return StatusCode::SUCCESS;
36 ATH_MSG_DEBUG(
"No input configured, output decisions will be empty" );
37 return StatusCode::SUCCESS;
41 if( not previousDecisionsHandle.isValid() ) {
43 return StatusCode::SUCCESS;
46 ATH_MSG_DEBUG(
"Running with "<< previousDecisionsHandle->size() <<
" decisions from the input implicit ReadHandle");
49 ATH_MSG_DEBUG(
" and with "<< recoInput->size() <<
" reco inputs");
53 std::vector<const FeatureOBJ*> featureFromDecision;
54 for (
const auto previousDecision: *previousDecisionsHandle ) {
55 const auto linkInfo = TrigCompositeUtils::findLink<FeatureContainer>(previousDecision,
m_linkName.value());
56 const auto featureLink = linkInfo.link;
57 CHECK( featureLink.isValid() );
59 featureFromDecision.push_back( feature);
61 ATH_MSG_DEBUG(
"Found "<<featureFromDecision.size()<<
" features "<<
m_linkName.value() <<
" mapped from input decisions");
64 size_t reco_counter = 0;
65 for (
const auto recoobj: *recoInput){
66 const auto roiInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( recoobj,
"initialRoI" );
67 const auto roiEL = roiInfo.link;
68 CHECK( roiEL.isValid() );
70 const auto featureInfo = TrigCompositeUtils::findLink<FeatureContainer>( recoobj,
m_linkName.value() );
71 const auto featurelink = featureInfo.link;
72 CHECK( featurelink.isValid() );
73 if ( not featurelink.isValid() ) {
75 return StatusCode::FAILURE;
81 bool foundFeatureInDecision=
false;
82 size_t pos=
distance(featureFromDecision.begin(),
find(featureFromDecision.begin(), featureFromDecision.end(), feature));
83 if (
pos < featureFromDecision.size()){
84 foundFeatureInDecision=
true;
87 if (foundFeatureInDecision){
88 ATH_MSG_DEBUG(
" Found link from the reco object to the previous decision at position "<<
pos);
91 d->setObjectLink(
m_linkName.value(), featurelink );
95 ATH_MSG_DEBUG(
" Can not find reference to this feature " +
m_linkName.value() +
" from reco object " << reco_counter <<
" in any previous decision" );
109 for (
auto outh: *outputHandle){
113 ATH_MSG_DEBUG(
"Number of positive decisions for this output: " << objDecisions.size() );
120 return StatusCode::SUCCESS;
virtual StatusCode finalize() override
std::string find(const std::string &s)
return a remapped string
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.
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...
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
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...
StringProperty m_linkName
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_recoInput
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
#define CHECK(...)
Evaluate an expression and check for errors.
ElementLink implementation for ROOT usage.
Hypothesis algorithms take the output of reco algorithms and the decision from the preceeding InputMa...
virtual StatusCode initialize() override
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.
virtual StatusCode execute(const EventContext &context) const override
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
size_type size() const noexcept
Returns the number of elements in the collection.
ToolHandleArray< ITestHypoTool > m_tools