37#include "tkspin_parity.h"
70tkspin::tkspin(
int N,
int D)
109 std::istringstream input; input.clear();
113 st.
replace_all(
"/",
" "); input.str(st); input >> fN >> fD;
115 else { input.str(st); input >> fN; fD = 1; }
127 st.
replace_all(
"/",
" "); input.str(st); input >> fN >> fD;
129 else { input.str(st); input >> fN; fD = 1; }
139 st.
replace_all(
"/",
" "); input.str(st); input >> fN >> fD;
141 else { input.str(st); input >> fN; fD = 1; }
151 st.
replace_all(
"/",
" "); input.str(st); input >> fN >> fD;
153 else { input.str(st); input >> fN; fD = 1; }
173 if ( fD < 1 || fD > 2 ) {
174 glog <<
warning <<
"A spin should be an integer or half an integer !\n";
186 int _2spin = lround(2*_spin);
196 if ( fD < 1 || fD > 2 ) {
197 glog <<
warning <<
"A spin should be an integer or half an integer !\n";
247 else if(_parity==1) {
313 fParity.
set(_parity);
324 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
tkstring & remove_all_extra_white_space()
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)