Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
fnex::InputPoint Class Reference

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

Public Member Functions

 InputPoint ()
 
 ~InputPoint ()
 
 InputPoint (ParameterDetMap const &parameterSpaceLoc)
 
 InputPoint (ParameterDetMap const &parameterSpaceLoc, ParameterDetMap const &systematicPulls, std::vector< ParameterDet > const &fixedParameters, std::vector< ParameterDet > const &fixedSystematics)
 
 InputPoint (const fhicl::ParameterSet &pset, bool fakeData=false)
 
ParameterMap const ParameterSpaceLocation (novadaq::cnv::DetId const &det) const
 
ParameterMap const SystematicPulls (novadaq::cnv::DetId const &det) const
 
ParameterDetMap const ParameterSpaceLocation () const
 
ParameterDetMap const SystematicPulls () const
 
std::vector< std::string > const & FixedParameters (novadaq::cnv::DetId const &det) const
 
std::vector< std::string > const & FixedSystematics (novadaq::cnv::DetId const &det) const
 
std::vector< ParameterDet > const FixedParameters () const
 
std::vector< ParameterDet > const FixedSystematics () const
 
std::vector< ParameterDet > const FitParameters () const
 
std::vector< ParameterDet > const FitSystematics () const
 
bool IsParameterFixed (ParameterDet const &pardet) const
 
bool IsParameterFixed (std::string const &par, novadaq::cnv::DetId const &det) const
 
double const ParameterValue (ParameterDet const &parDet) const
 

Public Attributes

bool fUseBinnedOscillations
 

Private Member Functions

void CommonConstructorAssistant (ParameterDetMap const &parameterSpaceLoc, ParameterDetMap const &systematicPulls, std::vector< ParameterDet > const &fixedParameters, std::vector< ParameterDet > const &fixedSystematics)
 
void FillParameterDetMap (fhicl::ParameterSet const &inputPars, ParameterDetMap &map, std::vector< fnex::ParameterDet > &fixedPars, bool fakeData)
 

Private Attributes

std::vector< std::stringfParameterSpaceKeysND
 
std::vector< double > fParameterSpaceValsND
 
std::vector< std::stringfFixedParametersND
 keys for which parameters are fixed More...
 
std::vector< std::stringfParameterSpaceKeysFD
 
std::vector< double > fParameterSpaceValsFD
 
std::vector< std::stringfFixedParametersFD
 keys for which parameters are fixed More...
 
std::vector< std::stringfSystematicPullKeysND
 
std::vector< double > fSystematicPullValsND
 
std::vector< std::stringfFixedSystematicsND
 keys for which systematics are fixed More...
 
std::vector< std::stringfSystematicPullKeysFD
 
std::vector< double > fSystematicPullValsFD
 
std::vector< std::stringfFixedSystematicsFD
 keys for which systematics are fixed More...
 

Friends

std::ostream & operator<< (std::ostream &o, fnex::InputPoint const &ip)
 

Detailed Description

Definition at line 26 of file InputPoint.h.

Constructor & Destructor Documentation

fnex::InputPoint::InputPoint ( )

Definition at line 22 of file InputPoint.cxx.

23  {
24  }
fnex::InputPoint::~InputPoint ( )

Definition at line 163 of file InputPoint.cxx.

References fFixedParametersFD, fFixedParametersND, fFixedSystematicsFD, fFixedSystematicsND, fParameterSpaceKeysFD, fParameterSpaceKeysND, fParameterSpaceValsFD, fParameterSpaceValsND, fSystematicPullKeysFD, fSystematicPullKeysND, fSystematicPullValsFD, and fSystematicPullValsND.

164  {
165  fParameterSpaceKeysND.clear();
166  fParameterSpaceValsND.clear();
167  fFixedParametersND .clear();
168  fParameterSpaceKeysFD.clear();
169  fParameterSpaceValsFD.clear();
170  fFixedParametersFD .clear();
171 
172  fSystematicPullKeysND.clear();
173  fSystematicPullValsND.clear();
174  fFixedSystematicsND .clear();
175  fSystematicPullKeysFD.clear();
176  fSystematicPullValsFD.clear();
177  fFixedSystematicsFD .clear();
178  }
std::vector< std::string > fParameterSpaceKeysFD
Definition: InputPoint.h:40
std::vector< double > fSystematicPullValsFD
Definition: InputPoint.h:49
std::vector< double > fParameterSpaceValsFD
Definition: InputPoint.h:41
std::vector< std::string > fSystematicPullKeysND
Definition: InputPoint.h:44
std::vector< std::string > fSystematicPullKeysFD
Definition: InputPoint.h:48
std::vector< std::string > fParameterSpaceKeysND
Definition: InputPoint.h:36
std::vector< std::string > fFixedSystematicsND
keys for which systematics are fixed
Definition: InputPoint.h:46
std::vector< std::string > fFixedParametersND
keys for which parameters are fixed
Definition: InputPoint.h:38
std::vector< std::string > fFixedParametersFD
keys for which parameters are fixed
Definition: InputPoint.h:42
std::vector< double > fParameterSpaceValsND
Definition: InputPoint.h:37
std::vector< std::string > fFixedSystematicsFD
keys for which systematics are fixed
Definition: InputPoint.h:50
std::vector< double > fSystematicPullValsND
Definition: InputPoint.h:45
fnex::InputPoint::InputPoint ( fnex::ParameterDetMap const &  parameterSpaceLoc)
explicit

Definition at line 27 of file InputPoint.cxx.

References fFixedParametersFD, fFixedParametersND, fFixedSystematicsFD, fFixedSystematicsND, fParameterSpaceKeysFD, fParameterSpaceKeysND, fParameterSpaceValsFD, fParameterSpaceValsND, fSystematicPullKeysFD, fSystematicPullKeysND, fSystematicPullValsFD, fSystematicPullValsND, it, novadaq::cnv::kFARDET, and novadaq::cnv::kNEARDET.

