ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDiTauHypoTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
8#include "GaudiKernel/SystemOfUnits.h"
9
10#include "TrigDiTauHypoTool.h"
11
12
13using namespace TrigCompositeUtils;
14
15TrigDiTauHypoTool::TrigDiTauHypoTool(const std::string& type, const std::string& name, const IInterface* parent)
16 : base_class(type, name, parent),
17 m_decisionId(HLT::Identifier::fromToolName(name))
18{}
19
20
23
24
26{
27 ATH_MSG_DEBUG(name() << ": in initialize()");
28
29 ATH_MSG_DEBUG("TrigDiTauHypoTool will cut on:");
30 ATH_MSG_DEBUG(" - PtMin : " << m_ditau_pt_threshold.value());
31 ATH_MSG_DEBUG(" - ID Score : " << m_ditau_omni_score.value());
32 ATH_MSG_DEBUG(" - Max Lead Trk: " << m_ditau_lead_max_trk.value());
33 ATH_MSG_DEBUG(" - Max Subl Trk: " << m_ditau_subl_max_trk.value());
34 return StatusCode::SUCCESS;
35}
36
37
39{
40 static const SG::ConstAccessor< int > n_tracks_leadAcc("n_tracks_lead");
41 static const SG::ConstAccessor< int > n_tracks_sublAcc("n_tracks_subl");
42 static const SG::ConstAccessor< float > ditau_ptAcc ("ditau_pt");
43 static const SG::ConstAccessor< float > omni_scoreAcc ("omni_score");
44 ATH_MSG_DEBUG(name() << ": in execute()");
45 // Tau pass flag
46 bool pass = false;
47 for(const xAOD::DiTauJet* diTau : *(input.diTauContainer)) {
48 if(ditau_ptAcc(*diTau) < m_ditau_pt_threshold.value()) continue;
49 if(omni_scoreAcc(*diTau) < m_ditau_omni_score.value()) continue;
50 if(n_tracks_leadAcc(*diTau) > m_ditau_lead_max_trk.value() || n_tracks_leadAcc(*diTau) < 0) continue;
51 if(n_tracks_sublAcc(*diTau) > m_ditau_subl_max_trk.value() || n_tracks_sublAcc(*diTau) < 0) continue;
52 pass = true;
53 }
54 ATH_MSG_DEBUG(" Pass hypo tool: " << pass);
55 return pass;
56}
57
58
59StatusCode TrigDiTauHypoTool::decide(std::vector<ITrigDiTauHypoTool::ToolInfo>& input) const {
60 for(auto& i : input) {
61 if(passed(m_decisionId.numeric(), i.previousDecisionIDs)) {
62 if(decide(i)) {
63 addDecisionID(m_decisionId, i.decision);
64 }
65 }
66 }
67
68 return StatusCode::SUCCESS;
69}
70
#define ATH_MSG_DEBUG(x)
Header file to be included by clients of the Monitored infrastructure.
Helper class to provide constant type-safe access to aux data.
HLT::Identifier m_decisionId
Gaudi::Property< int > m_ditau_lead_max_trk
virtual StatusCode decide(std::vector< ITrigDiTauHypoTool::ToolInfo > &input) const override
Gaudi::Property< float > m_ditau_pt_threshold
TrigDiTauHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize() override
Gaudi::Property< float > m_ditau_omni_score
Gaudi::Property< int > m_ditau_subl_max_trk
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition DiTauJet.h:17