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;
98 bg_nom_hists.push_back(
102 cfg.
EndZCut, tmin, tmax,
false, 0));
107 for (
auto const m : {-1, 1}) {
108 bg_syst_hists.push_back(
112 cfg.
EndZCut, tmin, tmax,
false,
127 sig_nom_hists.push_back(
136 for (
auto const n : {-1, 1}) {
138 sig_syst_hists.push_back(
162 0., 10000., cfg.
EndZCut,
false);
169 0., 10000., cfg.
EndZCut,
false));
171 inc_nom_hists.push_back(temp_hist);
175 for (
auto const n : {-1, 1}) {
190 inc_syst_hists.push_back(temp_hist);
212 for (
auto *
h : vec) {
224 variation->Add(nominal);
230 variation->Divide(nominal);
235 bool found_fcl_file =
false;
236 bool found_output_file =
false;
238 for (
int i = 1; i < argc; ++i) {
239 if ((
strcmp(argv[i],
"--help") == 0) || (
strcmp(argv[i],
"-h") == 0)) {
240 std::cout <<
"Usage: ./Geant4ReweightSysts -c <fitter_config>.fcl " <<
247 else if (
strcmp(argv[i],
"-c") == 0) {
249 found_fcl_file =
true;
252 else if (
strcmp(argv[i],
"-o") == 0) {
254 found_output_file =
true;
259 if (!found_fcl_file || !found_output_file) {
260 std::cout <<
"Error: Must provide fcl file with options '-c' and '-o'" <<
272 char const* fhicl_env =
getenv(
"FHICL_FILE_PATH");
275 if (fhicl_env ==
nullptr) {
276 std::cerr <<
"Expected environment variable FHICL_FILE_PATH is missing" <<
277 " or empty: using \".\"\n";
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.})
string_v IncidentMCFileNames
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)
static ParameterSet make(intermediate_table const &tbl)
std::vector< std::string > string_v
bool parseArgs(int argc, char **argv)
string_v BackgroundTopologyName
string_v IncidentTopologyName
void saveHists(std::vector< TH1 * > &vec)
std::string TruthTreeName
std::string getenv(std::string const &name)
std::vector< double > double_v
std::string output_file_name
void makeFracErrorHist(TH1 *variation, TH1 *nominal)
int main(int argc, char **argv)
systConfig(const fhicl::ParameterSet &pset)
int strcmp(const String &s1, const String &s2)
string_v SignalTopologyName
auto const & get(AssnsNode< L, R, D > const &r)
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)