LDMX Software
simcore::GammaPhysics Class Reference

extra gamma particle physics for simulation and sets up the photonuclear model to use from the configuration More...

Public Member Functions

 GammaPhysics (const G4String &name, const framework::config::Parameters &parameters)
 Class constructor.
 
virtual ~GammaPhysics ()=default
 Class destructor.
 
void ConstructParticle () final
 Construct particles.
 
void ConstructProcess () final
 We do two things for this call back during initialization.
 

Private Attributes

G4GammaConversionToMuons gamma_conv_process_
 The gamma to muons process.
 
framework::config::Parameters model_parameters_
 Parameters from the configuration to pass along to the photonuclear model.
 

Detailed Description

extra gamma particle physics for simulation and sets up the photonuclear model to use from the configuration

Note

Is responsible for selecting the photonuclear model from the python configuration. Currently adds gamma -> mumu reaction using the G4GammaConversionToMuons process. Also changes ordering of gamma processes such that photonNuclear and GammaToMuMu are called first.

Definition at line 36 of file GammaPhysics.h.

Constructor & Destructor Documentation

◆ GammaPhysics()

simcore::GammaPhysics::GammaPhysics ( const G4String & name,
const framework::config::Parameters & parameters )

Class constructor.

Parameters
nameThe name of the physics.
parametersThe python configuration

Definition at line 12 of file GammaPhysics.cxx.

14 : G4VPhysicsConstructor(name),
16 parameters.get<framework::config::Parameters>("photonuclear_model")} {
17}
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:78
framework::config::Parameters model_parameters_
Parameters from the configuration to pass along to the photonuclear model.

Member Function Documentation

◆ ConstructParticle()

void simcore::GammaPhysics::ConstructParticle ( )
final

Construct particles.

We don't do anything here since we are just attaching/updating the photon physics.

Definition at line 19 of file GammaPhysics.cxx.

19{}

◆ ConstructProcess()

void simcore::GammaPhysics::ConstructProcess ( )
final

We do two things for this call back during initialization.

  1. We add the muon-conversion process to the photon's process table, enabling it to be one of the processes that can happen.
  2. We move the photonNuclear process to be the first process in the photon's ordering so that the bias operator has a chance to lower its cross-section before any EM process is called (if need be).

Put the PN process first in the ordering in case PN biasing is happening.

Process ordering is a complicated concept and unfortunately its affect on biasing is poorly documented. What has been said is that some processes need to be called last[1]. In addition, the practical experience of working on defining a custom process for G4DarkBreM showed that sometimes Geant4 does not get through the full list of processes but it always starts at the beginning. For these reasons, we put the PN process first in the ordering so that we can insure it is always check by Geant4 before continuing.

[1] https://indico.cern.ch/event/58317/contributions/2047449/attachments/992300/1411062/PartDef-ProcMan-AS.pdf

Definition at line 21 of file GammaPhysics.cxx.

21 {
22 G4ProcessManager* process_manager = G4Gamma::Gamma()->GetProcessManager();
23 if (process_manager == nullptr) {
24 EXCEPTION_RAISE("GammaPhysics",
25 "Was unable to access the process manager for photons, "
26 "something is very wrong!");
27 }
28 // configure our PN model based on runtime parameters
29 auto pn = PhotoNuclearModel::Factory::get().make(
30 model_parameters_.get<std::string>("class_name"),
31 model_parameters_.get<std::string>("instance_name"), model_parameters_);
32 if (not pn) {
33 EXCEPTION_RAISE("UnableToCreate",
34 "Unable to create a PhotoNuclearModel of type " +
35 model_parameters_.get<std::string>("class_name"));
36 }
37 pn.value()->removeExistingModel(process_manager);
38 pn.value()->constructGammaProcess(process_manager);
57 const auto processes{process_manager->GetProcessList()};
58 for (int i{0}; i < processes->size(); i++) {
59 const auto process{(*processes)[i]};
60 if (process->GetProcessName() == "photonNuclear") {
61 process_manager->SetProcessOrderingToFirst(
62 process, G4ProcessVectorDoItIndex::idxAll);
63 }
64 }
65 // Add the gamma -> mumu to the physics list.
66 process_manager->AddDiscreteProcess(&gamma_conv_process_);
67}
G4GammaConversionToMuons gamma_conv_process_
The gamma to muons process.

References gamma_conv_process_, framework::config::Parameters::get(), and model_parameters_.

Member Data Documentation

◆ gamma_conv_process_

G4GammaConversionToMuons simcore::GammaPhysics::gamma_conv_process_
private

The gamma to muons process.

Definition at line 75 of file GammaPhysics.h.

Referenced by ConstructProcess().

◆ model_parameters_

framework::config::Parameters simcore::GammaPhysics::model_parameters_
private

Parameters from the configuration to pass along to the photonuclear model.

Definition at line 80 of file GammaPhysics.h.

Referenced by ConstructProcess().


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