28  {
29  fParameterSpaceKeysND.clear();
30  fParameterSpaceValsND.clear();
31  fFixedParametersND .clear();
32  fParameterSpaceKeysFD.clear();
33  fParameterSpaceValsFD.clear();
34  fFixedParametersFD .clear();
35 
36  fSystematicPullKeysND.clear();
37  fSystematicPullValsND.clear();
38  fFixedSystematicsND .clear();
39  fSystematicPullKeysFD.clear();
40  fSystematicPullValsFD.clear();
41  fFixedSystematicsFD .clear();
42 
43  for(auto const& it : parameterSpaceLoc){
44  if(it.first.second == novadaq::cnv::kNEARDET){
45  fParameterSpaceKeysND.emplace_back(it.first.first);
46  fParameterSpaceValsND.emplace_back(it.second);
47  }
48  if(it.first.second == novadaq::cnv::kFARDET){
49  fParameterSpaceKeysFD.emplace_back(it.first.first);
50  fParameterSpaceValsFD.emplace_back(it.second);
51  }
52  }
53 
54  return;
55  }
std::vector< std::string > fParameterSpaceKeysFD
Definition: InputPoint.h:40
set< int >::iterator it
std::vector< double > fSystematicPullValsFD
Definition: InputPoint.h:49
std::vector< double > fParameterSpaceValsFD
Definition: InputPoint.h:41
std::vector< std::string > fSystematicPullKeysND
Definition: InputPoint.h:44
std::vector< std::string > fSystematicPullKeysFD
Definition: InputPoint.h:48
std::vector< std::string > fParameterSpaceKeysND
Definition: InputPoint.h:36
Far Detector at Ash River, MN.
std::vector< std::string > fFixedSystematicsND
keys for which systematics are fixed
Definition: InputPoint.h:46
Near Detector in the NuMI cavern.
std::vector< std::string > fFixedParametersND
keys for which parameters are fixed
Definition: InputPoint.h:38
std::vector< std::string > fFixedParametersFD
keys for which parameters are fixed
Definition: InputPoint.h:42
std::vector< double > fParameterSpaceValsND
Definition: InputPoint.h:37
std::vector< std::string > fFixedSystematicsFD
keys for which systematics are fixed
Definition: InputPoint.h:50
std::vector< double > fSystematicPullValsND
Definition: InputPoint.h:45
fnex::InputPoint::InputPoint ( fnex::ParameterDetMap const &  parameterSpaceLoc,
fnex::ParameterDetMap const &  systematicPulls,
std::vector< ParameterDet > const &  fixedParameters,
std::vector< ParameterDet > const &  fixedSystematics 
)

Definition at line 59 of file InputPoint.cxx.

References CommonConstructorAssistant().

63  {
64  this->CommonConstructorAssistant(parameterSpaceLoc,
65  systematicPulls,
66  fixedParameters,
67  fixedSystematics);
68  return;
69  }
void CommonConstructorAssistant(ParameterDetMap const &parameterSpaceLoc, ParameterDetMap const &systematicPulls, std::vector< ParameterDet > const &fixedParameters, std::vector< ParameterDet > const &fixedSystematics)
Definition: InputPoint.cxx:242
fnex::InputPoint::InputPoint ( const fhicl::ParameterSet pset,
bool  fakeData = false 
)

Definition at line 72 of file InputPoint.cxx.

References CommonConstructorAssistant(), fnex::cOscParams_Default, fnex::cOscParams_Strings, FillParameterDetMap(), fUseBinnedOscillations, fhicl::ParameterSet::get(), fnex::SystematicSigmas::Instance(), fnex::ParameterConstraints::Instance(), fnex::NuisanceParameters::Instance(), novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, fnex::kNumOscParams, LOG_WARNING, and make_pair().

