SolarConstraints.cxx
Go to the documentation of this file.
2 
4 
5 #include "OscLib/IOscCalc.h"
6 #include "OscLib/OscCalcCPT.h"
7 
8 #include "Utilities/func/MathUtil.h"
9 
10 #include "TDirectory.h"
11 #include "TH1.h"
12 #include "TObjString.h"
13 
14 #include <cassert>
15 #include <iostream>
16 
17 namespace ana
18 {
19  REGISTER_LOADFROM("SolarConstraints", IExperiment, SolarConstraints);
20 
21  // http://pdg.lbl.gov/2017/tables/rpp2017-sum-leptons.pdf
22  // ssth12 0.307 +/- 0.013 -> ss2th12 0.851 +/- 0.020
23  // NOTE: PDG 2018, 2019 numbers are the same
24  const SolarConstraints kSolarConstraintsPDG2017(7.53e-5, 0.18e-5, 0.851, 0.020);
25 
26  // http://www.nu-fit.org/ https://arxiv.org/abs/1811.05487 NuFit 4.0 (2018)
27  // assuming same constraints for neutrinos and antineutrinos
28  // without SK-atm, assign conservative errors
29  // ssth12 0.310 +0.013-0.012 -> ss2th12 0.856 +0.020-0.18
30  // dmsq 7.39 +0.21-0.20
31  const SolarConstraintsNu kSolarConstraintsNuFit2018nu(7.39e-5, 0.21e-5, 0.856, 0.020);
32  const SolarConstraintsNubar kSolarConstraintsNuFit2018bar(7.39e-5, 0.21e-5, 0.856, 0.020);
33 
34  //----------------------------------------------------------------------
36  {
37  // These value are from the 2014 PDG
38  // http://pdg.lbl.gov/2014/tables/rpp2014-sum-leptons.pdf
39  std::cerr << "WARNING: Using 2014 Solar constraints."
40  << "Are you sure you don't want kSolarConstraintsPDG2017 ?"
41  << std::endl;
42 
43  fCentralDmsq = 7.53e-5;
44  fErrorDmsq = 0.18e-5;
45 
46  fCentralAngle = 0.846;
47  fErrorAngle = 0.021;
48  }
49 
50  //----------------------------------------------------------------------
51  SolarConstraints::SolarConstraints(const double dmsq, const double errorDmsq,
52  const double ss2th, const double errorSs2th)
53  :fCentralDmsq (dmsq), fErrorDmsq (errorDmsq),
54  fCentralAngle(ss2th), fErrorAngle(errorSs2th)
55  { }
56 
57  //----------------------------------------------------------------------
59  const SystShifts& /*syst*/) const
60  {
61  double ret = 0;
62 
63  ret += util::sqr((Dmsq21(osc) - fCentralDmsq)/fErrorDmsq);
64  const double ss2th12 = util::sqr(sin(2*Th12(osc)));
65  ret += util::sqr((ss2th12 - fCentralAngle)/fErrorAngle);
66 
67  return ret;
68  }
69 
70  //----------------------------------------------------------------------
72  {
73  return osc->GetDmsq21();
74  }
75 
76  //----------------------------------------------------------------------
77  SolarConstraintsNu::SolarConstraintsNu(const double dmsq, const double errorDmsq,
78  const double ss2th, const double errorSs2th)
79  : SolarConstraints(dmsq, errorDmsq, ss2th, errorSs2th)
80  {
81  }
82 
83  //----------------------------------------------------------------------
85  {
87  }
88 
89  //----------------------------------------------------------------------
90  SolarConstraintsNubar::SolarConstraintsNubar(const double dmsq, const double errorDmsq,
91  const double ss2th, const double errorSs2th)
92  : SolarConstraints(dmsq, errorDmsq, ss2th, errorSs2th)
93  {
94  }
95 
96  //----------------------------------------------------------------------
98  {
100  }
101 
102  //----------------------------------------------------------------------
104  {
105  return osc->GetTh12();
106  }
107 
108  //----------------------------------------------------------------------
110  {
112  }
113 
114  //----------------------------------------------------------------------
116  {
118  }
119 
120  //----------------------------------------------------------------------
121  void SolarConstraints::SaveTo(TDirectory* dir, const std::string& name) const
122  {
123  TDirectory* tmp = dir;
124 
125  dir = dir->mkdir(name.c_str()); // switch to subdir
126  dir->cd();
127 
128  TObjString("SolarConstraints").Write("type");
129 
130  TH1D params("", "", 4, 0, 4);
131  params.SetBinContent(1, fCentralDmsq);
132  params.SetBinContent(2, fErrorDmsq);
133  params.SetBinContent(3, fCentralAngle);
134  params.SetBinContent(4, fErrorAngle);
135  params.Write("params");
136 
137  dir->Write();
138  delete dir;
139 
140  tmp->cd();
141  }
142 
143  //----------------------------------------------------------------------
144  std::unique_ptr<SolarConstraints> SolarConstraints::LoadFrom(TDirectory* dir, const std::string& name)
145  {
146  dir = dir->GetDirectory(name.c_str()); // switch to subdir
147  assert(dir);
148 
149  TObjString* tag = (TObjString*)dir->Get("type");
150  assert(tag);
151  assert(tag->GetString() == "SolarConstraints");
152  delete tag;
153 
154  std::unique_ptr<SolarConstraints> ret(new SolarConstraints);
155 
156  TH1* params = (TH1*)dir->Get("params");
157  assert(params);
158 
159  ret->fCentralDmsq = params->GetBinContent(1);
160  ret->fErrorDmsq = params->GetBinContent(2);
161  ret->fCentralAngle = params->GetBinContent(3);
162  ret->fErrorAngle = params->GetBinContent(4);
163 
164  delete dir;
165 
166  return ret;
167  }
168 }
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:92
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:90
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
REGISTER_LOADFROM("BENDecomp", IDecomp, BENDecomp)
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)
enum BeamMode string