All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SolarConstraints.cxx
Go to the documentation of this file.
2 
3 #include "OscLib/IOscCalc.h"
5 
6 #include "TDirectory.h"
7 #include "TH1.h"
8 #include "TObjString.h"
9 
10 #include <cassert>
11 
12 namespace ana
13 {
14  //----------------------------------------------------------------------
16  {
17  // These value are from the 2014 PDG
18  // http://pdg.lbl.gov/2014/tables/rpp2014-sum-leptons.pdf
19  std::cerr << "WARNING: Using 2014 Solar constraints."
20  << "Are you sure you don't want kSolarConstraintsPDG2017 ?"
21  << std::endl;
22 
23  fCentralDmsq = 7.53e-5;
24  fErrorDmsq = 0.18e-5;
25 
26  fCentralAngle = 0.846;
27  fErrorAngle = 0.021;
28  }
29 
30  //----------------------------------------------------------------------
31  SolarConstraints::SolarConstraints(const double dmsq, const double errorDmsq,
32  const double ss2th, const double errorSs2th)
33  :fCentralDmsq (dmsq), fErrorDmsq (errorDmsq),
34  fCentralAngle(ss2th), fErrorAngle(errorSs2th)
35  { }
36 
37  //----------------------------------------------------------------------
39  const SystShifts& /*syst*/) const
40  {
41  double ret = 0;
42 
43  ret += util::sqr((osc->GetDmsq21() - fCentralDmsq)/fErrorDmsq);
44 
45  const double ss2th12 = util::sqr(sin(2*osc->GetTh12()));
46 
47  ret += util::sqr((ss2th12 - fCentralAngle)/fErrorAngle);
48 
49  return ret;
50  }
51 
52  //----------------------------------------------------------------------
53  void SolarConstraints::SaveTo(TDirectory* dir) const
54  {
55  TDirectory* tmp = dir;
56 
57  dir->cd();
58  TObjString("SolarConstraints").Write("type");
59 
60  TH1D params("", "", 4, 0, 4);
61  params.SetBinContent(1, fCentralDmsq);
62  params.SetBinContent(2, fErrorDmsq);
63  params.SetBinContent(3, fCentralAngle);
64  params.SetBinContent(4, fErrorAngle);
65  params.Write("params");
66 
67  tmp->cd();
68  }
69 
70  //----------------------------------------------------------------------
71  std::unique_ptr<SolarConstraints> SolarConstraints::LoadFrom(TDirectory* dir)
72  {
73  TObjString* tag = (TObjString*)dir->Get("type");
74  assert(tag);
75  assert(tag->GetString() == "SolarConstraints");
76 
77  std::unique_ptr<SolarConstraints> ret(new SolarConstraints);
78 
79  TH1* params = (TH1*)dir->Get("params");
80  assert(params);
81 
82  ret->fCentralDmsq = params->GetBinContent(1);
83  ret->fErrorDmsq = params->GetBinContent(2);
84  ret->fCentralAngle = params->GetBinContent(3);
85  ret->fErrorAngle = params->GetBinContent(4);
86 
87  return ret;
88  }
89 }
Constraints on the parameters and from solar experiments.
BEGIN_PROLOG could also be cerr
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:16
virtual void SaveTo(TDirectory *dir) const override
process_name opflashCryoW ana
virtual double ChiSq(osc::IOscCalcAdjustable *osc, const SystShifts &syst=SystShifts::Nominal()) const override
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
tuple dir
Definition: dropbox.py:28
static std::unique_ptr< SolarConstraints > LoadFrom(TDirectory *dir)