15 #include "fhiclcpp/ParameterSet.h"
16 #include "art/Framework/Core/ModuleMacros.h"
17 #include "art/Framework/Core/EDAnalyzer.h"
18 #include "canvas/Utilities/Exception.h"
41 virtual void analyze(art::Event
const&)
override {}
61 (fhicl::ParameterSet
const& pset)
62 : art::EDAnalyzer(pset)
63 , expected_Z(pset.get<
unsigned int>(
"AtomicNumber"))
69 auto const* Zprov = lar::providerFrom<lar::example::AtomicNumberService>();
71 unsigned int const Z = Zprov->Z();
73 throw art::Exception(art::errors::LogicError)
74 <<
"Unexpected atomic number " << Z <<
", should be " <<
expected_Z;
Provider returning atomic number of the active material in the TPC.
unsigned int expected_Z
expected atomic number
Tests AtomicNumberService.
AtomicNumberTest(fhicl::ParameterSet const &pset)
Returns the atomic number of the active material in the TPC.
virtual void analyze(art::Event const &) override
We don't really care about events.
virtual void beginJob() override
Test happens at begin job.