Public Member Functions | Private Attributes | List of all members
genie::rew::GSystSet Class Reference

Set of systematics to be considered by the reweighting package. More...

#include <GSystSet.h>

Public Member Functions

 GSystSet ()
 
 GSystSet (const GSystSet &syst_set)
 
 ~GSystSet ()
 
void Init (GSyst_t syst, double init=0., double min=-1., double max=+1., double step=0.05)
 
void Remove (GSyst_t syst)
 
void Set (GSyst_t syst, double current_value)
 
int Size (void) const
 
bool Added (GSyst_t syst) const
 
void Print (void)
 
void Copy (const GSystSet &syst_set)
 
const GSystInfoInfo (GSyst_t syst) const
 
vector< genie::rew::GSyst_tAllIncluded (void)
 

Private Attributes

map< GSyst_t, GSystInfo * > fSystematics
 

Detailed Description

Set of systematics to be considered by the reweighting package.

Author
Costas Andreopoulos <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

Aug 1, 2009

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

Definition at line 37 of file GSystSet.h.

Constructor & Destructor Documentation

GSystSet::GSystSet ( )

Definition at line 27 of file GSystSet.cxx.

28 {
29 
30 }
GSystSet::GSystSet ( const GSystSet syst_set)

Definition at line 32 of file GSystSet.cxx.

33 {
34  this->Copy(syst);
35 }
void Copy(const GSystSet &syst_set)
Definition: GSystSet.cxx:115
GSystSet::~GSystSet ( )

Definition at line 37 of file GSystSet.cxx.

38 {
39  fSystematics.clear();
40 }
map< GSyst_t, GSystInfo * > fSystematics
Definition: GSystSet.h:58

Member Function Documentation

bool GSystSet::Added ( GSyst_t  syst) const

Definition at line 64 of file GSystSet.cxx.

65 {
66  return (fSystematics.find(syst) != fSystematics.end());
67 }
map< GSyst_t, GSystInfo * > fSystematics
Definition: GSystSet.h:58
vector< genie::rew::GSyst_t > GSystSet::AllIncluded ( void  )

Definition at line 69 of file GSystSet.cxx.

70 {
71  vector<GSyst_t> svec;
72 
74  for( ; it != fSystematics.end(); ++it) {
75  GSyst_t syst = it->first;
76  svec.push_back(syst);
77  }
78  return svec;
79 }
intermediate_table::const_iterator const_iterator
An enumeration of systematic parameters.
map< GSyst_t, GSystInfo * > fSystematics
Definition: GSystSet.h:58
void GSystSet::Copy ( const GSystSet syst_set)

Definition at line 115 of file GSystSet.cxx.

116 {
117  return fSystematics.clear();
118 
120  for( ; it != syst_set.fSystematics.end(); ++it) {
121  GSyst_t syst = it->first;
122  GSystInfo * syst_info = it->second;
123 
124  double cur = syst_info->CurValue;
125  double init = syst_info->InitValue;
126  double min = syst_info->MinValue;
127  double max = syst_info->MaxValue;
128  double step = syst_info->Step;
129 
130  this->Init(syst,init,min,max,step);
131  this->Set(syst,cur);
132  }
133 }
cur
Definition: dbjson.py:21
void Set(GSyst_t syst, double current_value)
Definition: GSystSet.cxx:89
void Init(GSyst_t syst, double init=0., double min=-1., double max=+1., double step=0.05)
Definition: GSystSet.cxx:42
intermediate_table::const_iterator const_iterator
An enumeration of systematic parameters.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:57
map< GSyst_t, GSystInfo * > fSystematics
Definition: GSystSet.h:58
const GSystInfo * GSystSet::Info ( GSyst_t  syst) const

Definition at line 81 of file GSystSet.cxx.

82 {
83  if ( this->Added(syst) ) {
84  return fSystematics.find(syst)->second;
85  }
86  return 0;
87 }
bool Added(GSyst_t syst) const
Definition: GSystSet.cxx:64
map< GSyst_t, GSystInfo * > fSystematics
Definition: GSystSet.h:58
void GSystSet::Init ( GSyst_t  syst,
double  init = 0.,
double  min = -1.,
double  max = +1.,
double  step = 0.05 
)

Definition at line 42 of file GSystSet.cxx.

43 {
44  if(syst == kNullSystematic) return;
45 
46  if(this->Added(syst)) {
47  this->Remove(syst);
48  }
49 
50  GSystInfo * syst_info = new GSystInfo(init,min,max,step);
51  fSystematics.insert( map<GSyst_t, GSystInfo*>::value_type(syst, syst_info) );
52 }
bool Added(GSyst_t syst) const
Definition: GSystSet.cxx:64
void Remove(GSyst_t syst)
Definition: GSystSet.cxx:54
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:57
map< GSyst_t, GSystInfo * > fSystematics
Definition: GSystSet.h:58
void GSystSet::Print ( void  )

Definition at line 100 of file GSystSet.cxx.

101 {
102  LOG("ReW", pNOTICE)
103  << "Considering " << this->Size() << " systematics";
104 
105  vector<genie::rew::GSyst_t> svec = this->AllIncluded();
106 
107  unsigned int i=0;
109  for( ; it != svec.end(); ++it) {
110  GSyst_t syst = *it;
111  LOG("ReW", pNOTICE) << "(" << i++ << ") : " << GSyst::AsString(syst);
112  }
113 }
int Size(void) const
Definition: GSystSet.cxx:59
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
intermediate_table::const_iterator const_iterator
An enumeration of systematic parameters.
static string AsString(GSyst_t syst)
Definition: GSyst.h:175
#define pNOTICE
Definition: Messenger.h:52
vector< genie::rew::GSyst_t > AllIncluded(void)
Definition: GSystSet.cxx:69
void GSystSet::Remove ( GSyst_t  syst)

Definition at line 54 of file GSystSet.cxx.

55 {
56  fSystematics.erase(syst);
57 }
map< GSyst_t, GSystInfo * > fSystematics
Definition: GSystSet.h:58
void GSystSet::Set ( GSyst_t  syst,
double  current_value 
)

Definition at line 89 of file GSystSet.cxx.

90 {
91  if ( this->Added(syst) ) {
92  fSystematics[syst]->CurValue = val;
93  }
94  else {
95  this->Init(syst);
96  this->Set(syst,val);
97  }
98 }
bool Added(GSyst_t syst) const
Definition: GSystSet.cxx:64
void Set(GSyst_t syst, double current_value)
Definition: GSystSet.cxx:89
void Init(GSyst_t syst, double init=0., double min=-1., double max=+1., double step=0.05)
Definition: GSystSet.cxx:42
map< GSyst_t, GSystInfo * > fSystematics
Definition: GSystSet.h:58
int GSystSet::Size ( void  ) const

Definition at line 59 of file GSystSet.cxx.

60 {
61  return fSystematics.size();
62 }
map< GSyst_t, GSystInfo * > fSystematics
Definition: GSystSet.h:58

Member Data Documentation

map<GSyst_t, GSystInfo *> genie::rew::GSystSet::fSystematics
private

Definition at line 58 of file GSystSet.h.


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