ATLAS Offline Software
Typedefs | Functions | Variables
detail Namespace Reference

Typedefs

using BCondTag_t = FlavorTagDiscriminants::DecoratorAlg< xAOD::BTaggingContainer, IBTagConditionalDecorator, xAOD::TrackParticleContainer >
 
using BTag_t = FlavorTagDiscriminants::DecoratorAlg< xAOD::BTaggingContainer, IBTagDecorator, xAOD::TrackParticleContainer >
 
using BTagToJet_t = FlavorTagDiscriminants::BacklinkAlg< xAOD::JetContainer, xAOD::BTaggingContainer >
 
using JetCondTag_t = FlavorTagDiscriminants::DecoratorAlg< xAOD::JetContainer, IJetTagConditionalDecorator, xAOD::TrackParticleContainer >
 
using JetTag_t = FlavorTagDiscriminants::DecoratorAlg< xAOD::JetContainer, IJetTagDecorator, xAOD::TrackParticleContainer >
 
using JetToBTag_t = FlavorTagDiscriminants::BacklinkAlg< xAOD::BTaggingContainer, xAOD::JetContainer >
 
using CountIParticle_t = FlavorTagDiscriminants::LinkCounterAlg< xAOD::IParticleContainer, xAOD::IParticleContainer >
 
using CountTrackParticle_t = FlavorTagDiscriminants::LinkCounterAlg< xAOD::TrackParticleContainer, xAOD::BTaggingContainer >
 
template<typename T >
using defaultAccessor_t = decltype(defaultAccessor< T >)
 
using uchar = unsigned char
 
using uint = unsigned int
 
using ushort = unsigned short
 
using ull = unsigned long long
 
using ul = unsigned long
 
using ll = long long
 

Functions

std::pair< std::string, int > extract_histogram_tag (const std::string &histo_name)
 Extract tag/LB number from per-LBN histogram name. More...
 
bool isCustom (const Primitive &p)
 
bool isCustom (const Primitive::Type &t)
 
template<typename T , typename I , typename A , typename S = T>
std::function< T(I)> get (std::string source, A ass, T def)
 
template<typename T , typename A = defaultAccessor_t<T>>
void addInput (T &c, const Primitive &input, A a=defaultAccessor< T >)
 

Variables

template<typename T >
auto defaultAccessor = [](typename T::input_type in){ return in; }
 

Typedef Documentation

◆ BCondTag_t

Definition at line 15 of file BTagConditionalDecoratorAlg.h.

◆ BTag_t

Definition at line 16 of file BTagDecoratorAlg.h.

◆ BTagToJet_t

Definition at line 13 of file BTagToJetLinkerAlg.h.

◆ CountIParticle_t

Definition at line 9 of file CountIParticleAlg.h.

◆ CountTrackParticle_t

Definition at line 10 of file CountTrackParticleAlg.h.

◆ defaultAccessor_t

template<typename T >
using detail::defaultAccessor_t = typedef decltype(defaultAccessor<T>)

Definition at line 39 of file PrimitiveHelpers.h.

◆ JetCondTag_t

Definition at line 17 of file JetTagConditionalDecoratorAlg.h.

◆ JetTag_t

Definition at line 15 of file JetTagDecoratorAlg.h.

◆ JetToBTag_t

Definition at line 13 of file JetToBTagLinkerAlg.h.

◆ ll

using detail::ll = typedef long long

Definition at line 46 of file PrimitiveHelpers.h.

◆ uchar

using detail::uchar = typedef unsigned char

Definition at line 41 of file PrimitiveHelpers.h.

◆ uint

using detail::uint = typedef unsigned int

Definition at line 42 of file PrimitiveHelpers.h.

◆ ul

using detail::ul = typedef unsigned long

Definition at line 45 of file PrimitiveHelpers.h.

◆ ull

using detail::ull = typedef unsigned long long

Definition at line 44 of file PrimitiveHelpers.h.

◆ ushort

using detail::ushort = typedef unsigned short

Definition at line 43 of file PrimitiveHelpers.h.

Function Documentation

◆ addInput()

template<typename T , typename A = defaultAccessor_t<T>>
void detail::addInput ( T &  c,
const Primitive input,
A  a = defaultAccessor<T> 
)

Definition at line 49 of file PrimitiveHelpers.h.

