1 #include "art/Framework/Core/EDProducer.h"
2 #include "art/Framework/Core/ModuleMacros.h"
3 #include "art/Framework/Principal/Event.h"
4 #include "art/Framework/Principal/Run.h"
5 #include "fhiclcpp/ParameterSet.h"
6 #include "artdaq-core/Data/PackageBuildInfo.hh"
29 explicit BuildInfo(fhicl::ParameterSet
const& p);
51 void produce(art::Event& e)
override;
55 std::unique_ptr<std::vector<PackageBuildInfo>> packages_;
56 std::string instanceName_;
58 template <
typename... Args>
61 template <
typename Arg>
62 struct fill_packages<Arg>
64 static void doit(std::vector<PackageBuildInfo>& packages)
66 packages.emplace_back(Arg::getPackageBuildInfo());
70 template <
typename Arg,
typename... Args>
71 struct fill_packages<Arg, Args...>
73 static void doit(std::vector<PackageBuildInfo>& packages)
75 packages.emplace_back(Arg::getPackageBuildInfo());
76 fill_packages<Args...>::doit(packages);
83 packages_(new std::vector<PackageBuildInfo>())
84 , instanceName_(ps.get<std::string>(
"instance_name", *
instanceName))
86 fill_packages<Pkgs...>::doit(*packages_);
88 produces<std::vector<PackageBuildInfo>, art::InRun>(instanceName_);
105 auto packages_deep_copy_ptr = std::unique_ptr<std::vector<PackageBuildInfo>>(
106 new std::vector<PackageBuildInfo>(*packages_));
108 e.put(std::move(packages_deep_copy_ptr), instanceName_);
virtual ~BuildInfo()=default
Default Destructor.
void produce(art::Event &e) override
Perform actions for each event.
void beginRun(art::Run &r) override
Perform actions at the beginning of the Run.
BuildInfo(fhicl::ParameterSet const &p)
BuildInfo module Constructor.
BuildInfo is an art::EDProducer which saves information about package builds to the data file...
static std::string instanceName
Name of this BuildInfo instance.