LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
cosmic::HitTagAssociatorAlg Class Reference

#include "HitTagAssociatorAlg.h"

Public Member Functions

 HitTagAssociatorAlg (fhicl::ParameterSet const &p)
 
void MakeHitTagAssociations (std::vector< std::vector< size_t >> const &bridges_per_hit, std::vector< std::vector< size_t >> const &tags_per_bridges, std::vector< std::vector< size_t >> &tags_per_hit)
 
void MakeHitTagAssociations (std::vector< std::vector< size_t >> const &bridges_per_hit, std::vector< size_t > const &tag_per_bridge, std::vector< std::vector< size_t >> &tags_per_hit)
 

Detailed Description

Definition at line 24 of file HitTagAssociatorAlg.h.

Constructor & Destructor Documentation

cosmic::HitTagAssociatorAlg::HitTagAssociatorAlg ( fhicl::ParameterSet const &  p)

Title: Hit <–> Cosmic Tag Associator Alg Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Algorithm that will provide associations of Hits to cosmic tags, where both of those are associated to some intermediate object (like a track or cluster) Input: Assn<recob::Hit,???> and Assn<???,anab::CosmicTag> Output: Assn<recob::Hit,anab::CosmicTag>

Definition at line 15 of file HitTagAssociatorAlg.cxx.

15 {}

Member Function Documentation

void cosmic::HitTagAssociatorAlg::MakeHitTagAssociations ( std::vector< std::vector< size_t >> const &  bridges_per_hit,
std::vector< std::vector< size_t >> const &  tags_per_bridges,
std::vector< std::vector< size_t >> &  tags_per_hit 
)

Definition at line 17 of file HitTagAssociatorAlg.cxx.

References util::begin(), and util::end().

Referenced by cosmic::BeamFlashTrackMatchTagger::produce().

21 {
22 
23  const size_t N_HITS = bridges_per_hit.size();
24  tags_per_hit.clear();
25  tags_per_hit.resize(N_HITS);
26 
27  for (size_t i_hit = 0; i_hit < N_HITS; i_hit++) {
28  for (size_t i_bridge = 0; i_bridge < bridges_per_hit[i_hit].size(); i_bridge++) {
29  tags_per_hit[i_hit].insert(tags_per_hit[i_hit].end(),
30  tags_per_bridges[i_bridge].begin(),
31  tags_per_bridges[i_bridge].end());
32  }
33  }
34 }
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
void cosmic::HitTagAssociatorAlg::MakeHitTagAssociations ( std::vector< std::vector< size_t >> const &  bridges_per_hit,
std::vector< size_t > const &  tag_per_bridge,
std::vector< std::vector< size_t >> &  tags_per_hit 
)

Definition at line 36 of file HitTagAssociatorAlg.cxx.

40 {
41 
42  const size_t N_HITS = bridges_per_hit.size();
43 
44  tags_per_hit.clear();
45  tags_per_hit.resize(N_HITS);
46 
47  for (size_t i_hit = 0; i_hit < N_HITS; i_hit++) {
48 
49  for (size_t i_bridge = 0; i_bridge < bridges_per_hit[i_hit].size(); i_bridge++) {
50 
51  if (i_bridge >= tag_per_bridge.size()) continue;
52 
53  if (tag_per_bridge[i_bridge] == std::numeric_limits<size_t>::max()) continue;
54 
55  tags_per_hit[i_hit].push_back(tag_per_bridge[i_bridge]);
56  } //end loop over bridges
57 
58  } //end loop over hits
59 }

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