 |
DD4hep
1.37.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
50 #ifndef DDG4_GEANT4HEPEMTRACKINGPHYSICS_H
51 #define DDG4_GEANT4HEPEMTRACKINGPHYSICS_H 1
57 #include <G4Electron.hh>
59 #include <G4Positron.hh>
60 #include <G4VUserPhysicsList.hh>
63 #include <G4HepEmConfig.hh>
64 #include <G4HepEmTrackingManager.hh>
126 auto* tm =
new G4HepEmTrackingManager();
129 info(
"+++ Enabling Woodcock photon tracking in G4Region: %s", region.c_str());
130 tm->GetConfig()->SetWoodcockTrackingRegion(region);
135 auto warnIfConflict = [&](G4ParticleDefinition* particle) {
136 if (particle->GetTrackingManager() !=
nullptr) {
137 warning(
"+++ Replacing existing tracking manager for %s with G4HepEmTrackingManager",
138 particle->GetParticleName().c_str());
141 warnIfConflict(G4Electron::Definition());
142 warnIfConflict(G4Positron::Definition());
143 warnIfConflict(G4Gamma::Definition());
145 G4Electron::Definition()->SetTrackingManager(tm);
146 G4Positron::Definition()->SetTrackingManager(tm);
147 G4Gamma::Definition() ->SetTrackingManager(tm);
149 info(
"+++ Installed G4HepEmTrackingManager for e-/e+/gamma");
155 #endif // DDG4_GEANT4HEPEMTRACKINGPHYSICS_H
Geant4HepEmTrackingPhysics(Geant4Context *context, const std::string &nam)
Standard constructor.
virtual void constructProcesses(G4VUserPhysicsList *) override
Callback to install the G4HepEmTrackingManager on e-, e+ and gamma.
#define DECLARE_GEANT4ACTION(name)
Plugin defintion to create Geant4Action objects.
void warning(const char *fmt,...) const
Support of warning messages.
std::vector< std::string > m_woodcockRegions
G4Region names in which Woodcock tracking is activated for photons.
void info(const char *fmt,...) const
Support of info messages.
virtual ~Geant4HepEmTrackingPhysics()=default
Default destructor.
PhysicsConstructor enabling G4HepEm vectorised EM tracking for e-/e+/gamma.
DDG4_DEFINE_ACTION_CONSTRUCTORS(Geant4HepEmTrackingPhysics)
Define standard assignments and constructors.
Geant4Action & declareProperty(const std::string &nam, T &val)
Declare property.
Concrete basic implementation of a Geant4 physics list action.
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
Namespace for the AIDA detector description toolkit.
Generic context to extend user, run and event information.
Geant4Context * context() const
Access the context.