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