73  {
74 
75  // make the input point. The mapping of parameter space keys to values is
76  // given in Constants.h, cOscParams_Strings, defaults are cOscParams_Default
77  fnex::ParameterDetMap oscMap;
78  fnex::ParameterDetMap sysMap;
79 
80  std::vector<fnex::ParameterDet> fixedParameters;
81  std::vector<fnex::ParameterDet> fixedSystematics;
82 
83  // have default empty vectors for these which is what we expect if
84  // making the event lists
85  auto parameterSpaceInitial = pset.get<fhicl::ParameterSet>("ParameterSpaceInitial");
86  auto systematicPullInitial = pset.get<fhicl::ParameterSet>("SystematicPullInitial");
87 
88  // Grab whether or not we want to use binned oscillations and
89  // then remove it from the list of osc pars
90  fUseBinnedOscillations = parameterSpaceInitial.get<bool>("BinnedOscillations");
91  parameterSpaceInitial.erase("BinnedOscillations");
92 
93  // get the strings in the parameter set
94  auto pspaceNames = parameterSpaceInitial.get_names();
95 
96  // user wants the defaults specified in cOscParams_Default if the size of
97  // parameterSpaceInitialVals is 0
98  if(pspaceNames.size() < 1){
99  for(size_t p = 0; p < fnex::kNumOscParams; ++p){
102 
103  oscMap[parDetND] = fnex::cOscParams_Default[p];
104  oscMap[parDetFD] = fnex::cOscParams_Default[p];
105 
106  // explicitly set the ND distance to 1 km
107  if(p == 0) oscMap[parDetND] = 1.; // L for ND is 1 km
108  }
109  }
110 
111  // get the Instance of the SystematicSigmas and unlock it
112  auto systSigma = fnex::SystematicSigmas::Instance();
113 
114  // get the instance of the NuisanceParameters and unlock it
115  auto nuisancePars = fnex::NuisanceParameters::Instance();
116 
117  // get the instance of the ParameterConstraints and unlock it
118  auto parConst = fnex::ParameterConstraints::Instance();
119 
120  // don't unlock the singletons for fake data - if these are not
121  // unlocked then the Insert calls below do nothing
122  if(fakeData)
123  LOG_WARNING("InputPoint")
124  << "setting the singletons in InputPoint for FakeData";
125  else{
126  LOG_WARNING("InputPoint")
127  << "setting the singletons for a guess";
128 
129  systSigma ->Clear();
130  nuisancePars->Clear();
131  parConst ->Clear();
132  systSigma ->Unlock();
133  nuisancePars->Unlock();
134  parConst ->Unlock();
135  }
136 
137  // fill the oscillation map
138  this->FillParameterDetMap(parameterSpaceInitial, oscMap, fixedParameters, fakeData);
139 
140  // fill the systematic pull map
141  this->FillParameterDetMap(systematicPullInitial, sysMap, fixedSystematics, fakeData);
142 
143  // lock up the singletons again
144  if(!fakeData){
145  systSigma->Lock();
146  systSigma->Print();
147 
148  nuisancePars->Lock();
149  nuisancePars->Print();
150 
151  parConst->Lock();
152  parConst->Print();
153  }
154 
155  // create the input point and put it into the data member
156  this->CommonConstructorAssistant(oscMap, sysMap, fixedParameters, fixedSystematics);
157 
158  return;
159 
160  }
const double cOscParams_Default[kNumOscParams]
Definition: Constants.h:215
const char * p
Definition: xmltok.h:285
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
void FillParameterDetMap(fhicl::ParameterSet const &inputPars, ParameterDetMap &map, std::vector< fnex::ParameterDet > &fixedPars, bool fakeData)
Definition: InputPoint.cxx:181
Far Detector at Ash River, MN.
static ParameterConstraints * Instance()
T get(std::string const &key) const
Definition: ParameterSet.h:231
Near Detector in the NuMI cavern.
std::unordered_map< ParameterDet, double, ParameterDetHasher > ParameterDetMap
Definition: Constants.h:63
#define LOG_WARNING(category)
bool fUseBinnedOscillations
Definition: InputPoint.h:87
const std::string cOscParams_Strings[kNumOscParams]
Definition: Constants.h:196
void CommonConstructorAssistant(ParameterDetMap const &parameterSpaceLoc, ParameterDetMap const &systematicPulls, std::vector< ParameterDet > const &fixedParameters, std::vector< ParameterDet > const &fixedSystematics)
Definition: InputPoint.cxx:242
static NuisanceParameters * Instance()
static SystematicSigmas * Instance()

Member Function Documentation

void fnex::InputPoint::CommonConstructorAssistant ( fnex::ParameterDetMap const &  parameterSpaceLoc,
fnex::ParameterDetMap const &  systematicPulls,
std::vector< ParameterDet > const &  fixedParameters,
std::vector< ParameterDet > const &  fixedSystematics 
)
private

Definition at line 242 of file InputPoint.cxx.

References fFixedParametersFD, fFixedParametersND, fFixedSystematicsFD, fFixedSystematicsND, fParameterSpaceKeysFD, fParameterSpaceKeysND, fParameterSpaceValsFD, fParameterSpaceValsND, fSystematicPullKeysFD, fSystematicPullKeysND, fSystematicPullValsFD, fSystematicPullValsND, it, novadaq::cnv::kFARDET, and novadaq::cnv::kNEARDET.

Referenced by InputPoint().

245  {
246  fParameterSpaceKeysND.clear();
247  fParameterSpaceValsND.clear();
248  fFixedParametersND .clear();
249  fParameterSpaceKeysFD.clear();
250  fParameterSpaceValsFD.clear();
251  fFixedParametersFD .clear();
252 
253  fSystematicPullKeysND.clear();
254  fSystematicPullValsND.clear();
255  fFixedSystematicsND .clear();
256  fSystematicPullKeysFD.clear();
257  fSystematicPullValsFD.clear();
258  fFixedSystematicsFD .clear();
259 
260  for(auto const& it : parameterSpaceLoc){
261  if(it.first.second == novadaq::cnv::kNEARDET){
262  fParameterSpaceKeysND.emplace_back(it.first.first);
263  fParameterSpaceValsND.emplace_back(it.second);
264  }
265  if(it.first.second == novadaq::cnv::kFARDET){
266  fParameterSpaceKeysFD.emplace_back(it.first.first);
267  fParameterSpaceValsFD.emplace_back(it.second);
268  }
269  }
270  for(auto const& it : systematicPulls){
271  if(it.first.second == novadaq::cnv::kNEARDET){
272  fSystematicPullKeysND.emplace_back(it.first.first);
273  fSystematicPullValsND.emplace_back(it.second);
274  }
275  if(it.first.second == novadaq::cnv::kFARDET){
276  fSystematicPullKeysFD.emplace_back(it.first.first);
277  fSystematicPullValsFD.emplace_back(it.second);
278  }
279  }
280  for(auto const& it : fixedParameters){
281  if(it.second == novadaq::cnv::kNEARDET){
282  fFixedParametersND.push_back(it.first); }
283  if(it.second == novadaq::cnv::kFARDET){
284  fFixedParametersFD.push_back(it.first); }
285  }
286  for(auto const& it : fixedSystematics){
287  if(it.second == novadaq::cnv::kNEARDET){
288  fFixedSystematicsND.push_back(it.first); }
289  if(it.second == novadaq::cnv::kFARDET){
290  fFixedSystematicsFD.push_back(it.first); }
291  }
292 
293  }
std::vector< std::string > fParameterSpaceKeysFD
Definition: InputPoint.h:40
set< int >::iterator it
std::vector< double > fSystematicPullValsFD
Definition: InputPoint.h:49
std::vector< double > fParameterSpaceValsFD
Definition: InputPoint.h:41
std::vector< std::string > fSystematicPullKeysND
Definition: InputPoint.h:44
std::vector< std::string > fSystematicPullKeysFD
Definition: InputPoint.h:48
std::vector< std::string > fParameterSpaceKeysND
Definition: InputPoint.h:36
Far Detector at Ash River, MN.
std::vector< std::string > fFixedSystematicsND
keys for which systematics are fixed
Definition: InputPoint.h:46
Near Detector in the NuMI cavern.
std::vector< std::string > fFixedParametersND
keys for which parameters are fixed
Definition: InputPoint.h:38
std::vector< std::string > fFixedParametersFD
keys for which parameters are fixed
Definition: InputPoint.h:42
std::vector< double > fParameterSpaceValsND
Definition: InputPoint.h:37
std::vector< std::string > fFixedSystematicsFD
keys for which systematics are fixed
Definition: InputPoint.h:50
std::vector< double > fSystematicPullValsND
Definition: InputPoint.h:45
void fnex::InputPoint::FillParameterDetMap ( fhicl::ParameterSet const &  inputPars,
ParameterDetMap map,
std::vector< fnex::ParameterDet > &  fixedPars,
bool  fakeData 
)
private

