81 double tmin = cfg.TruthBinning[0];
82 double tmax = cfg.TruthBinning.back();
84 std::vector<TH1 *> bg_syst_hists;
85 std::vector<TH1 *> bg_nom_hists;
86 std::vector<TH1 *> sig_syst_hists;
87 std::vector<TH1 *> sig_nom_hists;
88 std::vector<TH1 *> inc_nom_hists;
89 std::vector<TH1 *> inc_syst_hists;
91 for (
size_t i = 0; i < cfg.ChannelNames.size(); ++i) {
94 for (
size_t j = 0; j < cfg.BackgroundTopology.size(); ++j) {
95 int topo = cfg.BackgroundTopology[j];
98 bg_nom_hists.push_back(
100 cfg.MCFileNames[i], cfg.RecoTreeName, cfg.RecoBinning,
101 cfg.ChannelNames[i], cfg.BackgroundTopologyName[j], topo,
102 cfg.EndZCut, tmin, tmax,
false, 0));
105 for (
size_t k = 0;
k < cfg.SystToConsider.size(); ++
k) {
106 std::cout <<
"Considering " << cfg.SystToConsider[
k] <<
std::endl;
107 for (
auto const m : {-1, 1}) {
108 bg_syst_hists.push_back(
110 cfg.MCFileNames[i], cfg.RecoTreeName, cfg.RecoBinning,
111 cfg.ChannelNames[i], cfg.BackgroundTopologyName[j], topo,
112 cfg.EndZCut, tmin, tmax,
false,
113 m, cfg.SystToConsider[
k]));
122 for (
size_t j = 0; j < cfg.SignalTopology.size(); ++j) {
123 int topo = cfg.SignalTopology[j];
124 for (
size_t k = 1;
k < cfg.TruthBinning.size(); ++
k) {
127 sig_nom_hists.push_back(
129 cfg.MCFileNames[i], cfg.RecoTreeName, cfg.RecoBinning,
130 cfg.ChannelNames[i], cfg.SignalTopologyName[j], topo,
131 cfg.TruthBinning[
k-1], cfg.TruthBinning[
k], cfg.EndZCut,
135 for (
size_t m = 0;
m < cfg.SystToConsider.size(); ++
m) {
136 for (
auto const n : {-1, 1}) {
137 std::cout <<
"Considering " << cfg.SystToConsider[
m] <<
std::endl;
138 sig_syst_hists.push_back(
140 cfg.MCFileNames[i], cfg.RecoTreeName, cfg.RecoBinning,
141 cfg.ChannelNames[i], cfg.SignalTopologyName[j], topo,
142 cfg.TruthBinning[
k-1], cfg.TruthBinning[
k], cfg.EndZCut,
144 n, cfg.SystToConsider[
m]));
156 for (
size_t j = 0; j < cfg.IncidentTopology.size(); ++j) {
160 cfg.IncidentMCFileNames[0], cfg.RecoTreeName, cfg.RecoBinning,
161 cfg.IncidentTopologyName[j], cfg.IncidentTopology[j],
162 0., 10000., cfg.EndZCut,
false);
163 for (
size_t k = 1;
k < cfg.IncidentMCFileNames.size(); ++
k) {
167 cfg.IncidentMCFileNames[
k], cfg.RecoTreeName, cfg.RecoBinning,
168 cfg.IncidentTopologyName[j], cfg.IncidentTopology[j],
169 0., 10000., cfg.EndZCut,
false));
171 inc_nom_hists.push_back(temp_hist);
174 for (
size_t m = 0;
m < cfg.SystToConsider.size(); ++
m) {
175 for (
auto const n : {-1, 1}) {
176 std::cout <<
"Considering " << cfg.SystToConsider[
m] <<
std::endl;
180 cfg.IncidentMCFileNames[0], cfg.RecoTreeName, cfg.RecoBinning,
181 cfg.IncidentTopologyName[j], cfg.IncidentTopology[j],
182 0., 10000., cfg.EndZCut,
false,
n, cfg.SystToConsider[
m]);
183 for (
size_t k = 1;
k < cfg.IncidentMCFileNames.size(); ++
k) {
186 cfg.IncidentMCFileNames[
k], cfg.RecoTreeName, cfg.RecoBinning,
187 cfg.IncidentTopologyName[j], cfg.IncidentTopology[j],
188 0., 10000., cfg.EndZCut,
false,
n, cfg.SystToConsider[
m]));
190 inc_syst_hists.push_back(temp_hist);
TH1 * FillMCIncidentHistogram_Pions(std::string filename, std::string treename, std::vector< double > recoBins, std::string topo, int toponum, double reco_beam_endZ_cut, double minval=0., double maxval=100000., bool doNegativeReco=false, int doSyst=0, std::string systName="", double weight=1.0, std::pair< double, double > PiMuScale={1., 1.})
std::string fcl_file_name
TH1 * FillMCBackgroundHistogram_Pions(std::string filename, std::string treename, std::vector< double > recoBins, std::string channel, std::string topo, int toponum, double endZ_cut, double minval=0.0, double maxval=100000.0, bool doNegativeReco=false, int doSyst=0, std::string systName="", double weight=1.0, std::pair< double, double > PiMuScale={1., 1.})
fhicl::ParameterSet makeParameterSet(std::string file)
bool parseArgs(int argc, char **argv)
void saveHists(std::vector< TH1 * > &vec)
std::string output_file_name
void makeFracErrorHist(TH1 *variation, TH1 *nominal)
TH1 * FillMCSignalHistogram_Pions(std::string filename, std::string treename, std::vector< double > recoBins, std::string channel, std::string topo, int toponum, double minval, double maxval, double endZ_cut, bool doNegativeReco=false, int doSyst=0, std::string systName="", double weight=1.0, std::pair< double, double > PiMuScale={1., 1.})
QTextStream & endl(QTextStream &s)