FakeUniverse.cxx
Go to the documentation of this file.
1 //
2 // Created by Brian Rebel on 11/15/19.
3 //
5 
7 
8 namespace cmf {
9  //------------------------------------------------------------
11  {
12  }
13 
14  //------------------------------------------------------------
16  cmf::Spectrum & asimov,
17  cmf::Spectrum & spect)
18  {
19  fAsimovSpectrum .swap(asimov);
20  fPoissonSpectrum.swap(spect);
21 
22  // fill the oscillation parameters for this universe, just use
23  // the FD values and ignore parameters we can't/don't measure, ie
24  // rho, L, Dmsq21, Th12
25 
26  // We want to order the oscillation parameters for future use according to
27  // which analysis the prediction is for:
28  // For three flavor analyses, order by Th23, Dmsq32, Th13, dCP
29  // For four flavor analyses, order by Th24, Dmsq41, Th34, Th23, Dmsq32
30 
31  std::vector<std::string> parOrder;
32  if(loc.FDLocation().find("Th24") != loc.FDLocation().end() ){
33  parOrder = std::vector<std::string>({"Th24", "Dmsq41", "Th34", "Th23", "Dmsq32"});
34  }
35  // look for an NSI parameter - this one needs to be fixed up
36  else if(loc.FDLocation().find("Eps_mumu") != loc.FDLocation().end()){
37  parOrder = std::vector<std::string>({"Eps_mumu", "Eps_ee", "Th23", "Dmsq32"});
38  }
39  else{
40  parOrder = std::vector<std::string>({"Th23", "Dmsq32", "Th13", "dCP"});
41  }
42 
43  for(auto const& itr : parOrder){
44  if(loc.FDLocation().count(itr) > 0)
45  fOscParVec.emplace_back(cmf::OscParm_t(loc.FDLocation().find(itr)->second.Key()),
46  float(loc.FDLocation().find(itr)->second.Value()));
47  }
48 
49  }
50 
51  //------------------------------------------------------------
53  {
54  }
55 
56  //------------------------------------------------------------
57  std::ostream& operator << (std::ostream & o, cmf::FakeUniverse const& fu)
58  {
59  o << "universe location ";
60 
61  for(auto const& itr : fu.OscParMap())
62  o << cmf::cOscParams_Strings[itr.first]
63  << " "
64  << itr.second
65  << " ";
66 
67  o << std::endl;
68 
69 // for(size_t b = 0; b < fu.AsimovSpectrum().size(); ++b){
70 // o << "fake universe spectrum bin "
71 // << b
72 // << " poisson: "
73 // << fu.PoissonSpectrum()[b]
74 // << " asimov: "
75 // << fu.AsimovSpectrum()[b]
76 // << "\n";
77 // }
78 
79  return o;
80  }
81 
82  //------------------------------------------------------------
83  std::vector<float> const& FakeUniverse::AsimovSpectrum() const
84  {
85  return fAsimovSpectrum;
86  }
87 
88  //------------------------------------------------------------
89  std::vector<float> const& FakeUniverse::PoissonSpectrum() const
90  {
91  return fPoissonSpectrum;
92  }
93 
94  //------------------------------------------------------------
96  {
97  //loop over the far detector point and create an oscillation parameter map
99  for(auto const& itr : fOscParVec){
100  oscPars.emplace(itr.Param(), itr.Value());
101  }
102 
103  return std::move(oscPars);
104  }
105 
106 } // end namespace
enum cmf::osc_params OscParm_t
cmf::Spectrum fPoissonSpectrum
the fake data spectrum for the universe
Definition: FakeUniverse.h:34
cmf::Spectrum fAsimovSpectrum
the average MC spectrum for the universe
Definition: FakeUniverse.h:33
const std::string cOscParams_Strings[kNumOscParams]
Definition: Constants.h:272
friend std::ostream & operator<<(std::ostream &o, cmf::FakeUniverse const &fu)
std::map< cmf::OscParm_t, float > OscillationParameterMap
Definition: Constants.h:761
cmf::ParameterSpaceLoc const & FDLocation() const
Definition: Parameter.h:161
std::vector< float > Spectrum
Definition: Constants.h:759
std::vector< cmf::OscPar > fOscParVec
the oscillation parameter values for this universe
Definition: FakeUniverse.h:32
Module to combine a set of results into a single file currently only does one data product type at a ...
Definition: Event.cxx:24
std::vector< float > const & AsimovSpectrum() const
cmf::OscillationParameterMap const OscParMap() const
std::vector< float > const & PoissonSpectrum() const