All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PhysListLoader_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: PhysListLoader
3 // Plugin Type: producer (art v3_06_03)
4 // File: PhysListLoader_module.cc
5 //
6 // Generated at Tue Aug 3 12:56:30 2021 by Marco Del Tutto using cetskelgen
7 // from cetlib version v3_11_01.
8 ////////////////////////////////////////////////////////////////////////
9 
10 /**
11  * @file PhysListLoader_module.cc
12  *
13  * @brief A dummy module that forces library loading to register a
14  * physics list.
15  *
16  * @author Marco Del Tutto (mdeltutt@fnal.gov)
17  *
18  * This module is a dummy module that does not act in any way
19  * on art::Events. This module, and in particular the library this
20  * module is built in, is linked to the PhysicsLists library in
21  * this same directory. Running this module causes the PhysicsLists
22  * library to be loaded, and so the Physics Lists to be registered
23  * to the Geant4 PhysListRegistry
24  *
25  */
26 
27 #include "art/Framework/Core/EDProducer.h"
28 #include "art/Framework/Core/ModuleMacros.h"
29 #include "art/Framework/Principal/Event.h"
30 #include "art/Framework/Principal/Handle.h"
31 #include "art/Framework/Principal/Run.h"
32 #include "art/Framework/Principal/SubRun.h"
33 #include "canvas/Utilities/InputTag.h"
34 #include "fhiclcpp/ParameterSet.h"
35 #include "messagefacility/MessageLogger/MessageLogger.h"
36 
37 #include <memory>
38 
39 #include "Geant4/G4PhysListRegistry.hh"
40 
41 
42 class PhysListLoader;
43 
44 
45 class PhysListLoader : public art::EDProducer {
46 public:
47  explicit PhysListLoader(fhicl::ParameterSet const& p);
48  // The compiler-generated destructor is fine for non-base
49  // classes without bare pointers or other resource use.
50 
51  // Plugins should not be copied or assigned.
52  PhysListLoader(PhysListLoader const&) = delete;
53  PhysListLoader(PhysListLoader&&) = delete;
54  PhysListLoader& operator=(PhysListLoader const&) = delete;
56 
57  // Required functions.
58  void produce(art::Event& e) override;
59 
60 private:
61 
62  // Declare member data here.
63 
64 };
65 
66 
67 PhysListLoader::PhysListLoader(fhicl::ParameterSet const& p)
68  : EDProducer{p} // ,
69  // More initializers here.
70 {
71  // Call appropriate produces<>() functions here.
72  // Call appropriate consumes<>() for any products to be retrieved by this module.
73 
74 
75  if (p.get<bool>("DumpList", false)) {
76  std::cout << "[PhysListLoader] Dumping G4 physics list:" << std::endl;
77  G4PhysListRegistry* g4plr = G4PhysListRegistry::Instance();
78  g4plr->PrintAvailablePhysLists();
79  }
80 
81 }
82 
83 void PhysListLoader::produce(art::Event& e)
84 {
85  // Implementation of required member function here.
86 }
87 
88 DEFINE_ART_MODULE(PhysListLoader)
pdgs p
Definition: selectors.fcl:22
PhysListLoader(fhicl::ParameterSet const &p)
void produce(art::Event &e) override
do i e
PhysListLoader & operator=(PhysListLoader const &)=delete
BEGIN_PROLOG could also be cout