Definition at line 181 of file InputPoint.cxx.

References fillBadChanDBTables::det, fhicl::ParameterSet::get(), fhicl::ParameterSet::get_names(), fnex::SystematicSigmas::Instance(), fnex::ParameterConstraints::Instance(), fnex::NuisanceParameters::Instance(), novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, make_pair(), ParseFluxesFile::param, string, and febshutoff_auto::val.

Referenced by InputPoint().

185  {
187  std::string detstr;
188  std::string parstr;
189 
190  bool fixed = false;
191  double val = 0.;
192  auto parDet = std::make_pair(parstr, det);
193 
194  // get the Instance of the SystematicSigmas and unlock it
195  auto systSigma = fnex::SystematicSigmas::Instance();
196 
197  // get the instance of the NuisanceParameters and unlock it
198  auto nuisancePars = fnex::NuisanceParameters::Instance();
199 
200  // get the instance of the ParameterConstraints and unlock it
201  auto parConst = fnex::ParameterConstraints::Instance();
202 
203  auto parNames = inputPars.get_names();
204 
206  for(auto itr : parNames){
207 
208  param = inputPars.get<fhicl::ParameterSet>(itr);
210  detstr = param.get<std::string>("Detector" );
211  parstr = param.get<std::string>("Parameter");
212  fixed = param.get<bool >("Fixed" );
213  val = param.get<double >("Value" );
214 
215  parConst ->InsertConstraint(param);
216  nuisancePars->InsertParameter (param);
217  // TODO: eventually should figure out how to just use NuisanceParameters
218  // to keep track of the sigma values
219  systSigma ->InsertSigma (param);
220 
221  if(detstr.compare("BOTH") == 0){
222  parDet = std::make_pair(parstr, novadaq::cnv::kNEARDET);
223  map[parDet] = val;
224  if(fixed) fixedPars.push_back(parDet);
225 
226  parDet = std::make_pair(parstr, novadaq::cnv::kFARDET);
227  map[parDet] = val;
228  if(fixed) fixedPars.push_back(parDet);
229  }
230  else{
231  det = (detstr.compare("NEARDET") == 0) ? novadaq::cnv::kNEARDET : novadaq::cnv::kFARDET;
232  parDet = std::make_pair(parstr, det);
233  map[parDet] = val;
234  if(fixed) fixedPars.push_back(parDet);
235  }
236  }
237 
238  return;
239  }
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
Far Detector at Ash River, MN.
static ParameterConstraints * Instance()
T get(std::string const &key) const
Definition: ParameterSet.h:231
Near Detector in the NuMI cavern.
static NuisanceParameters * Instance()
static SystematicSigmas * Instance()
enum BeamMode string
std::vector< fnex::ParameterDet > const fnex::InputPoint::FitParameters ( ) const

Definition at line 423 of file InputPoint.cxx.

References fParameterSpaceKeysFD, fParameterSpaceKeysND, IsParameterFixed(), novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, and make_pair().

424  {
425  std::vector<fnex::ParameterDet> fit;
426 
427  for(auto itr : fParameterSpaceKeysND){
428  if( !this->IsParameterFixed(itr, novadaq::cnv::kNEARDET) )
429  fit.emplace_back(std::make_pair(itr, novadaq::cnv::kNEARDET));
430  }
431  for(auto itr : fParameterSpaceKeysFD){
432  if( !this->IsParameterFixed(itr, novadaq::cnv::kFARDET) )
433  fit.emplace_back(std::make_pair(itr, novadaq::cnv::kFARDET));
434  }
435 
436  return fit;
437  }
std::vector< std::string > fParameterSpaceKeysFD
Definition: InputPoint.h:40
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::vector< std::string > fParameterSpaceKeysND
Definition: InputPoint.h:36
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
bool IsParameterFixed(ParameterDet const &pardet) const
Definition: InputPoint.cxx:468
std::vector< fnex::ParameterDet > const fnex::InputPoint::FitSystematics ( ) const

Definition at line 451 of file InputPoint.cxx.

References fSystematicPullKeysFD, fSystematicPullKeysND, IsParameterFixed(), novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, and make_pair().

