ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimHough1DShiftTool.cxx File Reference

See header file. More...

Go to the source code of this file.

Functions

static std::string to_string (std::vector< size_t > v)
static boost::dynamic_bitset lshift (boost::dynamic_bitset<> const &b, int n)
static boost::dynamic_bitset rshift (boost::dynamic_bitset<> const &b, int n)
static void updateBinHits (std::vector< boost::dynamic_bitset<> > &binHits, unsigned layer, boost::dynamic_bitset<> const &b)
static int layersHit (FPGATrackSimRoad &r)

Detailed Description

See header file.

Author
Riley Xu - riley.nosp@m..xu@.nosp@m.cern..nosp@m.ch
Date
October 31st, 2020

Definition in file FPGATrackSimHough1DShiftTool.cxx.

Function Documentation

◆ layersHit()

int layersHit ( FPGATrackSimRoad & r)
inlinestatic

Definition at line 715 of file FPGATrackSimHough1DShiftTool.cxx.

715 {
716 int cnt =0;
717 for (unsigned i = 0; i < r.getNLayers(); i++) {
718 if (r.getHitLayers() & (1<<i)) cnt++;
719 }
720 return cnt;
721}
int r
Definition globals.cxx:22

◆ lshift()

boost::dynamic_bitset lshift ( boost::dynamic_bitset<> const & b,
int n )
inlinestatic

Definition at line 565 of file FPGATrackSimHough1DShiftTool.cxx.

566{
567 if (n < 0) return rshift(b, -n);
568 return b << n;
569}
static boost::dynamic_bitset rshift(boost::dynamic_bitset<> const &b, int n)

◆ rshift()

boost::dynamic_bitset rshift ( boost::dynamic_bitset<> const & b,
int n )
inlinestatic

Definition at line 571 of file FPGATrackSimHough1DShiftTool.cxx.

572{
573 if (n < 0) return lshift(b, -n);
574
575 boost::dynamic_bitset<> out(b >> n);
576
577 // Force 0-padding
578 for (int i = 0; i < n; i++)
579 out[out.size() - 1 - i] = false;
580
581 return out;
582}
static boost::dynamic_bitset lshift(boost::dynamic_bitset<> const &b, int n)

◆ to_string()

std::string to_string ( std::vector< size_t > v)
inlinestatic

Definition at line 551 of file FPGATrackSimHough1DShiftTool.cxx.

552{
553 std::ostringstream oss;
554 oss << "[";
555 if (!v.empty())
556 {
557 std::copy(v.begin(), v.end()-1, std::ostream_iterator<size_t>(oss, ", "));
558 oss << v.back();
559 }
560 oss << "]";
561 return oss.str();
562}

◆ updateBinHits()

void updateBinHits ( std::vector< boost::dynamic_bitset<> > & binHits,
unsigned layer,
boost::dynamic_bitset<> const & b )
inlinestatic

Definition at line 584 of file FPGATrackSimHough1DShiftTool.cxx.

585{
586 for (size_t i = 0; i < b.size(); i++)
587 if (b[i]) binHits[i].set(layer);
588}