ATLAS Offline Software
Loading...
Searching...
No Matches
Trig3VarComboHypoTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef DECISIONHANDLING_TRIG3VARCOMBOHYPOTOOL_H
6#define DECISIONHANDLING_TRIG3VARCOMBOHYPOTOOL_H
7
9
10
12#include <vector>
13#include <cstdint> //for unit32_t etc
14#include <tuple>
15#include <limits>
16
18
19 public:
21
22 Trig3VarComboHypoTool(const std::string& type,
23 const std::string& name,
24 const IInterface* parent);
25
26 virtual StatusCode initialize() override;
27 private:
28
29 static constexpr float FLOATDEFAULT = std::numeric_limits<float>::lowest();
30
32 struct VarInfo {
33 std::string varTag{""};
35 size_t index{0};
36 std::string monToolName{""};
37
38 bool useMin{false};
40 bool useMax{false};
42
43 bool legA_is_MET{false};
44 uint32_t legA{0};
45 bool legB_is_MET{false};
46 uint32_t legB{0};
47 bool legC_is_MET{false};
48 uint32_t legC{0};
49
51 bool validate(std::string& errmsg) const;
53 std::string rangeStr() const {
54 return (useMin ? std::to_string(varMin) + " < " : "") + varTag + (useMax ? " < " + std::to_string(varMax): "");
55 }
56 bool test(float value) const {
57 return (useMin ? value > varMin : true) && (useMax ? value < varMax : true);
58 }
59
60 };
61
63 using KineInfo = std::tuple<float,float,float>;
64 using Combination = std::vector<Combo::LegDecision>;
65
68 StatusCode decide(Combo::LegDecisionsMap& passingLegs, const EventContext& /*ctx*/) const final;
69
71 bool executeAlgStep(const Combination& combination, const VarInfo&, std::vector<float>& values) const;
73 float compute(const std::tuple<KineInfo,KineInfo,KineInfo>& kinetrio, ComboHypoVars var) const;
74
75 bool fillLegDecisions_diffLeg(std::tuple<Combo::LegDecision,Combo::LegDecision,Combo::LegDecision>& legtrio, const Combination& combination, uint32_t legA, uint32_t legB, uint32_t legC) const;
76 bool fillTrioKinematics(std::tuple<KineInfo,KineInfo,KineInfo>& kinetrio, const Combination& combination, const VarInfo& varInfo) const;
77 bool fillKineInfo(KineInfo& kinematics, Combo::LegDecision decision, bool isMET) const;
78
80 // flags
81 Gaudi::Property<std::vector<std::string>> m_varTag_vec {this, "Variables" , {""}, "Variables to cut on"};
82 Gaudi::Property<std::vector<bool> > m_useMin_vec {this, "UseMinVec" , {false}, "Array with the apply_min_cut setting"};
83 Gaudi::Property<std::vector<bool> > m_useMax_vec {this, "UseMaxVec" , {false}, "Array with the apply_max_cut setting"};
84
85 //legs
86 Gaudi::Property<std::vector<uint32_t>> m_legA_vec {this, "LegAVec" , {0}, "Array with the first Leg ID"};
87 Gaudi::Property<std::vector<uint32_t>> m_legB_vec {this, "LegBVec" , {0}, "Array with the second Leg ID"};
88 Gaudi::Property<std::vector<uint32_t>> m_legC_vec {this, "LegCVec" , {0}, "Array with the third Leg ID"};
89 Gaudi::Property<std::vector< bool >> m_isLegA_MET_vec {this, "IsLegA_METVec", {false}, "Array with the first Leg MET identifier"};
90 Gaudi::Property<std::vector< bool >> m_isLegB_MET_vec {this, "IsLegB_METVec", {false}, "Array with the second Leg MET identifier"};
91 Gaudi::Property<std::vector< bool >> m_isLegC_MET_vec {this, "IsLegC_METVec", {false}, "Array with the third Leg MET identifier"};
92
93 // cuts
94 Gaudi::Property<std::vector<float>> m_varMin_vec {this, "LowerCutVec", {FLOATDEFAULT}, "Array with the lower cut for legs pair"};
95 Gaudi::Property<std::vector<float>> m_varMax_vec {this, "UpperCutVec", {FLOATDEFAULT}, "Array with the upper cut for legs pair"};
96
97 // monitoring
98 ToolHandleArray<GenericMonitoringTool> m_monTool_vec {this, "MonTools", {}, "Monitoring tools" };
99
101 std::vector<VarInfo> m_varInfo_vec;
102
103}; // DECISIONHANDLING_TRIG3VARCOMBOHYPOTOOL_H
104#endif
static thread_local std::ostringstream errmsg
Definition WaferTree.h:25
ComboHypoToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< std::vector< float > > m_varMax_vec
bool fillKineInfo(KineInfo &kinematics, Combo::LegDecision decision, bool isMET) const
static constexpr float FLOATDEFAULT
Gaudi::Property< std::vector< bool > > m_useMax_vec
Gaudi::Property< std::vector< std::string > > m_varTag_vec
Gaudi configuration hooks.
Gaudi::Property< std::vector< float > > m_varMin_vec
ToolHandleArray< GenericMonitoringTool > m_monTool_vec
bool executeAlgStep(const Combination &combination, const VarInfo &, std::vector< float > &values) const
Implementation of selection on individual variables.
std::vector< Combo::LegDecision > Combination
virtual StatusCode initialize() override
Gaudi::Property< std::vector< uint32_t > > m_legA_vec
StatusCode decide(Combo::LegDecisionsMap &passingLegs, const EventContext &) const final
Override the ComboHypoToolBase::decide in order to optimise combination generation This is to avoid e...
Trig3VarComboHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
float compute(const std::tuple< KineInfo, KineInfo, KineInfo > &kinetrio, ComboHypoVars var) const
Computation of the variables from the specified kinematics.
Gaudi::Property< std::vector< bool > > m_isLegC_MET_vec
std::vector< VarInfo > m_varInfo_vec
Internal variables for more efficient config lookup.
Gaudi::Property< std::vector< uint32_t > > m_legC_vec
std::tuple< float, float, float > KineInfo
alias for convenience, will contain eta/phi/pt info
Gaudi::Property< std::vector< uint32_t > > m_legB_vec
bool fillLegDecisions_diffLeg(std::tuple< Combo::LegDecision, Combo::LegDecision, Combo::LegDecision > &legtrio, const Combination &combination, uint32_t legA, uint32_t legB, uint32_t legC) const
Gaudi::Property< std::vector< bool > > m_isLegB_MET_vec
Gaudi::Property< std::vector< bool > > m_useMin_vec
Gaudi::Property< std::vector< bool > > m_isLegA_MET_vec
bool fillTrioKinematics(std::tuple< KineInfo, KineInfo, KineInfo > &kinetrio, const Combination &combination, const VarInfo &varInfo) const
Definition index.py:1
Organise info per var selection in a struct.
bool validate(std::string &errmsg) const
Check consistency of single var config.
std::string rangeStr() const
Generate range string for printing.