MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
DecayScheme.hh
1
4//
5// This file is part of MARLEY (Model of Argon Reaction Low Energy Yields)
6//
7// MARLEY is free software: you can redistribute it and/or modify it under the
8// terms of version 3 of the GNU General Public License as published by the
9// Free Software Foundation.
10//
11// For the full text of the license please see COPYING or
12// visit http://opensource.org/licenses/GPL-3.0
13//
14// Please respect the MCnet academic usage guidelines. See GUIDELINES
15// or visit https://www.montecarlonet.org/GUIDELINES for details.
16
17#pragma once
18#include <iostream>
19#include <memory>
20#include <vector>
21
22#include "marley/Level.hh"
23
24namespace HepMC3 {
25 class GenEvent;
26 class GenParticle;
27}
28
29namespace marley {
30
31 class Generator;
32
34 class DecayScheme {
35
36 public:
37
45 enum class FileFormat { native, talys };
46
47 inline DecayScheme() : Z_(0), A_(0) {}
48
52 DecayScheme(int Z, int A);
53
60 DecayScheme(int Z, int A, const std::string& filename,
61 FileFormat format = FileFormat::talys);
62
65 inline const std::vector<std::unique_ptr<marley::Level> >&
66 get_levels() const;
67
71
78
89 void do_cascade( marley::Level& initial_level, HepMC3::GenEvent& event,
91 std::shared_ptr< HepMC3::GenParticle >& residue );
92
94 inline int Z() const;
95
97 inline int A() const;
98
100 void print(std::ostream& out = std::cout) const;
101
106 void read_from_stream(std::istream& in);
107
110 void print_latex_table(std::ostream& ostr = std::cout);
111
114 void print_report(std::ostream& ostr = std::cout) const;
115
117 int pdg() const;
118
119 protected:
120
121 int Z_;
122 int A_;
123
125 std::vector< std::unique_ptr<marley::Level> > levels_;
126
131 size_t level_lower_bound_index(double Ex);
132
133 private:
134
137 void parse(const std::string& filename,
138 FileFormat ff = FileFormat::talys);
139
140 // Functions called by the constructor to parse the
141 // different nuclear data formats accepted by this class
142
145 void parse_talys(const std::string& filename);
146
149 void parse_native(const std::string& filename);
150 // Add more formats as needed
151 };
152
153 // Inline function definitions
154 inline int DecayScheme::Z() const { return Z_; }
155 inline int DecayScheme::A() const { return A_; }
156
157 inline const std::vector<std::unique_ptr<marley::Level> >&
159}
160
161inline std::istream& operator>>(std::istream& in, marley::DecayScheme& ds)
162{
163 ds.read_from_stream(in);
164 return in;
165}
166
167inline std::ostream& operator<<(std::ostream& out,
168 const marley::DecayScheme& ds)
169{
170 ds.print(out);
171 return out;
172}
Stores event-related information.
Definition GenEvent.h:47
Stores particle-related information.
Definition GenParticle.h:34
Discrete level and γ-ray data for a specific nuclide.
void read_from_stream(std::istream &in)
Use a std::istream to initialize this DecayScheme object, replacing any previous data.
int pdg() const
Returns the nuclear PDG code corresponding to Z and A.
std::vector< std::unique_ptr< marley::Level > > levels_
Level objects owned by this DecayScheme.
int Z_
Atomic number.
marley::Level & add_level(const marley::Level &level)
Add a level to the DecayScheme.
void print_latex_table(std::ostream &ostr=std::cout)
Print LaTeX source code that gives a tabular representation of the DecayScheme object.
void do_cascade(marley::Level &initial_level, HepMC3::GenEvent &event, marley::Generator &gen, std::shared_ptr< HepMC3::GenParticle > &residue)
Simulates nuclear de-excitation via γ-ray emission(s)
int A_
Mass number.
const std::vector< std::unique_ptr< marley::Level > > & get_levels() const
Get a const reference to the vector that holds the Level objects.
size_t level_lower_bound_index(double Ex)
Get the index of the first level whose energy is not less than Ex.
FileFormat
The FileFormat type is used to tell the DecayScheme class which format to assume when parsing a discr...
int A() const
Get the mass number.
int Z() const
Get the atomic number.
void print(std::ostream &out=std::cout) const
Print this DecayScheme object to a std::ostream.
void print_report(std::ostream &ostr=std::cout) const
Print a human-readable text representation of the DecayScheme object.
marley::Level * get_pointer_to_closest_level(double E_level)
Gets a pointer to the Level in the DecayScheme whose excitation energy is closest to E_level.
The MARLEY Event generator.
Definition Generator.hh:54
A discrete nuclear energy level.
Definition Level.hh:29