16 #ifdef XAOD_STANDALONE
29 #ifdef XAOD_STANDALONE
30 static std::once_flag
flag;
31 std::call_once (
flag, [] ()
46 static std::atomic<unsigned>
index = 0;
55 return std::is_same_v<ColumnarModeDefault,ColumnarModeArray>;
65 throw std::runtime_error (
"tool does not implement IColumnarTool");
77 m_toolWrapper = std::make_shared<ColumnarToolWrapper> (m_tool);
86 m_toolWrapper = std::make_shared<ColumnarToolWrapper> (m_tool);
96 if (m_systTool ==
nullptr)
99 throw std::runtime_error (
"failed to apply systematic variation");
108 throw std::runtime_error (
"tool not initialized");
109 return m_toolWrapper->getColumnInfo ();
118 throw std::runtime_error (
"tool not initialized");
119 return m_toolWrapper->getColumnNames ();
129 std::vector<std::string>
result;
141 throw std::runtime_error (
"tool not initialized");
142 return *m_toolWrapper;
163 throw std::runtime_error (
"column already exists: " +
column.name);
173 if (
column == m_columnMap.end())
174 throw std::runtime_error (
"adding unknown column: " +
name);
175 if (m_inputs.contains (
name))
176 throw std::runtime_error (
"column added twice: " +
name);
177 if (
column->second.type == &
typeid(
float))
179 else if (
column->second.type == &
typeid(
char))
181 else if (
column->second.type == &
typeid(
int))
184 addInputTyped<std::uint8_t> (
name,
data);
186 addInputTyped<std::uint16_t> (
name,
data);
188 addInputTyped<std::uint32_t> (
name,
data);
190 addInputTyped<std::uint64_t> (
name,
data);
192 throw std::logic_error (
"column name " +
name +
" has unsupported type " +
column->second.type->name() +
", extend test handler to support it");
201 if (
column == m_columnMap.end())
202 throw std::runtime_error (
"adding unknown column: " +
name);
203 if (m_expectations.contains (
name))
204 throw std::runtime_error (
"column added twice: " +
name);
205 if (
column->second.type == &
typeid(
float))
207 else if (
column->second.type == &
typeid(
char))
209 else if (
column->second.type == &
typeid(
int))
212 addExpectationTyped<std::uint8_t> (
name,
values);
214 addExpectationTyped<std::uint16_t> (
name,
values);
216 addExpectationTyped<std::uint32_t> (
name,
values);
218 addExpectationTyped<std::uint64_t> (
name,
values);
220 throw std::logic_error (
"column name " +
name +
" has unsupported type " +
column->second.type->name() +
", extend test handler to support it");
228 auto iter = m_inputs.find (
name);
229 if (iter == m_inputs.end())
230 throw std::runtime_error (
"column not found: " +
name);
231 return std::visit ([] (
const auto&
data) {
return data.size(); }, iter->second);
239 for (
auto& [
name, columnInfo] : m_columnMap)
241 if (
auto iter = m_inputs.find (columnInfo.name); iter != m_inputs.end())
243 switch (columnInfo.accessMode)
246 std::visit ([&] (
const auto&
data)
248 m_columnData->setColumn (iter->first,
data.size(),
data.data());
253 std::visit ([&] (
auto&
data)
255 m_columnData->setColumn (iter->first,
data.size(),
data.data());
256 }, m_activeColumns[iter->first] = iter->second);
259 throw std::runtime_error (
"column mode unknown: " + columnInfo.name);
270 m_columnData->call ();
278 for (
auto& [
name,
info] : m_columnMap)
283 auto iter = m_activeColumns.find (
name);
284 if (iter == m_activeColumns.end())
287 if (
info.type == &
typeid(
float))
288 checkExpectationTyped<float> (
name);
289 else if (
info.type == &
typeid(
char))
290 checkExpectationTyped<char> (
name);
291 else if (
info.type == &
typeid(
int))
292 checkExpectationTyped<int> (
name);
294 checkExpectationTyped<std::uint8_t> (
name);
296 checkExpectationTyped<std::uint16_t> (
name);
298 checkExpectationTyped<std::uint32_t> (
name);
300 checkExpectationTyped<std::uint64_t> (
name);
302 throw std::logic_error (
"column name " +
name +
" has unsupported type " +
info.type->name() +
", extend test handler to support it");