All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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::WireIDIntersection
fPtMap
 
geo::TPCID fTPC
 

Detailed Description

Definition at line 73 of file TripletFinder.cxx.

Constructor & Destructor Documentation

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

Definition at line 75 of file TripletFinder.cxx.

76  : geom(art::ServiceHandle<geo::Geometry const>()->provider()), fTPC(tpc)
77  {}
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 98 of file TripletFinder.cxx.

99  {
100  for (geo::WireID awire : geom->ChannelToWire(chanA)) {
101  if (geo::TPCID(awire) != fTPC) continue;
102  for (geo::WireID bwire : geom->ChannelToWire(chanB)) {
103  if (geo::TPCID(bwire) != fTPC) continue;
104 
105  if (geom->WireIDsIntersect(awire, bwire, pt)) return true;
106  }
107  }
108 
109  return false;
110  }
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:386
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 80 of file TripletFinder.cxx.

81  {
82  const auto key = std::make_pair(a, b);
83 
84  auto it = fMap.find(key);
85  if (it != fMap.end()) {
86  pt = fPtMap[key];
87  return it->second;
88  }
89 
90  const bool res = ISect(a, b, pt);
91  fMap.insert({key, res});
92  fPtMap.insert({key, pt});
93  return res;
94  }
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
process_name gaushit a
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 114 of file TripletFinder.cxx.

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

Definition at line 115 of file TripletFinder.cxx.

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

Definition at line 117 of file TripletFinder.cxx.

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

Definition at line 112 of file TripletFinder.cxx.


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