All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
lar::example::tests::AtomicNumberTest Class Reference

Tests AtomicNumberService. More...

Inheritance diagram for lar::example::tests::AtomicNumberTest:

Public Member Functions

 AtomicNumberTest (fhicl::ParameterSet const &pset)
 
virtual void analyze (art::Event const &) override
 We don't really care about events. More...
 
virtual void beginJob () override
 Test happens at begin job. More...
 

Private Attributes

unsigned int expected_Z
 expected atomic number More...
 

Detailed Description

Tests AtomicNumberService.

Configuration parameters

Definition at line 35 of file AtomicNumberTest_module.cc.

Constructor & Destructor Documentation

lar::example::tests::AtomicNumberTest::AtomicNumberTest ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 61 of file AtomicNumberTest_module.cc.

62  : art::EDAnalyzer(pset)
63  , expected_Z(pset.get<unsigned int>("AtomicNumber"))
64 {}
unsigned int expected_Z
expected atomic number

Member Function Documentation

virtual void lar::example::tests::AtomicNumberTest::analyze ( art::Event const &  )
inlineoverridevirtual

We don't really care about events.

Definition at line 41 of file AtomicNumberTest_module.cc.

41 {}
void lar::example::tests::AtomicNumberTest::beginJob ( )
overridevirtual

Test happens at begin job.

Definition at line 67 of file AtomicNumberTest_module.cc.

67  {
68 
69  auto const* Zprov = lar::providerFrom<lar::example::AtomicNumberService>();
70 
71  unsigned int const Z = Zprov->Z();
72  if (Z != expected_Z) {
73  throw art::Exception(art::errors::LogicError)
74  << "Unexpected atomic number " << Z << ", should be " << expected_Z;
75  }
76 
77 } // lar::example::tests::AtomicNumberTest::beginJob()
unsigned int expected_Z
expected atomic number

Member Data Documentation

unsigned int lar::example::tests::AtomicNumberTest::expected_Z
private

expected atomic number

Definition at line 48 of file AtomicNumberTest_module.cc.


The documentation for this class was generated from the following file: