23 for (
const auto&
l : m_hits_trans)
n +=
l.size();
29 std::vector<size_t>
out;
30 out.reserve(m_hits_trans.size());
31 for (
const auto&
l : m_hits_trans)
out.push_back(
l.size());
38 size_t l = m_hits_trans.size();
39 std::vector<unsigned int> skipindices;
43 for (
size_t i = 1;
i <
l; ++
i) {
44 if (m_hits_trans[
i - 1].
size() > 0 && m_hits_trans[
i].
size() > 0) {
46 (m_hits_trans[
i - 1][0]->getPhysLayer() % 2 == 0) &&
47 (m_hits_trans[
i][0]->getPhysLayer() - m_hits_trans[
i - 1][0]->getPhysLayer() == 1)) {
48 skipindices.push_back(
i);
55 for (
size_t i = 0;
i <
l; ++
i) {
57 for (
size_t j = 0; j < m_hits_trans[
i].size(); ++j) {
61 size_t skipsize = skipindices.size();
62 for (
size_t k = 0;
k < skipsize; ++
k)
63 if (
i == skipindices[
k])
skip =
true;
69 if (
n > 0) combos *=
n;
81 for (nPixel = 0; nPixel < m_hits_trans.size(); nPixel++)
82 if (!m_hits_trans[nPixel].
empty() && m_hits_trans[nPixel].front()->
isStrip())
85 std::map<FPGATrackSimMultiTruth::Barcode, layer_bitmask_t> layer_map;
87 for (
auto const&
hits : m_hits_trans)
88 for (
auto const &
h :
hits)
89 for (
auto const&
x :
h->getTruth())
90 layer_map[
x.first] |= (1 <<
h->getLayer());
93 for (
auto const&
x : layer_map)
96 for (
unsigned i = 0;
i < m_hits_trans.size();
i++)
98 if (!m_hits_trans[
i].
empty())
99 n += (
i < nPixel) ? 2 : 1;
100 if (
x.second & (1 <<
i))
101 w += (
i < nPixel) ? 2 : 1;
104 throw std::range_error(
"divide by zero in FPGATrackSimRoad::getTruth");
106 mt.
add(
x.first,
static_cast<float>(
w) /
n);
114 std::unordered_set<std::shared_ptr<const FPGATrackSimHit>>
hits;
115 for (
const auto& layerHits : m_hits_trans)
116 for (
auto const& hit : layerHits)
123 m_hits_trans.resize(m_hits.size());
124 for (
unsigned ilayer = 0; ilayer < m_hits.size(); ilayer++) {
125 m_hits_trans[ilayer].resize(m_hits[ilayer].
size());
126 for (
unsigned ihit = 0; ihit < m_hits[ilayer].size(); ihit++) {
127 m_hits_trans[ilayer][ihit] = std::make_shared<const FPGATrackSimHit>(m_hits[ilayer][ihit]);
134 m_hits[
layer].clear();
135 for (
const auto& hit : m_hits_trans[
layer])
136 m_hits[
layer].push_back(*hit);
140 if (
hits.size() != m_hits_trans.size()) setNLayers(
hits.size());
141 for (
unsigned i = 0;
i <
hits.size();++
i)
142 setHits(
i,std::move(
hits[
i]));
149 <<
": PID " << road.
m_pid
151 <<
" hitLayers " << std::showbase << std::hex << road.
m_hit_layers