G4SimulationParameters.cxx
Go to the documentation of this file.
1 //
2 // G4SimulationParameters.cxx
3 // garsoft-mrb
4 //
5 // Created by Brian Rebel on 11/3/16.
6 // Copyright © 2016 Brian Rebel. All rights reserved.
7 //
8 
10 
11 
12 namespace gar {
13  namespace garg4 {
14 
15  static G4SimulationParameters* gInstance = nullptr;
16 
17  //--------------------------------------------------------------------------
19  {
20  if(!gInstance) gInstance = new G4SimulationParameters(pset);
21  return gInstance;
22  }
23 
24  //--------------------------------------------------------------------------
26  {
27  // the instance must have been created already by CreateInstance()
28  if(!gInstance)
29  throw cet::exception("G4SimulationParameters")
30  << "instance pointer is null, that is bad";
31 
32  return gInstance;
33  }
34 
35  //--------------------------------------------------------------------------
37  {
38  fEnabledPhysics = pset.get<std::vector<std::string> >("EnabledPhysics" );
39  fKeepEMShowerDaughters = pset.get<bool >("KeepEMShowerDaughters", false);
40  fEMShowerDaughterMatRegex = pset.get<std::string >("EMShowerDaughterMatRegex", ".*");
41  fStoreTrajectories = pset.get<bool >("StoreTrajectories", true );
42  fKineticEnergyCut = pset.get<float >("KineticEnergyCut", 1.e-4);
43 
44  return;
45  }
46 
47  //--------------------------------------------------------------------------
49  {
50  return;
51  }
52 
53  //--------------------------------------------------------------------------
54 
55  //--------------------------------------------------------------------------
56 
57 
58  } // garg4
59 } // gar
std::vector< std::string > fEnabledPhysics
list of enabled physics processes
std::string string
Definition: nybbler.cc:12
static G4SimulationParameters * Instance()
bool fStoreTrajectories
keep particle trajectory information or not
float fKineticEnergyCut
don&#39;t track particles below this energy
T get(std::string const &key) const
Definition: ParameterSet.h:271
static G4SimulationParameters * gInstance
General GArSoft Utilities.
std::string fEMShowerDaughterMatRegex
keep EM shower daughters only in these materials
bool fKeepEMShowerDaughters
keep EM shower daughters or not
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
static G4SimulationParameters * CreateInstance(fhicl::ParameterSet const &pset)
G4SimulationParameters(fhicl::ParameterSet const &pset)