LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
AtomicNumber.h
Go to the documentation of this file.
1 
11 #ifndef LAREXAMPLES_SERVICES_ATOMICNUMBER_PROVIDER_ATOMICNUMBER_H
12 #define LAREXAMPLES_SERVICES_ATOMICNUMBER_PROVIDER_ATOMICNUMBER_H
13 
14 
15 // support libraries
17 #include "fhiclcpp/ParameterSet.h"
18 #include "fhiclcpp/types/Table.h"
19 #include "fhiclcpp/types/Atom.h"
20 
21 
22 namespace lar {
23  namespace example {
24 
39  class AtomicNumber {
40  public:
41  //---------------------------------------------------------------------
43  struct Config {
44  using Name = fhicl::Name;
46 
48  Name("AtomicNumber"),
49  Comment("atomic number of the active material in the TPC"),
50  18U // default value
51  };
52 
53  }; // struct Config
54 
57 
58 
59  //---------------------------------------------------------------------
61  AtomicNumber(Config const& config)
62  : Z_(config.AtomicNumber())
63  {}
64 
65  //---------------------------------------------------------------------
68  : AtomicNumber(parameters_type(pset, { "service_type" })())
69  {}
70 
71 
72  //---------------------------------------------------------------------
73  // copy and moving of service providers is "forbidden":
74  AtomicNumber(AtomicNumber const& pset) = delete;
75  AtomicNumber(AtomicNumber&& pset) = delete;
76  AtomicNumber& operator= (AtomicNumber const& pset) = delete;
77  AtomicNumber& operator= (AtomicNumber&& pset) = delete;
78 
79 
80  //---------------------------------------------------------------------
83 
85  unsigned int Z() const { return Z_; }
86 
88 
89 
90  //---------------------------------------------------------------------
91  private:
92  unsigned int Z_;
93 
94  }; // AtomicNumber
95 
96  } // namespace example
97 } // namespace lar
98 
99 
100 #endif // LAREXAMPLES_SERVICES_ATOMICNUMBER_PROVIDER_ATOMICNUMBER_H
101 
Collection of configuration parameters for the service.
Definition: AtomicNumber.h:43
unsigned int Z() const
Returns the atomic number.
Definition: AtomicNumber.h:85
AtomicNumber(fhicl::ParameterSet const &pset)
Constructor from a parameter set.
Definition: AtomicNumber.h:67
Provides information about the active material in the TPC.
Definition: AtomicNumber.h:39
LArSoft-specific namespace.
unsigned int Z_
atomic number
Definition: AtomicNumber.h:92
fhicl::Atom< unsigned int > AtomicNumber
Definition: AtomicNumber.h:47
AtomicNumber(Config const &config)
Constructor from the complete configuration object.
Definition: AtomicNumber.h:61
AtomicNumber & operator=(AtomicNumber const &pset)=delete