BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSPhysicsPionExtendedDecays.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#include "BDSPhysicsPionExtendedDecays.hh"
19
20#include "G4DecayTable.hh"
21#include "G4PhaseSpaceDecayChannel.hh"
22#include "G4PionPlus.hh"
23#include "G4PionMinus.hh"
24#include "G4ParticleDefinition.hh"
25#include "G4ParticleTable.hh"
26#include "G4Version.hh"
27
28
29BDSPhysicsPionExtendedDecays::BDSPhysicsPionExtendedDecays():
30 G4VPhysicsConstructor("BDSPhysicsPionExtendedDecays")
31{;}
32
33BDSPhysicsPionExtendedDecays::~BDSPhysicsPionExtendedDecays()
34{;}
35
37{
38 G4PionPlus::Definition();
39 G4PionMinus::Definition();
40}
41
43{
44 if (Activated())
45 {return;}
46
47 G4ParticleTable* pTable = G4ParticleTable::GetParticleTable();
48
49 // pi+
50 G4ParticleDefinition* piplus = pTable->FindParticle("pi+");
51 if (piplus)
52 {
53 G4DecayTable* ppdt = piplus->GetDecayTable();
54 // pi+ -> gamma, mu+, nu_mu
55 auto* ppmode2 = new G4PhaseSpaceDecayChannel("pi+", 2.00e-4, 3, "gamma", "mu+", "nu_mu");
56 // pi+ -> e+, nu_e
57 auto* ppmode3 = new G4PhaseSpaceDecayChannel("pi+", 1.23e-4, 2, "e+", "nu_e");
58 G4double ppnewBR = ppdt->GetDecayChannel(0)->GetBR() - 2.00e-4 - 1.23e-4; // they're ordered internally biggest first
59 ppdt->GetDecayChannel(0)->SetBR(ppnewBR);
60 ppdt->Insert(ppmode2); // takes ownership
61 ppdt->Insert(ppmode3);
62 }
63
64 // pi-
65 G4ParticleDefinition* piminus = pTable->FindParticle("pi-");
66 if (piminus)
67 {
68 G4DecayTable* pmdt = piminus->GetDecayTable();
69 // pi- -> gamma, mu-, nu_mu
70 auto* pnmode2 = new G4PhaseSpaceDecayChannel("pi-", 2.00e-4, 3, "gamma", "mu-", "anti_nu_mu");
71 // pi+ -> e+, nu_e
72 auto* pnmode3 = new G4PhaseSpaceDecayChannel("pi-", 1.23e-4, 2, "e-", "anti_nu_e");
73 G4double pnnewBR = pmdt->GetDecayChannel(0)->GetBR() - 2.00e-4 - 1.23e-4;
74 pmdt->GetDecayChannel(0)->SetBR(pnnewBR);
75 pmdt->Insert(pnmode2);
76 pmdt->Insert(pnmode3);
77 }
78
80}
81
82
virtual void ConstructProcess()
Extend the existing decay modes.
virtual void ConstructParticle()
Construct pi+-.
G4bool Activated() const
Get whether this instance has been activated.
void SetActivated()
Flag this instance as activated for later querying.