23 #include <TMathBase.h>
34 throw std::invalid_argument(
"Missing input filename");
37 throw std::invalid_argument(
"Missing tree name");
44 auto setBranches = [&](
const auto& keys,
auto& columns) {
45 for (
auto key : keys) {
46 columns.insert({key, f++});
48 for (
auto key : keys) {
73 auto nEntries =
static_cast<std::size_t
>(
m_inputChain->GetEntriesFast());
80 for (
auto i = 1ul;
i < nEntries; ++
i) {
94 [](
const auto&
a,
const auto&
b) {
95 return std::get<0>(
a) < std::get<0>(
b);
106 return {std::get<0>(m_eventMap.front()), std::get<0>(m_eventMap.back()) + 1};
111 auto it = std::find_if(
112 m_eventMap.begin(), m_eventMap.end(),
113 [&](
const auto&
a) {
return std::get<0>(
a) == context.
eventNumber; });
115 if (
it == m_eventMap.end()) {
118 if ((context.
eventNumber == availableEvents().first) &&
119 (context.
eventNumber == availableEvents().second - 1)) {
125 m_outputSimHits(context, {});
132 std::lock_guard<std::mutex> lock(m_read_mutex);
135 <<
" stored in entries: " << std::get<1>(*
it)
136 <<
" - " << std::get<2>(*
it));
139 for (
auto entry = std::get<1>(*
it); entry < std::get<2>(*it); ++
entry) {
140 m_inputChain->GetEntry(
entry);
142 auto eventId = m_uint32Columns.at(
"event_id");
149 const auto index = m_int32Columns.at(
"index");
172 SimHit hit(geoid, pid, pos4, before4, before4 + delta,
index);
177 m_outputSimHits(context,
std::move(hits));