Public Member Functions | Private Attributes | Friends | List of all members
genie::BaryonResList Class Reference

Encapsulates a list of baryon resonances. More...

#include <BaryonResList.h>

Public Member Functions

 BaryonResList ()
 
 BaryonResList (const BaryonResList &rl)
 
virtual ~BaryonResList ()
 
void DecodeFromNameList (string list, string delimiter=",")
 
unsigned int NResonances (void) const
 
string ResonanceName (unsigned int ires) const
 
Resonance_t ResonanceId (unsigned int ires) const
 
int ResonancePdgCode (unsigned int ires) const
 
bool Find (Resonance_t res) const
 
void Clear (void)
 
void Copy (const BaryonResList &rl)
 
void Print (ostream &stream) const
 
auto begin () noexcept-> typename vector< Resonance_t >::iterator
 
auto end () noexcept-> typename vector< Resonance_t >::iterator
 
auto begin () const noexcept-> typename vector< Resonance_t >::const_iterator
 
auto end () const noexcept-> typename vector< Resonance_t >::const_iterator
 
auto cbegin () const noexcept-> typename vector< Resonance_t >::const_iterator
 
auto cend () const noexcept-> typename vector< Resonance_t >::const_iterator
 

Private Attributes

vector< Resonance_t > * fResVec
 

Friends

ostream & operator<< (ostream &stream, const BaryonResList &rl)
 

Detailed Description

Encapsulates a list of baryon resonances.

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

May 03, 2004

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 37 of file BaryonResList.h.

Constructor & Destructor Documentation

BaryonResList::BaryonResList ( )

Definition at line 32 of file BaryonResList.cxx.