49  {
50  using I = typename T::input_type;
51  using Tp = Primitive::Type;
52  std::string s = input.source;
53  std::string t = input.target.empty() ? input.source : input.target;
55  const char cz = char(0);
56  const char cm = char(-1);
57  const char sm = short(-1);
58  switch (input.type) {
59  case Tp::PRECISION_CUSTOM: // intentional fall-through
60  case Tp::CUSTOM: throw std::logic_error("custom type unsupported");
61  case Tp::UCHAR: c.add(t, get<uchar,I,A>(s,a,cz), cz); return;
62  case Tp::CHAR: c.add(t, get<char,I,A>(s,a,cm), cm); return;
63  case Tp::USHORT: c.add(t, get<ushort,I,A>(s,a,cz), cz); return;
64  case Tp::SHORT: c.add(t, get<short,I,A>(s,a,sm), sm); return;
65  case Tp::UINT: c.add(t, get<uint,I,A>(s,a,0), 0); return;
66  case Tp::INT: c.add(t, get<int,I,A>(s,a,-1), -1); return;
67  case Tp::ULONG: c.add(t, get<ul,I,A>(s,a,0), 0); return;
68  case Tp::LONG: c.add(t, get<long,I,A>(s,a,-1), -1); return;
69  case Tp::ULL: c.add(t, get<ull,I,A>(s,a,0), 0); return;
70  case Tp::LL: c.add(t, get<ll,I,A>(s,a,-1), -1); return;
71  case Tp::HALF: c.add(t, get<float,I,A>(s,a,NAN), NAN, h); return;
72  case Tp::FLOAT: c.add(t, get<float,I,A>(s,a,NAN), NAN); return;
73  case Tp::DOUBLE: c.add(t, get<double,I,A>(s,a,NAN), NAN); return;
74  case Tp::UINT2UCHAR: c.add(t, get<uchar,I,A,uint>(s,a,0), 0); return;
75  case Tp::INT2CHAR: c.add(t, get<char,I,A,int>(s,a,cm), cm); return;
76  case Tp::UINT2USHORT: c.add(t, get<ushort,I,A,uint>(s,a,0), 0); return;
77  case Tp::INT2SHORT: c.add(t, get<short,I,A,int>(s,a,sm), sm); return;
78  case Tp::UL2ULL: c.add(t, get<ull,I,A,ul>(s,a,0),0); return;
79  }
80  }

◆ extract_histogram_tag()

std::pair< std::string, int > detail::extract_histogram_tag ( const std::string &  histo_name)

Extract tag/LB number from per-LBN histogram name.

This method supports naming conventions used in run2 and run3. It returns a histogram hame without LB number in it and a tag (LBN) extracted from the name. If histogram name does not have LBN in it then the name is returned without any change, and tag is set to -1.

Definition at line 16 of file extract_histogram_tag.cxx.

17 {
18  std::smatch what;
19  if (std::regex_match(histo_name, what, ::lbRegex_run2)) {
20  try {
21  int tag = std::stoi(what.str(1));
22  return std::make_pair(what[2], tag);
23  } catch(std::exception &ex) {
24  // should not happen but be defensive and just ignore it
25  }
26  }
27  if (std::regex_match(histo_name, what, ::lbRegex_run3)) {
28  std::string const tagStr = what[3].length() > 0 ? what.str(3) : what.str(4);
29  try {
30  int tag = std::stoi(tagStr);
31  return std::make_pair(what[1], tag);
32  } catch(std::exception &ex) {
33  // should not happen but be defensive and just ignore it
34  }
35  }
36  return std::make_pair(histo_name, -1);
37 }

◆ get()

template<typename T , typename I , typename A , typename S = T>
std::function<T(I)> detail::get ( std::string  source,
A  ass,
def 
)

Definition at line 22 of file PrimitiveHelpers.h.

22  {
24  using rettype = decltype(ass(std::declval<I>()));
25  if constexpr (std::is_pointer<rettype>::value) {
26  return [acc, ass, def](I in) -> T {
27  const auto* associated = ass(in);
28  if (!associated) return def;
29  return acc(*associated);
30  };
31  } else {
32  return [acc, ass](I in) -> T { return acc(ass(in)); };
33  }
34  }

◆ isCustom() [1/2]

bool detail::isCustom ( const Primitive p)

Definition at line 10 of file PrimitiveHelpers.cxx.

10  {
11  return isCustom(p.type);
12  }

◆ isCustom() [2/2]

bool detail::isCustom ( const Primitive::Type t)

Definition at line 13 of file PrimitiveHelpers.cxx.

13  {
14  using Tp = Primitive::Type;
15  return std::unordered_set {
16  Tp::CUSTOM, Tp::PRECISION_CUSTOM
17  }.count(t);
18  }

Variable Documentation

◆ defaultAccessor

template<typename T >
auto detail::defaultAccessor = [](typename T::input_type in){ return in; }

Definition at line 37 of file PrimitiveHelpers.h.

python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
xAOD::short
short
Definition: Vertex_v1.cxx:165
detail::isCustom
bool isCustom(const Primitive::Type &t)
Definition: PrimitiveHelpers.cxx:13
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
athena.value
value
Definition: athena.py:124
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
H5Utils::Compression::HALF_PRECISION
@ HALF_PRECISION
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
calibdata.exception
exception
Definition: calibdata.py:496
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
python.ExitCodes.what
def what(code)
Definition: ExitCodes.py:73
Primitive::Type
Type
Definition: Primitive.h:11
a
TList * a
Definition: liststreamerinfos.cxx:10
h
copySelective.source
string source
Definition: copySelective.py:32
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
I
#define I(x, y, z)
Definition: MD5.cxx:116
python.compressB64.c
def c
Definition: compressB64.py:93
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
ass
make the histogram assessment part of the config
Definition: hcg.cxx:626