452  {
453  std::vector<fnex::ParameterDet> fit;
454 
455  for(auto itr : fSystematicPullKeysND){
456  if( !this->IsParameterFixed(itr, novadaq::cnv::kNEARDET) )
457  fit.emplace_back(std::make_pair(itr, novadaq::cnv::kNEARDET));
458  }
459  for(auto itr : fSystematicPullKeysFD){
460  if( !this->IsParameterFixed(itr, novadaq::cnv::kFARDET) )
461  fit.emplace_back(std::make_pair(itr, novadaq::cnv::kFARDET));
462  }
463 
464  return fit;
465  }
std::vector< std::string > fSystematicPullKeysND
Definition: InputPoint.h:44
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::vector< std::string > fSystematicPullKeysFD
Definition: InputPoint.h:48
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
bool IsParameterFixed(ParameterDet const &pardet) const
Definition: InputPoint.cxx:468
std::vector< std::string > const & fnex::InputPoint::FixedParameters ( novadaq::cnv::DetId const &  det) const

Definition at line 396 of file InputPoint.cxx.

References fFixedParametersFD, fFixedParametersND, and novadaq::cnv::kNEARDET.

Referenced by fnex::Correlations::ApplyCorrelations(), fnex::CovarianceMatrixFitter::ConvertPointToVectors(), fnex::ConvertPointToVectors(), fnex::ConvertVectorsToPoint(), fnex::CorrectedSpectrum::DrawStacks(), fnex::CorrectedSpectrum::MakeOscillationLegend(), and fnex::operator<<().

397  {
399 
400  return fFixedParametersFD;
401  }
Near Detector in the NuMI cavern.
std::vector< std::string > fFixedParametersND
keys for which parameters are fixed
Definition: InputPoint.h:38
std::vector< std::string > fFixedParametersFD
keys for which parameters are fixed
Definition: InputPoint.h:42
std::vector< fnex::ParameterDet > const fnex::InputPoint::FixedParameters ( ) const

Definition at line 412 of file InputPoint.cxx.

References fFixedParametersFD, fFixedParametersND, novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, and make_pair().

413  {
414  std::vector<fnex::ParameterDet> fixed;
415 
416  for(auto itr : fFixedParametersND) fixed.emplace_back(std::make_pair(itr, novadaq::cnv::kNEARDET));
417  for(auto itr : fFixedParametersFD) fixed.emplace_back(std::make_pair(itr, novadaq::cnv::kFARDET));
418 
419  return fixed;
420  }
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
std::vector< std::string > fFixedParametersND
keys for which parameters are fixed
Definition: InputPoint.h:38
std::vector< std::string > fFixedParametersFD
keys for which parameters are fixed
Definition: InputPoint.h:42
std::vector< std::string > const & fnex::InputPoint::FixedSystematics ( novadaq::cnv::DetId const &  det) const

Definition at line 404 of file InputPoint.cxx.

References fFixedSystematicsFD, fFixedSystematicsND, and novadaq::cnv::kNEARDET.

Referenced by fnex::Correlations::ApplyCorrelations(), fnex::ConvertPointToVectors(), fnex::ConvertVectorsToPoint(), fnex::CorrectedSpectrum::MakeSystematicsLegend(), fnex::operator<<(), and fnex::ReadFitResults::readResults().

405  {
407 
408  return fFixedSystematicsFD;
409  }
std::vector< std::string > fFixedSystematicsND
keys for which systematics are fixed
Definition: InputPoint.h:46
Near Detector in the NuMI cavern.
std::vector< std::string > fFixedSystematicsFD
keys for which systematics are fixed
Definition: InputPoint.h:50
std::vector< fnex::ParameterDet > const fnex::InputPoint::FixedSystematics ( ) const

Definition at line 440 of file InputPoint.cxx.

References fFixedSystematicsFD, fFixedSystematicsND, novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, and make_pair().

441  {
442  std::vector<fnex::ParameterDet> fixed;
443 
444  for(auto itr : fFixedSystematicsND) fixed.emplace_back(std::make_pair(itr, novadaq::cnv::kNEARDET));
445  for(auto itr : fFixedSystematicsFD) fixed.emplace_back(std::make_pair(itr, novadaq::cnv::kFARDET));
446 
447  return fixed;
448  }
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
Far Detector at Ash River, MN.
std::vector< std::string > fFixedSystematicsND
keys for which systematics are fixed
Definition: InputPoint.h:46
Near Detector in the NuMI cavern.
std::vector< std::string > fFixedSystematicsFD
keys for which systematics are fixed
Definition: InputPoint.h:50
bool fnex::InputPoint::IsParameterFixed ( ParameterDet const &  pardet) const

Definition at line 468 of file InputPoint.cxx.

Referenced by fnex::NuisanceParameter_Experiment::ApplyPoint(), FitParameters(), FitSystematics(), fnex::CorrectedSpectrum::MakeOscillationLegend(), and fnex::CorrectedSpectrum::MakeSystematicsLegend().

469  {
470  return this->IsParameterFixed(pardet.first,
471  pardet.second);
472  }
bool IsParameterFixed(ParameterDet const &pardet) const
Definition: InputPoint.cxx:468
bool fnex::InputPoint::IsParameterFixed ( std::string const &  par,
novadaq::cnv::DetId const &  det 
) const

Definition at line 475 of file InputPoint.cxx.

References fFixedParametersFD, fFixedParametersND, fFixedSystematicsFD, fFixedSystematicsND, novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, and par.

