14#include "tkspin_parity.h"
86 std::istringstream input; input.clear();
90 st.
replace_all(
"/",
" "); input.str(st); input >> fN >> fD;
92 else { input.str(st); input >> fN; fD = 1; }
104 st.
replace_all(
"/",
" "); input.str(st); input >> fN >> fD;
106 else { input.str(st); input >> fN; fD = 1; }
116 st.
replace_all(
"/",
" "); input.str(st); input >> fN >> fD;
118 else { input.str(st); input >> fN; fD = 1; }
128 st.
replace_all(
"/",
" "); input.str(st); input >> fN >> fD;
130 else { input.str(st); input >> fN; fD = 1; }
150 if ( fD < 1 || fD > 2 ) {
151 glog <<
warning <<
"A spin should be an integer or half an integer !\n";
163 int _2spin = lround(2*_spin);
173 if ( fD < 1 || fD > 2 ) {
174 glog <<
warning <<
"A spin should be an integer or half an integer !\n";
224 else if(_parity==1) {
276 fJpi_str.remove_all_extra_white_space();
277 fJpi_str.replace_all(
"GE",
">=");
278 fJpi_str.replace_all(
"LE",
"<=");
279 fJpi_str.replace_all(
"GT",
">");
280 fJpi_str.replace_all(
"LT",
"<");
290 fParity.set(_parity);
301 else glog <<
info_o <<
"Jpi: " << setw(10) << fJpi_str <<
do_endl;
Nuclear excited state parity.
void print()
print the spin properties
tkstring get_string()
returns the parity as a string
virtual void set(const tkstring &_st)
define the parity from a string
void set_info(tkproperty::data_info _info)
to set some information about this data
tkstring get_info_str(bool _showknown=true) const
to print in string the data_info
static data_info what_is(const tkstring &_st)
It deduces from a string the kind of data.
bool is_info(data_info _info) const
to get some information about this data
Nuclear excited state spin-parity.
void set_from_str(const tkstring &_st)
define the spin parity from a string
void print()
print the spin and parity properties
void set_parity(int _parity)
define the parity from an integer
void set_spin(double _spin)
define the spin from a float
virtual bool is_known()
test if the spin and parity are known
const tkstring & get_jpi_str() const
returns the spin and parity string
Nuclear excited state spin.
virtual void print()
print the spin properties
tkstring get_string()
returns the spin as a string
void set(int n, int d=1)
define the spin value
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
static const char * form(const char *_format,...)
static tkstring Form(const char *_format,...)
bool ends_with(const char *_s, ECaseCompare _cmp=kExact) const
bool contains(const char *_pat, ECaseCompare _cmp=kExact) const
tkstring & prepend(const tkstring &_st)
tkstring & append(const tkstring &_st)
tkstring & replace_all(const tkstring &_s1, const tkstring &_s2)
tklog & warning_o(tklog &log)
tklog & info_o(tklog &log)
tklog & do_endl(tklog &log)
tklog & warning(tklog &log)