ATLAS Offline Software
Namespaces | Classes | Typedefs | Functions
GlobalSim Namespace Reference

AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench correspond to those produced by eEmMultAlgTool. More...

Namespaces

 BDT
 
 IOBitwise
 

Classes

struct  ap_fixed
 
struct  ap_int
 
class  CommonSelector
 
struct  digitizer
 
class  eEmMultAlgTool
 AlgTool to count GlobalSim::IOBitwise::eEmTOB objects. More...
 
class  eEmMultTestBench
 Algorithm to count create inputs and expectations to test the eEmMultAlgTool class. More...
 
class  eEmMultTestComparator
 
class  eEmSelector
 
class  eEmTOBArray
 
class  eFexCvtrAlgTool
 AlgTool to move eFex TOBS into the GlobalSim TOB system. More...
 
class  eFexRoIAlgTool
 
class  Egamma1_LArStrip_Fex
 
class  Egamma1_LArStrip_Fex_RowAware
 
class  Egamma1BDTAlgTool
 
class  Egamma1eRatioAlgTool
 
class  EMB1CellsFromCaloCells
 
struct  Feb2MuxInfo
 Helper struct to keep track of correct order of FEB2 for each MUX. More...
 
class  geq
 
class  GlobalCellTowerAlgTool
 
class  GlobalLArCell
 
class  GlobalLArCellContainer
 
class  GlobalSimulationAlg
 
class  gt
 
class  ICaloCellsProducer
 
class  ICommonSelector
 
class  ICutter
 
class  IeEmSelector
 
class  IGlobalSimAlgTool
 
class  ITIPwriterAlgTool
 
class  LArCellMuxAlg
 
class  LArCellPreparationAlg
 
class  LArStripNeighborhood
 Class to hold windows of LAr strip cells in a the neighbourhood of a eFexRoI. More...
 
class  LArStripNeighborhoodDumper
 
class  leq
 
class  lt
 
struct  Round
 
struct  StripData
 
struct  Tracer
 
struct  Trunc
 
struct  XilDef
 

Typedefs

typedef ap_int< 10 > input_t
 
typedef input_t input_arr_t[n_features]
 
typedef ap_int< 10 > threshold_t
 
typedef ap_fixed< 10, 5 > score_t
 
typedef score_t score_arr_t[n_classes]
 
typedef float accelerator_input_t
 
typedef float accelerator_output_t
 
using TIPword = std::bitset< ITIPwriterAlgTool::s_nbits_TIP >
 
using StripDataVector = std::vector< StripData >
 
using Coords = std::pair< double, double >
 
using LArStripNeighborhoodContainer = DataVector< LArStripNeighborhood >
 

Functions

std::unique_ptr< ICuttermake_cutter (const ulong &cut, const std::string &op)
 
std::optional< std::vector< std::size_t > > wrap3 (std::size_t center)
 
std::optional< std::vector< std::size_t > > wrap5 (std::size_t center)
 
void dump_stripdataVector (const StripDataVector &sdv, std::ostream &os)
 
void dump_n (const LArStripNeighborhood &n, std::ostream &os)
 
template<std::size_t width, typename T >
constexpr T max_to_overflow ()
 
char hex_char (std::string::size_type begin, std::string::size_type end, const std::string &s)
 
std::string binStrToHexStr (std::string s)
 
template<typename T >
void dump (const std::string &fn, const T &t)
 
std::string hexStrToBinStr (std::string s)
 
std::bitset< 72 > hexTOB2bitsetTOB (std::string s)
 
std::string trim (std::string s)
 

Detailed Description

AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench correspond to those produced by eEmMultAlgTool.

AlgTool to read in LArStripNeighborhoods, and run the eRatio Algorithm.

AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.

AlgTool to obtain a selection of eFex RoIs read in from the event store.

Typedef Documentation

◆ accelerator_input_t

Definition at line 23 of file parameters.h.

◆ accelerator_output_t

Definition at line 24 of file parameters.h.

◆ Coords

using GlobalSim::Coords = typedef std::pair<double, double>

Definition at line 25 of file LArStripNeighborhood.h.

◆ input_arr_t

typedef input_t GlobalSim::input_arr_t[n_features]

Definition at line 19 of file parameters.h.

◆ input_t

Definition at line 18 of file parameters.h.

◆ LArStripNeighborhoodContainer

Definition at line 14 of file LArStripNeighborhoodContainer.h.

◆ score_arr_t

typedef score_t GlobalSim::score_arr_t[n_classes]

Definition at line 22 of file parameters.h.

◆ score_t

Definition at line 21 of file parameters.h.

◆ StripDataVector

using GlobalSim::StripDataVector = typedef std::vector<StripData>

Definition at line 24 of file LArStripNeighborhood.h.

◆ threshold_t

Definition at line 20 of file parameters.h.

◆ TIPword

using GlobalSim::TIPword = typedef std::bitset<ITIPwriterAlgTool::s_nbits_TIP>

