GArPropertiesStandard.h
Go to the documentation of this file.
1 /**
2  * @file LArPropertiesStandard.h
3  * @brief Service provider with utility LAr functions
4  * @see LArPropertiesStandard.cxx LArPropertiesStandardTestHelpers.h
5  *
6  * The provider detinfo::LArProperiesStandard supports simple setup for testing
7  * environment, by including in your test:
8  *
9  * #include "DetectorInfo/LArPropertiesStandardTestHelpers.h"
10  *
11  */
12 
13 #ifndef DETECTORINFO_GARPROPERTIESSTANDARD_H
14 #define DETECTORINFO_GARPROPERTIESSTANDARD_H
15 
16 
17 // GArSoft libraries
19 
20 // FHiCL libraries
21 #include "fhiclcpp/ParameterSet.h"
22 #include "fhiclcpp/types/Atom.h"
24 #include "fhiclcpp/types/Table.h"
25 
26 // C/C++ standard libraries
27 #include <string>
28 #include <vector>
29 #include <map>
30 #include <set>
31 
32 
33 namespace gar {
34  namespace detinfo {
35  /**
36  * @brief Properties related to liquid argon environment in the detector
37  *
38  * This class can access databases via DatabaseUtil service.
39  *
40  * @note Some of the database connection properties are established before
41  * the beginning of the job and if they change this service will not be
42  * aware of it. These properties petrain, so far, only the connection mode
43  * and not any content of the databases themselves.
44  * @note 2: the database connection features for this base class have been removed
45  */
47  public:
49  explicit GArPropertiesStandard(fhicl::ParameterSet const& pset,
50  std::set<std::string> ignore_params = {});
52  virtual ~GArPropertiesStandard() = default;
53 
54  /**
55  * @brief Configures the provider
56  * @param p configuration parameter set
57  * @param ignore_params parameters to be ignored (optional)
58  *
59  * This method will validate the parameter set (except for the parameters
60  * it's explicitly told to ignore) and extract the useful information out
61  * of it.
62  */
63  bool Configure(fhicl::ParameterSet const& pset,
64  std::set<std::string> ignore_params = {});
65  bool Update(uint64_t ts=0);
66 
67  virtual double RadiationLength() const override { return fRadiationLength; } ///< g/cm^2
68 
69  /// Ar atomic number
70  virtual double AtomicNumber() const override { return fZ; }
71 
72  /// Ar atomic mass (g/mol)
73  virtual double AtomicMass() const override { return fA; }
74 
75  /// Ar mean excitation energy (eV)
76  virtual double ExcitationEnergy() const override { return fI; }
77 
78  /// Fano factor
79  virtual double FanoFactor() const override { return fF; }
80 
81  /// Diffusion constants
82  virtual double LongitudinalDiffusion() const override { return fLongDiff; }
83  virtual double TransverseDiffusion() const override { return fTransDiff; }
84 
85  void SetRadiationLength (double rl) { fRadiationLength = rl; }
86  void SetAtomicNumber (double z ) { fZ = z; }
87  void SetAtomicMass (double a ) { fA = a; }
88  void SetMeanExcitationEnergy (double e ) { fI = e; }
89  void SetFanoFactor (double f ) { fF = f; }
90  void SetLongitudinalDiffusion(double ld) { fLongDiff = ld; }
91  void SetTransverseDiffusion (double td) { fTransDiff = td; }
92 
93  private:
94  protected:
95 
96  /// structure with all configuration parameters
97  struct Configuration_t {
98  using Name = fhicl::Name;
100 
101  fhicl::Atom<double> RadiationLength { Name("RadiationLength" ), Comment("radiation length [g/cm^2]") };
102  fhicl::Atom<double> AtomicNumber { Name("AtomicNumber" ), Comment("atomic number (yes, yes, it's 18...)") };
103  fhicl::Atom<double> AtomicMass { Name("AtomicMass" ), Comment("atomic mass [g/mol]") };
104  fhicl::Atom<double> MeanExcitationEnergy { Name("ExcitationEnergy"), Comment("mean excitation energy [eV]") };
105  fhicl::Atom<double> FanoFactor { Name("FanoFactor"), Comment("controls fluctuations in ionization") };
106  fhicl::Atom<double> LongitudinalDiffusion{ Name("LongitudinalDiffusion"), Comment("controls fluctuations in ionization") };
107  fhicl::Atom<double> TransverseDiffusion { Name("TransverseDiffusion"), Comment("controls fluctuations in ionization") };
108 
109  }; // Configuration_t
110 
111 
113 
114  double fRadiationLength; ///< g/cm^2
115  double fZ; ///< Ar atomic number
116  double fA; ///< Ar atomic mass (g/mol)
117  double fI; ///< Ar mean excitation energy (eV)
118  double fF; ///< Ar Fano factor
119  double fLongDiff; ///< longitudinal diffusion in cm^2/ns
120  double fTransDiff; ///< transverse diffusion in cm^2/ns
121 
122  public:
123  // expose the configuration object for framework service
125 
126  }; // class GArPropertiesStandard
127  } //namespace detinfo
128 } // gar
129 #endif // GARPROPERTIES_H
double fTransDiff
transverse diffusion in cm^2/ns
virtual double FanoFactor() const override
Fano factor.
virtual double LongitudinalDiffusion() const override
Diffusion constants.
double fI
Ar mean excitation energy (eV)
ChannelGroupService::Name Name
const double e
const double a
virtual double ExcitationEnergy() const override
Ar mean excitation energy (eV)
structure with all configuration parameters
Properties related to liquid argon environment in the detector.
General LArSoft Utilities.
double fA
Ar atomic mass (g/mol)
General GArSoft Utilities.
#define Comment
virtual double TransverseDiffusion() const override
virtual double AtomicNumber() const override
Ar atomic number.
bool Configure(fhicl::ParameterSet const &pset, std::set< std::string > ignore_params={})
Configures the provider.
virtual double AtomicMass() const override
Ar atomic mass (g/mol)
virtual ~GArPropertiesStandard()=default
double fLongDiff
longitudinal diffusion in cm^2/ns
virtual double RadiationLength() const override
g/cm^2