ATLAS Offline Software
PhysicsListSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4ATLASTOOLS_PHYSICSLISTSVC_H
6 #define G4ATLASTOOLS_PHYSICSLISTSVC_H
7 
8 // Base classes
11 
12 
14 #include "GaudiKernel/ToolHandle.h"
15 
16 // Classes that are returned
17 class G4VModularPhysicsList;
18 class G4VUserPhysicsList;
19 
20 // STL library
21 #include <string>
22 
23 class PhysicsListSvc : public extends<AthService, IPhysicsListSvc>
24 {
25 public:
26  // Standard constructor and destructor
27  PhysicsListSvc(const std::string& name, ISvcLocator* pSvcLocator);
28  virtual ~PhysicsListSvc() = default;
29 
30 
31  virtual StatusCode initialize( ) override;
32  // Base class methods from IPhysicsListSvc
33  virtual void CreatePhysicsList() override;
34  virtual G4VUserPhysicsList* GetPhysicsList() override;
35  virtual void SetPhysicsList() override;
36  virtual void SetPhysicsOptions() override;
37 
38 private:
39 
41  void CommandLog(int returnCode, const std::string& commandString) const;
42 
43  ToolHandleArray<IPhysicsOptionTool> m_phys_option{this, "PhysOption", {}, "Tool handle array of physics options" };
44  ToolHandleArray<IPhysicsOptionTool> m_phys_decay{this, "PhysicsDecay", {}, "Tool handle array of physics decays"};
45  G4VModularPhysicsList* m_physicsList{};
46  Gaudi::Property<std::string> m_physicsListName{this, "PhysicsList", "FTFP_BERT", "Name for physics list"};
47  Gaudi::Property<double> m_neutronTimeCut{this, "NeutronTimeCut", 0, "Time cut for neutron killer"};
48  Gaudi::Property<double> m_neutronEnergyCut{this, "NeutronEnergyCut", 0, "Energy cut for neutron killer"};
49  Gaudi::Property<double> m_generalCut{this, "GeneralCut", 0, "General cut"};
50  Gaudi::Property<double> m_emMaxEnergy{this, "EMMaxEnergy", -1., "Maximum energy for EM tables"};
51  Gaudi::Property<double> m_emMinEnergy{this, "EMMinEnergy", -1., "Minimum energy for EM tables"};
52  /* --- ATLASSIM-3967 ---
53  Old methods SetDEDXBinning and SetLambdaBinning are replaced in G4 10.4 by
54  SetNumberOfBinsPerDecade which now controls both settings with the same
55  value. Instead of changing the overall number of bins, user should
56  specify the number of bins per energy decade instead.
57  */
58  Gaudi::Property<int> m_emNumberOfBinsPerDecade{this, "EMNumberOfBinsPerDecade", -1, "Number of bins per Energy decade. Used for both DeDx and for the Lambda binning."};
59  Gaudi::Property<bool> m_applyEMCuts{this, "ApplyEMCuts", true, "Apply cuts EM flag in Geant4"};
60  Gaudi::Property<bool> m_quietMode{this, "QuietMode", false, ""};
61  Gaudi::Property<bool> m_unstableAntiNeutrons{this, "UnstableAntiNeutrons",false,"Bugfix for ATLASSIM-6634 until we switch to using Geant4 11"};
62 };
63 
64 #endif
PhysicsListSvc::m_quietMode
Gaudi::Property< bool > m_quietMode
!< Switch for the G4 "apply cuts" EM physics flag
Definition: PhysicsListSvc.h:60
PhysicsListSvc::m_generalCut
Gaudi::Property< double > m_generalCut
!< Energy cut for neutrons (in the neutron killer process)
Definition: PhysicsListSvc.h:49
PhysicsListSvc::m_unstableAntiNeutrons
Gaudi::Property< bool > m_unstableAntiNeutrons
Definition: PhysicsListSvc.h:61
PhysicsListSvc::CreatePhysicsList
virtual void CreatePhysicsList() override
Definition: PhysicsListSvc.cxx:47
PhysicsListSvc::PhysicsListSvc
PhysicsListSvc(const std::string &name, ISvcLocator *pSvcLocator)
Definition: PhysicsListSvc.cxx:22
PhysicsListSvc::m_physicsListName
Gaudi::Property< std::string > m_physicsListName
!< Handle on the physics list
Definition: PhysicsListSvc.h:46
PhysicsListSvc::m_emMaxEnergy
Gaudi::Property< double > m_emMaxEnergy
!< A general cut - this isn't normally used in our simulation
Definition: PhysicsListSvc.h:50
PhysicsListSvc::m_phys_option
ToolHandleArray< IPhysicsOptionTool > m_phys_option
Definition: PhysicsListSvc.h:43
PhysicsListSvc::m_emMinEnergy
Gaudi::Property< double > m_emMinEnergy
!< Maximum energy of the pre-calculated EM cross-section tables
Definition: PhysicsListSvc.h:51
PhysicsListSvc::m_phys_decay
ToolHandleArray< IPhysicsOptionTool > m_phys_decay
Definition: PhysicsListSvc.h:44
PhysicsListSvc::CommandLog
void CommandLog(int returnCode, const std::string &commandString) const
This command prints a message about a G4Command depending on its returnCode.
Definition: PhysicsListSvc.cxx:211
PhysicsListSvc::m_neutronTimeCut
Gaudi::Property< double > m_neutronTimeCut
!< Name for the physics list (property to be set in the tool)
Definition: PhysicsListSvc.h:47
IPhysicsOptionTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PhysicsListSvc::initialize
virtual StatusCode initialize() override
Definition: PhysicsListSvc.cxx:28
PhysicsListSvc::m_neutronEnergyCut
Gaudi::Property< double > m_neutronEnergyCut
!< Time cut for neutrons (in the neutron killer process)
Definition: PhysicsListSvc.h:48
PhysicsListSvc::m_emNumberOfBinsPerDecade
Gaudi::Property< int > m_emNumberOfBinsPerDecade
!< Minimum energy of the pre-calculated EM cross-section tables
Definition: PhysicsListSvc.h:58
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
PhysicsListSvc::m_physicsList
G4VModularPhysicsList * m_physicsList
Definition: PhysicsListSvc.h:45
PhysicsListSvc
Definition: PhysicsListSvc.h:24
PhysicsListSvc::m_applyEMCuts
Gaudi::Property< bool > m_applyEMCuts
!< Number of bins per Energy decade. Used for both DeDx and for the Lambda binning.
Definition: PhysicsListSvc.h:59
PhysicsListSvc::~PhysicsListSvc
virtual ~PhysicsListSvc()=default
IPhysicsListSvc.h
AthService.h
PhysicsListSvc::GetPhysicsList
virtual G4VUserPhysicsList * GetPhysicsList() override
Definition: PhysicsListSvc.cxx:138
PhysicsListSvc::SetPhysicsList
virtual void SetPhysicsList() override
Definition: PhysicsListSvc.cxx:147
PhysicsListSvc::SetPhysicsOptions
virtual void SetPhysicsOptions() override
Definition: PhysicsListSvc.cxx:156