7 #include "Utilities/func/MathUtil.h" 62 const Nus17FlatSyst
kNus17NormSyst (
"normNus17",
"Normalization", 4.9, 4.9);
64 const Nus17FlatSyst
kNusFDPPFXSyst (
"ppfx_fd",
"Fluxweight_fd",0.96,2.8);
71 :
ISyst(shortname, latexname),
86 if(!
fHists.empty())
return;
95 std::vector<std::string>
channels = {
"NC",
"BG"};
97 const std::vector<int> sigmas = {-1, 0, +1};
98 const std::vector<std::string> sigstr = {
"-1",
"0",
"+1"};
100 for(
int i_chan = 0; i_chan < (
int)channels.size(); ++i_chan) {
101 std::vector< std::pair<int,TH1D*> > curHists;
103 for(
int i_sig = 0; i_sig < (
int)sigmas.size(); ++i_sig) {
106 channels[i_chan].c_str(),
109 sigstr[i_sig].c_str()).Data();
110 TH1D*
h = (TH1D*)
fin.Get(hName.c_str());
113 std::cout <<
"Error: can't find necessary " << hName
120 curHists.emplace_back(sigmas[i_sig], h);
123 fHists.push_back(curHists);
133 assert(0 &&
"Unknown Oscillation Channel");
146 if (sigma <
fHists[chan].front().first)
148 else if (sigma >=
fHists[chan].back().first)
152 if (sigma >=
fHists[chan][
i].first){
163 const double fracpart = sigma -
fHists[
chan][LowIdx].first;
164 const double ret = fracpart*
fHists[
chan][LowIdx+1].second->GetBinContent(bin) +
165 (1-fracpart)*
fHists[chan][LowIdx] .
second->GetBinContent(bin);
175 fDet.compare(
"FD") != 0 &&
176 fDet.compare(
"EX") != 0) {
return; }
178 fDet.compare(
"ND") != 0) {
return; }
195 :
ISyst(shortname, latexname),
212 if(sr->
mc.
nnu == 0)
return;
213 if(sigma == 0)
return;
215 weight *= ((sr->
mc.
nu[0].iscc) ?
Near Detector underground.
T max(const caf::Proxy< T > &a, T b)
Far Detector at Ash River.
Cuts and Vars for the 2020 FD DiF Study.
virtual const std::string & ShortName() const final
The name printed out to the screen.
caf::Proxy< caf::SRHeader > hdr
Proxy for caf::StandardRecord.
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Nus17FlatSyst(const std::string &shortname, const std::string &latexname, const double &ncWei, const double &bgWei)
const Nus17FlatSyst kNus17OscParamSysts("oscparm","Oscillation_Parameter", 0.7, 10.7)
caf::Proxy< short int > nnu
const Nus17FlatSyst kNus17NormSyst("normNus17","Normalization", 4.9, 4.9)
Encapsulate code to systematically shift a caf::SRProxy.
NusChannel GetNusChannel(caf::SRProxy *sr) const
const Var kNus17Energy([](const caf::SRProxy *sr){double cale=sr->slc.calE;double recoE=0.;if(sr->hdr.det==caf::kFARDET) recoE=FDscaleCalE17 *cale;if(sr->hdr.det==caf::kNEARDET) recoE=NDscaleCalE17 *cale;return recoE;})
std::map< ToFCounter, std::vector< unsigned int > > channels
double WeightFor(NusChannel chan, double sigma, double nueenergy) const
caf::Proxy< caf::SRTruthBranch > mc
std::vector< std::vector< std::pair< int, TH1D * > > > fHists
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
assert(nhit_max >=nhit_nbins)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
const Nus17FlatSyst kNusFDPPFXSyst("ppfx_fd","Fluxweight_fd", 0.96, 2.8)
Nus17SystFromHist(const std::string &fname, const std::string &det, const std::string &shortname, const std::string &latexname)