Definition at line 36 of file ITIPwriterAlgTool.h.

Function Documentation

◆ binStrToHexStr()

std::string GlobalSim::binStrToHexStr ( std::string  s)

Definition at line 37 of file binStrToHexStr.h.

37  {
38 
39  if (s.size() == 0) {return "";}
40 
41 
42  bool header{false};
43 
44  if ((s.starts_with("0b") or s.starts_with("0B")) and s.size() >=2){
45  if (s.size() == 2) {return "";};
46  header = true;
47  }
48 
49  const std::string::size_type offset = header ? 2:0;
50  const auto sz = s.size()-offset;
51 
52 
53  auto is_bin_char = [](const auto& c) {return c == '0' or c == '1';};
54 
55  if (!std::all_of(std::cbegin(s)+offset, std::cend(s), is_bin_char)) {
56  throw std::out_of_range("ss contains non-binary char");
57  }
58 
59  const auto n_ragged = sz - 4*(sz/4);
60 
61  std::string result;
62  result.reserve (n_ragged ? 1+(sz)/4 : (sz)/4);
63 
64 
65  std::string::size_type start{offset};
66  std::string::size_type stop{offset+n_ragged};
67 
68  if (n_ragged) {result.push_back(hex_char(start, stop, s));}
69 
70  start = offset+n_ragged;
71  stop = start + 4;
72 
73  if (stop > s.size()) {return result;}
74 
75 
76  for (auto i = start; i != s.size(); i += 4) {
77  result.push_back(hex_char(i, i+4, s));
78 
79  start = stop;
80  stop += 4;
81  }
82 
83  return result;
84 
85  }

◆ dump()

template<typename T >
void GlobalSim::dump ( const std::string &  fn,
const T &  t 
)

◆ dump_n()

void GlobalSim::dump_n ( const LArStripNeighborhood n,
std::ostream &  os 
)

Definition at line 57 of file LArStripNeighborhoodDumper.cxx.

58  {
59  dump_stripdataVector(n.phi_low(), os);
60  dump_stripdataVector(n.phi_center(), os);
61  dump_stripdataVector(n.phi_high(), os);
62  }

◆ dump_stripdataVector()

void GlobalSim::dump_stripdataVector ( const StripDataVector sdv,
std::ostream &  os 
)

Definition at line 37 of file LArStripNeighborhoodDumper.cxx.

37  {
38 
39  for(const auto& sd : sdv) {
40  os << sd.m_eta << ' ';
41  }
42  os << '\n';
43 
44 
45  for(const auto& sd : sdv) {
46  os << sd.m_phi << ' ';
47  }
48  os << '\n';
49 
50  for(const auto & sd : sdv) {
51  os << sd.m_e << ' ';
52  }
53  os << '\n';
54  os << '\n';
55  }

◆ hex_char()

char GlobalSim::hex_char ( std::string::size_type  begin,
std::string::size_type  end,
const std::string &  s 
)

Definition at line 15 of file binStrToHexStr.h.

17  {
18  auto place_val{1U};
19  for (auto i{begin+1}; i != end; ++i) {
20  place_val *= 2;
21  }
22 
23  auto val{0U};
24  for (std::size_t i{begin}; i != end; ++i) {
25  if (s[i] == '1') {val += place_val;}
26  place_val /= 2;
27  }
28 
29  if (val < 10) {
30 
31  return char('0' + val);
32  }
33 
34  return char('a' + val-10);
35  }

◆ hexStrToBinStr()

std::string GlobalSim::hexStrToBinStr ( std::string  s)

Definition at line 12 of file hexStrToBinStr.cxx.

12  {
13  if (s[0] == '0' and std::tolower(s[1]) == 'x' and s.size()>2) {
14  s.assign(std::begin(s)+2, std::end(s));
15  }
16  std::string alpha{"abcdef"};
17  std::string result;
18  for (auto c : s){
19  c = std::tolower(c);
20  int num;
21  if (std::isdigit(c)) {
22  num = int(c) - int('0');
23  } else if (alpha.find(c) != std::string::npos){
24  num = int(c) - int('a') + 10;
25  } else {
26  throw std::out_of_range("not hex character");
27  }
28 
29  short mask{8};
30  for (int j = 3; j != -1; --j) {
31  result += (mask & num) ? '1' : '0';
32  mask = mask >> 1;
33  }
34  }
35 
36  return result;
37  }

◆ hexTOB2bitsetTOB()

std::bitset< 72 > GlobalSim::hexTOB2bitsetTOB ( std::string  s)

Definition at line 8 of file hexTOB2bitsetTOB.cxx.

8  {
9 
10  auto bit_tob = std::bitset<72>();
11  auto bs = std::bitset<4>();
12 
13  std::size_t ind{s.size()*4};
14 
15  // ensure s is lower case
16  std::transform(s.begin(), s.end(), s.begin(),
17  [](unsigned char c){return std::tolower(c);});
18 
19  for(const char& c : s) {
20  bs = (c >= 'a') ? (c - 'a' + 10) : (c-'0');
21  for (int j = 3; j != -1; --j) {
22  bit_tob[--ind] = bs[j];
23  }
24  if (ind == 0) {break;}
25  }
26  return bit_tob;
27  }

