All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
sbn::PlaneStubMerge Class Reference

Art tool for merging stubs on the same plane. More...

Inheritance diagram for sbn::PlaneStubMerge:
sbn::IStubMerge

Public Member Functions

 PlaneStubMerge (fhicl::ParameterSet const &pset)
 Constructor. More...
 
std::vector< sbn::StubInfoMerge (const std::vector< sbn::StubInfo > &stubs, const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, const detinfo::DetectorClocksData &dclock, const detinfo::DetectorPropertiesData &dprop) override
 
- Public Member Functions inherited from sbn::IStubMerge
virtual ~IStubMerge () noexcept=default
 Virtual Destructor. More...
 

Private Attributes

double fStubDotCut
 

Detailed Description

Art tool for merging stubs on the same plane.

Always merges into the larger stub.

Definition at line 27 of file PlaneStubMerge_tool.cc.

Constructor & Destructor Documentation

sbn::PlaneStubMerge::PlaneStubMerge ( fhicl::ParameterSet const &  pset)

Constructor.

Definition at line 44 of file PlaneStubMerge_tool.cc.

44  :
45  fStubDotCut(pset.get<double>("StubDotCut"))
46 {
47 }

Member Function Documentation

std::vector< sbn::StubInfo > sbn::PlaneStubMerge::Merge ( const std::vector< sbn::StubInfo > &  stubs,
const geo::GeometryCore geo,
const spacecharge::SpaceCharge sce,
const detinfo::DetectorClocksData dclock,
const detinfo::DetectorPropertiesData dprop 
)
overridevirtual

Implements sbn::IStubMerge.

Definition at line 49 of file PlaneStubMerge_tool.cc.

53  {
54 
55  std::vector<bool> toerase(stubs.size(), false);
56  for (unsigned i_stub = 0; i_stub < stubs.size(); i_stub++) {
57  for (unsigned j_stub = 0; j_stub < stubs.size(); j_stub++) {
58  if (i_stub == j_stub) continue;
59  if (toerase[j_stub]) continue; // Already being erased
60  if (sbn::StubContains(stubs[i_stub], stubs[j_stub])) {
61  if (sbn::StubDirectionDot(stubs[i_stub], stubs[j_stub], geo, dprop) > fStubDotCut) {
62  toerase[j_stub] = true;
63  }
64  }
65  }
66  }
67 
68  std::vector<sbn::StubInfo> ret;
69  // Keep only good stubs
70  for (unsigned i = 0; i < stubs.size(); i++) {
71  if (!toerase[i]) ret.push_back(stubs[i]);
72  }
73 
74  return ret;
75 }
float StubDirectionDot(const sbn::StubInfo &A, const sbn::StubInfo &B, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
Computes the dot product of two stubs.
bool StubContains(const sbn::StubInfo &A, const sbn::StubInfo &B)
Returns whether stub A contains stub B.

Member Data Documentation

double sbn::PlaneStubMerge::fStubDotCut
private

Definition at line 41 of file PlaneStubMerge_tool.cc.


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