7 #include "Utilities/func/MathUtil.h" 42 const NusFlatSyst
kNusNDContSyst (
"ndcont",
"ND Containment", 1.0, 0.6);
43 const NusFlatSyst
kNusNormSyst (
"normNus",
"Normalization", 4.9, 4.9);
50 :
ISyst(shortname, latexname),
65 if(!
fHists.empty())
return;
74 std::vector<std::string>
channels = {
"NC",
"BG"};
76 const std::vector<int> sigmas = {-1, 0, +1};
77 const std::vector<std::string> sigstr = {
"-1",
"0",
"+1"};
79 for(
int i_chan = 0; i_chan < (
int)channels.size(); ++i_chan) {
80 std::vector< std::pair<int,TH1D*> > curHists;
82 for(
int i_sig = 0; i_sig < (
int)sigmas.size(); ++i_sig) {
85 channels[i_chan].c_str(),
88 sigstr[i_sig].c_str()).Data();
89 TH1D*
h = (TH1D*)
fin.Get(hName.c_str());
92 std::cout <<
"Error: can't find necessary " << hName
99 curHists.emplace_back(sigmas[i_sig], h);
102 fHists.push_back(curHists);
112 assert(0 &&
"Unknown Oscillation Channel");
125 if (sigma <
fHists[chan].front().first)
127 else if (sigma >=
fHists[chan].back().first)
131 if (sigma >=
fHists[chan][
i].first){
142 const double fracpart = sigma -
fHists[
chan][LowIdx].first;
143 const double ret = fracpart*
fHists[
chan][LowIdx+1].second->GetBinContent(bin) +
144 (1-fracpart)*
fHists[chan][LowIdx] .
second->GetBinContent(bin);
154 fDet.compare(
"FD") != 0 &&
155 fDet.compare(
"EX") != 0) {
return; }
157 fDet.compare(
"ND") != 0) {
return; }
173 :
ISyst(shortname, latexname),
190 if(sr->
mc.
nnu == 0)
return;
191 if(sigma == 0)
return;
193 weight *= ((sr->
mc.
nu[0].iscc) ?
204 std::vector<const ISyst*>
systs;
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.
NusFlatSyst(const std::string &shortname, const std::string &latexname, const double &ncWei, const double &bgWei)
const NusSystFromHist kNusNDBirksSyst(kNusAna01SystFile,"ND","NDBirks","Birks C")
virtual const std::string & ShortName() const final
The name printed out to the screen.
caf::Proxy< caf::SRHeader > hdr
const NusFlatSyst kNusNDContSyst("ndcont","ND Containment", 1.0, 0.6)
Proxy for caf::StandardRecord.
caf::Proxy< std::vector< caf::SRNeutrino > > nu
caf::Proxy< short int > nnu
const NusSystFromHist kNusNDCalibSlopeYSyst(kNusAna01SystFile,"ND","NDCalSlopeY","Sloped Miscalibration, Y")
Encapsulate code to systematically shift a caf::SRProxy.
const NusSystFromHist kNusCalibFlatSyst(kNusAna01SystFile,"EX","CalFlat","Flat Miscalibration")
const NusSystFromHist kNusNDNDRockSyst(kNusAna01SystFile,"ND","NDRock","ND Rock")
const NusSystFromHist kNusBeamSysts(kNusAna01SystFile,"EX","Beam","All Beam")
const NusSystFromHist kNusNDCalibSlopeXSyst(kNusAna01SystFile,"ND","NDCalSlopeX","Sloped Miscalibration, X")
std::vector< std::vector< std::pair< int, TH1D * > > > fHists
std::vector< const ISyst * > getAllNusSysts()
Get a vector of all the nus group systs.
std::map< ToFCounter, std::vector< unsigned int > > channels
const Var kCaloE
Summed calorimetric energy of all hits in slice, uncorrected.
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
const NusSystFromHist kNusBirksSyst(kNusAna01SystFile,"EX","Birks","Birks C")
const NusFlatSyst kNusMCStatsSyst("mcstat","MC Stats", 2.0, 4.8)
const NusSystFromHist kNusGENIESmallSysts(kNusAna01SystFile,"EX","GENIESm","Summed small GENIE Systs")
const std::string kNusAna01SystFile
const NusSystFromHist kNusNueCCSyst(kNusAna01SystFile,"EX","NueCC","#nu_{e} CC Background")
caf::Proxy< caf::SRTruthBranch > mc
const NusSystFromHist kNusNDGENIESmallSysts(kNusAna01SystFile,"ND","NDGENIESm","Summed small GENIE Systs")
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
NusSystFromHist(const std::string &fname, const std::string &det, const std::string &shortname, const std::string &latexname)
const NusSystFromHist kNusCalibRelSyst(kNusAna01SystFile,"EX","CalRel","Relative Detector Miscalibration")
const NusFlatSyst kNusNormSyst("normNus","Normalization", 4.9, 4.9)
double WeightFor(NusChannel chan, double sigma, double nueenergy) const
assert(nhit_max >=nhit_nbins)
const NusSystFromHist kNusNDRockSyst(kNusAna01SystFile,"EX","NDNDRock","ND Rock")
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
const NusSystFromHist kNusNDNumuCCSyst(kNusAna01SystFile,"ND","NDNumuCC","#nu_{#mu} CC Background")
const NusSystFromHist kNusCalibSlopeXSyst(kNusAna01SystFile,"EX","CalSlopeX","Sloped Miscalibration, X")
const NusSystFromHist kNusCalibSlopeYSyst(kNusAna01SystFile,"EX","CalSlopeY","Sloped Miscalibration, Y")
const NusSystFromHist kNusNDBeamSysts(kNusAna01SystFile,"ND","NDBeam","All Beam")
NusChannel GetNusChannel(caf::SRProxy *sr) const
const NusSystFromHist kNusNDCalibFlatSyst(kNusAna01SystFile,"ND","NDCalFlat","Flat Miscalibration")
const NusSystFromHist kNusNumuCCSyst(kNusAna01SystFile,"EX","NumuCC","#nu_{#mu} CC Background")
const NusSystFromHist kNusNDNueCCSyst(kNusAna01SystFile,"ND","NDNueCC","#nu_{e} CC Background")