LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 67 of file TripletFinder.cxx.

Constructor & Destructor Documentation

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

Definition at line 70 of file TripletFinder.cxx.

71  : geom(art::ServiceHandle<geo::Geometry>()->provider()),
72  fTPC(tpc)
73  {
74  }
const geo::GeometryCore * geom

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().

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

Definition at line 76 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 111 of file TripletFinder.cxx.

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

Definition at line 112 of file TripletFinder.cxx.

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

Definition at line 114 of file TripletFinder.cxx.

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

Definition at line 109 of file TripletFinder.cxx.


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