31 double constexpr
tolerance = std::numeric_limits<double>::epsilon();
42 using Parameters = EDProducer::Table<Config>;
43 explicit AssembleMoreProducts(Parameters
const&
config);
59 double const expectedEff_;
63 AssembleMoreProducts::AssembleMoreProducts(Parameters
const&
config)
65 , trkEffTag_{
config().trkEffTag()}
66 , nParticlesTag_{
config().nParticlesTag()}
67 , seenParticlesTag_{
config().seenParticlesTag()}
68 , expectedEff_{
config().trkEff()}
70 consumes<arttest::TrackEfficiency, art::InSubRun>(trkEffTag_);
71 consumes<unsigned, art::InSubRun>(nParticlesTag_);
72 consumes<unsigned, art::InSubRun>(seenParticlesTag_);
73 produces<Fraction, art::InSubRun>(
"TrkEffValue");
74 produces<Fraction, art::InSubRun>(
"ParticleRatio");
82 trkEffRef.emplace_range(sr.
subRun(), 1, 101);
85 trkEffNum_.update(
h,
h->num());
86 trkEffDenom_.update(
h,
h->denom());
93 std::make_unique<Fraction>(trkEffNum_.value(), trkEffDenom_.value());
94 BOOST_CHECK_CLOSE_FRACTION(expectedEff_, trkEff->value(),
tolerance);
107 if (sr.
getByLabel(nParticlesTag_, nParticlesH)) {
108 nParticles_.update(nParticlesH);
112 auto const& seenParticlesH = sr.
getValidHandle<
unsigned>(seenParticlesTag_);
113 seenParticles_.update(seenParticlesH);
117 std::make_unique<Fraction>(seenParticles_.value(), nParticles_.value()),
121 seenParticles_.clear();
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
std::enable_if_t< detail::are_handles< T, U >::value, bool > disjoint_ranges(T const &a, U const &b)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
SubRunNumber_t subRun() const
constexpr auto subRunFragment()
std::enable_if_t< detail::are_handles< T, U >::value, bool > overlapping_ranges(T const &a, U const &b)
std::enable_if_t< detail::are_handles< T, U >::value, bool > same_ranges(T const &a, U const &b)
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
h
training ###############################