Public Member Functions | Private Attributes | List of all members
cmf::ParameterSpaceLoc Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-05-06/CovarianceMatrixFit/dataProducts/Parameter.h"

Public Member Functions

 ParameterSpaceLoc ()
 
 ParameterSpaceLoc (cmf::DetType_t const &det, std::vector< cmf::Parameter > const &pars)
 
size_t count (std::string const &parName) const
 
cmf::Parameter const & Parameter (std::string const &parName) const
 
void SetParameterValue (std::string const &parName, double const &val)
 
void InsertParameter (cmf::Parameter const &par)
 
size_t size () const
 
std::vector< cmf::Parameter > const & Parameters () const
 
cmf::DetType_t const Detector () const
 

Private Attributes

uint8_t fDetector
 
std::vector< cmf::ParameterfPars
 

Detailed Description

Definition at line 23 of file Parameter.h.

Constructor & Destructor Documentation

cmf::ParameterSpaceLoc::ParameterSpaceLoc ( )
inline

Definition at line 26 of file Parameter.h.

27  : fDetector((uint8_t)cmf::kUnknownDet)
28  {}
cmf::ParameterSpaceLoc::ParameterSpaceLoc ( cmf::DetType_t const &  det,
std::vector< cmf::Parameter > const &  pars 
)
inline

Definition at line 30 of file Parameter.h.

References count(), InsertParameter(), par, Parameter(), SetParameterValue(), string, and febshutoff_auto::val.

32  : fDetector((uint8_t)det)
33  , fPars(pars)
34  {}
std::string pars("Th23Dmsq32")
std::vector< cmf::Parameter > fPars
Definition: Parameter.h:49

Member Function Documentation

size_t cmf::ParameterSpaceLoc::count ( std::string const &  parName) const

Definition at line 14 of file Parameter.cxx.

References cmf::cDetType_Strings(), fDetector, and fPars.

Referenced by ParameterSpaceLoc().

15  {
16  size_t cnt = 0;
17  for(auto const& itr : fPars) if(itr.Name() == parName) ++cnt;
18 
19  if(cnt > 1)
20  throw cet::exception("ParameterSpaceLoc")
21  << "Parameter "
22  << parName
23  << " shows up multiple times for detector "
25 
26  return cnt;
27  }
const std::vector< std::string > cDetType_Strings({"UnknownDet","NearDet","FarDet","MINOSNear","MINOSFar","AllDetectors"})
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
std::vector< cmf::Parameter > fPars
Definition: Parameter.h:49
cmf::DetType_t const cmf::ParameterSpaceLoc::Detector ( ) const
inline

Definition at line 44 of file Parameter.h.

References fDetector.

Referenced by cmf::ShifterAndWeighter::ShiftForParameter().

44 { return (cmf::DetType_t)fDetector; }
enum cmf::det_type DetType_t
void cmf::ParameterSpaceLoc::InsertParameter ( cmf::Parameter const &  par)

Definition at line 74 of file Parameter.cxx.

References cmf::Parameter::Detector(), fDetector, fPars, and cmf::Parameter::Name().

Referenced by cmf::Location::DetectorLocations(), and ParameterSpaceLoc().

75  {
76  // first check that we are looking at the correct detector and
77  // if the parameter is already in there
78  if(par.Detector() != fDetector) return;
79 
80  for(auto const& itr : fPars){
81  if(itr.Name() == par.Name()) return;
82  }
83 
84  fPars.emplace_back(par);
85  }
Int_t par
Definition: SimpleIterate.C:24
std::vector< cmf::Parameter > fPars
Definition: Parameter.h:49
cmf::Parameter const & cmf::ParameterSpaceLoc::Parameter ( std::string const &  parName) const

Definition at line 30 of file Parameter.cxx.

References cmf::cDetType_Strings(), fDetector, and fPars.

Referenced by cmf::ShifterAndWeighter::CurrentParameterValue(), ParameterSpaceLoc(), cmf::CovarianceMatrixMaker::SetSystematicParameter(), and cmf::ShifterAndWeighter::ShiftForParameter().

31  {
32  for(auto const& itr : fPars){
33  if(itr.Name() == parName){
34  return itr;
35  }
36  }
37 
38  // if we got here, we didn't find the parameter
39  throw cet::exception("ParameterSpaceLoc")
40  << "no parameter corresponding to "
41  << parName
42  << " found for detector "
44 
45  // make the compiler happy, although we will never get here
46  return fPars.front();
47  }
const std::vector< std::string > cDetType_Strings({"UnknownDet","NearDet","FarDet","MINOSNear","MINOSFar","AllDetectors"})
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
std::vector< cmf::Parameter > fPars
Definition: Parameter.h:49
std::vector<cmf::Parameter> const& cmf::ParameterSpaceLoc::Parameters ( ) const
inline
void cmf::ParameterSpaceLoc::SetParameterValue ( std::string const &  parName,
double const &  val 
)

Definition at line 50 of file Parameter.cxx.

References cmf::cDetType_Strings(), fDetector, fPars, and febshutoff_auto::val.

Referenced by cmf::Location::DetectorLocations(), and ParameterSpaceLoc().

52  {
53  bool foundPar = false;
54  for(auto & itr : fPars){
55  if(itr.Name() == parName){
56  itr.SetValue(val);
57  foundPar = true;
58  }
59  }
60 
61  if(!foundPar)
62  throw cet::exception("ParameterSpaceLoc")
63  << "no parameter corresponding to "
64  << parName
65  << " found for detector "
67  << " to set to value "
68  << val;
69 
70  return;
71  }
const std::vector< std::string > cDetType_Strings({"UnknownDet","NearDet","FarDet","MINOSNear","MINOSFar","AllDetectors"})
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
std::vector< cmf::Parameter > fPars
Definition: Parameter.h:49
size_t cmf::ParameterSpaceLoc::size ( ) const
inline

Definition at line 42 of file Parameter.h.

References fPars.

42 { return fPars.size(); }
std::vector< cmf::Parameter > fPars
Definition: Parameter.h:49

Member Data Documentation

uint8_t cmf::ParameterSpaceLoc::fDetector
private
std::vector<cmf::Parameter> cmf::ParameterSpaceLoc::fPars
private

Definition at line 49 of file Parameter.h.

Referenced by count(), InsertParameter(), Parameter(), Parameters(), SetParameterValue(), and size().


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