Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
fnex::ParameterConstraints Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-01/FNEX/dataProducts/ParameterConstraints.h"

Public Member Functions

void InsertConstraint (fhicl::ParameterSet const &p)
 
std::map< std::string, ConstraintInfo > const & Constraints ()
 
void Lock ()
 
void Unlock ()
 
void Clear ()
 
void Print (std::ostream &stream=std::cout)
 

Static Public Member Functions

static ParameterConstraintsInstance ()
 

Private Member Functions

 ParameterConstraints ()
 
 ~ParameterConstraints ()
 

Private Attributes

std::map< std::string, ConstraintInfofParameterMap
 map of parameter string to constraint info More...
 
bool fLock
 set if we are done allowing new additions More...
 

Detailed Description

Definition at line 36 of file ParameterConstraints.h.

Constructor & Destructor Documentation

fnex::ParameterConstraints::ParameterConstraints ( )
private

Definition at line 23 of file ParameterConstraints.cxx.

References fParameterMap.

Referenced by Instance().

24  : fLock(true)
25  {
26  fParameterMap.clear();
27 
28  return;
29  }
bool fLock
set if we are done allowing new additions
std::map< std::string, ConstraintInfo > fParameterMap
map of parameter string to constraint info
fnex::ParameterConstraints::~ParameterConstraints ( )
private

Definition at line 32 of file ParameterConstraints.cxx.

33  {
34 
35  }

Member Function Documentation

void fnex::ParameterConstraints::Clear ( )
inline

Definition at line 69 of file ParameterConstraints.h.

70 {
71  fParameterMap.clear();
72  return;
73 }
std::map< std::string, ConstraintInfo > fParameterMap
map of parameter string to constraint info
std::map< std::string, fnex::ConstraintInfo > const & fnex::ParameterConstraints::Constraints ( )
inline

Definition at line 63 of file ParameterConstraints.h.

Referenced by fnex::CovarianceMatrixFitter::InitializeMinimizer(), and fnex::FitAlg_ROOTFactoryFit::SetConstraints().

64 {
65  return fParameterMap;
66 }
std::map< std::string, ConstraintInfo > fParameterMap
map of parameter string to constraint info
void fnex::ParameterConstraints::InsertConstraint ( fhicl::ParameterSet const &  p)

Definition at line 38 of file ParameterConstraints.cxx.

References fLock, fParameterMap, fhicl::ParameterSet::get(), fhicl::ParameterSet::has_key(), cet::sqlite::max(), min(), and string.

39  {
40  // Don't do anything if we are locked out
41  if(fLock) return;
42 
43  // do nothing if there is no constrain key for this parameter or
44  // the key is set to false
45  if(!p.has_key("Constraint") ) return;
46  if(!p.get<bool>("Constraint")) return;
47 
48  auto parName = p.get<std::string>("Parameter");
49  double loVal = p.get<double >("LoVal", std::numeric_limits<double>::min());
50  double hiVal = p.get<double >("HiVal", std::numeric_limits<double>::max());
51 
52  fParameterMap.emplace(parName,
53  ConstraintInfo(loVal, hiVal));
54 
55  return;
56  }
const char * p
Definition: xmltok.h:285
bool fLock
set if we are done allowing new additions
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
std::map< std::string, ConstraintInfo > fParameterMap
map of parameter string to constraint info
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
enum BeamMode string
ParameterConstraints * fnex::ParameterConstraints::Instance ( )
static
void fnex::ParameterConstraints::Lock ( )
inline

Definition at line 76 of file ParameterConstraints.h.

77 {
78  fLock = true;
79  return;
80 }
bool fLock
set if we are done allowing new additions
void fnex::ParameterConstraints::Print ( std::ostream &  stream = std::cout)

Definition at line 59 of file ParameterConstraints.cxx.

References allTimeWatchdog::endl, HTMLTools::entry(), and fParameterMap.

Referenced by fnex::CovarianceMatrixFitter::InitializeMinimizer(), and fnex::FitAlg_ROOTFactoryFit::SetConstraints().

60  {
61  stream << "ParameterConstraints::Print( ): \n";
62  for(auto entry : fParameterMap){
63  stream << std::setw(15)
64  << entry.first
65  << " LoVal: "
66  << std::setw(10)
67  << entry.second.LoValue()
68  << " HiVal: "
69  << std::setw(10)
70  << entry.second.HiValue()
71  << std::endl;
72  }
73  }
std::map< std::string, ConstraintInfo > fParameterMap
map of parameter string to constraint info
def entry(str)
Definition: HTMLTools.py:26
void fnex::ParameterConstraints::Unlock ( )
inline

Definition at line 83 of file ParameterConstraints.h.

84 {
85  fLock = false;
86  return;
87 }
bool fLock
set if we are done allowing new additions

Member Data Documentation

bool fnex::ParameterConstraints::fLock
private

set if we are done allowing new additions

Definition at line 57 of file ParameterConstraints.h.

Referenced by InsertConstraint().

std::map<std::string, ConstraintInfo> fnex::ParameterConstraints::fParameterMap
private

map of parameter string to constraint info

Definition at line 56 of file ParameterConstraints.h.

Referenced by InsertConstraint(), ParameterConstraints(), and Print().


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