File indexing completed on 2026-03-28 07:50:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "F04PhysicsListMessenger.hh"
0030
0031 #include "F04PhysicsList.hh"
0032
0033 #include "G4DecayTable.hh"
0034 #include "G4ParticleDefinition.hh"
0035 #include "G4ParticleTable.hh"
0036 #include "G4PhaseSpaceDecayChannel.hh"
0037 #include "G4PionRadiativeDecayChannel.hh"
0038 #include "G4VDecayChannel.hh"
0039 #include "globals.hh"
0040
0041 #include <G4UIcmdWithADoubleAndUnit.hh>
0042 #include <G4UIcmdWithAString.hh>
0043 #include <G4UIcmdWithoutParameter.hh>
0044 #include <G4UIdirectory.hh>
0045
0046
0047
0048 F04PhysicsListMessenger::F04PhysicsListMessenger(F04PhysicsList* pPhys) : fPhysicsList(pPhys)
0049 {
0050 fDirectory = new G4UIdirectory("/exp/phys/");
0051 fDirectory->SetGuidance("Control the physics lists");
0052
0053 fStepMaxCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/stepMax", this);
0054 fStepMaxCMD->SetGuidance("Set max. step length in the detector");
0055 fStepMaxCMD->SetParameterName("mxStep", false);
0056 fStepMaxCMD->SetUnitCategory("Length");
0057 fStepMaxCMD->SetRange("mxStep>0.0");
0058 fStepMaxCMD->SetDefaultUnit("mm");
0059 fStepMaxCMD->AvailableForStates(G4State_PreInit, G4State_Idle);
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072 fDecayDirectory = new G4UIdirectory("/decay/");
0073 fDecayDirectory->SetGuidance("Decay chain control commands.");
0074
0075 fPienuCMD = new G4UIcmdWithoutParameter("/decay/pienu", this);
0076 fPienuCMD->SetGuidance("Sets the pi+ to decay into e+, nu");
0077
0078 fPimunuCMD = new G4UIcmdWithoutParameter("/decay/pimunu", this);
0079 fPimunuCMD->SetGuidance("Sets the pi+ to decay into mu+, nu");
0080 }
0081
0082
0083
0084 F04PhysicsListMessenger::~F04PhysicsListMessenger()
0085 {
0086
0087
0088
0089
0090 delete fPienuCMD;
0091 delete fPimunuCMD;
0092 }
0093
0094
0095
0096 void F04PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0097 {
0098 G4ParticleTable* fParticleTable = G4ParticleTable::GetParticleTable();
0099
0100 if (command == fPienuCMD) {
0101 G4ParticleDefinition* fParticleDef = fParticleTable->FindParticle("pi+");
0102 G4VDecayChannel* fMode = new G4PhaseSpaceDecayChannel("pi+", 0.999983, 2, "e+", "nu_e");
0103 auto fTable = new G4DecayTable();
0104 fTable->Insert(fMode);
0105 fMode = new G4PionRadiativeDecayChannel("pi+", 0.000017);
0106 fTable->Insert(fMode);
0107 fParticleDef->SetDecayTable(fTable);
0108 }
0109
0110 if (command == fPimunuCMD) {
0111 G4ParticleDefinition* fParticleDef = fParticleTable->FindParticle("pi+");
0112 G4VDecayChannel* fMode = new G4PhaseSpaceDecayChannel("pi+", 1.000, 2, "mu+", "nu_mu");
0113 auto fTable = new G4DecayTable();
0114 fTable->Insert(fMode);
0115 fParticleDef->SetDecayTable(fTable);
0116 }
0117
0118 else if (command == fStepMaxCMD) {
0119 fPhysicsList->SetStepMax(fStepMaxCMD->GetNewDoubleValue(newValue));
0120 }
0121
0122
0123
0124
0125
0126
0127
0128
0129 }