LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
artg4tk::PhysicsListService Class Reference

#include "PhysicsList_service.hh"

Inheritance diagram for artg4tk::PhysicsListService:
artg4tk::PhysicsListServiceBase

Public Member Functions

 PhysicsListService (fhicl::ParameterSet const &)
 
virtual ~PhysicsListService ()
 
G4VUserPhysicsList * makePhysicsList () override
 
virtual void initializePhysicsList ()
 

Private Attributes

std::string PhysicsListName_
 
bool DumpList_
 
bool enableNeutronLimit_
 
double NeutronTimeLimit_
 
double NeutronKinELimit_
 
bool enableStepLimit_
 
bool enableOptical_
 
bool enableCerenkov_
 
bool CerenkovStackPhotons_
 
int CerenkovMaxNumPhotons_
 
double CerenkovMaxBetaChange_
 
bool CerenkovTrackSecondariesFirst_
 
bool enableScintillation_
 
bool ScintillationStackPhotons_
 
bool ScintillationByParticleType_
 
bool ScintillationTrackInfo_
 
bool ScintillationTrackSecondariesFirst_
 
bool enableAbsorption_
 
bool enableRayleigh_
 
bool enableMieHG_
 
bool enableBoundary_
 
bool enableWLS_
 
bool BoundaryInvokeSD_
 
int verbositylevel_
 
std::string WLSProfile_
 

Detailed Description

Definition at line 14 of file PhysicsList_service.hh.

Constructor & Destructor Documentation

artg4tk::PhysicsListService::PhysicsListService ( fhicl::ParameterSet const &  p)

Definition at line 19 of file PhysicsList.cc.

20  : PhysicsListName_(p.get<std::string>("PhysicsListName", "FTFP_BERT"))
21  , DumpList_(p.get<bool>("DumpList", false))
22  , enableNeutronLimit_(p.get<bool>("enableNeutronLimit", true))
23  , NeutronTimeLimit_(p.get<double>("NeutronTimeLimit", 10. * microsecond))
24  , NeutronKinELimit_(p.get<double>("NeutronKinELimit", 0.0))
25  , enableStepLimit_(p.get<bool>("enableStepLimit", true))
26  , enableOptical_(p.get<bool>("enableOptical", true))
27  , enableCerenkov_(p.get<bool>("enableCerenkov", false))
28  , CerenkovStackPhotons_(p.get<bool>("CerenkovStackPhotons", false))
29  , CerenkovMaxNumPhotons_(p.get<int>(" CerenkovMaxNumPhotons", 100))
30  , CerenkovMaxBetaChange_(p.get<double>("CerenkovMaxBetaChange", 10.0))
31  , CerenkovTrackSecondariesFirst_(p.get<bool>("CerenkovTrackSecondariesFirst", false))
32  , enableScintillation_(p.get<bool>("enableScintillation", true))
33  , ScintillationStackPhotons_(p.get<bool>("ScintillationStackPhotons", false))
34  , ScintillationByParticleType_(p.get<bool>("ScintillationByParticleType", true))
35  , ScintillationTrackInfo_(p.get<bool>("ScintillationTrackInfo", false))
36  , ScintillationTrackSecondariesFirst_(p.get<bool>("ScintillationTrackSecondariesFirst", false))
37  , enableAbsorption_(p.get<bool>("enableAbsorption", false))
38  , enableRayleigh_(p.get<bool>("enableRayleigh", false))
39  , enableMieHG_(p.get<bool>("enableMieHG", false))
40  , enableBoundary_(p.get<bool>("enableBoundary", false))
41  , enableWLS_(p.get<bool>("enableWLS", false))
42  , BoundaryInvokeSD_(p.get<bool>("BoundaryInvokeSD", false))
43  , verbositylevel_(p.get<int>("Verbosity", 0))
44  , WLSProfile_(p.get<std::string>("WLSProfile", "delta"))
45 {}
microsecond_as<> microsecond
Type of time stored in microseconds, in double precision.
Definition: spacetime.h:116
virtual artg4tk::PhysicsListService::~PhysicsListService ( )
inlinevirtual

Definition at line 18 of file PhysicsList_service.hh.

References makePhysicsList().

18 {};

Member Function Documentation

virtual void artg4tk::PhysicsListServiceBase::initializePhysicsList ( )
inlinevirtualinherited
G4VUserPhysicsList * artg4tk::PhysicsListService::makePhysicsList ( )
overridevirtual

Implements artg4tk::PhysicsListServiceBase.

Definition at line 48 of file PhysicsList.cc.

References CerenkovMaxBetaChange_, CerenkovMaxNumPhotons_, CerenkovStackPhotons_, DumpList_, enableAbsorption_, enableBoundary_, enableCerenkov_, enableMieHG_, enableNeutronLimit_, enableOptical_, enableRayleigh_, enableScintillation_, enableStepLimit_, enableWLS_, NeutronTimeLimit_, PhysicsListName_, ScintillationByParticleType_, ScintillationStackPhotons_, ScintillationTrackInfo_, and verbositylevel_.

Referenced by ~PhysicsListService().

