13 #include "art/Framework/Core/EDProducer.h"
14 #include "art/Framework/Core/ModuleMacros.h"
15 #include "art/Framework/Principal/Event.h"
16 #include "art/Framework/Services/Registry/ServiceHandle.h"
17 #include "art_root_io/TFileService.h"
26 class MVAPID :
public art::EDProducer {
29 explicit MVAPID(fhicl::ParameterSet
const& pset);
42 MVAPID::MVAPID(fhicl::ParameterSet
const& pset) : EDProducer{pset}, fAlg(pset)
44 produces<std::vector<anab::MVAPIDResult>>();
45 produces<art::Assns<recob::Track, anab::MVAPIDResult, void>>();
46 produces<art::Assns<recob::Shower, anab::MVAPIDResult, void>>();
47 fResult =
new std::vector<anab::MVAPIDResult>;
54 art::ServiceHandle<art::TFileService const>
tfs;
56 tfs->make<TTree>(
"MVAPID",
"Results");
69 std::unique_ptr<std::vector<anab::MVAPIDResult>> result(
new std::vector<anab::MVAPIDResult>);
70 std::unique_ptr<art::Assns<recob::Track, anab::MVAPIDResult>> trackAssns(
71 new art::Assns<recob::Track, anab::MVAPIDResult>);
72 std::unique_ptr<art::Assns<recob::Shower, anab::MVAPIDResult>> showerAssns(
73 new art::Assns<recob::Shower, anab::MVAPIDResult>);
74 fRun = evt.id().run();
77 fAlg.
RunPID(evt, *result, *trackAssns, *showerAssns);
80 evt.put(std::move(result));
81 evt.put(std::move(trackAssns));
82 evt.put(std::move(showerAssns));
MVAPID(fhicl::ParameterSet const &pset)
void RunPID(art::Event &evt, std::vector< anab::MVAPIDResult > &result, art::Assns< recob::Track, anab::MVAPIDResult, void > &trackAssns, art::Assns< recob::Shower, anab::MVAPIDResult, void > &showerAssns)
Provides recob::Track data product.
void produce(art::Event &evt)
art::ServiceHandle< art::TFileService > tfs
std::vector< anab::MVAPIDResult > * fResult