LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
reco3d::IntersectionCache Class Reference

Public Member Functions

 IntersectionCache (geo::TPCID tpc)
 
bool operator() (raw::ChannelID_t a, raw::ChannelID_t b, geo::WireIDIntersection &pt)
 

Protected Member Functions

bool ISect (raw::ChannelID_t chanA, raw::ChannelID_t chanB, geo::WireIDIntersection &pt) const
 

Protected Attributes

const geo::GeometryCoregeom
 
std::map< std::pair< raw::ChannelID_t, raw::ChannelID_t >, bool > fMap
 
std::map< std::pair< raw::ChannelID_t, raw::ChannelID_t >, geo::WireIDIntersectionfPtMap
 
geo::TPCID fTPC
 

Detailed Description

Definition at line 71 of file TripletFinder.cxx.

Constructor & Destructor Documentation

reco3d::IntersectionCache::IntersectionCache ( geo::TPCID  tpc)
inline

Definition at line 73 of file TripletFinder.cxx.

Member Function Documentation

bool reco3d::IntersectionCache::ISect ( raw::ChannelID_t  chanA,
raw::ChannelID_t  chanB,
geo::WireIDIntersection pt 
) const
inlineprotected

Definition at line 94 of file TripletFinder.cxx.

References geo::GeometryCore::ChannelToWire(), reco3d::TripletFinder::geom, and geo::GeometryCore::WireIDsIntersect().

95  {
96  for (geo::WireID awire : geom->ChannelToWire(chanA)) {
97  if (geo::TPCID(awire) != fTPC) continue;
98  for (geo::WireID bwire : geom->ChannelToWire(chanB)) {
99  if (geo::TPCID(bwire) != fTPC) continue;
100 
101  if (geom->WireIDsIntersect(awire, bwire, pt)) return true;
102  }
103  }
104 
105  return false;
106  }
std::vector< WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, Point_t &intersection) const
Computes the intersection between two wires.
const geo::GeometryCore * geom
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
bool reco3d::IntersectionCache::operator() ( raw::ChannelID_t  a,
raw::ChannelID_t  b,
geo::WireIDIntersection pt 
)
inline

Definition at line 77 of file TripletFinder.cxx.

78  {
79  const auto key = std::make_pair(a, b);
80 
81  auto it = fMap.find(key);
82  if (it != fMap.end()) {
83  pt = fPtMap[key];
84  return it->second;
85  }
86 
87  const bool res = ISect(a, b, pt);
88  fMap.insert({key, res});
89  fPtMap.insert({key, pt});
90  return res;
91  }
std::map< std::pair< raw::ChannelID_t, raw::ChannelID_t >, geo::WireIDIntersection > fPtMap
std::map< std::pair< raw::ChannelID_t, raw::ChannelID_t >, bool > fMap
bool ISect(raw::ChannelID_t chanA, raw::ChannelID_t chanB, geo::WireIDIntersection &pt) const

Member Data Documentation

std::map<std::pair<raw::ChannelID_t, raw::ChannelID_t>, bool> reco3d::IntersectionCache::fMap
protected

Definition at line 110 of file TripletFinder.cxx.

std::map<std::pair<raw::ChannelID_t, raw::ChannelID_t>, geo::WireIDIntersection> reco3d::IntersectionCache::fPtMap
protected

Definition at line 111 of file TripletFinder.cxx.

geo::TPCID reco3d::IntersectionCache::fTPC
protected

Definition at line 113 of file TripletFinder.cxx.

const geo::GeometryCore* reco3d::IntersectionCache::geom
protected

Definition at line 108 of file TripletFinder.cxx.


The documentation for this class was generated from the following file: