GArPropertiesStandard.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // GArProperties
4 //
5 ////////////////////////////////////////////////////////////////////////
6 // Framework includes
7 
8 // C++ language includes
9 #include <cmath>
10 #include <iostream>
11 
12 // GArSoft includes
14 #include "CoreUtils/ProviderUtil.h" // gar::IgnorableProviderConfigKeys()
15 
16 // ROOT includes
17 #include "TMath.h"
18 
19 // Framework includes
21 #include "cetlib_except/exception.h"
22 
23 //-----------------------------------------------
25 : fIsConfigured(false)
26 {
27 }
28 
29 //-----------------------------------------------
31  std::set<std::string> ignore_params /* = {} */)
33 {
34  this->Configure(pset, ignore_params);
35 }
36 
37 #if 0
38 //------------------------------------------------
40 {
41  this->SetRadiationLength (pset.get< double >("RadiationLength" ));
42  this->SetAtomicNumber (pset.get< double >("AtomicNumber"));
43  this->SetAtomicMass (pset.get< double >("AtomicMass"));
44  this->SetMeanExcitationEnergy (pset.get< double >("ExcitationEnergy"));
45  fIsConfigured = true;
46  return true;
47 }
48 #endif // 0
49 
50 //------------------------------------------------
52  std::set<std::string> ignore_params /* = {} */)
53 {
54  std::set<std::string> ignorable_keys = gar::IgnorableProviderConfigKeys();
55  ignorable_keys.insert(ignore_params.begin(), ignore_params.end());
56 
57  // validation happens here:
59  Configuration_t const& config = config_table();
60 
62  SetAtomicNumber (config.AtomicNumber() );
63  SetAtomicMass (config.AtomicMass() );
65  SetFanoFactor (config.FanoFactor() );
68  fIsConfigured = true;
69 
70  return true;
71 }
72 
73 //------------------------------------------------
75 {
76  if (ts == 0) return false;
77 
78  return true;
79 }
80 
static Config * config
Definition: config.cpp:1054
T get(std::string const &key) const
Definition: ParameterSet.h:271
std::set< std::string > const & IgnorableProviderConfigKeys()
Returns a list of configuration keys that providers should ignore.
Definition: ProviderUtil.h:35
structure with all configuration parameters
Properties related to liquid argon environment in the detector.
bool Configure(fhicl::ParameterSet const &pset, std::set< std::string > ignore_params={})
Configures the provider.