◆ make_cutter()

std::unique_ptr<ICutter> GlobalSim::make_cutter ( const ulong &  cut,
const std::string &  op 
)

Definition at line 82 of file eEmSelector.cxx.

83  {
84 
85  auto cutter = std::unique_ptr<ICutter>(nullptr);
86 
87  if (op == ">"){
88  cutter.reset(new gt(cut));
89  } else if (op == ">="){
90  cutter.reset(new geq(cut));
91  } else if (op == "<"){
92  cutter.reset(new lt(cut));
93  } else if (op == "<="){
94  cutter.reset(new leq(cut));
95  } else {
96  throw std::invalid_argument("unown operator " + op);
97  }
98 
99 
100 
101  return cutter;
102  }

◆ max_to_overflow()

template<std::size_t width, typename T >
constexpr T GlobalSim::max_to_overflow ( )
constexpr

Definition at line 27 of file ap_fixed.h.

27  {
28  T t{0};
29  static_assert(8*sizeof(t) >= width, "ap_fixed underlying int to small");
30  for (std::size_t i = 0; i <= sizeof(t)*8-width; ++i){
31  T bit{1};
32  t = t+(bit<<i);
33  }
34 
35  t = t << (width-1);
36  return t;
37  }

◆ trim()

std::string GlobalSim::trim ( std::string  s)

Definition at line 7 of file trim.cxx.

7  {
8  const char* t = " \t\n\r\f\v";
9 
10  // trim from right
11  auto l_rtrim = [&t](std::string& str){
12  str.erase(str.find_last_not_of(t) + 1);
13  return str;
14  };
15 
16  // trim from left
17  auto l_ltrim = [&t] (std::string& str){
18  str.erase(0, str.find_first_not_of(t));
19  return str;
20  };
21 
22  auto rs = l_rtrim(s);
23  return l_ltrim(rs);
24  }

◆ wrap3()

std::optional<std::vector<std::size_t> > GlobalSim::wrap3 ( std::size_t  center)

Definition at line 25 of file Egamma1_LArStrip_Fex.cxx.

25  {
26  if (center > 63) {
27  return std::optional<std::vector<std::size_t>>{};
28  }
29 
30  if (center == 63) {
31  return std::make_optional(std::vector<std::size_t>({62ul, 63ul, 0ul}));
32  }
33 
34  if (center == 0) {
35  return std::make_optional(std::vector<std::size_t>({63ul, 0ul, 1ul}));
36  }
37 
38  return std::make_optional(std::vector<std::size_t>(
39  {center-1,
40  center,
41  center+1}));
42  }

◆ wrap5()

std::optional<std::vector<std::size_t> > GlobalSim::wrap5 ( std::size_t  center)

Definition at line 25 of file Egamma1_LArStrip_Fex_RowAware.cxx.

25  {
26  if (center > 63) {
27  return std::optional<std::vector<std::size_t>>{};
28  }
29 
30  if (center == 63) {
31  return std::make_optional(std::vector<std::size_t>({61ul, 62ul, 63ul, 0ul, 1ul}));
32  }
33 
34  if (center == 0) {
35  return std::make_optional(std::vector<std::size_t>({62ul, 63ul, 0ul, 1ul, 2ul}));
36  }
37 
38  return std::make_optional(std::vector<std::size_t>(
39  {center-2,
40  center-1,
41  center,
42  center+1,
43  center+2}));
44  }
add-xsec-uncert-quadrature-N.alpha
alpha
Definition: add-xsec-uncert-quadrature-N.py:110
fitman.sz
sz
Definition: fitman.py:527
get_generator_info.result
result
Definition: get_generator_info.py:21
header
Definition: hcg.cxx:527
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:13
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
GlobalSim::hex_char
char hex_char(std::string::size_type begin, std::string::size_type end, const std::string &s)
Definition: binStrToHexStr.h:15
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:459
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
python.selector.AtlRunQuerySelectorLhcOlc.sd
sd
Definition: AtlRunQuerySelectorLhcOlc.py:611
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:727
tolower
void tolower(std::string &s)
Definition: AthenaSummarySvc.cxx:108
python.CaloAddPedShiftConfig.str
str
Definition: CaloAddPedShiftConfig.py:42
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
detail::ul
unsigned long ul
Definition: PrimitiveHelpers.h:47
GlobalSim::dump_stripdataVector
void dump_stripdataVector(const StripDataVector &sdv, std::ostream &os)
Definition: LArStripNeighborhoodDumper.cxx:37
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
str
Definition: BTagTrackIpAccessor.cxx:11
python.compressB64.c
def c
Definition: compressB64.py:93
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35