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 716 of file FPGATrackSimHough1DShiftTool.cxx.

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

◆ lshift()

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

Definition at line 566 of file FPGATrackSimHough1DShiftTool.cxx.

567{
568 if (n < 0) return rshift(b, -n);
569 return b << n;
570}
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 572 of file FPGATrackSimHough1DShiftTool.cxx.

573{
574 if (n < 0) return lshift(b, -n);
575
576 boost::dynamic_bitset<> out(b >> n);
577
578 // Force 0-padding
579 for (int i = 0; i < n; i++)
580 out[out.size() - 1 - i] = false;
581
582 return out;
583}
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 552 of file FPGATrackSimHough1DShiftTool.cxx.

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

◆ updateBinHits()

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

Definition at line 585 of file FPGATrackSimHough1DShiftTool.cxx.

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