This repository was archived by the owner on May 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99#include < G4ParticleDefinition.hh>
1010#include < G4VDecayChannel.hh>
1111#include < G4VPhysicsConstructor.hh>
12+ #include < iomanip>
13+ #include < iostream>
1214#include < numeric>
1315#include < vector>
1416
@@ -127,6 +129,8 @@ class KaonPhysics : public G4VPhysicsConstructor {
127129
128130 void ConstructParticle () override ;
129131
132+ void DumpDecayDetails (const G4ParticleDefinition* kaon) const ;
133+
130134 /* *
131135 * Construct processes
132136 *
Original file line number Diff line number Diff line change @@ -79,4 +79,26 @@ void KaonPhysics::ConstructParticle() {
7979 setDecayProperties (kaonShort, k0s_branching_ratios, k0s_lifetime_factor);
8080}
8181
82+ void KaonPhysics::DumpDecayDetails (const G4ParticleDefinition* kaon) const {
83+ std::cout << " Decay table details for " << kaon->GetParticleName ()
84+ << std::endl
85+ << std::scientific << std::setprecision (15 );
86+ std::cout << " PDG Lifetime " << kaon->GetPDGLifeTime () << std::endl;
87+ const auto table{kaon->GetDecayTable ()};
88+ const int entries{table->entries ()};
89+ for (auto i{0 }; i < entries; ++i) {
90+ const auto channel{(*table)[i]};
91+ std::cout << " Channel " << i << " Kinematics type "
92+ << channel->GetKinematicsName () << " with BR " << channel->GetBR ()
93+ << std::endl;
94+ std::cout << kaon->GetParticleName () << " -> " ;
95+ const auto daughters{channel->GetNumberOfDaughters ()};
96+ for (auto j{0 }; j < daughters - 1 ; ++j) {
97+ std::cout << channel->GetDaughter (j)->GetParticleName () << " + " ;
98+ }
99+ // Special formatting for last one :)
100+ std::cout << channel->GetDaughter (daughters - 1 )->GetParticleName ()
101+ << std::endl;
102+ }
103+ }
82104} // namespace simcore
You can’t perform that action at this time.
0 commit comments