477  {
479  if(std::find(fFixedParametersND.begin(),
480  fFixedParametersND.end(),
481  par) != fFixedParametersND.end() ) return true;
482  if(std::find(fFixedSystematicsND.begin(),
483  fFixedSystematicsND.end(),
484  par) != fFixedSystematicsND.end() ) return true;
485  }
486  else if(det == novadaq::cnv::kFARDET){
487  if(std::find(fFixedParametersFD.begin(),
488  fFixedParametersFD.end(),
489  par) != fFixedParametersFD.end() ) return true;
490  if(std::find(fFixedSystematicsFD.begin(),
491  fFixedSystematicsFD.end(),
492  par) != fFixedSystematicsFD.end() ) return true;
493  }
494 
495  return false;
496  }
Int_t par
Definition: SimpleIterate.C:24
Far Detector at Ash River, MN.
std::vector< std::string > fFixedSystematicsND
keys for which systematics are fixed
Definition: InputPoint.h:46
Near Detector in the NuMI cavern.
std::vector< std::string > fFixedParametersND
keys for which parameters are fixed
Definition: InputPoint.h:38
std::vector< std::string > fFixedParametersFD
keys for which parameters are fixed
Definition: InputPoint.h:42
std::vector< std::string > fFixedSystematicsFD
keys for which systematics are fixed
Definition: InputPoint.h:50
ParameterMap const fnex::InputPoint::ParameterSpaceLocation ( novadaq::cnv::DetId const &  det) const

Definition at line 330 of file InputPoint.cxx.

References fParameterSpaceKeysFD, fParameterSpaceKeysND, fParameterSpaceValsFD, fParameterSpaceValsND, novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, submit_hadd::l, and PandAna.Demos.demo0::loc.

Referenced by fnex::Correlations::ApplyCorrelations(), fnex::NuisanceParameter_Experiment::ApplyPoint(), fnex::CovarianceMatrixFitter::ConvertPointToVectors(), fnex::ConvertPointToVectors(), fnex::ConvertVectorsToPoint(), fnex::CorrectedSpectrum::DrawStacks(), fnex::FitAlg_ROOTFactoryFit::LoadFinalResults(), fnex::ContourMaker::Make2DContours(), fnex::CorrectedSpectrum::MakeOscillationLegend(), fnex::operator<<(), and fnex::ShifterAndWeighter::SetCurrentVals().

331  {
333 
335  //QQQstd::cout << "ACCESSING NEARDET KEYS of size: " << fParameterSpaceKeysND.size() << "\n";
336  for(size_t l = 0; l < fParameterSpaceKeysND.size(); ++l)
338  }
339  else if(det == novadaq::cnv::kFARDET){
340  //QQQstd::cout << "ACCESSING FARDET KEYS of size: " << fParameterSpaceKeysFD.size() << "\n";
341  for(size_t l = 0; l < fParameterSpaceKeysFD.size(); ++l)
343  }
344 
345  return loc;
346  }
std::vector< std::string > fParameterSpaceKeysFD
Definition: InputPoint.h:40
std::vector< double > fParameterSpaceValsFD
Definition: InputPoint.h:41
std::vector< std::string > fParameterSpaceKeysND
Definition: InputPoint.h:36
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
std::unordered_map< std::string, double > ParameterMap
Definition: Constants.h:62
std::vector< double > fParameterSpaceValsND
Definition: InputPoint.h:37
ParameterDetMap const fnex::InputPoint::ParameterSpaceLocation ( ) const

Definition at line 349 of file InputPoint.cxx.

References fParameterSpaceKeysFD, fParameterSpaceKeysND, fParameterSpaceValsFD, fParameterSpaceValsND, novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, submit_hadd::l, PandAna.Demos.demo0::loc, and make_pair().

350  {
352 
353  for(size_t l = 0; l < fParameterSpaceKeysND.size(); ++l)
356  for(size_t l = 0; l < fParameterSpaceKeysFD.size(); ++l)
359 
360  return loc;
361  }
std::vector< std::string > fParameterSpaceKeysFD
Definition: InputPoint.h:40
std::vector< double > fParameterSpaceValsFD
Definition: InputPoint.h:41
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::vector< std::string > fParameterSpaceKeysND
Definition: InputPoint.h:36
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
std::unordered_map< ParameterDet, double, ParameterDetHasher > ParameterDetMap
Definition: Constants.h:63
std::vector< double > fParameterSpaceValsND
Definition: InputPoint.h:37
double const fnex::InputPoint::ParameterValue ( ParameterDet const &  parDet) const

Definition at line 296 of file InputPoint.cxx.

References fParameterSpaceKeysFD, fParameterSpaceKeysND, fParameterSpaceValsFD, fParameterSpaceValsND, fSystematicPullKeysFD, fSystematicPullKeysND, fSystematicPullValsFD, fSystematicPullValsND, novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, submit_hadd::l, LOG_WARNING, and cet::sqlite::max().

