NumuCCIncPionTemplateFitter.h
Go to the documentation of this file.
1 
2 #pragma once
3 
5 
6 //ROOT Includes
7 #include "Utilities/rootlogon.C"
8 #include "TH1.h"
9 #include "TH2.h"
10 #include "THStack.h"
11 #include "TCanvas.h"
12 #include "TLegend.h"
13 #include "TStyle.h"
14 #include "TFile.h"
15 #include <vector>
16 #include <math.h>
17 #include "TLine.h"
18 #include "TFile.h"
19 #include "TTree.h"
20 #include "TCanvas.h"
21 #include "TF1.h"
22 #include "TH1F.h"
23 #include "TH2F.h"
24 #include "TF2.h"
25 #include "TH2.h"
26 #include "TCutG.h"
27 #include "TMath.h"
28 #include "TCanvas.h"
29 #include "TStyle.h"
30 #include "TRandom.h"
31 #include "TGraph.h"
32 #include "TColor.h"
33 #include "TF3.h"
34 #include "TH3.h"
35 #include "TH3F.h"
36 #include "TMinuit.h"
37 #include "TLegend.h"
38 #include "THStack.h"
39 #include "TMatrix.h"
40 #include "TGraphErrors.h"
41 #include "TGraph.h"
42 #include "TDecompLU.h"
43 #include "TDecompSVD.h"
44 #include "TRandom.h"
45 
46 //C++
47 #include <iostream>
48 #include <fstream>
49 #include <iomanip>
50 #include <vector>
51 #include <cmath>
52 #include <math.h>
53 #include <string>
54 #include <stdint.h>
55 #include <sstream>
56 #include <functional>
57 
58 namespace ana
59 {
60 
62  public:
64  std::vector<TH2F*> templates,
65  std::vector<TH2F*> analysis,
66  TH2F* cv,
67  std::vector<TH2F*> systs_up,
68  std::vector<TH2F*> systs_down,
69  std::vector<TH2F*> systs_oneside,
70  std::vector<TH2F*> multiverse,
71  std::vector<TH2F*> ppfx,
72  int numbins);
74 
75  std::pair<double,double> signal_wei;
76  std::pair<double,double> other_wei;
77  std::pair<double,double> cc0pi_wei;
78  double fit_covariance_matrix[3][3];
79  double chisquared;
80 
81  void PrintValueHolders(int binx);
82  void FCNMinuit();
83  std::vector<TH2F*> doFullFit();
84  //Function That Can Be used after the full fit is performed
85  std::vector<TH1F*> getPIDFitTemplates(int binx);
86  std::vector<std::pair<TH2F*,TH2F*>> getFitNormalizationAndErrors();
87  //Functions That Can Be used at any point
88  std::vector<TH1F*> getPIDTemplates(int binx);
94 
95 
96  private:
97 
98  void FillValueHolders(int binx);
99  bool CheckSystsSize();
100  std::vector<TH2F*> GetAnalysisTemplates();
102  bool CheckIfBinShouldBeUsed(int binx);
103  std::vector<TH1F*> CalculateOneSigmaShift(int binx);
104  void FillCovarianceMatrix(int binx);
106  double GetCovarianceMatrixValue(int binx, int biny);
108  static void fcn3Var(Int_t &npar, Double_t *gin,
109  Double_t &f, Double_t *par, Int_t iflag);
110  double myFunction3Vars(double numu_par,double nue_par,double nc_par);
111  static void fcn2Var(Int_t &npar, Double_t *gin,
112  Double_t &f, Double_t *par, Int_t iflag);
113  double myFunction2Vars(double bkgd_par,double nue_par);
114  void SetBinWeightsAndErrors2D(int binx);
116  std::vector<std::pair<double,double>> GetTemplateWeightsAndErrors(int binx);
117  std::vector<TH1F*> GetTemplates(int binx,std::string name);
118  TH2F* FillCovarianceBetweenSysts(int binx);
119 
120 
121  TH2F* hData2D;
122  std::vector<TH2F*> hTemplates2D;
123  std::vector<TH2F*> hAnalysis2D;
124  TH2F* hCV2D;
125  std::vector<TH2F*> hSystsUp2D;
126  std::vector<TH2F*> hSystsDown2D;
127  std::vector<TH2F*> hSystsOneSided;
128  std::vector<TH2F*> hSystsMultiverse;
129  std::vector<TH2F*> hSystsPPFX;
136  TH1F* hNCError1D;
138 
139 
140  double DataValues[25];
141  double SignalLike_Values[25];
142  double CC0Pi_Values[25];
143  double Other_Values[25];
144  double CovarianceMatrix[25][25];
145  double StatCovarianceMatrix[25][25];
146  //*/
147 
148 
149  };//end class def
150 }
const XML_Char * name
Definition: expat.h:151
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
double myFunction3Vars(double numu_par, double nue_par, double nc_par)
double GetStatisticCovarianceMatrixValue(int binx, int biny)
Int_t par
Definition: SimpleIterate.C:24
static void fcn3Var(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
const Binning binx
Definition: SINCpi0_Bins.h:6
static void fcn2Var(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
double myFunction2Vars(double bkgd_par, double nue_par)
double GetCovarianceMatrixValue(int binx, int biny)
const std::string cv[Ncv]
NumuCCIncPionTemplateFitter(TH2F *da, std::vector< TH2F * > templates, std::vector< TH2F * > analysis, TH2F *cv, std::vector< TH2F * > systs_up, std::vector< TH2F * > systs_down, std::vector< TH2F * > systs_oneside, std::vector< TH2F * > multiverse, std::vector< TH2F * > ppfx, int numbins)
std::vector< std::pair< TH2F *, TH2F * > > getFitNormalizationAndErrors()
const Binning biny
Definition: SINCpi0_Bins.h:7
std::vector< TH1F * > GetTemplates(int binx, std::string name)
std::vector< std::pair< double, double > > GetTemplateWeightsAndErrors(int binx)
std::vector< TH1F * > getPIDTemplates(int binx)
std::vector< TH1F * > getPIDFitTemplates(int binx)
std::vector< TH1F * > CalculateOneSigmaShift(int binx)
enum BeamMode string