10 #include "art/Framework/Core/EDProducer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/Handle.h"
14 #include "art/Framework/Principal/Run.h"
15 #include "art/Framework/Principal/SubRun.h"
16 #include "canvas/Utilities/InputTag.h"
17 #include "fhiclcpp/ParameterSet.h"
18 #include "messagefacility/MessageLogger/MessageLogger.h"
21 #include "TDatabasePDG.h"
23 #include "LArReco/TrackMomentumCalculator.h"
46 void produce(art::Event&
e)
override;
57 const static std::vector<int>
PIDs {13, 211, 2212};
58 const static std::vector<std::string>
names {
"muon",
"pion",
"proton"};
63 fTrackLabel(
p.get<art::InputTag>(
"TrackLabel",
"pandoraTrack"))
65 for (
unsigned i = 0; i <
names.size(); i++) {
66 produces<std::vector<sbn::RangeP>>(
names[i]);
67 produces<art::Assns<recob::Track, sbn::RangeP>>(
names[i]);
70 const TDatabasePDG *
PDGTable = TDatabasePDG::Instance();
71 fMuonMass = PDGTable->GetParticle(13)->Mass();
72 fPionMass = PDGTable->GetParticle(211)->Mass();
77 art::Handle<std::vector<recob::Track>> track_handle;
78 e.getByLabel(fTrackLabel, track_handle);
80 std::vector<art::Ptr<recob::Track>>
tracks;
81 art::fill_ptr_vector(tracks, track_handle);
83 for (
unsigned i = 0; i <
PIDs.size(); i++) {
84 std::unique_ptr<std::vector<sbn::RangeP>> rangecol(
new std::vector<sbn::RangeP>);
85 std::unique_ptr<art::Assns<recob::Track, sbn::RangeP>> assn(
new art::Assns<recob::Track, sbn::RangeP>);
87 for (
const art::Ptr<recob::Track>
track: tracks) {
97 rangecol->push_back(rangep);
101 e.put(std::move(rangecol),
names[i]);
102 e.put(std::move(assn),
names[i]);
ClusterModuleLabel join with tracks
static const std::vector< int > PIDs
process_name use argoneut_mc_hitfinder track
fRangeCalculator(p.get< float >("MinTrackLength", 0.1))
trkf::TrackMomentumCalculator fRangeCalculator
static const std::vector< std::string > names
art::InputTag fTrackLabel
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.
static const TDatabasePDG * PDGTable(new TDatabasePDG)
RangePAllPID & operator=(RangePAllPID const &)=delete
RangePAllPID(fhicl::ParameterSet const &p)
void produce(art::Event &e) override