Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // 27 //--------------------------------------------------------------------------- 28 // 29 // ClassName: G4SpinDecayPhysics 30 // 31 // Author: 2015 P. Gumplinger 32 // 33 // Modified: 34 // 35 //---------------------------------------------------------------------------- 36 // 37 #include "G4SpinDecayPhysics.hh" 38 39 #include "G4ParticleDefinition.hh" 40 #include "G4ProcessManager.hh" 41 42 #include "G4ParticleTypes.hh" 43 #include "G4ParticleTable.hh" 44 45 #include "G4ProcessTable.hh" 46 47 #include "G4DecayTable.hh" 48 #include "G4MuonDecayChannelWithSpin.hh" 49 #include "G4MuonRadiativeDecayChannelWithSpin.hh" 50 51 #include "G4EmBuilder.hh" 52 #include "G4PhysListUtil.hh" 53 54 // factory 55 #include "G4PhysicsConstructorFactory.hh" 56 // 57 G4_DECLARE_PHYSCONSTR_FACTORY(G4SpinDecayPhysics); 58 59 G4SpinDecayPhysics::G4SpinDecayPhysics(G4int verb) 60 : G4SpinDecayPhysics("SpinDecay", verb) 61 { 62 } 63 64 G4SpinDecayPhysics::G4SpinDecayPhysics(const G4String& name, G4int) 65 : G4VPhysicsConstructor(name) 66 { 67 G4PhysListUtil::InitialiseParameters(); 68 } 69 70 G4SpinDecayPhysics::~G4SpinDecayPhysics() 71 { 72 } 73 74 void G4SpinDecayPhysics::ConstructParticle() 75 { 76 // minimal set of particles for EM physics 77 G4EmBuilder::ConstructMinimalEmSet(); 78 79 G4MuonPlus::MuonPlusDefinition(); 80 G4MuonMinus::MuonMinusDefinition(); 81 82 G4DecayTable* MuonPlusDecayTable = new G4DecayTable(); 83 MuonPlusDecayTable -> Insert(new 84 G4MuonDecayChannelWithSpin("mu+",0.986)); 85 MuonPlusDecayTable -> Insert(new 86 G4MuonRadiativeDecayChannelWithSpin("mu+",0.014)); 87 G4MuonPlus::MuonPlusDefinition() -> SetDecayTable(MuonPlusDecayTable); 88 89 G4DecayTable* MuonMinusDecayTable = new G4DecayTable(); 90 MuonMinusDecayTable -> Insert(new 91 G4MuonDecayChannelWithSpin("mu-",0.986)); 92 MuonMinusDecayTable -> Insert(new 93 G4MuonRadiativeDecayChannelWithSpin("mu-",0.014)); 94 G4MuonMinus::MuonMinusDefinition() -> SetDecayTable(MuonMinusDecayTable); 95 } 96 97 void G4SpinDecayPhysics::ConstructProcess() 98 { 99 G4DecayWithSpin* decayWithSpin = new G4DecayWithSpin(); 100 101 G4ProcessTable* processTable = G4ProcessTable::GetProcessTable(); 102 103 G4VProcess* decay; 104 decay = processTable->FindProcess("Decay",G4MuonPlus::MuonPlus()); 105 106 G4ProcessManager* fManager = G4MuonPlus::MuonPlus()->GetProcessManager(); 107 108 if (fManager) { 109 if (decay) fManager->RemoveProcess(decay); 110 fManager->AddProcess(decayWithSpin); 111 // set ordering for PostStepDoIt and AtRestDoIt 112 fManager ->SetProcessOrdering(decayWithSpin, idxPostStep); 113 fManager ->SetProcessOrdering(decayWithSpin, idxAtRest); 114 } 115 116 fManager = G4MuonMinus::MuonMinus()->GetProcessManager(); 117 118 if (fManager) { 119 if (decay) fManager->RemoveProcess(decay); 120 fManager->AddProcess(decayWithSpin); 121 // set ordering for PostStepDoIt and AtRestDoIt 122 fManager ->SetProcessOrdering(decayWithSpin, idxPostStep); 123 fManager ->SetProcessOrdering(decayWithSpin, idxAtRest); 124 } 125 126 G4PionDecayMakeSpin* poldecay = new G4PionDecayMakeSpin(); 127 128 decay = processTable->FindProcess("Decay",G4PionPlus::PionPlus()); 129 130 fManager = G4PionPlus::PionPlus()->GetProcessManager(); 131 132 if (fManager) { 133 if (decay) fManager->RemoveProcess(decay); 134 fManager->AddProcess(poldecay); 135 // set ordering for PostStepDoIt and AtRestDoIt 136 fManager ->SetProcessOrdering(poldecay, idxPostStep); 137 fManager ->SetProcessOrdering(poldecay, idxAtRest); 138 } 139 140 decay = processTable->FindProcess("Decay",G4PionMinus::PionMinus()); 141 142 fManager = G4PionMinus::PionMinus()->GetProcessManager(); 143 144 if (fManager) { 145 if (decay) fManager->RemoveProcess(decay); 146 fManager->AddProcess(poldecay); 147 // set ordering for PostStepDoIt and AtRestDoIt 148 fManager ->SetProcessOrdering(poldecay, idxPostStep); 149 fManager ->SetProcessOrdering(poldecay, idxAtRest); 150 } 151 } 152