49 {
50 
51  g4alt::G4PhysListFactory factory;
52  // Access to registries and factories
53  //
54  G4PhysicsConstructorRegistry* g4pcr = G4PhysicsConstructorRegistry::Instance();
55  G4PhysListRegistry* g4plr = G4PhysListRegistry::Instance();
56  //
57  // the following should be unneccessary at some point:
58  //
59  g4plr->AddPhysicsExtension("OPTICAL", "G4OpticalPhysics");
60  g4plr->AddPhysicsExtension("STEPLIMIT", "G4StepLimiterPhysics");
61  g4plr->AddPhysicsExtension("NEUTRONLIMIT", "G4NeutronTrackingCut");
62  g4pcr->PrintAvailablePhysicsConstructors();
63  g4plr->PrintAvailablePhysLists();
64  G4VModularPhysicsList* phys = NULL;
65  G4String physName = PhysicsListName_;
66  if (enableOptical_)
67  physName = physName + "+OPTICAL";
68  if (enableStepLimit_)
69  physName = physName + "+STEPLIMIT";
71  physName = physName + "+NEUTRONLIMIT";
72  std::cout << " Name of Physics list: " << physName << std::endl;
73  if (factory.IsReferencePhysList(physName)) {
74  phys = factory.GetReferencePhysList(physName);
75  phys->SetVerboseLevel(verbositylevel_);
76  }
77 
78  if (enableOptical_) {
79  G4OpticalPhysics* opticalPhysics = (G4OpticalPhysics*)phys->GetPhysics("Optical");
80  opticalPhysics->Configure(kCerenkov, enableCerenkov_);
81  opticalPhysics->SetCerenkovStackPhotons(CerenkovStackPhotons_);
82  opticalPhysics->Configure(kScintillation, enableScintillation_);
83  opticalPhysics->SetScintillationStackPhotons(ScintillationStackPhotons_);
84  opticalPhysics->SetScintillationByParticleType(ScintillationByParticleType_);
85  opticalPhysics->SetScintillationTrackInfo(ScintillationTrackInfo_);
86  opticalPhysics->SetTrackSecondariesFirst(
87  kCerenkov, true); // only relevant if we actually stack and trace the optical photons
88  opticalPhysics->SetTrackSecondariesFirst(
89  kScintillation, true); // only relevant if we actually stack and trace the optical photons
90  opticalPhysics->SetMaxNumPhotonsPerStep(CerenkovMaxNumPhotons_);
91  opticalPhysics->SetMaxBetaChangePerStep(CerenkovMaxBetaChange_);
92  opticalPhysics->Configure(kAbsorption, enableAbsorption_);
93  opticalPhysics->Configure(kRayleigh, enableRayleigh_);
94  opticalPhysics->Configure(kMieHG, enableMieHG_);
95  opticalPhysics->Configure(kBoundary, enableBoundary_);
96  opticalPhysics->SetVerboseLevel(verbositylevel_);
97  opticalPhysics->Configure(kWLS, enableWLS_);
98  }
99  if (enableNeutronLimit_) {
100  G4NeutronTrackingCut* neutrcut = (G4NeutronTrackingCut*)phys->GetPhysics("neutronTrackingCut");
101  neutrcut->SetTimeLimit(NeutronTimeLimit_);
102  }
103  if (DumpList_) {
104  std::cout << phys->GetPhysicsTableDirectory() << std::endl;
105  phys->DumpList();
106  phys->DumpCutValuesTable();
107  }
108  return phys;
109 }

Member Data Documentation

bool artg4tk::PhysicsListService::BoundaryInvokeSD_
private

Definition at line 51 of file PhysicsList_service.hh.

double artg4tk::PhysicsListService::CerenkovMaxBetaChange_
private

Definition at line 37 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

int artg4tk::PhysicsListService::CerenkovMaxNumPhotons_
private

Definition at line 36 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::CerenkovStackPhotons_
private

Definition at line 35 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::CerenkovTrackSecondariesFirst_
private

Definition at line 38 of file PhysicsList_service.hh.

bool artg4tk::PhysicsListService::DumpList_
private

Definition at line 23 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableAbsorption_
private

Definition at line 46 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableBoundary_
private

Definition at line 49 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableCerenkov_
private

Definition at line 34 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableMieHG_
private

Definition at line 48 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableNeutronLimit_
private

Definition at line 24 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableOptical_
private

Definition at line 32 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableRayleigh_
private

Definition at line 47 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableScintillation_
private

Definition at line 39 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableStepLimit_
private

Definition at line 27 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::enableWLS_
private

Definition at line 50 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

double artg4tk::PhysicsListService::NeutronKinELimit_
private

Definition at line 26 of file PhysicsList_service.hh.

double artg4tk::PhysicsListService::NeutronTimeLimit_
private

Definition at line 25 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

std::string artg4tk::PhysicsListService::PhysicsListName_
private

Definition at line 22 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::ScintillationByParticleType_
private

Definition at line 41 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::ScintillationStackPhotons_
private

Definition at line 40 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::ScintillationTrackInfo_
private

Definition at line 43 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

bool artg4tk::PhysicsListService::ScintillationTrackSecondariesFirst_
private

Definition at line 44 of file PhysicsList_service.hh.

int artg4tk::PhysicsListService::verbositylevel_
private

Definition at line 52 of file PhysicsList_service.hh.

Referenced by makePhysicsList().

std::string artg4tk::PhysicsListService::WLSProfile_
private

Definition at line 53 of file PhysicsList_service.hh.


The documentation for this class was generated from the following files: