SolarConstraints.cxx
Go to the documentation of this file.
2 
3 #include "OscLib/IOscCalc.h"
4 #include "OscLib/OscCalcCPT.h"
5 
6 #include "Utilities/func/MathUtil.h"
7 
8 #include "TDirectory.h"
9 #include "TH1.h"
10 #include "TObjString.h"
11 
12 #include <cassert>
13 #include <iostream>
14 
15 namespace ana
16 {
17  // http://pdg.lbl.gov/2017/tables/rpp2017-sum-leptons.pdf
18  // ssth12 0.307 +/- 0.013 -> ss2th12 0.851 +/- 0.020
19  // NOTE: PDG 2018, 2019 numbers are the same
20  const SolarConstraints kSolarConstraintsPDG2017(7.53e-5, 0.18e-5, 0.851, 0.020);
21 
22  // http://www.nu-fit.org/ https://arxiv.org/abs/1811.05487 NuFit 4.0 (2018)
23  // assuming same constraints for neutrinos and antineutrinos
24  // without SK-atm, assign conservative errors
25  // ssth12 0.310 +0.013-0.012 -> ss2th12 0.856 +0.020-0.18
26  // dmsq 7.39 +0.21-0.20
27  const SolarConstraintsNu kSolarConstraintsNuFit2018nu(7.39e-5, 0.21e-5, 0.856, 0.020);
28  const SolarConstraintsNubar kSolarConstraintsNuFit2018bar(7.39e-5, 0.21e-5, 0.856, 0.020);
29 
30  //----------------------------------------------------------------------
32  {
33  // These value are from the 2014 PDG
34  // http://pdg.lbl.gov/2014/tables/rpp2014-sum-leptons.pdf
35  std::cerr << "WARNING: Using 2014 Solar constraints."
36  << "Are you sure you don't want kSolarConstraintsPDG2017 ?"
37  << std::endl;
38 
39  fCentralDmsq = 7.53e-5;
40  fErrorDmsq = 0.18e-5;
41 
42  fCentralAngle = 0.846;
43  fErrorAngle = 0.021;
44  }
45 
46  //----------------------------------------------------------------------
47  SolarConstraints::SolarConstraints(const double dmsq, const double errorDmsq,
48  const double ss2th, const double errorSs2th)
49  :fCentralDmsq (dmsq), fErrorDmsq (errorDmsq),
50  fCentralAngle(ss2th), fErrorAngle(errorSs2th)
51  { }
52 
53  //----------------------------------------------------------------------
55  const SystShifts& /*syst*/) const
56  {
57  double ret = 0;
58 
59  ret += util::sqr((Dmsq21(osc) - fCentralDmsq)/fErrorDmsq);
60  const double ss2th12 = util::sqr(sin(2*Th12(osc)));
61  ret += util::sqr((ss2th12 - fCentralAngle)/fErrorAngle);
62 
63  return ret;
64  }
65 
66  //----------------------------------------------------------------------
68  {
69  return osc->GetDmsq21();
70  }
71 
72  //----------------------------------------------------------------------
73  SolarConstraintsNu::SolarConstraintsNu(const double dmsq, const double errorDmsq,
74  const double ss2th, const double errorSs2th)
75  : SolarConstraints(dmsq, errorDmsq, ss2th, errorSs2th)
76  {
77  }
78 
79  //----------------------------------------------------------------------
81  {
83  }
84 
85  //----------------------------------------------------------------------
86  SolarConstraintsNubar::SolarConstraintsNubar(const double dmsq, const double errorDmsq,
87  const double ss2th, const double errorSs2th)
88  : SolarConstraints(dmsq, errorDmsq, ss2th, errorSs2th)
89  {
90  }
91 
92  //----------------------------------------------------------------------
94  {
96  }
97 
98  //----------------------------------------------------------------------
100  {
101  return osc->GetTh12();
102  }
103 
104  //----------------------------------------------------------------------
106  {
108  }
109 
110  //----------------------------------------------------------------------
112  {
114  }
115 
116  //----------------------------------------------------------------------
117  void SolarConstraints::SaveTo(TDirectory* dir, const std::string& name) const
118  {
119  TDirectory* tmp = dir;
120 
121  dir = dir->mkdir(name.c_str()); // switch to subdir
122  dir->cd();
123 
124  TObjString("SolarConstraints").Write("type");
125 
126  TH1D params("", "", 4, 0, 4);
127  params.SetBinContent(1, fCentralDmsq);
128  params.SetBinContent(2, fErrorDmsq);
129  params.SetBinContent(3, fCentralAngle);
130  params.SetBinContent(4, fErrorAngle);
131  params.Write("params");
132 
133  dir->Write();
134  delete dir;
135 
136  tmp->cd();
137  }
138 
139  //----------------------------------------------------------------------
140  std::unique_ptr<SolarConstraints> SolarConstraints::LoadFrom(TDirectory* dir, const std::string& name)
141  {
142  dir = dir->GetDirectory(name.c_str()); // switch to subdir
143  assert(dir);
144 
145  TObjString* tag = (TObjString*)dir->Get("type");
146  assert(tag);
147  assert(tag->GetString() == "SolarConstraints");
148  delete tag;
149 
150  std::unique_ptr<SolarConstraints> ret(new SolarConstraints);
151 
152  TH1* params = (TH1*)dir->Get("params");
153  assert(params);
154 
155  ret->fCentralDmsq = params->GetBinContent(1);
156  ret->fErrorDmsq = params->GetBinContent(2);
157  ret->fCentralAngle = params->GetBinContent(3);
158  ret->fErrorAngle = params->GetBinContent(4);
159 
160  delete dir;
161 
162  return ret;
163  }
164 }
const XML_Char * name
Definition: expat.h:151
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
virtual double Th12(osc::IOscCalcAdjustable *calc) const override
const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
Constraints on the parameters and from solar experiments.
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
SolarConstraintsNu(const double dmsq, const double errorDmsq, const double ss2th, const double errorSs2th)
OStream cerr
Definition: OStream.cxx:7
virtual double Dmsq21(osc::IOscCalcAdjustable *calc) const
Float_t tmp
Definition: plot.C:36
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
virtual void SaveTo(TDirectory *dir, const std::string &name) const override
virtual double Th12(osc::IOscCalcAdjustable *calc) const override
virtual T GetTh12() const
Definition: IOscCalc.h:87
virtual double Dmsq21(osc::IOscCalcAdjustable *calc) const override
virtual double Th12(osc::IOscCalcAdjustable *calc) const
Oscillation probability calculators.
Definition: Calcs.h:5
double GetDmsq21() const override
Definition: OscCalcCPT.cxx:109
virtual T GetDmsq21() const
Definition: IOscCalc.h:85
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const SolarConstraints kSolarConstraintsPDG2017(7.53e-5, 0.18e-5, 0.851, 0.020)
T sin(T number)
Definition: d0nt_math.hpp:132
const SolarConstraintsNu kSolarConstraintsNuFit2018nu(7.39e-5, 0.21e-5, 0.856, 0.020)
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
static std::unique_ptr< SolarConstraints > LoadFrom(TDirectory *dir, const std::string &name)
virtual double ChiSq(osc::IOscCalcAdjustable *osc, const SystShifts &syst=SystShifts::Nominal()) const override
double GetTh12() const override
Definition: OscCalcCPT.cxx:123
Float_t e
Definition: plot.C:35
SolarConstraintsNubar(const double dmsq, const double errorDmsq, const double ss2th, const double errorSs2th)
virtual double Dmsq21(osc::IOscCalcAdjustable *calc) const override
const SolarConstraintsNubar kSolarConstraintsNuFit2018bar(7.39e-5, 0.21e-5, 0.856, 0.020)