Referenced by fnex::ShifterAndWeighter::AbsNormWeight(), fnex::ShifterAndWeighter::BeamSystWeight(), fnex::ShifterAndWeighter::BirksNormWeight(), fnex::ShifterAndWeighter::CalibNormWeight(), fnex::ShifterAndWeighter::CalibSystWeight(), fnex::ShifterAndWeighter::COHCCScale2018Weight(), fnex::ShifterAndWeighter::COHNCScale2018Weight(), fnex::ShifterAndWeighter::CosmicMuNormWeight(), fnex::ShifterAndWeighter::CosmicOverlayNormWeight(), fnex::ShifterAndWeighter::DISvnCC1piWeight(), fnex::ShifterAndWeighter::FluxPCAWeight(), fnex::ShifterAndWeighter::GeniePCASystWeight(), fnex::ShifterAndWeighter::GENIESystWeight(), fnex::ShifterAndWeighter::HornNormWeight(), fnex::ShifterAndWeighter::MaCCQEReducedWeight(), fnex::ShifterAndWeighter::MECEnuShapeWeight(), fnex::ShifterAndWeighter::MECInitStateNPFracWeight(), fnex::ShifterAndWeighter::MECNormWeight(), fnex::ShifterAndWeighter::MECShapeWeight(), fnex::ShifterAndWeighter::NCNormWeight(), fnex::ShifterAndWeighter::NoiseFarNormWeight(), fnex::ShifterAndWeighter::NormBothWeight(), fnex::ShifterAndWeighter::NueAcceptBkg2018Weight(), fnex::ShifterAndWeighter::NueAcceptSignalKin2018Weight(), fnex::ShifterAndWeighter::NueExtrapBkg2017Weight(), fnex::ShifterAndWeighter::NueExtrapSig2017Weight(), fnex::ShifterAndWeighter::NueHistSystWeight(), fnex::ShifterAndWeighter::PPFXSmoothCVWeight(), fnex::ShifterAndWeighter::RadCorrNueBarWeight(), fnex::ShifterAndWeighter::RadCorrNueWeight(), fnex::ShifterAndWeighter::RelNormWeight(), fnex::ShifterAndWeighter::RockNormOnFidWeight(), fnex::ShifterAndWeighter::RPACCQEshapeEnhWeight(), fnex::ShifterAndWeighter::RPACCQEshapeSuppWeight(), fnex::ShifterAndWeighter::RPACCQEWeight(), fnex::ShifterAndWeighter::RPARESWeight(), fnex::ShifterAndWeighter::SecondClassCurrWeight(), fnex::ShifterAndWeighter::SetCurrentEvent(), fnex::ShifterAndWeighter::SumSmallXSecNue2017Weight(), fnex::ShifterAndWeighter::SumSmallXSecNumu2017Weight(), fnex::ShifterAndWeighter::TauScaleSystWeight(), and fnex::ShifterAndWeighter::TotalShift().

297  {
298 
299  if(parDet.second == novadaq::cnv::kNEARDET){
300  for(size_t l = 0; l < fParameterSpaceKeysND.size(); ++l){
301  if(parDet.first == fParameterSpaceKeysND[l]) return fParameterSpaceValsND[l];
302  }
303  for(size_t l = 0; l < fSystematicPullKeysND.size(); ++l){
304  if(parDet.first == fSystematicPullKeysND[l]) return fSystematicPullValsND[l];
305  }
306  }
307  else if(parDet.second == novadaq::cnv::kFARDET){
308  for(size_t l = 0; l < fParameterSpaceKeysFD.size(); ++l){
309  if(parDet.first == fParameterSpaceKeysFD[l]) return fParameterSpaceValsFD[l];
310  }
311  for(size_t l = 0; l < fSystematicPullKeysFD.size(); ++l){
312  if(parDet.first == fSystematicPullKeysFD[l]) return fSystematicPullValsFD[l];
313  }
314  }
315 
316  // if we got here, something is very wrong because we don't have this parameter
317  // as an option
318  LOG_WARNING("InputPoint")
319  << "requested parameter/detector "
320  << parDet.first
321  << "/"
322  << parDet.second
323  << " does not show up in either the oscillation or systematic lists, return"
324  << " a bogus value";
325 
327  }
std::vector< std::string > fParameterSpaceKeysFD
Definition: InputPoint.h:40
std::vector< double > fSystematicPullValsFD
Definition: InputPoint.h:49
std::vector< double > fParameterSpaceValsFD
Definition: InputPoint.h:41
std::vector< std::string > fSystematicPullKeysND
Definition: InputPoint.h:44
std::vector< std::string > fSystematicPullKeysFD
Definition: InputPoint.h:48
std::vector< std::string > fParameterSpaceKeysND
Definition: InputPoint.h:36
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
#define LOG_WARNING(category)
std::vector< double > fParameterSpaceValsND
Definition: InputPoint.h:37
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
std::vector< double > fSystematicPullValsND
Definition: InputPoint.h:45
ParameterMap const fnex::InputPoint::SystematicPulls ( novadaq::cnv::DetId const &  det) const

Definition at line 364 of file InputPoint.cxx.

References fSystematicPullKeysFD, fSystematicPullKeysND, fSystematicPullValsFD, fSystematicPullValsND, novadaq::cnv::kFARDET, and novadaq::cnv::kNEARDET.

Referenced by fnex::StarPlot::AddPointToMap(), fnex::Correlations::ApplyCorrelations(), fnex::NuisanceParameter_Experiment::ApplyPoint(), fnex::ConvertPointToVectors(), fnex::ConvertVectorsToPoint(), fnex::ShifterAndWeighter::InitShiftsAndWeightsToUse(), fnex::FitAlg_ROOTFactoryFit::LoadFinalResults(), fnex::CorrectedSpectrum::MakeSystematicsLegend(), fnex::operator<<(), fnex::ReadFitResults::readResults(), and fnex::CovarianceMatrixMaker::SetSystematicParameter().

365  {
366  ParameterMap pull;
367 
369  for(size_t p = 0; p < fSystematicPullKeysND.size(); ++p)
370  pull.emplace(fSystematicPullKeysND[p], fSystematicPullValsND[p]);
371  }
372  else if(det == novadaq::cnv::kFARDET){
373  for(size_t p = 0; p < fSystematicPullKeysFD.size(); ++p)
374  pull.emplace(fSystematicPullKeysFD[p], fSystematicPullValsFD[p]);
375  }
376 
377  return pull;
378  }
std::vector< double > fSystematicPullValsFD
Definition: InputPoint.h:49
const char * p
Definition: xmltok.h:285
std::vector< std::string > fSystematicPullKeysND
Definition: InputPoint.h:44
std::vector< std::string > fSystematicPullKeysFD
Definition: InputPoint.h:48
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
std::unordered_map< std::string, double > ParameterMap
Definition: Constants.h:62
std::vector< double > fSystematicPullValsND
Definition: InputPoint.h:45
ParameterDetMap const fnex::InputPoint::SystematicPulls ( ) const

Definition at line 381 of file InputPoint.cxx.

References fSystematicPullKeysFD, fSystematicPullKeysND, fSystematicPullValsFD, fSystematicPullValsND, novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, and make_pair().

382  {
383  ParameterDetMap pull;
384 
385  for(size_t p = 0; p < fSystematicPullKeysND.size(); ++p)
388  for(size_t p = 0; p < fSystematicPullKeysFD.size(); ++p)
391 
392  return pull;
393  }
std::vector< double > fSystematicPullValsFD
Definition: InputPoint.h:49
const char * p
Definition: xmltok.h:285
std::vector< std::string > fSystematicPullKeysND
Definition: InputPoint.h:44
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::vector< std::string > fSystematicPullKeysFD
Definition: InputPoint.h:48
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
std::unordered_map< ParameterDet, double, ParameterDetHasher > ParameterDetMap
Definition: Constants.h:63
std::vector< double > fSystematicPullValsND
Definition: InputPoint.h:45

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
fnex::InputPoint const &  ip 
)
friend

Definition at line 500 of file InputPoint.cxx.

501  {
502 
503  o << "InputPoint ND:" << std::endl;
504  for(auto itr : ip.ParameterSpaceLocation(novadaq::cnv::kNEARDET) ){
505  if(itr.first=="dCP")
506  o << "\t" << std::setw(20) << itr.first << " " << std::setw(10) << itr.second << " = " << itr.second/TMath::Pi() << "(pi)" << std::endl;
507  else if(itr.first=="Th23")
508  o << "\t" << std::setw(20) << itr.first << " " << std::setw(10) << itr.second << ": sin^2(Th23) : " << std::pow(std::sin(itr.second), 2.) << std::endl;
509  else o << "\t" << std::setw(20) << itr.first << " " << std::setw(10) << itr.second << std::endl;
510  }
511  for(auto itr : ip.SystematicPulls(novadaq::cnv::kNEARDET) ){
512 
513  o << "\t"<< std::setw(10) << itr.first << " " << std::setw(10) << itr.second << std::endl;
514  }
515  o << "Fixed:" << std::endl;
516  for(auto itr: ip.FixedParameters(novadaq::cnv::kNEARDET) )
517  o << "\t"<< std::setw(10) << itr << " " << std::endl;
518  for(auto itr: ip.FixedSystematics(novadaq::cnv::kNEARDET) )
519  o << "\t"<< std::setw(10) << itr << " " << std::endl;
520 
521  o << "\nInputPoint FD:" << std::endl;
522  for(auto itr : ip.ParameterSpaceLocation(novadaq::cnv::kFARDET) ){
523  if(itr.first=="dCP")
524  o << "\t" << std::setw(20) << itr.first << " " << std::setw(10) << itr.second << " = " << itr.second/TMath::Pi() << "(pi)" << std::endl;
525  else if(itr.first=="Th23")
526  o << "\t" << std::setw(20) << itr.first << " " << std::setw(10) << itr.second << ": sin^2(Th23) : " << std::pow(std::sin(itr.second), 2.) << std::endl;
527  else o << "\t"<< std::setw(10) << itr.first << " " << std::setw(10) << itr.second << std::endl;
528  }
529  for(auto itr : ip.SystematicPulls(novadaq::cnv::kFARDET) ){
530  o << "\t"<< std::setw(10) << itr.first
531  << " " << std::setw(10) << itr.second << std::endl;
532  }
533  o << "Fixed:" << std::endl;
534  for(auto itr: ip.FixedParameters(novadaq::cnv::kFARDET) )
535  o << std::setw(10)<< itr << " " << std::endl;
536  for(auto itr: ip.FixedSystematics(novadaq::cnv::kFARDET) )
537  o << std::setw(10)<< itr << " " << std::endl;
538 
539  return o;
540  }
constexpr T pow(T x)
Definition: pow.h:75
TString ip
Definition: loadincs.C:5
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
T sin(T number)
Definition: d0nt_math.hpp:132

Member Data Documentation

std::vector<std::string> fnex::InputPoint::fFixedParametersFD
private

keys for which parameters are fixed

Definition at line 42 of file InputPoint.h.

Referenced by CommonConstructorAssistant(), FixedParameters(), InputPoint(), IsParameterFixed(), and ~InputPoint().

std::vector<std::string> fnex::InputPoint::fFixedParametersND
private

keys for which parameters are fixed

Definition at line 38 of file InputPoint.h.

Referenced by CommonConstructorAssistant(), FixedParameters(), InputPoint(), IsParameterFixed(), and ~InputPoint().

std::vector<std::string> fnex::InputPoint::fFixedSystematicsFD
private

keys for which systematics are fixed

Definition at line 50 of file InputPoint.h.

Referenced by CommonConstructorAssistant(), FixedSystematics(), InputPoint(), IsParameterFixed(), and ~InputPoint().

std::vector<std::string> fnex::InputPoint::fFixedSystematicsND
private

keys for which systematics are fixed

Definition at line 46 of file InputPoint.h.

Referenced by CommonConstructorAssistant(), FixedSystematics(), InputPoint(), IsParameterFixed(), and ~InputPoint().

std::vector<std::string> fnex::InputPoint::fParameterSpaceKeysFD
private
std::vector<std::string> fnex::InputPoint::fParameterSpaceKeysND
private
std::vector<double> fnex::InputPoint::fParameterSpaceValsFD
private
std::vector<double> fnex::InputPoint::fParameterSpaceValsND
private
std::vector<std::string> fnex::InputPoint::fSystematicPullKeysFD
private
std::vector<std::string> fnex::InputPoint::fSystematicPullKeysND
private
std::vector<double> fnex::InputPoint::fSystematicPullValsFD
private
std::vector<double> fnex::InputPoint::fSystematicPullValsND
private
bool fnex::InputPoint::fUseBinnedOscillations

Definition at line 87 of file InputPoint.h.

Referenced by InputPoint().


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