Version: SMASH-1.6
decayactionsfinderdilepton.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2019
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
11 
12 #include "smash/constants.h"
13 #include "smash/cxx14compat.h"
15 #include "smash/decaymodes.h"
16 #include "smash/particles.h"
17 
18 namespace smash {
19 
21  OutputInterface *output,
22  double dt) const {
23  if (!output->is_dilepton_output()) {
24  return;
25  }
26  for (const auto &p : search_list) {
27  const auto n_all_modes =
28  p.type()
29  .get_partial_widths(p.momentum(), p.position().threevec(),
31  .size();
32  if (n_all_modes == 0) {
33  continue;
34  }
35 
36  const double inv_gamma = p.inverse_gamma();
37  DecayBranchList dil_modes = p.type().get_partial_widths(
38  p.momentum(), p.position().threevec(), WhichDecaymodes::Dileptons);
39 
40  /* If particle can only decay into dileptons or is stable, use shining only
41  * in find_final_actions and ignore them here, also unformed
42  * resonances cannot decay */
43  if (dil_modes.size() == n_all_modes || p.type().is_stable() ||
44  (p.formation_time() > p.position().x0())) {
45  continue;
46  }
47 
48  for (DecayBranchPtr &mode : dil_modes) {
49  // SHINING as described in \iref{Schmidt:2008hm}, chapter 2D
50  const double shining_weight = dt * inv_gamma * mode->weight() / hbarc;
51 
52  if (shining_weight > 0.0) { // decays that can happen
53  DecayActionDilepton act(p, 0., shining_weight);
54  act.add_decay(std::move(mode));
56  output->at_interaction(act, 0.0);
57  }
58  }
59  }
60 }
61 
63  OutputInterface *output,
64  bool only_res) const {
65  if (!output->is_dilepton_output()) {
66  return;
67  }
68  for (const auto &p : search_list) {
69  const ParticleType &t = p.type();
70  if (t.decay_modes().decay_mode_list().empty() ||
71  (only_res && t.is_stable())) {
72  continue;
73  }
74 
75  DecayBranchList dil_modes = t.get_partial_widths(
76  p.momentum(), p.position().threevec(), WhichDecaymodes::Dileptons);
77 
78  // total decay width, also hadronic decays
79  const double width_tot = total_weight<DecayBranch>(t.get_partial_widths(
80  p.momentum(), p.position().threevec(), WhichDecaymodes::All));
81 
82  for (DecayBranchPtr &mode : dil_modes) {
83  const double shining_weight = mode->weight() / width_tot;
84 
85  if (shining_weight > 0.0) { // decays that can happen
86  DecayActionDilepton act(p, 0., shining_weight);
87  act.add_decay(std::move(mode));
89  output->at_interaction(act, 0.0);
90  }
91  }
92  }
93 }
94 
95 } // namespace smash
void shine(const Particles &search_list, OutputInterface *output, double dt) const
Check the whole particles list and print out possible dilepton decays.
DecayActionDilepton is special action created for particles that can decay into dileptons.
bool is_stable() const
Definition: particletype.h:236
DecayBranchList get_partial_widths(const FourVector p, const ThreeVector x, WhichDecaymodes wh) const
Get all the mass-dependent partial decay widths of a particle with mass m.
Collection of useful constants that are known at compile time.
void add_decay(DecayBranchPtr p)
Add one new decay.
Definition: decayaction.cc:28
constexpr double hbarc
GeV <-> fm conversion factor.
Definition: constants.h:25
const DecayBranchList & decay_mode_list() const
Definition: decaymodes.h:63
virtual void at_interaction(const Action &action, const double density)
Called whenever an action modified one or more particles.
Particle type contains the static properties of a particle species.
Definition: particletype.h:97
Only return dilepton decays widths.
bool is_dilepton_output() const
Get, whether this is the dilepton output?
All decay mode widths.
void generate_final_state() override
Generate the final state of the decay process.
Definition: decayaction.cc:32
constexpr int p
Proton.
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
void shine_final(const Particles &search_list, OutputInterface *output, bool only_res=false) const
Shine dileptons from resonances at the end of the simulation.
const DecayModes & decay_modes() const
Abstraction of generic output.
Definition: action.h:24