33 {
34  fResVec = 0;
35 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
BaryonResList::BaryonResList ( const BaryonResList rl)

Definition at line 37 of file BaryonResList.cxx.

38 {
39  fResVec = 0;
40  this->Copy(res_list);
41 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
void Copy(const BaryonResList &rl)
BaryonResList::~BaryonResList ( )
virtual

Definition at line 43 of file BaryonResList.cxx.

44 {
45  if(fResVec) delete fResVec;
46 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67

Member Function Documentation

auto BaryonResList::begin ( ) -> typename vector<Resonance_t>::iterator
noexcept

Definition at line 155 of file BaryonResList.cxx.

156 {
157  return fResVec->begin();
158 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
auto BaryonResList::begin ( ) const -> typename vector<Resonance_t>::const_iterator
noexcept

Definition at line 165 of file BaryonResList.cxx.

166 {
167  return fResVec->begin();
168 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
auto BaryonResList::cbegin ( ) const -> typename vector<Resonance_t>::const_iterator
noexcept

Definition at line 175 of file BaryonResList.cxx.

176 {
177  return fResVec->cbegin();
178 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
auto BaryonResList::cend ( ) const -> typename vector<Resonance_t>::const_iterator
noexcept

Definition at line 180 of file BaryonResList.cxx.

181 {
182  return fResVec->cend();
183 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
void BaryonResList::Clear ( void  )

Definition at line 126 of file BaryonResList.cxx.

127 {
128  if(fResVec) fResVec->clear();
129 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
void BaryonResList::Copy ( const BaryonResList rl)

Definition at line 131 of file BaryonResList.cxx.

132 {
133  if(fResVec) fResVec->clear();
134 
135  unsigned int nres = res_list.NResonances();
136  if(nres==0) return;
137 
138  if(!fResVec) fResVec = new vector<Resonance_t> (nres);
139 
140  for(unsigned int ires = 0; ires < nres; ires++) {
141  (*fResVec)[ires] = res_list.ResonanceId(ires);
142  }
143 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
void BaryonResList::DecodeFromNameList ( string  list,
string  delimiter = "," 
)

Definition at line 101 of file BaryonResList.cxx.

102 {
103  //-- remove all spaces in the input string coming from the XML config file
104 
105  string list = utils::str::FilterString(" ", input_list);
106 
107  vector<string> resonances = utils::str::Split(list, delimiter);
108 
109  SLOG("BaryonResList", pINFO) << list;
110  SLOG("BaryonResList", pINFO) << resonances.size();
111 
112  if(fResVec) delete fResVec;
113  fResVec = new vector<Resonance_t> (resonances.size());
114 
115  unsigned int ires = 0;
117  for(riter = resonances.begin(); riter != resonances.end(); ++riter) {
118 
119  Resonance_t res = utils::res::FromString( (*riter).c_str() );
120  if( res == kNoResonance ) {
121  SLOG("BaryonResList", pERROR) << "*** Unknown resonance: " << *riter;
122  } else (*fResVec)[ires++] = res;
123  }
124 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
Resonance_t FromString(const char *res)
string -> resonance id
#define pERROR
Definition: Messenger.h:59
intermediate_table::const_iterator const_iterator
enum genie::EResonance Resonance_t
#define pINFO
Definition: Messenger.h:62
string FilterString(string filt, string input)
Definition: StringUtils.cxx:79
vector< string > Split(string input, string delim)
Definition: StringUtils.cxx:36
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
auto BaryonResList::end ( ) -> typename vector<Resonance_t>::iterator
noexcept

Definition at line 160 of file BaryonResList.cxx.

161 {
162  return fResVec->end();
163 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
auto BaryonResList::end ( ) const -> typename vector<Resonance_t>::const_iterator
noexcept

Definition at line 170 of file BaryonResList.cxx.

171 {
172  return fResVec->end();
173 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
bool BaryonResList::Find ( Resonance_t  res) const

Definition at line 90 of file BaryonResList.cxx.

91 {
92  if(!fResVec) {
93  SLOG("BaryonResList", pWARN) << "NULL resonance list!";
94  return false;
95  }
96  int n = count(fResVec->begin(), fResVec->end(), res);
97  if(n!=0) return true;
98  return false;
99 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
std::void_t< T > n
#define pWARN
Definition: Messenger.h:60
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
unsigned int BaryonResList::NResonances ( void  ) const

Definition at line 48 of file BaryonResList.cxx.

49 {
50  if(!fResVec) {
51  SLOG("BaryonResList", pERROR) << "Null Resonance List";
52  return 0;
53  }
54  return fResVec->size();
55 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
#define pERROR
Definition: Messenger.h:59
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
void BaryonResList::Print ( ostream &  stream) const

Definition at line 145 of file BaryonResList.cxx.

146 {
147  stream << "\n [-] Resonance List\n";
148 
150  for(riter = fResVec->begin(); riter != fResVec->end(); ++riter) {
151  stream << " |--> RES: " << utils::res::AsString(*riter) << endl;
152  }
153 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
intermediate_table::const_iterator const_iterator
const char * AsString(Resonance_t res)
resonance id -> string
QTextStream & endl(QTextStream &s)
Resonance_t BaryonResList::ResonanceId ( unsigned int  ires) const

Definition at line 71 of file BaryonResList.cxx.

72 {
73  if(!fResVec) {
74  SLOG("BaryonResList", pERROR) << "Null Resonance List";
75  return kNoResonance;
76  }
77  if(ires >= this->NResonances() ) {
78  SLOG("BaryonResList", pERROR) << "Resonance idx: " << ires
79  << " outside limits: [0, " << this->NResonances() << "]";
80  return kNoResonance;
81  }
82  return (*fResVec)[ires];
83 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
#define pERROR
Definition: Messenger.h:59
unsigned int NResonances(void) const
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
string BaryonResList::ResonanceName ( unsigned int  ires) const

Definition at line 57 of file BaryonResList.cxx.

58 {
59  if(!fResVec) {
60  SLOG("BaryonResList", pERROR) << "Null Resonance List";
61  return "-";
62  }
63  if(ires >= this->NResonances() ) {
64  SLOG("BaryonResList", pERROR) << "Resonance idx: " << ires
65  << " outside limits: [0, " << this->NResonances() << "]";
66  return "-";
67  }
68  return utils::res::AsString( (*fResVec)[ires] );
69 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:67
#define pERROR
Definition: Messenger.h:59
unsigned int NResonances(void) const
const char * AsString(Resonance_t res)
resonance id -> string
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
int BaryonResList::ResonancePdgCode ( unsigned int  ires) const

Definition at line 85 of file BaryonResList.cxx.

86 {
87  return 0;
88 }

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const BaryonResList rl 
)
friend

Definition at line 25 of file BaryonResList.cxx.

26  {
27  res_list.Print(stream);
28  return stream;
29  }

Member Data Documentation

vector<Resonance_t>* genie::BaryonResList::fResVec
private

Definition at line 67 of file BaryonResList.h.


The documentation for this class was generated from the following files: