72 produces<std::vector<anab::CosmicTag>>();
73 produces<art::Assns<recob::Track, anab::CosmicTag>>();
80 auto providers = lar::extractProviders<geo::Geometry, detinfo::LArPropertiesService>();
90 std::vector<recob::OpFlash>
const& flashVector(*flashHandle);
95 std::vector<recob::Track>
const& trackVector(*trackHandle);
98 std::unique_ptr<std::vector<anab::CosmicTag>> cosmicTagPtr(
new std::vector<anab::CosmicTag>);
99 std::vector<anab::CosmicTag>& cosmicTagVector(*cosmicTagPtr);
103 std::vector<size_t> assnTrackTagVector;
104 std::unique_ptr<art::Assns<recob::Track, anab::CosmicTag>> assnTrackTag(
109 flashVector, trackVector, cosmicTagVector, assnTrackTagVector, providers, pvs, opdigip);
112 for (
size_t track_iter = 0; track_iter < assnTrackTagVector.size(); track_iter++) {
113 if (assnTrackTagVector[track_iter] == std::numeric_limits<size_t>::max())
continue;
115 util::CreateAssn(evt, cosmicTagVector, trk_ptr, *assnTrackTag, assnTrackTagVector[track_iter]);
128 std::vector<std::vector<size_t>> track_indices_per_hit =
131 std::vector<std::vector<size_t>> assnHitTagVector;
132 std::unique_ptr<art::Assns<recob::Hit, anab::CosmicTag>> assnHitTag(
136 track_indices_per_hit, assnTrackTagVector, assnHitTagVector);
139 for (
size_t hit_iter = 0; hit_iter < assnHitTagVector.size(); hit_iter++) {
141 for (
size_t tag_iter = 0; tag_iter < assnHitTagVector[hit_iter].size(); tag_iter++)
143 evt, cosmicTagVector, hit_ptr, *assnHitTag, assnHitTagVector[hit_iter][tag_iter]);
146 evt.
put(std::move(assnHitTag));
150 evt.
put(std::move(cosmicTagPtr));
151 evt.
put(std::move(assnTrackTag));
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)
Utilities to manage ProviderPack objects with art.
Declaration of signal hit object.
EDProducer(fhicl::ParameterSet const &pset)
void RunCompatibilityCheck(std::vector< recob::OpFlash > const &, std::vector< recob::Track > const &, std::vector< anab::CosmicTag > &, std::vector< size_t > &, Providers_t, phot::PhotonVisibilityService const &, opdet::OpDigiProperties const &)
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
#define DEFINE_ART_MODULE(klass)
BeamFlashTrackMatchTaggerAlg fAlg
HitTagAssociatorAlg fHitTagAssnsAlg
BeamFlashTrackMatchTagger(fhicl::ParameterSet const &p)
BeamFlashTrackMatchTagger & operator=(BeamFlashTrackMatchTagger const &)=delete
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
void produce(art::Event &e) override
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Utility object to perform functions of association.
std::string fTrackModuleLabel
std::string fHitModuleLabel
std::vector< std::vector< size_t > > GetAssociatedVectorManyI(art::Handle< art::Assns< T, U >> h, art::Handle< std::vector< T >> index_p)
std::string fFlashModuleLabel
art framework interface to geometry description