48 Spectrum*
intime = LoadFromFile<Spectrum>(
"$NOVA_ANA/steriles/Ana01/fout_nus_ana01_box_opening_restricted.root",
"spec_nus_cale_numi").
release();
51 TH1 *hSpectrum = intime->
ToTH1(intime->
POT());
53 std::cout <<
"Data spectrum: " << data_spec.POT()
55 << data_spec.ToTH1(intime->
POT())->GetSumOfWeights()
60 Spectrum* cosmic_scale = LoadFromFile<Spectrum>(
"$NOVA_ANA/steriles/Ana01/AnaResults.root",
"cosmic__CalE").
release();
64 double totcosmics =
cosmics.ToTH1(intime->
POT())->GetSumOfWeights();
68 TFile input(
"$NOVA_ANA/steriles/Ana01/nus_ana01_prediction.root",
"READ");
71 std::unique_ptr<PredictionInterp> pred_p1p2e3b =
74 std::unique_ptr<PredictionInterp> pred_e3c =
77 const double pot_p1p2e3b =
86 {&(*pred_p1p2e3b),pot_p1p2e3b},
87 {&(*pred_e3c),pot_e3ce3d}
92 calc4f->SetNFlavors(4);
94 calc4f->SetAngle(2, 4, 0.);
95 calc4f->SetAngle(3, 4, 0.);
101 double widthX = (maxX-minX)/(NX-1);
107 double widthY = (maxY-
minY)/(NY-1);
109 assert(
bin < NX*NY &&
"Invalid bin number");
111 int binX =
bin - NX*binY;
112 double centerX = minX + binX*widthX;
113 double centerY = minY + binY*widthY;
116 std::vector<const IFitVar*> fitvars;
127 for(
int iTrial = 0; iTrial < nTrials; ++iTrial){
139 while (trueX < minX || trueX > maxX)
140 trueX = rnd.Uniform(centerX-widthX/2,centerX+widthX/2);
142 while (trueY < minY || trueY > maxY)
143 trueY = rnd.Uniform(centerY-widthY/2,centerY+widthY/2);
189 if (trueChi < bestChi) {
195 FCPoint pt(trueX, trueY, trueChi,bestX, bestY, bestChi,0);
196 if (100*iTrial % nTrials == 0){
197 std::cout <<
"Trial: " << iTrial <<
", TrueX: " << trueX <<
", Y: " << trueY <<
", trueChi: " << trueChi <<
", bestX: " << bestX <<
", Y: " << bestY <<
", bestChi: " << bestChi <<
", true-best: " << trueChi-bestChi <<
std::endl;
206 fccol.
SaveToFile(
"FCCol_"+binname+
"_"+number+
".root");
TCut intime("tave>=217.0 && tave<=227.8")
Cuts and Vars for the 2020 FD DiF Study.
const double kSecondAnaPeriod2POT
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
A simple Gaussian constraint on an arbitrary IFitVar.
const double kSecondAnaEpoch3dPOT
void AddPoint(const FCPoint &p)
const double kSecondAnaEpoch3bPOT
Adapt the PMNS_Sterile calculator to standard interface.
const FitTheta23InDegreesSterile kFitTheta23InDegreesSterile
const double kSecondAnaPeriod1POT
const FitTheta24InDegreesSterile kFitTheta24InDegreesSterile
Spectrum MockData(double pot, int seed=0) const
Mock data is FakeData with Poisson fluctuations applied.
Representation of a spectrum in any variable, with associated POT.
Represents the results of a single Feldman-Cousins pseudo-experiment.
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
osc::OscCalcSterile * DefaultSterileCalc(int nflavors)
Create a sterile calculator with default assumptions for all parameters.
std::vector< const ISyst * > getAllNusSysts()
Get a vector of all the nus group systs.
double GetValue(const osc::IOscCalcAdjustable *osc) const override
virtual std::unique_ptr< IFitSummary > Fit(osc::IOscCalcAdjustable *seed, SystShifts &bestSysts=junkShifts, const SeedList &seedPts=SeedList(), const std::vector< SystShifts > &systSeedPts={}, Verbosity verb=kVerbose) const
Master fitting method. Depends on FitHelper and FitHelperSeeded.
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
void ResetSterileCalcToDefault(osc::OscCalcSterile *calc)
Reset calculator to default assumptions for all parameters.
Combine multiple component experiments.
void SetAngle(int i, int j, double th)
double GetValue(const osc::IOscCalcAdjustable *osc) const override
static std::unique_ptr< PredictionInterp > LoadFrom(TDirectory *dir, const std::string &name)
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
void make_nus_fc_surfs(int nTrials=100, int bin=0, int Idx=0)
assert(nhit_max >=nhit_nbins)
const FitTheta34InDegreesSterile kFitTheta34InDegreesSterile
void ResetAngles(osc::OscCalcSterile *calc)
const double kSecondAnaEpoch3cPOT
Sum MC predictions from different periods scaled according to data POT targets.
std::string to_string(ModuleType mt)
void SaveToFile(const std::string &fname) const
const double kSecondAnaPOT
double Livetime() const
Seconds. For informational purposes only. No calculations use this.
Compare a data spectrum to MC expectation using only the event count.
Collection of FCPoint. Serializable to/from a file.
Perform MINUIT fits in one or two dimensions.