#include <NuMIFluxSysts.h>
Definition at line 12 of file NuMIFluxSysts.h.
ana::NuMIFluxSyst::~NuMIFluxSyst |
( |
| ) |
|
|
virtual |
Definition at line 18 of file NuMIFluxSysts.cxx.
20 for(
int i = 0; i < 2; ++i)
21 for(
int j = 0; j < 2; ++j)
22 for(
int k = 0;
k < 2; ++
k)
ana::NuMIFluxSyst::NuMIFluxSyst |
( |
const std::string & |
dir, |
|
|
const std::string & |
prefix, |
|
|
const std::string & |
name |
|
) |
| |
|
inlineprotected |
Definition at line 24 of file NuMIFluxSysts.h.
ISyst(const std::string &shortName, const std::string &latexName, bool applyPenalty=true, double min=-3, double max=+3)
void ana::NuMIFluxSyst::Shift |
( |
double |
sigma, |
|
|
caf::SRSliceProxy * |
sr, |
|
|
double & |
weight |
|
) |
| const |
|
overridevirtual |
Perform the systematic shift.
- Parameters
-
sigma | Number of sigma to shift record by |
sr | The record to inspect and alter |
weight | Scale this weight for reweighting systematics |
Implements ana::ISyst.
Definition at line 27 of file NuMIFluxSysts.cxx.
29 if(slc->truth.index < 0)
return;
32 if(slc->truth.baseline < 500){
33 std::cout <<
"Using NuMIFluxSyst on what appears not to be an icarus file (baseline = " << slc->truth.baseline <<
")!" << std::endl;
38 const char* sbndata = getenv(
"SBNDATA_DIR");
40 std::cout <<
"NuMIFluxSysts: $SBNDATA_DIR environment variable not set. Please setup the sbndata product." << std::endl;
44 const std::string
fname = std::string(sbndata)+
"/beamData/NuMIdata/icarus_numi_flux_syst_ana.root";
45 TFile f(fname.c_str());
47 std::cout <<
"NuMIFluxSysts: Failed to open " << fname << std::endl;
51 for(
int hcIdx: {0, 1}){
52 for(
int flavIdx: {0, 1}){
53 for(
int signIdx: {0, 1}){
55 if(hcIdx == 0) hName +=
"_fhc";
else hName +=
"_rhc";
56 if(flavIdx == 0) hName +=
"_nue";
else hName +=
"_numu";
57 if(signIdx == 1) hName +=
"bar";
59 TH1*
h = (TH1*)f.Get(hName.c_str());
61 std::cout <<
"NuMIFluxSysts: failed to find " << hName <<
" in " << f.GetName() << std::endl;
67 fScale[hcIdx][flavIdx][signIdx] =
h;
73 const int flav =
abs(slc->truth.initpdg);
74 if(flav != 12 && flav != 14)
return;
77 const int flavIdx = (flav == 12) ? 0 : 1;
78 const int signIdx = (slc->truth.initpdg > 0) ? 0 : 1;
80 TH1* h =
fScale[hcIdx][flavIdx][signIdx];
83 const int bin = h->FindBin(slc->truth.E);
85 if(bin == 0 || bin == h->GetNbinsX()+1)
return;
87 weight *= 1 + sigma*h->GetBinContent(bin);
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
std::string UniqueName()
Return a different string each time, for creating histograms.
BEGIN_PROLOG could also be cout
const NuMIFluxSyst* GetNuMIFluxSyst |
( |
const std::string & |
, |
|
|
const std::string & |
, |
|
|
const std::string & |
|
|
) |
| |
|
friend |
Definition at line 91 of file NuMIFluxSysts.cxx.
96 static std::map<std::string, const NuMIFluxSyst*> cache;
98 const std::string key =
dir+
"/"+prefix+
name;
99 if(cache.count(key) == 0) cache[key] =
new NuMIFluxSyst(
dir, prefix, name);
NuMIFluxSyst(const std::string &dir, const std::string &prefix, const std::string &name)
std::string ana::NuMIFluxSyst::fHistName |
|
protected |
std::string ana::NuMIFluxSyst::fName |
|
protected |
TH1* ana::NuMIFluxSyst::fScale[2][2][2] |
|
mutableprotected |
The documentation for this class was generated from the following files: