ATLAS Offline Software
Typedefs | Functions
Utility functions to access the different RoI objects with a single interface

Typedefs

using HLTSeedingRoIToolDefs::AnyRoIPointer = std::variant< const eFexEM::T_RoI *, const eFexTau::T_RoI *, const jFexFwdEl::T_RoI *, const jFexTau::T_RoI *, const jFexSRJet::T_RoI *, const jFexLRJet::T_RoI *, const gFexSRJet::T_RoI *, const Muon::T_RoI * >
 std::variant of const ptr to RoI types. Note identical types are only entered once in the template (e.g. no cTau which is same type as eFexTau) More...
 
using HLTSeedingRoIToolDefs::AnyRoIContainer = std::variant< eFexEM::T_RoIContainer, eFexTau::T_RoIContainer, jFexFwdEl::T_RoIContainer, jFexTau::T_RoIContainer, jFexSRJet::T_RoIContainer, jFexLRJet::T_RoIContainer, gFexSRJet::T_RoIContainer, Muon::T_RoIContainer >
 std::variant of RoI containers. Has to correspond directly to AnyRoIPointer types. More...
 

Functions

template<std::size_t I = 0>
std::optional< AnyRoIPointerHLTSeedingRoIToolDefs::roiFromLink (const xAOD::TrigComposite &tc, const std::string &linkName)
 Recursively try each type from AnyRoIPointer variant to retrieve an object from a TrigComposite link. More...
 
constexpr float HLTSeedingRoIToolDefs::roiPhi (const AnyRoIPointer &roi)
 
constexpr float HLTSeedingRoIToolDefs::roiEta (const AnyRoIPointer &roi)
 
constexpr unsigned int HLTSeedingRoIToolDefs::roiWord (const AnyRoIPointer &roi)
 
constexpr unsigned int HLTSeedingRoIToolDefs::roiTobEt (const AnyRoIPointer &roi)
 

Detailed Description

Typedef Documentation

◆ AnyRoIContainer

std::variant of RoI containers. Has to correspond directly to AnyRoIPointer types.

Definition at line 146 of file HLTSeedingRoIToolDefs.h.

◆ AnyRoIPointer

std::variant of const ptr to RoI types. Note identical types are only entered once in the template (e.g. no cTau which is same type as eFexTau)

Definition at line 144 of file HLTSeedingRoIToolDefs.h.

Function Documentation

◆ roiEta()

constexpr float HLTSeedingRoIToolDefs::roiEta ( const AnyRoIPointer roi)
constexpr

Definition at line 171 of file HLTSeedingRoIToolDefs.h.

171  {
172  return std::visit([](auto arg) -> float {return arg->eta();}, roi);
173  }

◆ roiFromLink()

template<std::size_t I = 0>
std::optional<AnyRoIPointer> HLTSeedingRoIToolDefs::roiFromLink ( const xAOD::TrigComposite tc,
const std::string &  linkName 
)
inline

Recursively try each type from AnyRoIPointer variant to retrieve an object from a TrigComposite link.

See https://stackoverflow.com/a/57643845

Definition at line 154 of file HLTSeedingRoIToolDefs.h.

154  {
155  if constexpr (I < std::variant_size_v<AnyRoIPointer>) {
156  using T_RoIContainer = std::variant_alternative_t<I,AnyRoIContainer>;
157  using T_RoI_constptr = std::variant_alternative_t<I,AnyRoIPointer>;
158  using T_RoI = std::remove_const_t<std::remove_pointer_t<T_RoI_constptr>>;
160  return AnyRoIPointer{tc.object<T_RoI>(linkName)};
161  }
162  return roiFromLink<I+1>(tc,linkName);
163  }
164  return std::nullopt;
165  }

◆ roiPhi()

constexpr float HLTSeedingRoIToolDefs::roiPhi ( const AnyRoIPointer roi)
constexpr

Definition at line 167 of file HLTSeedingRoIToolDefs.h.

167  {
168  return std::visit([](auto arg) -> float {return arg->phi();}, roi);
169  }

◆ roiTobEt()

constexpr unsigned int HLTSeedingRoIToolDefs::roiTobEt ( const AnyRoIPointer roi)
constexpr

Definition at line 206 of file HLTSeedingRoIToolDefs.h.

206  {
207  return std::visit([](auto arg) -> float {
208  using T = std::decay_t<decltype(arg)>;
209  if constexpr (std::is_same_v<T, const eFexEM::T_RoI*>) {
210  return (arg->*eFexEM::F_TobEtGetter)();
211  }
212  if constexpr (std::is_same_v<T, const eFexTau::T_RoI*>) {
213  return (arg->*eFexTau::F_TobEtGetter)();
214  }
215  if constexpr (std::is_same_v<T, const jFexFwdEl::T_RoI*>) {
216  return (arg->*jFexFwdEl::F_TobEtGetter)();
217  }
218  if constexpr (std::is_same_v<T, const jFexTau::T_RoI*>) {
219  return (arg->*jFexTau::F_TobEtGetter)();
220  }
221  if constexpr (std::is_same_v<T, const jFexSRJet::T_RoI*>) {
222  return (arg->*jFexSRJet::F_TobEtGetter)();
223  }
224  if constexpr (std::is_same_v<T, const jFexLRJet::T_RoI*>) {
225  return (arg->*jFexLRJet::F_TobEtGetter)();
226  }
227  if constexpr (std::is_same_v<T, const gFexSRJet::T_RoI*>) {
228  return (arg->*gFexSRJet::F_TobEtGetter)();
229  }
230  if constexpr (std::is_same_v<T, const Muon::T_RoI*>) {
231  return (arg->*Muon::F_TobEtGetter)();
232  }
233  return 0;
234  }, roi);
235  }

◆ roiWord()

constexpr unsigned int HLTSeedingRoIToolDefs::roiWord ( const AnyRoIPointer roi)
constexpr

Definition at line 175 of file HLTSeedingRoIToolDefs.h.

175  {
176  return std::visit([](auto arg) -> float {
177  using T = std::decay_t<decltype(arg)>;
178  if constexpr (std::is_same_v<T, const eFexEM::T_RoI*>) {
179  return (arg->*eFexEM::F_RoIWordGetter)();
180  }
181  if constexpr (std::is_same_v<T, const eFexTau::T_RoI*>) {
182  return (arg->*eFexTau::F_RoIWordGetter)();
183  }
184  if constexpr (std::is_same_v<T, const jFexFwdEl::T_RoI*>) {
185  return (arg->*jFexFwdEl::F_RoIWordGetter)();
186  }
187  if constexpr (std::is_same_v<T, const jFexTau::T_RoI*>) {
188  return (arg->*jFexTau::F_RoIWordGetter)();
189  }
190  if constexpr (std::is_same_v<T, const jFexSRJet::T_RoI*>) {
191  return (arg->*jFexSRJet::F_RoIWordGetter)();
192  }
193  if constexpr (std::is_same_v<T, const jFexLRJet::T_RoI*>) {
194  return (arg->*jFexLRJet::F_RoIWordGetter)();
195  }
196  if constexpr (std::is_same_v<T, const gFexSRJet::T_RoI*>) {
197  return (arg->*gFexSRJet::F_RoIWordGetter)();
198  }
199  if constexpr (std::is_same_v<T, const Muon::T_RoI*>) {
200  return (arg->*Muon::F_RoIWordGetter)();
201  }
202  return 0;
203  }, roi);
204  }
HLTSeedingRoIToolDefs::AnyRoIPointer
std::variant< const eFexEM::T_RoI *, const eFexTau::T_RoI *, const jFexFwdEl::T_RoI *, const jFexTau::T_RoI *, const jFexSRJet::T_RoI *, const jFexLRJet::T_RoI *, const gFexSRJet::T_RoI *, const Muon::T_RoI * > AnyRoIPointer
std::variant of const ptr to RoI types. Note identical types are only entered once in the template (e...
Definition: HLTSeedingRoIToolDefs.h:144
xAOD::TrigComposite_v1::hasObjectLink
bool hasObjectLink(const std::string &name, const CLID clid=CLID_NULL) const
Check if a link to an object with a given name and type exists. CLID_NULL to not check type.
Definition: TrigComposite_v1.cxx:226
xAOD::TrigComposite_v1::object
const OBJECT * object(const std::string &name) const
Get a bare pointer with the requested name.
HLTSeedingRoIToolDefs::Muon::F_TobEtGetter
constexpr auto F_TobEtGetter
Definition: HLTSeedingRoIToolDefs.h:133
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
HLTSeedingRoIToolDefs::Muon::T_RoI
xAOD::MuonRoI T_RoI
Definition: HLTSeedingRoIToolDefs.h:130
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
HLTSeedingRoIToolDefs::Muon::T_RoIContainer
xAOD::MuonRoIContainer T_RoIContainer
Definition: HLTSeedingRoIToolDefs.h:131
HLTSeedingRoIToolDefs::Muon::F_RoIWordGetter
constexpr auto F_RoIWordGetter
Definition: HLTSeedingRoIToolDefs.h:132
I
#define I(x, y, z)
Definition: MD5.cxx:116
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35