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

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

Public Member Functions

 Location ()
 
 Location (ParameterSpaceLoc const &nd, ParameterSpaceLoc const &fd)
 
 Location (cmf::OscillationParameterMap const &oscPars)
 
cmf::OscillationParameterMap AsOscillationParameterMap ()
 
cmf::ParameterSpaceLoc const & NDLocation () const
 
cmf::ParameterSpaceLoc const & FDLocation () const
 
void InsertParameter (cmf::Parameter const &par)
 
void SetParameterValue (std::string const &parName, double const &value, cmf::DetType_t const &det)
 

Private Attributes

ParameterSpaceLoc fNDLoc
 
ParameterSpaceLoc fFDLoc
 

Friends

std::ostream & operator<< (std::ostream &o, cmf::Location const &loc)
 

Detailed Description

Definition at line 143 of file Parameter.h.

Constructor & Destructor Documentation

cmf::Location::Location ( )
inline

Definition at line 147 of file Parameter.h.

Referenced by cmf::operator<<().

148  {}
cmf::Location::Location ( ParameterSpaceLoc const &  nd,
ParameterSpaceLoc const &  fd 
)
inline

Definition at line 150 of file Parameter.h.

152  : fNDLoc(nd)
153  , fFDLoc(fd)
154  {}
ParameterSpaceLoc fFDLoc
Definition: Parameter.h:172
ParameterSpaceLoc fNDLoc
Definition: Parameter.h:171
cmf::Location::Location ( cmf::OscillationParameterMap const &  oscPars)

Member Function Documentation

cmf::OscillationParameterMap cmf::Location::AsOscillationParameterMap ( )

Definition at line 250 of file Parameter.cxx.

251  {
253 
254  for(auto const& itr : fFDLoc){
255  oscMap.emplace((cmf::OscParm_t)itr.second.Key(),
256  itr.second.Value());
257  }
258 
259  return std::move(oscMap);
260  }
enum cmf::osc_params OscParm_t
ParameterSpaceLoc fFDLoc
Definition: Parameter.h:172
std::map< cmf::OscParm_t, float > OscillationParameterMap
Definition: Constants.h:761
cmf::ParameterSpaceLoc const& cmf::Location::FDLocation ( ) const
inline
void cmf::Location::InsertParameter ( cmf::Parameter const &  par)

Definition at line 216 of file Parameter.cxx.

References cmf::Parameter::Detector(), cmf::kFARDET, cmf::kNEARDET, cmf::Parameter::Name(), par, moon_position_table_new3::second, and cmf::Parameter::Value().

Referenced by cmf::ParameterUtility::ParametersAsLocation(), and cmf::ParameterSetToLocation().

217  {
218  if(par.Detector() == cmf::kNEARDET){
219  if(fNDLoc.count(par.Name()) < 1) fNDLoc.emplace(par.Name(), par);
220  else fNDLoc.find(par.Name())->second.SetValue(par.Value());
221  }
222  if(par.Detector() == cmf::kFARDET){
223  if(fFDLoc.count(par.Name()) < 1) fFDLoc.emplace(par.Name(), par);
224  else fFDLoc.find(par.Name())->second.SetValue(par.Value());
225  }
226  }
Int_t par
Definition: SimpleIterate.C:24
ParameterSpaceLoc fFDLoc
Definition: Parameter.h:172
ParameterSpaceLoc fNDLoc
Definition: Parameter.h:171
cmf::ParameterSpaceLoc const& cmf::Location::NDLocation ( ) const
inline
void cmf::Location::SetParameterValue ( std::string const &  parName,
double const &  value,
cmf::DetType_t const &  det 
)

Definition at line 229 of file Parameter.cxx.

References cmf::kFARDET, cmf::kNEARDET, and LOG_WARNING.

Referenced by cmf::RandomUniverseUtility::CreateLocationWithVariedOscParameters(), cmf::RandomUniverseUtility::CreateLocationWithVariedSystematics(), cmf::CMFSpectraMaker::endJob(), cmf::ShifterAndWeighter::SetCurrentVals(), and cmf::CovarianceMatrixMaker::SetSystematicParameter().

232  {
233  if(det == cmf::kNEARDET){
234  if(fNDLoc.count(parName) > 0) fNDLoc.find(parName)->second.SetValue(value);
235  else
236  LOG_WARNING("Location")
237  << parName
238  << " is not a recognized parameter for the NearDet";
239  }
240  else if(det == cmf::kFARDET ){
241  if(fFDLoc.count(parName) > 0) fFDLoc.find(parName)->second.SetValue(value);
242  else
243  LOG_WARNING("Location")
244  << parName
245  << " is not a recognized parameter for the FarDet";
246  }
247  }
ParameterSpaceLoc fFDLoc
Definition: Parameter.h:172
const XML_Char int const XML_Char * value
Definition: expat.h:331
ParameterSpaceLoc fNDLoc
Definition: Parameter.h:171
#define LOG_WARNING(category)

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
cmf::Location const &  loc 
)
friend

Definition at line 116 of file Parameter.cxx.

116  {
117  o << std::endl;
118  for(auto const& itr : loc.NDLocation()){
119  o << " -- parameter: "
120  << std::setw(30)
121  << itr.first
122  << std::setw(15)
123  << " val ND: "
124  << itr.second.Value()
125  << " fixed: "
126  << std::setw(5)
127  << itr.second.IsFixed();
128  if(loc.FDLocation().count(itr.first) > 0)
129  o << " val FD: "
130  << std::setw(15)
131  << " "
132  << loc.FDLocation().find(itr.first)->second.Value()
133  << " fixed: "
134  << std::setw(5)
135  << itr.second.IsFixed();
136 
137  o << std::endl;
138  }
139  for(auto const& itr : loc.FDLocation()){
140  if(loc.NDLocation().count(itr.first) < 1)
141  o << " -- parameter: "
142  << std::setw(30)
143  << itr.first
144  << std::setw(15)
145  << " val FD: "
146  << itr.second.Value()
147  << " fixed: "
148  << std::setw(5)
149  << itr.second.IsFixed()
150  << std::endl;
151  }
152 
153  return o;
154  }

Member Data Documentation

ParameterSpaceLoc cmf::Location::fFDLoc
private

Definition at line 172 of file Parameter.h.

ParameterSpaceLoc cmf::Location::fNDLoc
private

Definition at line 171 of file Parameter.h.


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