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

Encapsulates a list of baryon resonances. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Framework/ParticleData/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
 

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 <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

May 03, 2004

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

Definition at line 37 of file BaryonResList.h.

Constructor & Destructor Documentation

BaryonResList::BaryonResList ( )

Definition at line 38 of file BaryonResList.cxx.

References fResVec.

39 {
40  fResVec = 0;
41 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61
BaryonResList::BaryonResList ( const BaryonResList rl)

Definition at line 43 of file BaryonResList.cxx.

References Copy(), and fResVec.

44 {
45  fResVec = 0;
46  this->Copy(res_list);
47 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61
void Copy(const BaryonResList &rl)
BaryonResList::~BaryonResList ( )
virtual

Definition at line 49 of file BaryonResList.cxx.

References fResVec.

50 {
51  if(fResVec) delete fResVec;
52 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61

Member Function Documentation

void BaryonResList::Clear ( void  )
void BaryonResList::Copy ( const BaryonResList rl)

Definition at line 137 of file BaryonResList.cxx.

References fResVec, NResonances(), and ResonanceId().

Referenced by BaryonResList().

138 {
139  if(fResVec) fResVec->clear();
140 
141  unsigned int nres = res_list.NResonances();
142  if(nres==0) return;
143 
144  if(!fResVec) fResVec = new vector<Resonance_t> (nres);
145 
146  for(unsigned int ires = 0; ires < nres; ires++) {
147  (*fResVec)[ires] = res_list.ResonanceId(ires);
148  }
149 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61
void BaryonResList::DecodeFromNameList ( string  list,
string  delimiter = "," 
)

Definition at line 107 of file BaryonResList.cxx.

References genie::utils::str::FilterString(), fResVec, genie::utils::res::FromString(), genie::kNoResonance, parse_dependency_file_t::list, pERROR, pINFO, SLOG, and genie::utils::str::Split().

Referenced by genie::RSPPResonanceSelector::LoadConfig(), genie::ReinSehgalRESXSec::LoadConfig(), genie::ReinSehgalRESXSecFast::LoadConfig(), genie::ReinSehgalSPPXSec::LoadConfig(), genie::ReinSehgalSPPPXSec::LoadConfig(), and genie::RESInteractionListGenerator::LoadConfigData().

108 {
109  //-- remove all spaces in the input string coming from the XML config file
110 
112 
113  vector<string> resonances = utils::str::Split(list, delimiter);
114 
115  SLOG("BaryonResList", pINFO) << list;
116  SLOG("BaryonResList", pINFO) << resonances.size();
117 
118  if(fResVec) delete fResVec;
119  fResVec = new vector<Resonance_t> (resonances.size());
120 
121  unsigned int ires = 0;
122  vector<string>::const_iterator riter;
123  for(riter = resonances.begin(); riter != resonances.end(); ++riter) {
124 
125  Resonance_t res = utils::res::FromString( (*riter).c_str() );
126  if( res == kNoResonance ) {
127  SLOG("BaryonResList", pERROR) << "*** Unknown resonance: " << *riter;
128  } else (*fResVec)[ires++] = res;
129  }
130 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61
Resonance_t FromString(const char *res)
string -> resonance id
#define pERROR
Definition: Messenger.h:60
enum genie::EResonance Resonance_t
#define pINFO
Definition: Messenger.h:63
string FilterString(string filt, string input)
Definition: StringUtils.cxx:85
vector< string > Split(string input, string delim)
Definition: StringUtils.cxx:42
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
bool BaryonResList::Find ( Resonance_t  res) const

Definition at line 96 of file BaryonResList.cxx.

References confusionMatrixTree::count, fResVec, getGoodRuns4SAM::n, pWARN, and SLOG.

Referenced by genie::ReinSehgalSPPPXSec::XSec().

97 {
98  if(!fResVec) {
99  SLOG("BaryonResList", pWARN) << "NULL resonance list!";
100  return false;
101  }
102  int n = count(fResVec->begin(), fResVec->end(), res);
103  if(n!=0) return true;
104  return false;
105 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61
#define pWARN
Definition: Messenger.h:61
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
unsigned int BaryonResList::NResonances ( void  ) const

Definition at line 54 of file BaryonResList.cxx.

References fResVec, pERROR, and SLOG.

Referenced by genie::ReinSehgalRESXSecWithCache::CacheResExcitationXSec(), genie::ReinSehgalRESXSecWithCacheFast::CacheResExcitationXSec(), Copy(), genie::RESInteractionListGenerator::CreateInteractionList(), genie::ReinSehgalSPPXSec::Integrate(), ResonanceId(), ResonanceName(), genie::RSPPResonanceSelector::SelectResonance(), and genie::ReinSehgalSPPPXSec::XSecNRES().

55 {
56  if(!fResVec) {
57  SLOG("BaryonResList", pERROR) << "Null Resonance List";
58  return 0;
59  }
60  return fResVec->size();
61 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61
#define pERROR
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:85
void BaryonResList::Print ( ostream &  stream) const

Definition at line 151 of file BaryonResList.cxx.

References genie::utils::res::AsString(), allTimeWatchdog::endl, and fResVec.

Referenced by genie::operator<<().

152 {
153  stream << "\n [-] Resonance List\n";
154 
155  vector<Resonance_t>::const_iterator riter;
156  for(riter = fResVec->begin(); riter != fResVec->end(); ++riter) {
157  stream << " |--> RES: " << utils::res::AsString(*riter) << endl;
158  }
159 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61
const char * AsString(Resonance_t res)
resonance id -> string
Resonance_t BaryonResList::ResonanceId ( unsigned int  ires) const

Definition at line 77 of file BaryonResList.cxx.

References fResVec, genie::kNoResonance, NResonances(), pERROR, and SLOG.

Referenced by genie::ReinSehgalRESXSecWithCache::CacheResExcitationXSec(), genie::ReinSehgalRESXSecWithCacheFast::CacheResExcitationXSec(), Copy(), genie::RESInteractionListGenerator::CreateInteractionList(), genie::ReinSehgalSPPXSec::Integrate(), genie::RSPPResonanceSelector::SelectResonance(), and genie::ReinSehgalSPPPXSec::XSecNRES().

78 {
79  if(!fResVec) {
80  SLOG("BaryonResList", pERROR) << "Null Resonance List";
81  return kNoResonance;
82  }
83  if(ires >= this->NResonances() ) {
84  SLOG("BaryonResList", pERROR) << "Resonance idx: " << ires
85  << " outside limits: [0, " << this->NResonances() << "]";
86  return kNoResonance;
87  }
88  return (*fResVec)[ires];
89 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61
#define pERROR
Definition: Messenger.h:60
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:85
string BaryonResList::ResonanceName ( unsigned int  ires) const

Definition at line 63 of file BaryonResList.cxx.

References genie::utils::res::AsString(), fResVec, NResonances(), pERROR, and SLOG.

64 {
65  if(!fResVec) {
66  SLOG("BaryonResList", pERROR) << "Null Resonance List";
67  return "-";
68  }
69  if(ires >= this->NResonances() ) {
70  SLOG("BaryonResList", pERROR) << "Resonance idx: " << ires
71  << " outside limits: [0, " << this->NResonances() << "]";
72  return "-";
73  }
74  return utils::res::AsString( (*fResVec)[ires] );
75 }
vector< Resonance_t > * fResVec
Definition: BaryonResList.h:61
#define pERROR
Definition: Messenger.h:60
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:85
int BaryonResList::ResonancePdgCode ( unsigned int  ires) const

Definition at line 91 of file BaryonResList.cxx.

92 {
93  return 0;
94 }

Friends And Related Function Documentation

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

Definition at line 31 of file BaryonResList.cxx.

32  {
33  res_list.Print(stream);
34  return stream;
35  }

Member Data Documentation

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

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