All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalcsNuFit_cdr.cxx
Go to the documentation of this file.
2 
4 
5 #include "OscLib/OscCalcPMNSOpt.h"
6 
7 namespace ana
8 {
9  //----------------------------------------------------------------------
11  {
12  assert(hie == +1 || hie == -1);
13 
14  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
15  ret->SetL(1300);
16  ret->SetRho(2.95674); // g/cm^3. Dan Cherdack's doc "used in GLOBES"
17 
18  ret->SetDmsq21(kNuFitDmsq21CV);
19  ret->SetTh12(kNuFitTh12CV);
20 
21  if(hie > 0){
22  ret->SetDmsq32(kNuFitDmsq32CVNH);
23  ret->SetTh23(kNuFitTh23CVNH);
24  ret->SetTh13(kNuFitTh13CVNH);
25  ret->SetdCP(kNuFitdCPCVNH);
26  }
27  else{
28  ret->SetDmsq32(kNuFitDmsq32CVIH);
29  ret->SetTh23(kNuFitTh23CVIH);
30  ret->SetTh13(kNuFitTh13CVIH);
31  ret->SetdCP(kNuFitdCPCVIH);
32  }
33 
34  return ret;
35  }
36 
37  //----------------------------------------------------------------------
39  {
40  assert(hie == +1 || hie == -1);
41 
42  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
43  ret->SetL(1300);
44 
45  // Throw 12 and rho within errors
46  ret->SetRho(2.95674*(1+0.02*gRandom->Gaus()));
47  ret->SetDmsq21(kNuFitDmsq21CV*(1+kNuFitDmsq21Err*gRandom->Gaus()));
48  ret->SetTh12(kNuFitTh12CV*(1+kNuFitTh12Err*gRandom->Gaus()));
49 
50  // Uniform throws within +/-3 sigma
51  if(hie > 0){
52  ret->SetDmsq32(gRandom->Uniform(kNuFitDmsq32CVNH-3*kNuFitDmsq32ErrNH,
54  ret->SetTh23(gRandom->Uniform(kNuFitTh23CVNH-3*kNuFitTh23ErrNH,
56  ret->SetTh13(gRandom->Uniform(kNuFitTh13CVNH-3*kNuFitTh13ErrNH,
58  } else {
59  ret->SetDmsq32(gRandom->Uniform(kNuFitDmsq32CVIH-3*kNuFitDmsq32ErrIH,
61  ret->SetTh23(gRandom->Uniform(kNuFitTh23CVIH-3*kNuFitTh23ErrIH,
63  ret->SetTh13(gRandom->Uniform(kNuFitTh13CVIH-3*kNuFitTh13ErrIH,
65  }
66  ret->SetdCP(gRandom->Uniform(-1*TMath::Pi(), TMath::Pi()));
67 
68  return ret;
69  }
70 
71 
72  //----------------------------------------------------------------------
74  {
75  assert(hie == +1 || hie == -1);
76 
77  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
78  ret->SetL(1300);
79  ret->SetRho(2.95674); // g/cm^3. Dan Cherdack's doc "used in GLOBES"
80 
81  ret->SetDmsq21(kNuFitDmsq21CV + kNuFitDmsq21Err);
82  ret->SetTh12(kNuFitTh12CV + kNuFitTh12Err);
83 
84  if(hie > 0){
85  ret->SetDmsq32(kNuFitDmsq32CVNH + kNuFitDmsq32ErrNH);
86  ret->SetTh23(kNuFitTh23CVNH + kNuFitTh23ErrNH);
87  ret->SetTh13(kNuFitTh13CVNH + kNuFitTh13ErrNH);
88  }
89  else{
90  ret->SetDmsq32(kNuFitDmsq32CVIH + kNuFitDmsq32ErrIH);
91  ret->SetTh23(kNuFitTh23CVIH + kNuFitTh23ErrIH);
92  ret->SetTh13(kNuFitTh13CVIH + kNuFitTh13ErrIH);
93  }
94 
95  ret->SetdCP(0); // a little ambiguous in the instructions
96 
97  return ret;
98  }
99 
100  //----------------------------------------------------------------------
102  const SystShifts& /*syst*/) const
103  {
104  double ret =
105  util::sqr((calc->GetDmsq21() - kNuFitDmsq21CV)/kNuFitDmsq21Err) +
106  util::sqr((calc->GetTh12() - kNuFitTh12CV)/kNuFitTh12Err);
107 
108  if(calc->GetDmsq32() > 0){
109  ret +=
110  util::sqr((calc->GetDmsq32() - kNuFitDmsq32CVNH)/kNuFitDmsq32ErrNH) +
111  util::sqr((calc->GetTh23() - kNuFitTh23CVNH)/kNuFitTh23ErrNH) +
112  util::sqr((calc->GetTh13() - kNuFitTh13CVNH)/kNuFitTh13ErrNH);
113  }
114  else{
115  ret +=
116  util::sqr((calc->GetDmsq32() - kNuFitDmsq32CVIH)/kNuFitDmsq32ErrIH) +
117  util::sqr((calc->GetTh23() - kNuFitTh23CVIH)/kNuFitTh23ErrIH) +
118  util::sqr((calc->GetTh13() - kNuFitTh13CVIH)/kNuFitTh13ErrIH);
119  }
120 
121  // No term in delta
122 
123  return ret;
124  }
125 
126  //----------------------------------------------------------------------
127  Penalizer_GlbLikeCDR::Penalizer_GlbLikeCDR(osc::IOscCalcAdjustable* cvcalc, int hietrue, bool weakOnly) : fWeakOnly(weakOnly) {
128 
129  fDmsq21 = cvcalc->GetDmsq21();
130  fTh12 = cvcalc->GetTh12();
131  fDmsq32 = cvcalc->GetDmsq32();
132  fTh23 = cvcalc->GetTh23();
133  fTh13 = cvcalc->GetTh13();
134  fRho = cvcalc->GetRho();
135 
136  //Set the errors by hand for now.
137  //Fractional errors in GLoBES convention
138  //NH: 0.023, 0.018, 0.058, 0.0, 0.024, 0.016
139  //IH: 0.023, 0.018, 0.048, 0.0, 0.024, 0.016
140 
141  fDmsq21Err = 0.024*fDmsq21;
142  fTh12Err = 0.023*fTh12;
143  fDmsq32Err = 0.016*fDmsq32;
144  fTh13Err = 0.018*fTh13;
145  fTh23Err = (hietrue > 0) ? 0.058*fTh23 : 0.048*fTh23;
146 
147  fRhoErr = 0.02*fRho;
148 
149  }
150 
152  const SystShifts& /*syst*/) const {
153 
154  //Usage: calc is the fit parameters as above
155  //Starting fit parameters and errors are set in constructor - this is equivalent to SetCentralValues in globes
156 
157  double ret =
158  util::sqr((calc->GetDmsq21() - fDmsq21)/fDmsq21Err) +
159  util::sqr((calc->GetTh12() - fTh12)/fTh12Err) +
160  util::sqr((calc->GetRho() - fRho)/fRhoErr);
161 
162  // if fWeakOnly is set, only apply a constraint to the parameter we can only weakly constrain in DUNE
163  if (!fWeakOnly)
164  ret +=
165  util::sqr((calc->GetDmsq32() - fDmsq32)/fDmsq32Err) +
166  util::sqr((calc->GetTh23() - fTh23)/fTh23Err) +
167  util::sqr((calc->GetTh13() - fTh13)/fTh13Err);
168 
169  // No term in delta
170 
171  return ret;
172  }
173 
174 
175 }
Penalizer_GlbLikeCDR(osc::IOscCalcAdjustable *cvcalc, int hietrue, bool weakOnly=false)
osc::IOscCalcAdjustable * NuFitOscCalcCDRPlusOneSigma(int hie)
const double kNuFitDmsq32ErrNH
Definition: CalcsNuFit.h:32
const double kNuFitTh23ErrIH
Definition: CalcsNuFit.h:37
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:16
const double kNuFitDmsq32ErrIH
Definition: CalcsNuFit.h:36
double ChiSq(osc::IOscCalcAdjustable *calc, const SystShifts &syst=SystShifts::Nominal()) const override
process_name opflashCryoW ana
const double kNuFitTh12Err
Definition: CalcsNuFit.h:30
const double kNuFitdCPCVIH
Definition: CalcsNuFit.h:26
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
const double kNuFitDmsq32CVIH
Definition: CalcsNuFit.h:23
osc::IOscCalcAdjustable * ThrownNuFitOscCalcCDR(int hie)
const double kNuFitTh23CVIH
Definition: CalcsNuFit.h:24
double ChiSq(osc::IOscCalcAdjustable *calc, const SystShifts &syst=SystShifts::Nominal()) const override
const double kNuFitTh23CVNH
Definition: CalcsNuFit.h:19
const double kNuFitTh13ErrIH
Definition: CalcsNuFit.h:38
const double kNuFitDmsq21Err
Definition: CalcsNuFit.h:29
const double kNuFitDmsq21CV
Definition: CalcsNuFit.h:14
const double kNuFitdCPCVNH
Definition: CalcsNuFit.h:21
const double kNuFitTh13CVIH
Definition: CalcsNuFit.h:25
const double kNuFitDmsq32CVNH
Definition: CalcsNuFit.h:18
const double kNuFitTh23ErrNH
Definition: CalcsNuFit.h:33
const double kNuFitTh13ErrNH
Definition: CalcsNuFit.h:34
osc::IOscCalcAdjustable * NuFitOscCalcCDR(int hie)
const double kNuFitTh12CV
Definition: CalcsNuFit.h:15
const double kNuFitTh13CVNH
Definition: CalcsNuFit.h:20