58 return Form(
"%d/%d",
fN,
fD);
60 return Form(
"%d",
fN);
65 std::istringstream input; input.clear(); TString st = s;
68 if ( st.Contains(
'/') ) {
69 st.ReplaceAll(
'/',
' '); input.str(st.Data()); input >>
fN >>
fD;
71 else { input.str(st.Data()); input >>
fN;
fD = 1; }
81 st.ReplaceAll(
'~',
' ');
82 if ( st.Contains(
'/') ) {
83 st.ReplaceAll(
'/',
' '); input.str(st.Data()); input >>
fN >>
fD;
85 else { input.str(st.Data()); input >>
fN;
fD = 1; }
92 st.ReplaceAll(
'(',
' ');
93 st.ReplaceAll(
')',
' ');
94 if ( st.Contains(
'/') ) {
95 st.ReplaceAll(
'/',
' '); input.str(st.Data()); input >>
fN >>
fD;
97 else { input.str(st.Data()); input >>
fN;
fD = 1; }
104 st.ReplaceAll(
'[',
' ');
105 st.ReplaceAll(
']',
' ');
106 if ( st.Contains(
'/') ) {
107 st.ReplaceAll(
'/',
' '); input.str(st.Data()); input >>
fN >>
fD;
109 else { input.str(st.Data()); input >>
fN;
fD = 1; }
127 if ( fD < 1 || fD > 2 ) {
128 printf(
"- ! - A spin should be an integer or half an integer ! \n ");
146 fD = TMath::Max(
fD, sp.
fD);
161 { sep1 =
'('; sep2 =
')'; }
163 { sep1 =
'['; sep2 =
']'; }
165 { sep1 =
'~'; sep2 =
""; }
167 if ( spin.
GetD() == 1 ) {
168 out << sep1 << spin.
GetN() << sep2 ;
172 out << sep1 << spin.
GetN() <<
"/" << spin.
GetD() << sep2;
printf("******************************************************************** \n")
static EData WhatIs(const char *)
It deduces from a string the kind of data.
virtual bool IsData(UShort_t) const
to get some information about this data
void Set(Int_t n, Int_t d=1)
To set the spin.
Int_t GetD() const
To get the spin (denominator)
Base class for a quantum number.
A spin is defined by two integers: a numerator and a denominator.
Spin & operator+=(Int_t value)
operator +=
const Char_t * GetString() const
To get the spin as a string.
Base class to get/set some flag informations concerning any data.
virtual void SetInfo(InfoData::EData)
to set some information about this data
Int_t GetN() const
To get the spin (numerator)
header file for a spin quantum number
std::ostream & operator<<(std::ostream &out, const Spin &spin)
to write a Spin in a stream