34 double flux = hflux->Integral();
36 for(
int iBinX = 1; iBinX<=xsec->GetXaxis()->GetNbins(); iBinX++)
38 for(
int iBinY = 1; iBinY<=xsec->GetYaxis()->GetNbins(); iBinY++)
40 double binwidth = xsec->GetXaxis()->GetBinWidth(iBinX)*xsec->GetYaxis()->GetBinWidth(iBinY);
41 double newcontent = xsec->GetBinContent(iBinX,iBinY)/binwidth;
42 xsec->SetBinContent(iBinX,iBinY,newcontent);
46 xsec->Scale(1./ntargs);
63 double flux = hflux->Integral();
65 for(
int iBinX = 1; iBinX<=xsec->GetXaxis()->GetNbins(); iBinX++)
67 double binwidth = xsec->GetXaxis()->GetBinWidth(iBinX);
68 double newcontent = xsec->GetBinContent(iBinX)/binwidth;
69 xsec->SetBinContent(iBinX,newcontent);
73 xsec->Scale(1./ntargs);
106 h->GetYaxis()->SetTitle(
"Flux / POT / m^{2}");
141 (dir->GetDirectory(
"fData")).
release();
143 (dir->GetDirectory(
"fMC")).
release();
144 Spectrum* mcsig= ana::LoadFrom<Spectrum>
145 (dir->GetDirectory(
"fMCSig")).
release();
146 Spectrum* mcsignutree = ana::LoadFrom<Spectrum>
147 (dir->GetDirectory(
"fMCSigNuTree")).
release();
149 (dir->GetDirectory(
"fRecoTrue")).
release();
152 (dir->GetDirectory(
"fBkgdEst")).
release();
155 TVector3*
min = (TVector3*)dir->Get(
"fFidMin");
156 TVector3*
max = (TVector3*)dir->Get(
"fFidMax");
159 (dir->GetDirectory(
"fFlux")).
release();
161 return std::unique_ptr<NumuCC2p2hAnalysis>(
new NumuCC2p2hAnalysis(*data, *mc, mcsig, mcsignutree, *rt, bkgdest,
162 (*unfoldreg)[0], unfoldmethod, *min, *max, flux));
170 (dir->GetDirectory(
"fData")).
release();
172 (dir->GetDirectory(
"fMC")).
release();
173 Spectrum* mcsig= ana::LoadFrom<Spectrum>
174 (dir->GetDirectory(
"fMCSig")).
release();
175 Spectrum* mcsignutree = ana::LoadFrom<Spectrum>
176 (dir->GetDirectory(
"fMCSigNuTree")).
release();
178 (dir->GetDirectory(
"fRecoTrue")).
release();
181 (dir->GetDirectory(
"fBkgdEst")).
release();
184 TVector3*
min = (TVector3*)dir->Get(
"fFidMin");
185 TVector3*
max = (TVector3*)dir->Get(
"fFidMax");
188 (dir->GetDirectory(
"fFlux")).
release();
190 return std::unique_ptr<NumuCC2p2hAnalysis>(
new NumuCC2p2hAnalysis(*data, *mc, mcsig, mcsignutree, *rt, bkgdest, nTargets,
191 (*unfoldreg)[0], unfoldmethod, *min, *max, flux));
TH2 * ToTH2(double exposure, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Spectrum must be 2D to obtain TH2.
Cuts and Vars for the 2020 FD DiF Study.
IBkgdEstimator * fBkgdEst
Spectrum UnfoldedSignal(Spectrum signal, ReweightableSpectrum *rt=NULL)
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.
Spectrum with the value of a second variable, allowing for reweighting
virtual Spectrum Background() const =0
Representation of a spectrum in any variable, with associated POT.
const XML_Char const XML_Char * data
virtual double NTargets()
Default implementation returns number of nucleons. Override if needed.
TH2 * PlotBackgroundEstimate2D()
Spectrum SignalEst(Spectrum bkgd)
Represent the ratio between two spectra.
TH2D * PlotRecoToTrueMatrix2D()
static float min(const float a, const float b, const float c)
UnfoldMethod_t
Enumerator for unfolding methods. TODO: Allow swapping to RooUnfold, TUnfold, etc?
TH1 * PlotFluxEstimate2D()
std::unique_ptr< IBkgdEstimator > LoadFrom< IBkgdEstimator >(TDirectory *dir, const std::string &label)
static std::unique_ptr< NumuCC2p2hAnalysis > LoadFrom(TDirectory *dir)
ReweightableSpectrum fRecoTrue
TH2 * PlotSignalEstimate2D()
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
TH2 * ToTH2(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
For use with Var2D.
TH2D * ToTH2(double pot) const
TH2 * PlotUnfoldedSignal2D()