LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ArtG4tkModelConfig.hh
Go to the documentation of this file.
1 #ifndef artg4tk_DataProducts_G4ModelConfig_ArtG4tkModelConfig_hh
2 #define artg4tk_DataProducts_G4ModelConfig_ArtG4tkModelConfig_hh
3 
4 #include <map>
5 #include <string>
6 #include <vector>
7 
8 namespace fhicl {
9  class ParameterSet;
10 }
11 
12 namespace artg4tk {
13 
15 
16  public:
17  ArtG4tkModelConfig() : fDefaultPhysics(true) {}
18  ArtG4tkModelConfig(const bool& flag) : fDefaultPhysics(flag) {}
20  : fDefaultPhysics(rhs.fDefaultPhysics), fModelConfig(rhs.fModelConfig)
21  {}
23 
24  void Fill(const fhicl::ParameterSet&);
25  void Insert(const std::string&, const std::string&, const double&);
26 
27  bool
29  {
30  return fDefaultPhysics;
31  }
32  std::vector<std::string> GetConfiguredModels() const;
33  const std::vector<std::pair<std::string, double>>* GetConfig(const std::string&) const;
34 
35  // Patch up dictionary generation.
36  // NOTE(from GenParticle, by HW):
37  // There is source in art::PtrVector that should be protected and gccxml trying to instantiate
38  // it. Until that is fixed, we need to provide a an operator< or else the dictionary generation
39  // fails. So we provide a bogus version here. This is never actually used but,if gccxml cannot
40  // find the method, it quits.
41  //
42  bool
44  {
45  return true;
46  }
47 
48  private:
49  // private member functions
50  //
51  void DoFill(std::string&, std::string&, fhicl::ParameterSet&);
52 
53  // data members
54  //
56  //
57  // NOTE-1(JVY): the reason of using this construct is because there's already
58  // a "standard" (Art's) dictionary for it (art/Persistency/StdDictionaries)
59  //
60  // NOTE-2(JVY): at present, only those parameters different from DEFAULTS will be stored
61  // although in the future we might consider a bit more extensive options
62  //
63  std::map<std::string, std::vector<std::pair<std::string, double>>> fModelConfig;
64  };
65 
66 }
67 
68 #endif /* artg4tk_DataProducts_G4ModelConfig_ArtG4tkModelConfig_hh */
ArtG4tkModelConfig(const bool &flag)
constexpr bool operator<(CryostatID const &a, CryostatID const &b)
Order cryostats with increasing ID.
Definition: geo_types.h:692
TNtupleSim Fill(f1, f2, f3, f4)
parameter set interface
std::map< std::string, std::vector< std::pair< std::string, double > > > fModelConfig
ArtG4tkModelConfig(const ArtG4tkModelConfig &rhs)