Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8725528
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
92 KB
Subscribers
None
View Options
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92577c6..96fd9e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,238 +1,239 @@
# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
################################################################################
# This file is part of NUISANCE.
#
# NUISANCE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# NUISANCE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NUISANCE. If not, see <http://www.gnu.org/licenses/>.
################################################################################
cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
#Use the compilers found in the path
find_program(CMAKE_C_COMPILER NAMES $ENV{CC} gcc PATHS ENV PATH NO_DEFAULT_PATH)
find_program(CMAKE_CXX_COMPILER NAMES $ENV{CXX} g++ PATHS ENV PATH NO_DEFAULT_PATH)
project(NUISANCE)
include(ExternalProject)
enable_language(Fortran)
set (NUISANCE_VERSION_MAJOR 2)
set (NUISANCE_VERSION_MINOR 7)
set (NUISANCE_VERSION_REVISION 0)
set (NUISANCE_VERSION_STRING "v${NUISANCE_VERSION_MAJOR}r${NUISANCE_VERSION_MINOR}")
if(${NUISANCE_VERSION_REVISION} STRGREATER "0")
set (NUISANCE_VERSION_STRING "${NUISANCE_VERSION_STRING}p${NUISANCE_VERSION_REVISION}")
endif()
#Set this to TRUE to enable build debugging messages
set(BUILD_DEBUG_MSGS TRUE)
include(${CMAKE_SOURCE_DIR}/cmake/cmessage.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/cacheVariables.cmake)
cmessage(STATUS "CMAKE_INSTALL_PREFIX: \"${CMAKE_INSTALL_PREFIX}\"")
cmessage(STATUS "CMAKE_BUILD_TYPE: \"${CMAKE_BUILD_TYPE}\"")
################################################################################
# Check Dependencies
################################################################################
################################## ROOT ######################################
include(${CMAKE_SOURCE_DIR}/cmake/ROOTSetup.cmake)
################################# HEPMC ######################################
include(${CMAKE_SOURCE_DIR}/cmake/HepMC.cmake)
############################ Reweight Engines ################################
include(${CMAKE_SOURCE_DIR}/cmake/ReweightEnginesSetup.cmake)
############################ Other Generators ################################
include(${CMAKE_SOURCE_DIR}/cmake/GiBUUSetup.cmake)
if(USE_NUANCE)
LIST(APPEND EXTRA_CXX_FLAGS -D__NUANCE_ENABLED__)
endif()
################################# Pythia6/8 ####################################
include(${CMAKE_SOURCE_DIR}/cmake/pythia6Setup.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/pythia8Setup.cmake)
################################# gperftools ###################################
include(${CMAKE_SOURCE_DIR}/cmake/gperfSetup.cmake)
if(NOT NOTEST)
enable_testing()
endif()
SET(GENERATOR_SUPPORT)
foreach(gen NEUT;NuWro;GENIE;GiBUU;NUANCE)
if(USE_${gen})
SET(GENERATOR_SUPPORT "${GENERATOR_SUPPORT}${gen} ")
endif()
endforeach(gen)
cmessage(STATUS "Generator Input Support: ${GENERATOR_SUPPORT}")
set(MINCODE
Routines
FCN)
set(CORE
MCStudies
Genie
FitBase
Config
Logger
InputHandler
Splines
Utils
Statistical
#Devel
Smearceptance
)
LIST(APPEND ALLEXPERIMENTS
ANL
ArgoNeuT
BEBC
BNL
Electron
FNAL
GGM
K2K
MINERvA
+ MicroBooNE
MiniBooNE
SciBooNE
T2K)
foreach(exp ${ALLEXPERIMENTS})
if(NOT NO_${exp})
LIST(APPEND EXPERIMENTS_TO_BUILD ${exp})
else()
LIST(REVERSE EXTRA_CXX_FLAGS)
LIST(APPEND EXTRA_CXX_FLAGS -D__NO_${exp}__)
LIST(REVERSE EXTRA_CXX_FLAGS)
endif()
endforeach()
################################## COMPILER ####################################
include(${CMAKE_SOURCE_DIR}/cmake/c++CompilerSetup.cmake)
################################### doxygen ###################################
include(${CMAKE_SOURCE_DIR}/cmake/docsSetup.cmake)
################################################################################
set(MINIMUM_INCLUDE_DIRECTORIES)
LIST(APPEND MINIMUM_INCLUDE_DIRECTORIES
${RWENGINE_INCLUDE_DIRECTORIES}
${CMAKE_SOURCE_DIR}/src/FitBase
${CMAKE_SOURCE_DIR}/src/Reweight
${CMAKE_SOURCE_DIR}/src/InputHandler
${CMAKE_SOURCE_DIR}/src/Config
${CMAKE_SOURCE_DIR}/src/Logger
${CMAKE_SOURCE_DIR}/src/Statistical
${CMAKE_SOURCE_DIR}/src/Splines
${CMAKE_SOURCE_DIR}/src/Utils
${CMAKE_SOURCE_DIR}/src/Genie)
#Not yet capable of just building without the rwdirs.
#if(USE_REWEIGHT)
LIST(APPEND MINIMUM_INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}/src/Reweight)
LIST(APPEND CORE Reweight)
#endif()
cmessage(DEBUG "Base include directories: ${MINIMUM_INCLUDE_DIRECTORIES}")
set(EXP_INCLUDE_DIRECTORIES)
foreach(edir ${EXPERIMENTS_TO_BUILD})
LIST(APPEND EXP_INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src/${edir})
endforeach()
cmessage(DEBUG "Included experiments: ${EXP_INCLUDE_DIRECTORIES}")
foreach(mdir ${MINCODE})
cmessage (DEBUG "Configuring directory: src/${mdir}")
add_subdirectory(src/${mdir})
endforeach()
foreach(edir ${EXPERIMENTS_TO_BUILD})
cmessage (DEBUG "Configuring directory: src/${edir}")
add_subdirectory(src/${edir})
endforeach()
foreach(cdir ${CORE})
cmessage (DEBUG "Configuring directory: src/${cdir}")
add_subdirectory(src/${cdir})
endforeach()
cmessage(DEBUG "Module targets: ${MODULETargets}")
add_subdirectory(app)
add_subdirectory(src/Tests)
configure_file(cmake/setup.sh.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh" @ONLY)
install(FILES
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh" DESTINATION
${CMAKE_INSTALL_PREFIX})
configure_file(cmake/MakeBinaryBlob.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/MakeBinaryBlob" @ONLY)
install(PROGRAMS
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/MakeBinaryBlob" DESTINATION
bin)
if(USE_DYNSAMPLES)
SET(ALL_INCLUDES ${MINIMUM_INCLUDE_DIRECTORIES})
LIST(APPEND ALL_INCLUDES ${CMAKE_SOURCE_DIR}/src/Smearceptance)
LIST(APPEND ALL_INCLUDES ${EXP_INCLUDE_DIRECTORIES})
string(REPLACE ";" " -I" ALL_INCLUDES_STR "${ALL_INCLUDES}")
cmessage(DEBUG ${CMAKE_DEPENDLIB_FLAGS})
string(REPLACE "-levent " "" CMAKE_DEPENDLIB_FLAGS_NEW ${CMAKE_DEPENDLIB_FLAGS})
set(CMAKE_DEPENDLIB_FLAGS ${CMAKE_DEPENDLIB_FLAGS_NEW})
cmessage(DEBUG ${CMAKE_DEPENDLIB_FLAGS})
string(REPLACE ";" " -l" ALL_MODULETARGETS_STR "${MODULETargets}")
configure_file(cmake/BuildDynamicSample.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/BuildDynamicSample" @ONLY)
install(PROGRAMS
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/BuildDynamicSample" DESTINATION
bin)
configure_file(cmake/BuildDynamicSmearcepter.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/BuildDynamicSmearcepter" @ONLY)
install(PROGRAMS
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/BuildDynamicSmearcepter" DESTINATION
bin)
endif()
install(PROGRAMS
"${PROJECT_SOURCE_DIR}/scripts/nuiscardgen" DESTINATION
bin)
install(PROGRAMS
"${PROJECT_SOURCE_DIR}/scripts/nuissamples" DESTINATION
bin)
diff --git a/app/PrepareNuwroEvents.cxx b/app/PrepareNuwroEvents.cxx
index 8702d4d..ad41e3f 100644
--- a/app/PrepareNuwroEvents.cxx
+++ b/app/PrepareNuwroEvents.cxx
@@ -1,500 +1,500 @@
#include <stdio.h>
#include <stdlib.h>
#include "event1.h"
// Hopefully we don't need these as they're included above.
// #include "params_all.h"
// #include "params.h"
#include "FitLogger.h"
#include "PlotUtils.h"
#include "TFile.h"
#include "TH1D.h"
#include "TTree.h"
void printInputCommands(char* argv[]) {
std::cout << "[USAGE]: " << argv[0]
<< " [-h] [-f] [-F <FluxRootFile>,<FluxHistName>] [-o output.root] "
"inputfile.root [file2.root ...]"
<< std::endl
<< "\t-h : Print this message." << std::endl
<< "\t-f : Pass -f argument to '$ hadd' invocation." << std::endl
<< "\t-F : Read input flux from input descriptor." << std::endl
<< "\t-o : Write full output to a new file." << std::endl
<< std::endl;
};
void CreateRateHistograms(std::string inputs, bool force_out);
void HaddNuwroFiles(std::vector<std::string>& inputs, bool force_out);
bool outputNewFile = false;
std::string ofile = "";
bool haveFluxInputs = false;
struct FluxInputBlob {
FluxInputBlob(std::string _File, std::string _Hist, int _PDG,
double _Fraction)
: File(_File), Hist(_Hist), PDG(_PDG), Fraction(_Fraction) {}
std::string File;
std::string Hist;
int PDG;
double Fraction;
};
std::vector<FluxInputBlob> FluxInputs;
bool haddedFiles = false;
TH1D* F2D(TH1F* f) {
Double_t* bins = new Double_t[f->GetXaxis()->GetNbins() + 1];
for (Int_t bi_it = 0; bi_it < f->GetXaxis()->GetNbins(); ++bi_it) {
bins[bi_it] = f->GetXaxis()->GetBinLowEdge(bi_it + 1);
}
bins[f->GetXaxis()->GetNbins()] =
f->GetXaxis()->GetBinUpEdge(f->GetXaxis()->GetNbins());
TH1D* d = new TH1D((std::string(f->GetName()) + "_f").c_str(), f->GetTitle(),
f->GetXaxis()->GetNbins(), bins);
std::cout << "Converted TH1F with " << f->GetXaxis()->GetXbins()
<< " bins : " << std::endl;
for (Int_t bi_it = 0; bi_it < f->GetXaxis()->GetNbins() + 2; ++bi_it) {
d->SetBinContent(bi_it, f->GetBinContent(bi_it));
d->SetBinError(bi_it, f->GetBinError(bi_it));
std::cout << "\tF " << f->GetXaxis()->GetBinLowEdge(bi_it) << "--[" << bi_it
<< "]--" << f->GetXaxis()->GetBinUpEdge(bi_it) << ": "
<< f->GetBinContent(bi_it) << " D "
<< d->GetXaxis()->GetBinLowEdge(bi_it) << "--[" << bi_it << "]--"
<< d->GetXaxis()->GetBinUpEdge(bi_it) << ": "
<< d->GetBinContent(bi_it) << std::endl;
}
delete bins;
return d;
}
TH1D* GetTH1DFromFile(std::string const& rootFile,
std::string const& histName) {
TFile* inpFile = new TFile(rootFile.c_str(), "READ");
if (!inpFile || !inpFile->IsOpen()) {
ERR(FTL) << "Cannot open input root file: " << rootFile
<< " to read input histo." << std::endl;
throw;
}
TH1D* histD = dynamic_cast<TH1D*>(inpFile->Get(histName.c_str()));
if (!histD) {
TH1F* histF = dynamic_cast<TH1F*>(inpFile->Get(histName.c_str()));
if (!histF) {
ERR(FTL) << "Cannot find TH1D/F: " << histName
<< " in root file: " << rootFile << "." << std::endl;
throw;
}
histD = F2D(histF);
} else {
histD = static_cast<TH1D*>(histD->Clone());
}
histD->SetDirectory(NULL);
inpFile->Close();
return histD;
}
//*******************************
int main(int argc, char* argv[]) {
//*******************************
// If No Arguments print commands
if (argc == 1) {
printInputCommands(argv);
return 0;
}
std::vector<std::string> inputfiles;
bool force_output = false;
// Get Inputs
for (int i = 1; i < argc; ++i) {
if (!std::strcmp(argv[i], "-h")) {
printInputCommands(argv);
return 0;
} else if (!std::strcmp(argv[i], "-f")) {
force_output = true;
} else if (!std::strcmp(argv[i], "-o")) {
outputNewFile = true;
ofile = argv[++i];
} else if (!std::strcmp(argv[i], "-F")) {
std::string inpLine = argv[++i];
std::vector<std::string> fluxInputDescriptor =
GeneralUtils::ParseToStr(inpLine, ",");
if ((fluxInputDescriptor.size() != 2) &&
(fluxInputDescriptor.size() != 3) &&
(fluxInputDescriptor.size() != 4)) {
ERR(FTL) << "Received -F argument with option: \"" << inpLine
<< "\", was expecting "
"<FluxRootFile>,<FluxHistName>[,PDG[,speciesFraction]]."
<< std::endl;
return 1;
}
haveFluxInputs = true;
FluxInputs.push_back(
FluxInputBlob(fluxInputDescriptor[0], fluxInputDescriptor[1],
(fluxInputDescriptor.size() > 2)
? GeneralUtils::StrToInt(fluxInputDescriptor[2])
: 14,
(fluxInputDescriptor.size() > 3)
? GeneralUtils::StrToDbl(fluxInputDescriptor[3])
: 1));
if (!FluxInputs.back().File.length() ||
!FluxInputs.back().Hist.length()) {
ERR(FTL) << "Received -F argument with option: \"" << inpLine
<< "\", was expecting "
"<FluxRootFile>,<FluxHistName>[,PDG[,speciesFraction]]."
<< std::endl;
return 1;
}
} else {
inputfiles.push_back(std::string(argv[i]));
}
}
// If one input file just create flux histograms
if (inputfiles.size() > (UInt_t)1) {
HaddNuwroFiles(inputfiles, force_output);
} else if (inputfiles.size() < (UInt_t)1) {
printInputCommands(argv);
}
CreateRateHistograms(inputfiles[0], force_output);
LOG(FIT) << "Finished NUWRO Prep." << std::endl;
};
//*******************************
void CreateRateHistograms(std::string inputs, bool force_out) {
//*******************************
// Open root file
TFile* outRootFile = 0;
TTree* nuwrotree = 0;
if (!haddedFiles &&
outputNewFile) { // we need to make the new file and clone the tree.
TFile* inpFile = new TFile(inputs.c_str(), "READ");
if (!inpFile || !inpFile->IsOpen()) {
ERR(FTL) << "Cannot open input root file: " << inputs << std::endl;
throw;
}
TTree* inpTree = dynamic_cast<TTree*>(inpFile->Get("treeout"));
if (!inpTree) {
ERR(FTL) << "Cannot find TTree \"treeout\" in input root file: "
<< inputs.c_str() << std::endl;
throw;
}
outRootFile = new TFile(ofile.c_str(), force_out ? "RECREATE" : "CREATE");
if (!outRootFile || !outRootFile->IsOpen()) {
ERR(FTL) << "Couldn't open root file: " << ofile
<< " for writing, does it already exist?" << std::endl;
throw;
}
- nuwrotree = inpTree->CloneTree();
+ nuwrotree = inpTree->CloneTree(-1, "fast");
nuwrotree->SetDirectory(outRootFile);
nuwrotree->Write(nuwrotree->GetName());
} else {
outRootFile = new TFile(inputs.c_str(), "UPDATE");
if (!outRootFile || !outRootFile->IsOpen()) {
ERR(FTL) << "Cannot open input root file: " << inputs << std::endl;
throw;
}
nuwrotree = dynamic_cast<TTree*>(outRootFile->Get("treeout"));
if (!nuwrotree) {
ERR(FTL) << "Cannot find TTree \"treeout\" in input root file: "
<< inputs.c_str() << std::endl;
throw;
}
}
// Get Flux Histogram
- event* evt = NULL;
+ event* evt = new event();
nuwrotree->SetBranchAddress("e", &evt);
nuwrotree->GetEntry(0);
int fluxtype = evt->par.beam_type;
std::map<int, TH1D*> fluxlist;
std::map<int, TH1D*> eventlist;
std::vector<int> allpdg;
std::map<int, int> nevtlist;
std::map<int, double> intxseclist;
// Did the input file have a mono-energetic flux?
bool isMono = false;
nevtlist[0] = 0.0;
intxseclist[0] = 0.0;
allpdg.push_back(0);
LOG(FIT) << "Nuwro fluxtype = " << fluxtype << std::endl;
if (haveFluxInputs) {
double totalFraction = 0;
for (size_t flux_it = 0; flux_it < FluxInputs.size(); ++flux_it) {
FluxInputBlob& fb = FluxInputs[flux_it];
int pdg = fb.PDG;
TH1D* fluxHist = GetTH1DFromFile(fb.File, fb.Hist);
double pctg = fb.Fraction;
totalFraction += pctg;
double Elow = fluxHist->GetXaxis()->GetBinLowEdge(1);
double Ehigh = fluxHist->GetXaxis()->GetBinLowEdge(
fluxHist->GetXaxis()->GetNbins() + 1);
LOG(FIT) << "Adding new nuwro flux "
<< "pdg: " << pdg << " pctg: " << pctg << " Elow: " << Elow
<< " Ehigh: " << Ehigh << std::endl;
// Sort total flux plot
if (!fluxlist[0]) {
// Setup total flux
fluxlist[0] = (TH1D*)fluxHist->Clone();
fluxlist[0]->SetNameTitle("FluxHist", "FluxHist");
// Prep empty total events
eventlist[0] = (TH1D*)fluxHist->Clone();
eventlist[0]->SetNameTitle("EvtHist", "EvtHist");
eventlist[0]->Reset();
} else {
// Add up each new plot
fluxlist[0]->Add(fluxHist);
}
fluxHist->SetNameTitle(Form("nuwro_pdg%i_pct%f_Flux", pdg, pctg),
Form("nuwro_pdg%i_pct%f_Flux", pdg, pctg));
TH1D* eventplot = (TH1D*)fluxHist->Clone();
eventplot->SetNameTitle(Form("nuwro_pdg%i_pct%f_Evt", pdg, pctg),
Form("nuwro_pdg%i_pct%f_Evt", pdg, pctg));
eventplot->Reset();
fluxlist[pdg] = (TH1D*)fluxHist->Clone();
eventlist[pdg] = eventplot;
nevtlist[pdg] = 0;
intxseclist[pdg] = 0.0;
allpdg.push_back(pdg);
delete fluxHist;
}
if (fabs(totalFraction - 1) > 1E-5) {
ERR(FTL) << "Total species fraction for input flux histos = "
<< totalFraction << ", expected to sum to 1." << std::endl;
throw;
}
} else if (fluxtype == 0) {
std::string fluxstring = evt->par.beam_energy;
std::vector<double> fluxvals = GeneralUtils::ParseToDbl(fluxstring, " ");
int pdg = evt->par.beam_particle;
double Elow = double(fluxvals[0]) / 1000.0;
double Ehigh = double(fluxvals[1]) / 1000.0;
TH1D* fluxplot = NULL;
if (Elow > Ehigh) isMono = true;
// For files produced with a flux distribution
if (!isMono) {
LOG(FIT) << "Adding new nuwro flux "
<< "pdg: " << pdg << " Elow: " << Elow << " Ehigh: " << Ehigh
<< std::endl;
fluxplot =
new TH1D("fluxplot", "fluxplot", fluxvals.size() - 4, Elow, Ehigh);
for (uint j = 2; j < fluxvals.size(); j++) {
LOG(DEB) << j << " " << fluxvals[j] << endl;
fluxplot->SetBinContent(j - 1, fluxvals[j]);
}
} else { // For monoenergetic fluxes
LOG(FIT) << "Adding mono-energetic nuwro flux "
<< "pdg: " << pdg << " E: " << Elow << std::endl;
fluxplot = new TH1D("fluxplot", "fluxplot", 100, 0, Elow * 2);
fluxplot->SetBinContent(fluxplot->FindBin(Elow), 1);
}
// Setup total flux
fluxlist[0] = (TH1D*)fluxplot->Clone();
fluxlist[0]->SetNameTitle("FluxHist", "FluxHist");
// Prep empty total events
eventlist[0] = (TH1D*)fluxplot->Clone();
eventlist[0]->SetNameTitle("EvtHist", "EvtHist");
eventlist[0]->Reset();
fluxplot->SetNameTitle(Form("nuwro_pdg%i_Flux", pdg),
Form("nuwro_pdg%i_Flux", pdg));
TH1D* eventplot = (TH1D*)fluxplot->Clone();
eventplot->SetNameTitle(Form("nuwro_pdg%i_Evt", pdg),
Form("nuwro_pdg%i_Evt", pdg));
eventplot->Reset();
fluxlist[pdg] = fluxplot;
eventlist[pdg] = eventplot;
nevtlist[pdg] = 0;
intxseclist[pdg] = 0.0;
allpdg.push_back(pdg);
} else if (fluxtype == 1) {
std::string fluxstring = evt->par.beam_content;
std::vector<std::string> fluxlines =
GeneralUtils::ParseToStr(fluxstring, "\n");
for (uint i = 0; i < fluxlines.size(); i++) {
std::vector<double> fluxvals =
GeneralUtils::ParseToDbl(fluxlines[i], " ");
int pdg = int(fluxvals[0]);
double pctg = double(fluxvals[1]) / 100.0;
double Elow = double(fluxvals[2]) / 1000.0;
double Ehigh = double(fluxvals[3]) / 1000.0;
LOG(FIT) << "Adding new nuwro flux "
<< "pdg: " << pdg << " pctg: " << pctg << " Elow: " << Elow
<< " Ehigh: " << Ehigh << std::endl;
TH1D* fluxplot =
new TH1D("fluxplot", "fluxplot", fluxvals.size() - 4, Elow, Ehigh);
for (uint j = 4; j < fluxvals.size(); j++) {
fluxplot->SetBinContent(j + 1, fluxvals[j]);
}
// Sort total flux plot
if (!fluxlist[0]) {
// Setup total flux
fluxlist[0] = (TH1D*)fluxplot->Clone();
fluxlist[0]->SetNameTitle("FluxHist", "FluxHist");
// Prep empty total events
eventlist[0] = (TH1D*)fluxplot->Clone();
eventlist[0]->SetNameTitle("EvtHist", "EvtHist");
eventlist[0]->Reset();
} else {
// Add up each new plot
fluxlist[0]->Add(fluxplot);
}
fluxplot->SetNameTitle(Form("nuwro_pdg%i_pct%f_Flux", pdg, pctg),
Form("nuwro_pdg%i_pct%f_Flux", pdg, pctg));
TH1D* eventplot = (TH1D*)fluxplot->Clone();
eventplot->SetNameTitle(Form("nuwro_pdg%i_pct%f_Evt", pdg, pctg),
Form("nuwro_pdg%i_pct%f_Evt", pdg, pctg));
eventplot->Reset();
fluxlist[pdg] = fluxplot;
eventlist[pdg] = eventplot;
nevtlist[pdg] = 0;
intxseclist[pdg] = 0.0;
allpdg.push_back(pdg);
}
}
// Start main event loop to fill plots
int nevents = nuwrotree->GetEntries();
double Enu = 0.0;
double TotXSec = 0.0;
// double totaleventmode = 0.0;
// double totalevents = 0.0;
int pdg = 0;
int countwidth = nevents / 50.0;
countwidth = countwidth ? countwidth : 1;
for (int i = 0; i < nevents; i++) {
nuwrotree->GetEntry(i);
// Get Variables
Enu = evt->in[0].t / 1000.0;
TotXSec = evt->weight;
pdg = evt->in[0].pdg;
eventlist[0]->Fill(Enu);
eventlist[pdg]->Fill(Enu);
nevtlist[0] += 1;
nevtlist[pdg] += 1;
intxseclist[0] += TotXSec;
intxseclist[pdg] += TotXSec;
if (i % countwidth == 0)
LOG(FIT) << "Processed " << i << " events "
<< " (" << int(i * 100.0 / nevents) << "%)"
<< " : E, W, PDG = " << Enu << ", " << TotXSec << ", " << pdg
<< std::endl;
}
TH1D* zeroevents = (TH1D*)eventlist[0]->Clone();
outRootFile->cd();
// Loop over eventlist
for (uint i = 0; i < allpdg.size(); i++) {
int pdg = allpdg[i];
double AvgXSec = intxseclist[0] * 1E38 / double(nevtlist[0]);
LOG(FIT) << pdg << " Avg XSec = " << AvgXSec << endl;
LOG(FIT) << pdg << " nevents = " << double(nevtlist[pdg]) << endl;
if (!isMono) {
// Convert events to PDF
eventlist[pdg]->Scale(1.0 / zeroevents->Integral("width"));
// Multiply by total predicted event rate
eventlist[pdg]->Scale(fluxlist[0]->Integral("width") * AvgXSec);
} else {
// If a mono-energetic flux was used, width should not be used
// The output is (now) forced to be flux = 1, evtrt = xsec (in 1E38 * nb
// cm^2)
eventlist[pdg]->Scale(1.0 / zeroevents->Integral());
eventlist[pdg]->Scale(fluxlist[0]->Integral() * AvgXSec);
}
// Save everything
fluxlist[pdg]->Write("", TObject::kOverwrite);
eventlist[pdg]->Write("", TObject::kOverwrite);
}
// Tidy up
outRootFile->Close();
fluxlist.clear();
eventlist.clear();
// Exit Program
return;
}
//*******************************
void HaddNuwroFiles(std::vector<std::string>& inputs, bool force_out) {
//*******************************
// Get output file name
std::string outputname = inputs[0];
// Make command line string
std::string cmd = "hadd ";
if (outputNewFile) {
cmd += ofile + " ";
outputname = ofile;
} else if (force_out) {
cmd += "-f ";
}
for (UInt_t i = 0; i < inputs.size(); i++) {
cmd += inputs[i] + " ";
}
LOG(FIT) << " Running HADD from PrepareNuwro: " << cmd << std::endl;
// Start HADD
system(cmd.c_str());
// Return name of output file
inputs.clear();
inputs.push_back(outputname);
haddedFiles = true;
return;
}
diff --git a/data/MicroBooNE/CCinc/microboone_numu_cc_inclusive.root b/data/MicroBooNE/CCinc/microboone_numu_cc_inclusive.root
new file mode 100644
index 0000000..099f9f7
Binary files /dev/null and b/data/MicroBooNE/CCinc/microboone_numu_cc_inclusive.root differ
diff --git a/src/FCN/SampleList.cxx b/src/FCN/SampleList.cxx
index 9b8a0b9..3771f60 100644
--- a/src/FCN/SampleList.cxx
+++ b/src/FCN/SampleList.cxx
@@ -1,1423 +1,1440 @@
#include "SampleList.h"
#ifndef __NO_ANL__
#include "ANL_CCQE_Evt_1DQ2_nu.h"
#include "ANL_CCQE_XSec_1DEnu_nu.h"
// ANL CC1ppip
#include "ANL_CC1ppip_Evt_1DQ2_nu.h"
#include "ANL_CC1ppip_Evt_1DcosmuStar_nu.h"
#include "ANL_CC1ppip_Evt_1DcosmuStar_nu.h"
#include "ANL_CC1ppip_Evt_1DcosthAdler_nu.h"
#include "ANL_CC1ppip_Evt_1Dphi_nu.h"
#include "ANL_CC1ppip_Evt_1Dppi_nu.h"
#include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
#include "ANL_CC1ppip_XSec_1DEnu_nu.h"
#include "ANL_CC1ppip_XSec_1DQ2_nu.h"
// ANL CC1npip
#include "ANL_CC1npip_Evt_1DQ2_nu.h"
#include "ANL_CC1npip_Evt_1DcosmuStar_nu.h"
#include "ANL_CC1npip_Evt_1Dppi_nu.h"
#include "ANL_CC1npip_XSec_1DEnu_nu.h"
// ANL CC1pi0
#include "ANL_CC1pi0_Evt_1DQ2_nu.h"
#include "ANL_CC1pi0_Evt_1DcosmuStar_nu.h"
#include "ANL_CC1pi0_XSec_1DEnu_nu.h"
// ANL NC1npip (mm, exotic!)
#include "ANL_NC1npip_Evt_1Dppi_nu.h"
// ANL NC1ppim (mm, exotic!)
#include "ANL_NC1ppim_Evt_1DcosmuStar_nu.h"
#include "ANL_NC1ppim_XSec_1DEnu_nu.h"
// ANL CC2pi 1pim1pip (mm, even more exotic!)
#include "ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.h"
#include "ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h"
#include "ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h"
#include "ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h"
#include "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h"
// ANL CC2pi 1pip1pip (mm, even more exotic!)
#include "ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h"
#include "ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h"
#include "ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h"
#include "ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h"
#include "ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h"
// ANL CC2pi 1pip1pi0 (mm, even more exotic!)
#include "ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h"
#include "ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h"
#include "ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h"
#include "ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h"
#include "ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h"
#endif
#ifndef __NO_ArgoNeuT__
// ArgoNeuT CC1Pi
#include "ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.h"
#include "ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.h"
#include "ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.h"
#include "ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.h"
#include "ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.h"
#include "ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.h"
#include "ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.h"
#include "ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.h"
// ArgoNeuT CC-inclusive
#include "ArgoNeuT_CCInc_XSec_1Dpmu_antinu.h"
#include "ArgoNeuT_CCInc_XSec_1Dpmu_nu.h"
#include "ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.h"
#include "ArgoNeuT_CCInc_XSec_1Dthetamu_nu.h"
#endif
#ifndef __NO_BNL__
// BNL CCQE
#include "BNL_CCQE_Evt_1DQ2_nu.h"
#include "BNL_CCQE_XSec_1DEnu_nu.h"
// BNL CC1ppip
#include "BNL_CC1ppip_Evt_1DQ2_nu.h"
#include "BNL_CC1ppip_Evt_1DQ2_nu.h"
#include "BNL_CC1ppip_Evt_1DcosthAdler_nu.h"
#include "BNL_CC1ppip_Evt_1Dphi_nu.h"
#include "BNL_CC1ppip_XSec_1DEnu_nu.h"
// BNL CC1npip
#include "BNL_CC1npip_Evt_1DQ2_nu.h"
#include "BNL_CC1npip_XSec_1DEnu_nu.h"
// BNL CC1pi0
#include "BNL_CC1pi0_Evt_1DQ2_nu.h"
#include "BNL_CC1pi0_XSec_1DEnu_nu.h"
#endif
#ifndef __NO_FNAL__
// FNAL CCQE
#include "FNAL_CCQE_Evt_1DQ2_nu.h"
// FNAL CC1ppip
#include "FNAL_CC1ppip_Evt_1DQ2_nu.h"
#include "FNAL_CC1ppip_XSec_1DEnu_nu.h"
#include "FNAL_CC1ppip_XSec_1DQ2_nu.h"
// FNAL CC1ppim
#include "FNAL_CC1ppim_XSec_1DEnu_antinu.h"
#endif
#ifndef __NO_BEBC__
// BEBC CCQE
#include "BEBC_CCQE_XSec_1DQ2_nu.h"
// BEBC CC1ppip
#include "BEBC_CC1ppip_XSec_1DEnu_nu.h"
#include "BEBC_CC1ppip_XSec_1DQ2_nu.h"
// BEBC CC1npip
#include "BEBC_CC1npip_XSec_1DEnu_nu.h"
#include "BEBC_CC1npip_XSec_1DQ2_nu.h"
// BEBC CC1pi0
#include "BEBC_CC1pi0_XSec_1DEnu_nu.h"
#include "BEBC_CC1pi0_XSec_1DQ2_nu.h"
// BEBC CC1npim
#include "BEBC_CC1npim_XSec_1DEnu_antinu.h"
#include "BEBC_CC1npim_XSec_1DQ2_antinu.h"
// BEBC CC1ppim
#include "BEBC_CC1ppim_XSec_1DEnu_antinu.h"
#include "BEBC_CC1ppim_XSec_1DQ2_antinu.h"
#endif
#ifndef __NO_GGM__
// GGM CC1ppip
#include "GGM_CC1ppip_Evt_1DQ2_nu.h"
#include "GGM_CC1ppip_XSec_1DEnu_nu.h"
#endif
#ifndef __NO_MiniBooNE__
// MiniBooNE CCQE
#include "MiniBooNE_CCQE_XSec_1DQ2_antinu.h"
#include "MiniBooNE_CCQE_XSec_1DQ2_nu.h"
#include "MiniBooNE_CCQE_XSec_2DTcos_antinu.h"
#include "MiniBooNE_CCQE_XSec_2DTcos_antinu.h"
#include "MiniBooNE_CCQE_XSec_2DTcos_nu.h"
// MiniBooNE CC1pi+ 1D
#include "MiniBooNE_CC1pip_XSec_1DEnu_nu.h"
#include "MiniBooNE_CC1pip_XSec_1DQ2_nu.h"
#include "MiniBooNE_CC1pip_XSec_1DTpi_nu.h"
#include "MiniBooNE_CC1pip_XSec_1DTu_nu.h"
// MiniBooNE CC1pi+ 2D
#include "MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.h"
#include "MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.h"
#include "MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.h"
#include "MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.h"
#include "MiniBooNE_CC1pip_XSec_2DTuEnu_nu.h"
// MiniBooNE CC1pi0
#include "MiniBooNE_CC1pi0_XSec_1DEnu_nu.h"
#include "MiniBooNE_CC1pi0_XSec_1DQ2_nu.h"
#include "MiniBooNE_CC1pi0_XSec_1DTu_nu.h"
#include "MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.h"
#include "MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.h"
#include "MiniBooNE_CC1pi0_XSec_1Dppi0_nu.h"
#include "MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.h"
#include "MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.h"
#include "MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.h"
#include "MiniBooNE_NC1pi0_XSec_1Dppi0_nu.h"
// MiniBooNE NC1pi0
//#include "MiniBooNE_NCpi0_XSec_1Dppi0_nu.h"
// MiniBooNE NCEL
#include "MiniBooNE_NCEL_XSec_Treco_nu.h"
#endif
+#ifndef __NO_MicroBooNE__
+#include "MicroBooNE_CCInc_XSec_2DPcos_nu.h"
+#endif
+
#ifndef __NO_MINERvA__
// MINERvA CCQE
#include "MINERvA_CCQE_XSec_1DQ2_antinu.h"
#include "MINERvA_CCQE_XSec_1DQ2_joint.h"
#include "MINERvA_CCQE_XSec_1DQ2_nu.h"
// MINERvA CC0pi
#include "MINERvA_CC0pi_XSec_1DEe_nue.h"
#include "MINERvA_CC0pi_XSec_1DQ2_nu_proton.h"
#include "MINERvA_CC0pi_XSec_1DQ2_nue.h"
#include "MINERvA_CC0pi_XSec_1DThetae_nue.h"
// 2018 MINERvA CC0pi STV
#include "MINERvA_CC0pinp_STV_XSec_1D_nu.h"
// 2018 MINERvA CC0pi 2D
#include "MINERvA_CC0pi_XSec_2D_nu.h"
#include "MINERvA_CC0pi_XSec_1D_2018_nu.h"
// 2018 MINERvA CC0pi 2D antinu
#include "MINERvA_CC0pi_XSec_2D_antinu.h"
// MINERvA CC1pi+
#include "MINERvA_CC1pip_XSec_1DTpi_20deg_nu.h"
#include "MINERvA_CC1pip_XSec_1DTpi_nu.h"
#include "MINERvA_CC1pip_XSec_1Dth_20deg_nu.h"
#include "MINERvA_CC1pip_XSec_1Dth_nu.h"
// 2017 data update
#include "MINERvA_CC1pip_XSec_1D_2017Update.h"
// MINERvA CCNpi+
#include "MINERvA_CCNpip_XSec_1DEnu_nu.h"
#include "MINERvA_CCNpip_XSec_1DQ2_nu.h"
#include "MINERvA_CCNpip_XSec_1DTpi_nu.h"
#include "MINERvA_CCNpip_XSec_1Dpmu_nu.h"
#include "MINERvA_CCNpip_XSec_1Dth_nu.h"
#include "MINERvA_CCNpip_XSec_1Dthmu_nu.h"
// MINERvA CC1pi0
#include "MINERvA_CC1pi0_XSec_1DEnu_antinu.h"
#include "MINERvA_CC1pi0_XSec_1DQ2_antinu.h"
#include "MINERvA_CC1pi0_XSec_1DTpi0_antinu.h"
#include "MINERvA_CC1pi0_XSec_1Dpmu_antinu.h"
#include "MINERvA_CC1pi0_XSec_1Dppi0_antinu.h"
#include "MINERvA_CC1pi0_XSec_1Dth_antinu.h"
#include "MINERvA_CC1pi0_XSec_1Dthmu_antinu.h"
// MINERvA CC1pi0 neutrino
#include "MINERvA_CC1pi0_XSec_1D_nu.h"
// MINERvA CCINC
#include "MINERvA_CCinc_XSec_1DEnu_ratio.h"
#include "MINERvA_CCinc_XSec_1Dx_ratio.h"
#include "MINERvA_CCinc_XSec_2DEavq3_nu.h"
// MINERvA CCDIS
#include "MINERvA_CCDIS_XSec_1DEnu_ratio.h"
#include "MINERvA_CCDIS_XSec_1Dx_ratio.h"
// MINERvA CCCOH pion
#include "MINERvA_CCCOHPI_XSec_1DEnu_antinu.h"
#include "MINERvA_CCCOHPI_XSec_1DEnu_antinu.h"
#include "MINERvA_CCCOHPI_XSec_1DEpi_antinu.h"
#include "MINERvA_CCCOHPI_XSec_1DQ2_antinu.h"
#include "MINERvA_CCCOHPI_XSec_1DEpi_nu.h"
#include "MINERvA_CCCOHPI_XSec_1DQ2_nu.h"
#include "MINERvA_CCCOHPI_XSec_1Dth_nu.h"
#include "MINERvA_CCCOHPI_XSec_1Dth_nu.h"
#include "MINERvA_CCCOHPI_XSec_joint.h"
#include "MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.h"
#include "MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.h"
#endif
#ifndef __NO_T2K__
// T2K CC0pi 2016
#include "T2K_CC0pi_XSec_2DPcos_nu.h"
// T2K CC-inclusive with full acceptance 2018
#include "T2K_CCinc_XSec_2DPcos_nu_nonuniform.h"
// T2K STV CC0pi 2018
#include "T2K_CC0pi_XSec_2DPcos_nu_nonuniform.h"
#include "T2K_CC0pinp_STV_XSec_1Ddpt_nu.h"
#include "T2K_CC0pinp_STV_XSec_1Ddphit_nu.h"
#include "T2K_CC0pinp_STV_XSec_1Ddat_nu.h"
#include "T2K_CC0pi1p_XSec_3DPcoscos_nu_nonuniform.h"
#include "T2K_CC0pinp_ifk_XSec_3Dinfp_nu.h"
#include "T2K_CC0pinp_ifk_XSec_3Dinfa_nu.h"
#include "T2K_CC0pinp_ifk_XSec_3Dinfip_nu.h"
// T2K CC1pi+ on CH
#include "T2K_CC1pip_CH_XSec_2Dpmucosmu_nu.h"
#include "T2K_CC1pip_CH_XSec_1Dppi_nu.h"
#include "T2K_CC1pip_CH_XSec_1Dthpi_nu.h"
#include "T2K_CC1pip_CH_XSec_1Dthmupi_nu.h"
#include "T2K_CC1pip_CH_XSec_1DQ2_nu.h"
#include "T2K_CC1pip_CH_XSec_1DAdlerPhi_nu.h"
#include "T2K_CC1pip_CH_XSec_1DCosThAdler_nu.h"
//#include "T2K_CC1pip_CH_XSec_1Dthq3pi_nu.h"
//#include "T2K_CC1pip_CH_XSec_1DWrec_nu.h"
//#include "T2K_CC1pip_CH_XSec_1Dq3_nu.h"
// T2K CC1pi+ on H2O
#include "T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.h"
#include "T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h"
#include "T2K_CC1pip_H2O_XSec_1Dcosmu_nu.h"
#include "T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.h"
#include "T2K_CC1pip_H2O_XSec_1Dcospi_nu.h"
#include "T2K_CC1pip_H2O_XSec_1Dpmu_nu.h"
#include "T2K_CC1pip_H2O_XSec_1Dppi_nu.h"
#endif
#ifndef __NO_SciBooNE__
// SciBooNE COH studies
#include "SciBooNE_CCCOH_1TRK_1DQ2_nu.h"
#include "SciBooNE_CCCOH_1TRK_1Dpmu_nu.h"
#include "SciBooNE_CCCOH_1TRK_1Dthetamu_nu.h"
#include "SciBooNE_CCCOH_MuPiNoVA_1DQ2_nu.h"
#include "SciBooNE_CCCOH_MuPiNoVA_1Dthetapi_nu.h"
#include "SciBooNE_CCCOH_MuPiNoVA_1Dthetapr_nu.h"
#include "SciBooNE_CCCOH_MuPiNoVA_1Dthetamu_nu.h"
#include "SciBooNE_CCCOH_MuPiNoVA_1Dpmu_nu.h"
#include "SciBooNE_CCCOH_MuPiVA_1DQ2_nu.h"
#include "SciBooNE_CCCOH_MuPiVA_1Dpmu_nu.h"
#include "SciBooNE_CCCOH_MuPiVA_1Dthetamu_nu.h"
#include "SciBooNE_CCCOH_MuPr_1DQ2_nu.h"
#include "SciBooNE_CCCOH_MuPr_1Dpmu_nu.h"
#include "SciBooNE_CCCOH_MuPr_1Dthetamu_nu.h"
#include "SciBooNE_CCCOH_STOPFINAL_1DQ2_nu.h"
#include "SciBooNE_CCCOH_STOP_NTrks_nu.h"
#endif
#ifndef __NO_K2K__
// K2K NC1pi0
#include "K2K_NC1pi0_Evt_1Dppi0_nu.h"
#endif
// MC Studies
#include "ExpMultDist_CCQE_XSec_1DVar_FakeStudy.h"
#include "ExpMultDist_CCQE_XSec_2DVar_FakeStudy.h"
#include "MCStudy_CCQEHistograms.h"
#include "GenericFlux_Tester.h"
#include "GenericFlux_Vectors.h"
#include "ElectronFlux_FlatTree.h"
#include "ElectronScattering_DurhamData.h"
#include "MCStudy_KaonPreSelection.h"
#include "MCStudy_MuonValidation.h"
#include "OfficialNIWGPlots.h"
#include "T2K2017_FakeData.h"
#include "Simple_Osc.h"
#include "Smear_SVDUnfold_Propagation_Osc.h"
#include "FitWeight.h"
#include "NuisConfig.h"
#include "NuisKey.h"
#ifdef __USE_DYNSAMPLES__
#include "TRegexp.h"
#include <dirent.h>
// linux
#include <dlfcn.h>
DynamicSampleFactory::DynamicSampleFactory() : NSamples(0), NManifests(0) {
LoadPlugins();
QLOG(FIT, "Loaded " << NSamples << " from " << NManifests
<< " shared object libraries.");
}
DynamicSampleFactory* DynamicSampleFactory::glblDSF = NULL;
DynamicSampleFactory::PluginManifest::~PluginManifest() {
for (size_t i_it = 0; i_it < Instances.size(); ++i_it) {
(*(DSF_DestroySample))(Instances[i_it]);
}
}
std::string EnsureTrailingSlash(std::string const& inp) {
if (!inp.length()) {
return "/";
}
if (inp[inp.length() - 1] == '/') {
return inp;
}
return inp + "/";
}
void DynamicSampleFactory::LoadPlugins() {
std::vector<std::string> SearchDirectories;
if (Config::HasPar("dynamic_sample.path")) {
SearchDirectories =
GeneralUtils::ParseToStr(Config::GetParS("dynamic_sample.path"), ":");
}
char const* envPath = getenv("NUISANCE_DS_PATH");
if (envPath) {
std::vector<std::string> envPaths = GeneralUtils::ParseToStr(envPath, ":");
for (size_t ep_it = 0; ep_it < envPaths.size(); ++ep_it) {
SearchDirectories.push_back(envPaths[ep_it]);
}
}
if (!SearchDirectories.size()) {
char const* pwdPath = getenv("PWD");
if (pwdPath) {
SearchDirectories.push_back(pwdPath);
}
}
for (size_t sp_it = 0; sp_it < SearchDirectories.size(); ++sp_it) {
std::string dirpath = EnsureTrailingSlash(SearchDirectories[sp_it]);
QLOG(FIT, "Searching for dynamic sample manifests in: " << dirpath);
Ssiz_t len = 0;
DIR* dir;
struct dirent* ent;
dir = opendir(dirpath.c_str());
if (dir != NULL) {
TRegexp matchExp("*.so", true);
while ((ent = readdir(dir)) != NULL) {
if (matchExp.Index(TString(ent->d_name), &len) != Ssiz_t(-1)) {
QLOG(FIT, "\tFound shared object: "
<< ent->d_name << " checking for relevant methods...");
void* dlobj =
dlopen((dirpath + ent->d_name).c_str(), RTLD_NOW | RTLD_GLOBAL);
char const* dlerr_cstr = dlerror();
std::string dlerr;
if (dlerr_cstr) {
dlerr = dlerr_cstr;
}
if (dlerr.length()) {
ERROR(WRN, "\tDL Load Error: " << dlerr);
continue;
}
PluginManifest plgManif;
plgManif.dllib = dlobj;
plgManif.soloc = (dirpath + ent->d_name);
plgManif.DSF_NSamples =
reinterpret_cast<DSF_NSamples_ptr>(dlsym(dlobj, "DSF_NSamples"));
dlerr = "";
dlerr_cstr = dlerror();
if (dlerr_cstr) {
dlerr = dlerr_cstr;
}
if (dlerr.length()) {
ERROR(WRN, "\tFailed to load symbol \"DSF_NSamples\" from "
<< (dirpath + ent->d_name) << ": " << dlerr);
dlclose(dlobj);
continue;
}
plgManif.DSF_GetSampleName = reinterpret_cast<DSF_GetSampleName_ptr>(
dlsym(dlobj, "DSF_GetSampleName"));
dlerr = "";
dlerr_cstr = dlerror();
if (dlerr_cstr) {
dlerr = dlerr_cstr;
}
if (dlerr.length()) {
ERROR(WRN, "\tFailed to load symbol \"DSF_GetSampleName\" from "
<< (dirpath + ent->d_name) << ": " << dlerr);
dlclose(dlobj);
continue;
}
plgManif.DSF_GetSample = reinterpret_cast<DSF_GetSample_ptr>(
dlsym(dlobj, "DSF_GetSample"));
dlerr = "";
dlerr_cstr = dlerror();
if (dlerr_cstr) {
dlerr = dlerr_cstr;
}
if (dlerr.length()) {
ERROR(WRN, "\tFailed to load symbol \"DSF_GetSample\" from "
<< (dirpath + ent->d_name) << ": " << dlerr);
dlclose(dlobj);
continue;
}
plgManif.DSF_DestroySample = reinterpret_cast<DSF_DestroySample_ptr>(
dlsym(dlobj, "DSF_DestroySample"));
dlerr = "";
dlerr_cstr = dlerror();
if (dlerr_cstr) {
dlerr = dlerr_cstr;
}
if (dlerr.length()) {
ERROR(WRN, "Failed to load symbol \"DSF_DestroySample\" from "
<< (dirpath + ent->d_name) << ": " << dlerr);
dlclose(dlobj);
continue;
}
plgManif.NSamples = (*(plgManif.DSF_NSamples))();
QLOG(FIT, "\tSuccessfully loaded dynamic sample manifest: "
<< plgManif.soloc << ". Contains " << plgManif.NSamples
<< " samples.");
for (size_t smp_it = 0; smp_it < plgManif.NSamples; ++smp_it) {
char const* smp_name = (*(plgManif.DSF_GetSampleName))(smp_it);
if (!smp_name) {
THROW("Could not load sample " << smp_it << " / "
<< plgManif.NSamples << " from "
<< plgManif.soloc);
}
if (Samples.count(smp_name)) {
ERROR(WRN, "Already loaded a sample named: \""
<< smp_name << "\". cannot load duplciates. This "
"sample will be skipped.");
continue;
}
plgManif.SamplesProvided.push_back(smp_name);
Samples[smp_name] = std::make_pair(plgManif.soloc, smp_it);
QLOG(FIT, "\t\t" << smp_name);
}
if (plgManif.SamplesProvided.size()) {
Manifests[plgManif.soloc] = plgManif;
NSamples += plgManif.SamplesProvided.size();
NManifests++;
} else {
dlclose(dlobj);
}
}
}
closedir(dir);
} else {
ERROR(WRN, "Tried to open non-existant directory.");
}
}
}
DynamicSampleFactory& DynamicSampleFactory::Get() {
if (!glblDSF) {
glblDSF = new DynamicSampleFactory();
}
return *glblDSF;
}
void DynamicSampleFactory::Print() {
std::map<std::string, std::vector<std::string> > ManifestSamples;
for (std::map<std::string, std::pair<std::string, int> >::iterator smp_it =
Samples.begin();
smp_it != Samples.end(); ++smp_it) {
if (!ManifestSamples.count(smp_it->second.first)) {
ManifestSamples[smp_it->second.first] = std::vector<std::string>();
}
ManifestSamples[smp_it->second.first].push_back(smp_it->first);
}
QLOG(FIT, "Dynamic sample manifest: ");
for (std::map<std::string, std::vector<std::string> >::iterator m_it =
ManifestSamples.begin();
m_it != ManifestSamples.end(); ++m_it) {
QLOG(FIT, "\tLibrary " << m_it->first << " contains: ");
for (size_t s_it = 0; s_it < m_it->second.size(); ++s_it) {
QLOG(FIT, "\t\t" << m_it->second[s_it]);
}
}
}
bool DynamicSampleFactory::HasSample(std::string const& name) {
return Samples.count(name);
}
bool DynamicSampleFactory::HasSample(nuiskey& samplekey) {
return HasSample(samplekey.GetS("name"));
}
MeasurementBase* DynamicSampleFactory::CreateSample(nuiskey& samplekey) {
if (!HasSample(samplekey)) {
ERROR(WRN, "Asked to load unknown sample: \"" << samplekey.GetS("name")
<< "\".");
return NULL;
}
std::pair<std::string, int> sample = Samples[samplekey.GetS("name")];
QLOG(SAM, "\tLoading sample " << sample.second << " from " << sample.first);
return (*(Manifests[sample.first].DSF_GetSample))(sample.second, &samplekey);
}
DynamicSampleFactory::~DynamicSampleFactory() { Manifests.clear(); }
#endif
//! Functions to make it easier for samples to be created and handled.
namespace SampleUtils {
//! Create a given sample given its name, file, type, fakdata(fkdt) file and the
//! current rw engine and push it back into the list fChain.
MeasurementBase* CreateSample(std::string name, std::string file,
std::string type, std::string fkdt,
FitWeight* rw) {
nuiskey samplekey = Config::CreateKey("sample");
samplekey.Set("name", name);
samplekey.Set("input", file);
samplekey.Set("type", type);
return CreateSample(samplekey);
}
MeasurementBase* CreateSample(nuiskey samplekey) {
#ifdef __USE_DYNSAMPLES__
if (DynamicSampleFactory::Get().HasSample(samplekey)) {
QLOG(SAM, "Instantiating dynamic sample...");
MeasurementBase* ds = DynamicSampleFactory::Get().CreateSample(samplekey);
if (ds) {
QLOG(SAM, "Done.");
return ds;
}
THROW("Failed to instantiate dynamic sample.");
}
#endif
FitWeight* rw = FitBase::GetRW();
std::string name = samplekey.GetS("name");
std::string file = samplekey.GetS("input");
std::string type = samplekey.GetS("type");
std::string fkdt = "";
/*
ANL CCQE Samples
*/
#ifndef __NO_ANL__
if (!name.compare("ANL_CCQE_XSec_1DEnu_nu") ||
!name.compare("ANL_CCQE_XSec_1DEnu_nu_PRD26") ||
!name.compare("ANL_CCQE_XSec_1DEnu_nu_PRL31") ||
!name.compare("ANL_CCQE_XSec_1DEnu_nu_PRD16")) {
return (new ANL_CCQE_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("ANL_CCQE_Evt_1DQ2_nu") ||
!name.compare("ANL_CCQE_Evt_1DQ2_nu_PRL31") ||
!name.compare("ANL_CCQE_Evt_1DQ2_nu_PRD26") ||
!name.compare("ANL_CCQE_Evt_1DQ2_nu_PRD16")) {
return (new ANL_CCQE_Evt_1DQ2_nu(samplekey));
/*
ANL CC1ppip samples
*/
} else if (!name.compare("ANL_CC1ppip_XSec_1DEnu_nu") ||
!name.compare("ANL_CC1ppip_XSec_1DEnu_nu_W14Cut") ||
!name.compare("ANL_CC1ppip_XSec_1DEnu_nu_Uncorr") ||
!name.compare("ANL_CC1ppip_XSec_1DEnu_nu_W14Cut_Uncorr") ||
!name.compare("ANL_CC1ppip_XSec_1DEnu_nu_W16Cut_Uncorr")) {
return (new ANL_CC1ppip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("ANL_CC1ppip_XSec_1DQ2_nu")) {
return (new ANL_CC1ppip_XSec_1DQ2_nu(samplekey));
} else if (!name.compare("ANL_CC1ppip_Evt_1DQ2_nu") ||
!name.compare("ANL_CC1ppip_Evt_1DQ2_nu_W14Cut")) {
return (new ANL_CC1ppip_Evt_1DQ2_nu(samplekey));
} else if (!name.compare("ANL_CC1ppip_Evt_1Dppi_nu")) {
return (new ANL_CC1ppip_Evt_1Dppi_nu(samplekey));
} else if (!name.compare("ANL_CC1ppip_Evt_1Dthpr_nu")) {
return (new ANL_CC1ppip_Evt_1Dthpr_nu(samplekey));
} else if (!name.compare("ANL_CC1ppip_Evt_1DcosmuStar_nu")) {
return (new ANL_CC1ppip_Evt_1DcosmuStar_nu(samplekey));
} else if (!name.compare("ANL_CC1ppip_Evt_1DcosthAdler_nu")) {
return (new ANL_CC1ppip_Evt_1DcosthAdler_nu(samplekey));
} else if (!name.compare("ANL_CC1ppip_Evt_1Dphi_nu")) {
return (new ANL_CC1ppip_Evt_1Dphi_nu(samplekey));
/*
ANL CC1npip sample
*/
} else if (!name.compare("ANL_CC1npip_XSec_1DEnu_nu") ||
!name.compare("ANL_CC1npip_XSec_1DEnu_nu_W14Cut") ||
!name.compare("ANL_CC1npip_XSec_1DEnu_nu_Uncorr") ||
!name.compare("ANL_CC1npip_XSec_1DEnu_nu_W14Cut_Uncorr") ||
!name.compare("ANL_CC1npip_XSec_1DEnu_nu_W16Cut_Uncorr")) {
return (new ANL_CC1npip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("ANL_CC1npip_Evt_1DQ2_nu") ||
!name.compare("ANL_CC1npip_Evt_1DQ2_nu_W14Cut")) {
return (new ANL_CC1npip_Evt_1DQ2_nu(samplekey));
} else if (!name.compare("ANL_CC1npip_Evt_1Dppi_nu")) {
return (new ANL_CC1npip_Evt_1Dppi_nu(samplekey));
} else if (!name.compare("ANL_CC1npip_Evt_1DcosmuStar_nu")) {
return (new ANL_CC1npip_Evt_1DcosmuStar_nu(samplekey));
/*
ANL CC1pi0 sample
*/
} else if (!name.compare("ANL_CC1pi0_XSec_1DEnu_nu") ||
!name.compare("ANL_CC1pi0_XSec_1DEnu_nu_W14Cut") ||
!name.compare("ANL_CC1pi0_XSec_1DEnu_nu_Uncorr") ||
!name.compare("ANL_CC1pi0_XSec_1DEnu_nu_W14Cut_Uncorr") ||
!name.compare("ANL_CC1pi0_XSec_1DEnu_nu_W16Cut_Uncorr")) {
return (new ANL_CC1pi0_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("ANL_CC1pi0_Evt_1DQ2_nu") ||
!name.compare("ANL_CC1pi0_Evt_1DQ2_nu_W14Cut")) {
return (new ANL_CC1pi0_Evt_1DQ2_nu(samplekey));
} else if (!name.compare("ANL_CC1pi0_Evt_1DcosmuStar_nu")) {
return (new ANL_CC1pi0_Evt_1DcosmuStar_nu(samplekey));
/*
ANL NC1npip sample
*/
} else if (!name.compare("ANL_NC1npip_Evt_1Dppi_nu")) {
return (new ANL_NC1npip_Evt_1Dppi_nu(samplekey));
/*
ANL NC1ppim sample
*/
} else if (!name.compare("ANL_NC1ppim_XSec_1DEnu_nu")) {
return (new ANL_NC1ppim_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("ANL_NC1ppim_Evt_1DcosmuStar_nu")) {
return (new ANL_NC1ppim_Evt_1DcosmuStar_nu(samplekey));
/*
ANL CC2pi sample
*/
} else if (!name.compare("ANL_CC2pi_1pim1pip_XSec_1DEnu_nu")) {
return (new ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu")) {
return (new ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pim1pip_Evt_1Dppip_nu")) {
return (new ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pim1pip_Evt_1Dppim_nu")) {
return (new ANL_CC2pi_1pim1pip_Evt_1Dppim_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu")) {
return (new ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pip_XSec_1DEnu_nu")) {
return (new ANL_CC2pi_1pip1pip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu")) {
return (new ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu")) {
return (new ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu")) {
return (new ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu")) {
return (new ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu")) {
return (new ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu")) {
return (new ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu")) {
return (new ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu")) {
return (new ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu(samplekey));
} else if (!name.compare("ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu")) {
return (new ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu(samplekey));
/*
ArgoNeut Samples
*/
} else
#endif
#ifndef __NO_ArgoNeuT__
if (!name.compare("ArgoNeuT_CCInc_XSec_1Dpmu_antinu")) {
return (new ArgoNeuT_CCInc_XSec_1Dpmu_antinu(samplekey));
} else if (!name.compare("ArgoNeuT_CCInc_XSec_1Dpmu_nu")) {
return (new ArgoNeuT_CCInc_XSec_1Dpmu_nu(samplekey));
} else if (!name.compare("ArgoNeuT_CCInc_XSec_1Dthetamu_antinu")) {
return (new ArgoNeuT_CCInc_XSec_1Dthetamu_antinu(samplekey));
} else if (!name.compare("ArgoNeuT_CCInc_XSec_1Dthetamu_nu")) {
return (new ArgoNeuT_CCInc_XSec_1Dthetamu_nu(samplekey));
} else if (!name.compare("ArgoNeuT_CC1Pi_XSec_1Dpmu_nu")) {
return (new ArgoNeuT_CC1Pi_XSec_1Dpmu_nu(samplekey));
} else if (!name.compare("ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu")) {
return (new ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu(samplekey));
} else if (!name.compare("ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu")) {
return (new ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu(samplekey));
} else if (!name.compare("ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu")) {
return (new ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu(samplekey));
} else if (!name.compare("ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu")) {
return (new ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu(samplekey));
} else if (!name.compare("ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu")) {
return (new ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu(samplekey));
} else if (!name.compare("ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu")) {
return (new ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu(samplekey));
} else if (!name.compare("ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu")) {
return (new ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu(samplekey));
/*
BNL Samples
*/
} else
#endif
#ifndef __NO_BNL__
if (!name.compare("BNL_CCQE_XSec_1DEnu_nu")) {
return (new BNL_CCQE_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("BNL_CCQE_Evt_1DQ2_nu")) {
return (new BNL_CCQE_Evt_1DQ2_nu(samplekey));
/*
BNL CC1ppip samples
*/
} else if (!name.compare("BNL_CC1ppip_XSec_1DEnu_nu") ||
!name.compare("BNL_CC1ppip_XSec_1DEnu_nu_Uncorr") ||
!name.compare("BNL_CC1ppip_XSec_1DEnu_nu_W14Cut") ||
!name.compare("BNL_CC1ppip_XSec_1DEnu_nu_W14Cut_Uncorr")) {
return (new BNL_CC1ppip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("BNL_CC1ppip_Evt_1DQ2_nu") ||
!name.compare("BNL_CC1ppip_Evt_1DQ2_nu_W14Cut")) {
return (new BNL_CC1ppip_Evt_1DQ2_nu(samplekey));
} else if (!name.compare("BNL_CC1ppip_Evt_1DcosthAdler_nu")) {
return (new BNL_CC1ppip_Evt_1DcosthAdler_nu(samplekey));
} else if (!name.compare("BNL_CC1ppip_Evt_1Dphi_nu")) {
return (new BNL_CC1ppip_Evt_1Dphi_nu(samplekey));
/*
BNL CC1npip samples
*/
} else if (!name.compare("BNL_CC1npip_XSec_1DEnu_nu") ||
!name.compare("BNL_CC1npip_XSec_1DEnu_nu_Uncorr")) {
return (new BNL_CC1npip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("BNL_CC1npip_Evt_1DQ2_nu")) {
return (new BNL_CC1npip_Evt_1DQ2_nu(samplekey));
/*
BNL CC1pi0 samples
*/
} else if (!name.compare("BNL_CC1pi0_XSec_1DEnu_nu")) {
return (new BNL_CC1pi0_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("BNL_CC1pi0_Evt_1DQ2_nu")) {
return (new BNL_CC1pi0_Evt_1DQ2_nu(samplekey));
/*
FNAL Samples
*/
} else
#endif
#ifndef __NO_FNAL__
if (!name.compare("FNAL_CCQE_Evt_1DQ2_nu")) {
return (new FNAL_CCQE_Evt_1DQ2_nu(samplekey));
/*
FNAL CC1ppip
*/
} else if (!name.compare("FNAL_CC1ppip_XSec_1DEnu_nu")) {
return (new FNAL_CC1ppip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("FNAL_CC1ppip_XSec_1DQ2_nu")) {
return (new FNAL_CC1ppip_XSec_1DQ2_nu(samplekey));
} else if (!name.compare("FNAL_CC1ppip_Evt_1DQ2_nu")) {
return (new FNAL_CC1ppip_Evt_1DQ2_nu(samplekey));
/*
FNAL CC1ppim
*/
} else if (!name.compare("FNAL_CC1ppim_XSec_1DEnu_antinu")) {
return (new FNAL_CC1ppim_XSec_1DEnu_antinu(samplekey));
/*
BEBC Samples
*/
} else
#endif
#ifndef __NO_BEBC__
if (!name.compare("BEBC_CCQE_XSec_1DQ2_nu")) {
return (new BEBC_CCQE_XSec_1DQ2_nu(samplekey));
/*
BEBC CC1ppip samples
*/
} else if (!name.compare("BEBC_CC1ppip_XSec_1DEnu_nu")) {
return (new BEBC_CC1ppip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("BEBC_CC1ppip_XSec_1DQ2_nu")) {
return (new BEBC_CC1ppip_XSec_1DQ2_nu(samplekey));
/*
BEBC CC1npip samples
*/
} else if (!name.compare("BEBC_CC1npip_XSec_1DEnu_nu")) {
return (new BEBC_CC1npip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("BEBC_CC1npip_XSec_1DQ2_nu")) {
return (new BEBC_CC1npip_XSec_1DQ2_nu(samplekey));
/*
BEBC CC1pi0 samples
*/
} else if (!name.compare("BEBC_CC1pi0_XSec_1DEnu_nu")) {
return (new BEBC_CC1pi0_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("BEBC_CC1pi0_XSec_1DQ2_nu")) {
return (new BEBC_CC1pi0_XSec_1DQ2_nu(samplekey));
/*
BEBC CC1npim samples
*/
} else if (!name.compare("BEBC_CC1npim_XSec_1DEnu_antinu")) {
return (new BEBC_CC1npim_XSec_1DEnu_antinu(samplekey));
} else if (!name.compare("BEBC_CC1npim_XSec_1DQ2_antinu")) {
return (new BEBC_CC1npim_XSec_1DQ2_antinu(samplekey));
/*
BEBC CC1ppim samples
*/
} else if (!name.compare("BEBC_CC1ppim_XSec_1DEnu_antinu")) {
return (new BEBC_CC1ppim_XSec_1DEnu_antinu(samplekey));
} else if (!name.compare("BEBC_CC1ppim_XSec_1DQ2_antinu")) {
return (new BEBC_CC1ppim_XSec_1DQ2_antinu(samplekey));
/*
GGM CC1ppip samples
*/
} else
#endif
#ifndef __NO_GGM__
if (!name.compare("GGM_CC1ppip_XSec_1DEnu_nu")) {
return (new GGM_CC1ppip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("GGM_CC1ppip_Evt_1DQ2_nu")) {
return (new GGM_CC1ppip_Evt_1DQ2_nu(samplekey));
/*
MiniBooNE Samples
*/
/*
CCQE
*/
} else
#endif
#ifndef __NO_MiniBooNE__
if (!name.compare("MiniBooNE_CCQE_XSec_1DQ2_nu") ||
!name.compare("MiniBooNE_CCQELike_XSec_1DQ2_nu")) {
return (new MiniBooNE_CCQE_XSec_1DQ2_nu(samplekey));
} else if (!name.compare("MiniBooNE_CCQE_XSec_1DQ2_antinu") ||
!name.compare("MiniBooNE_CCQELike_XSec_1DQ2_antinu") ||
!name.compare("MiniBooNE_CCQE_CTarg_XSec_1DQ2_antinu")) {
return (new MiniBooNE_CCQE_XSec_1DQ2_antinu(samplekey));
} else if (!name.compare("MiniBooNE_CCQE_XSec_2DTcos_nu") ||
!name.compare("MiniBooNE_CCQELike_XSec_2DTcos_nu")) {
return (new MiniBooNE_CCQE_XSec_2DTcos_nu(samplekey));
} else if (!name.compare("MiniBooNE_CCQE_XSec_2DTcos_antinu") ||
!name.compare("MiniBooNE_CCQELike_XSec_2DTcos_antinu")) {
return (new MiniBooNE_CCQE_XSec_2DTcos_antinu(samplekey));
/*
MiniBooNE CC1pi+
*/
// 1D
} else if (!name.compare("MiniBooNE_CC1pip_XSec_1DEnu_nu")) {
return (new MiniBooNE_CC1pip_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pip_XSec_1DQ2_nu")) {
return (new MiniBooNE_CC1pip_XSec_1DQ2_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pip_XSec_1DTpi_nu")) {
return (new MiniBooNE_CC1pip_XSec_1DTpi_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pip_XSec_1DTu_nu")) {
return (new MiniBooNE_CC1pip_XSec_1DTu_nu(samplekey));
// 2D
} else if (!name.compare("MiniBooNE_CC1pip_XSec_2DQ2Enu_nu")) {
return (new MiniBooNE_CC1pip_XSec_2DQ2Enu_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pip_XSec_2DTpiCospi_nu")) {
return (new MiniBooNE_CC1pip_XSec_2DTpiCospi_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pip_XSec_2DTpiEnu_nu")) {
return (new MiniBooNE_CC1pip_XSec_2DTpiEnu_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pip_XSec_2DTuCosmu_nu")) {
return (new MiniBooNE_CC1pip_XSec_2DTuCosmu_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pip_XSec_2DTuEnu_nu")) {
return (new MiniBooNE_CC1pip_XSec_2DTuEnu_nu(samplekey));
/*
MiniBooNE CC1pi0
*/
} else if (!name.compare("MiniBooNE_CC1pi0_XSec_1DEnu_nu")) {
return (new MiniBooNE_CC1pi0_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pi0_XSec_1DQ2_nu")) {
return (new MiniBooNE_CC1pi0_XSec_1DQ2_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pi0_XSec_1DTu_nu")) {
return (new MiniBooNE_CC1pi0_XSec_1DTu_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pi0_XSec_1Dcosmu_nu")) {
return (new MiniBooNE_CC1pi0_XSec_1Dcosmu_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pi0_XSec_1Dcospi0_nu")) {
return (new MiniBooNE_CC1pi0_XSec_1Dcospi0_nu(samplekey));
} else if (!name.compare("MiniBooNE_CC1pi0_XSec_1Dppi0_nu")) {
return (new MiniBooNE_CC1pi0_XSec_1Dppi0_nu(samplekey));
} else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu") ||
!name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_rhc")) {
return (new MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu(samplekey));
} else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_nu") ||
!name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_fhc")) {
return (new MiniBooNE_NC1pi0_XSec_1Dcospi0_nu(samplekey));
} else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_antinu") ||
!name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_rhc")) {
return (new MiniBooNE_NC1pi0_XSec_1Dppi0_antinu(samplekey));
} else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_nu") ||
!name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_fhc")) {
return (new MiniBooNE_NC1pi0_XSec_1Dppi0_nu(samplekey));
/*
MiniBooNE NCEL
*/
} else if (!name.compare("MiniBooNE_NCEL_XSec_Treco_nu")) {
return (new MiniBooNE_NCEL_XSec_Treco_nu(samplekey));
+ } else
+#endif
+#ifndef __NO_MicroBooNE__
/*
- MINERvA Samples
+ MicroBooNE Samples
+ */
+
+ /*
+ MicroBooNE CCinclusive
*/
+ if (!name.compare("MicroBooNE_CCInc_XSec_2DPcos_nu")) {
+ return (new MicroBooNE_CCInc_XSec_2DPcos_nu(samplekey));
} else
#endif
+
#ifndef __NO_MINERvA__
+ /*
+ MINERvA Samples
+ */
if (!name.compare("MINERvA_CCQE_XSec_1DQ2_nu") ||
!name.compare("MINERvA_CCQE_XSec_1DQ2_nu_20deg") ||
!name.compare("MINERvA_CCQE_XSec_1DQ2_nu_oldflux") ||
!name.compare("MINERvA_CCQE_XSec_1DQ2_nu_20deg_oldflux")) {
return (new MINERvA_CCQE_XSec_1DQ2_nu(samplekey));
} else if (!name.compare("MINERvA_CCQE_XSec_1DQ2_antinu") ||
!name.compare("MINERvA_CCQE_XSec_1DQ2_antinu_20deg") ||
!name.compare("MINERvA_CCQE_XSec_1DQ2_antinu_oldflux") ||
!name.compare("MINERvA_CCQE_XSec_1DQ2_antinu_20deg_oldflux")) {
return (new MINERvA_CCQE_XSec_1DQ2_antinu(samplekey));
} else if (!name.compare("MINERvA_CCQE_XSec_1DQ2_joint_oldflux") ||
!name.compare("MINERvA_CCQE_XSec_1DQ2_joint_20deg_oldflux") ||
!name.compare("MINERvA_CCQE_XSec_1DQ2_joint") ||
!name.compare("MINERvA_CCQE_XSec_1DQ2_joint_20deg")) {
return (new MINERvA_CCQE_XSec_1DQ2_joint(samplekey));
} else if (!name.compare("MINERvA_CC0pi_XSec_1DEe_nue")) {
return (new MINERvA_CC0pi_XSec_1DEe_nue(samplekey));
} else if (!name.compare("MINERvA_CC0pi_XSec_1DQ2_nue")) {
return (new MINERvA_CC0pi_XSec_1DQ2_nue(samplekey));
} else if (!name.compare("MINERvA_CC0pi_XSec_1DThetae_nue")) {
return (new MINERvA_CC0pi_XSec_1DThetae_nue(samplekey));
} else if (!name.compare("MINERvA_CC0pinp_STV_XSec_1Dpmu_nu") ||
!name.compare("MINERvA_CC0pinp_STV_XSec_1Dthmu_nu") ||
!name.compare("MINERvA_CC0pinp_STV_XSec_1Dpprot_nu") ||
!name.compare("MINERvA_CC0pinp_STV_XSec_1Dthprot_nu") ||
!name.compare("MINERvA_CC0pinp_STV_XSec_1Dpnreco_nu") ||
!name.compare("MINERvA_CC0pinp_STV_XSec_1Ddalphat_nu") ||
!name.compare("MINERvA_CC0pinp_STV_XSec_1Ddpt_nu") ||
!name.compare("MINERvA_CC0pinp_STV_XSec_1Ddphit_nu")) {
return (new MINERvA_CC0pinp_STV_XSec_1D_nu(samplekey));
} else if (!name.compare("MINERvA_CC0pi_XSec_1DQ2_nu_proton")) {
return (new MINERvA_CC0pi_XSec_1DQ2_nu_proton(samplekey));
} else if (!name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtC_nu") ||
!name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtCH_nu") ||
!name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtFe_nu") ||
!name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtPb_nu")) {
return (new MINERvA_CC0pi_XSec_1DQ2_Tgt_nu(samplekey));
} else if (!name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtRatioC_nu") ||
!name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtRatioFe_nu") ||
!name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtRatioPb_nu")) {
return (new MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu(samplekey));
// Dan Ruterbories measurements of late 2018
} else if ( !name.compare("MINERvA_CC0pi_XSec_2Dptpz_nu")) {
return (new MINERvA_CC0pi_XSec_2D_nu(samplekey));
} else if ( !name.compare("MINERvA_CC0pi_XSec_1Dpt_nu") ||
!name.compare("MINERvA_CC0pi_XSec_1Dpz_nu") ||
!name.compare("MINERvA_CC0pi_XSec_1DQ2QE_nu") ||
!name.compare("MINERvA_CC0pi_XSec_1DEnuQE_nu")) {
return (new MINERvA_CC0pi_XSec_1D_2018_nu(samplekey));
// C. Patrick's early 2018 measurements
} else if ( !name.compare("MINERvA_CC0pi_XSec_2Dptpz_antinu") ||
!name.compare("MINERvA_CC0pi_XSec_2DQ2QEEnuQE_antinu") ||
!name.compare("MINERvA_CC0pi_XSec_2DQ2QEEnuTrue_antinu")) {
return (new MINERvA_CC0pi_XSec_2D_antinu(samplekey));
/*
CC1pi+
*/
// DONE
} else if (!name.compare("MINERvA_CC1pip_XSec_1DTpi_nu") ||
!name.compare("MINERvA_CC1pip_XSec_1DTpi_nu_20deg") ||
!name.compare("MINERvA_CC1pip_XSec_1DTpi_nu_fluxcorr") ||
!name.compare("MINERvA_CC1pip_XSec_1DTpi_nu_20deg_fluxcorr")) {
return (new MINERvA_CC1pip_XSec_1DTpi_nu(samplekey));
// DONE
} else if (!name.compare("MINERvA_CC1pip_XSec_1Dth_nu") ||
!name.compare("MINERvA_CC1pip_XSec_1Dth_nu_20deg") ||
!name.compare("MINERvA_CC1pip_XSec_1Dth_nu_fluxcorr") ||
!name.compare("MINERvA_CC1pip_XSec_1Dth_nu_20deg_fluxcorr")) {
return (new MINERvA_CC1pip_XSec_1Dth_nu(samplekey));
} else if (!name.compare("MINERvA_CC1pip_XSec_1DTpi_nu_2017") ||
!name.compare("MINERvA_CC1pip_XSec_1Dth_nu_2017") ||
!name.compare("MINERvA_CC1pip_XSec_1Dpmu_nu_2017") ||
!name.compare("MINERvA_CC1pip_XSec_1Dthmu_nu_2017") ||
!name.compare("MINERvA_CC1pip_XSec_1DQ2_nu_2017") ||
!name.compare("MINERvA_CC1pip_XSec_1DEnu_nu_2017")) {
return (new MINERvA_CC1pip_XSec_1D_2017Update(samplekey));
/*
CCNpi+
*/
} else if (!name.compare("MINERvA_CCNpip_XSec_1Dth_nu") ||
!name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2015") ||
!name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2016") ||
!name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2015_20deg") ||
!name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2015_fluxcorr") ||
!name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2015_20deg_fluxcorr")) {
return (new MINERvA_CCNpip_XSec_1Dth_nu(samplekey));
} else if (!name.compare("MINERvA_CCNpip_XSec_1DTpi_nu") ||
!name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_2015") ||
!name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_2016") ||
!name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_2015_20deg") ||
!name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_2015_fluxcorr") ||
!name.compare(
"MINERvA_CCNpip_XSec_1DTpi_nu_2015_20deg_fluxcorr")) {
return (new MINERvA_CCNpip_XSec_1DTpi_nu(samplekey));
} else if (!name.compare("MINERvA_CCNpip_XSec_1Dthmu_nu")) {
return (new MINERvA_CCNpip_XSec_1Dthmu_nu(samplekey));
} else if (!name.compare("MINERvA_CCNpip_XSec_1Dpmu_nu")) {
return (new MINERvA_CCNpip_XSec_1Dpmu_nu(samplekey));
} else if (!name.compare("MINERvA_CCNpip_XSec_1DQ2_nu")) {
return (new MINERvA_CCNpip_XSec_1DQ2_nu(samplekey));
} else if (!name.compare("MINERvA_CCNpip_XSec_1DEnu_nu")) {
return (new MINERvA_CCNpip_XSec_1DEnu_nu(samplekey));
/*
MINERvA CC1pi0 anti-nu
*/
// Done
} else if (!name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu") ||
!name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_2015") ||
!name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_2016") ||
!name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_fluxcorr") ||
!name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_2015_fluxcorr") ||
!name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_2016_fluxcorr")) {
return (new MINERvA_CC1pi0_XSec_1Dth_antinu(samplekey));
} else if (!name.compare("MINERvA_CC1pi0_XSec_1Dppi0_antinu") ||
!name.compare("MINERvA_CC1pi0_XSec_1Dppi0_antinu_fluxcorr")) {
return (new MINERvA_CC1pi0_XSec_1Dppi0_antinu(samplekey));
} else if (!name.compare("MINERvA_CC1pi0_XSec_1DTpi0_antinu")) {
return (new MINERvA_CC1pi0_XSec_1DTpi0_antinu(samplekey));
// Done
} else if (!name.compare("MINERvA_CC1pi0_XSec_1DQ2_antinu")) {
return (new MINERvA_CC1pi0_XSec_1DQ2_antinu(samplekey));
// Done
} else if (!name.compare("MINERvA_CC1pi0_XSec_1Dthmu_antinu")) {
return (new MINERvA_CC1pi0_XSec_1Dthmu_antinu(samplekey));
// Done
} else if (!name.compare("MINERvA_CC1pi0_XSec_1Dpmu_antinu")) {
return (new MINERvA_CC1pi0_XSec_1Dpmu_antinu(samplekey));
// Done
} else if (!name.compare("MINERvA_CC1pi0_XSec_1DEnu_antinu")) {
return (new MINERvA_CC1pi0_XSec_1DEnu_antinu(samplekey));
// MINERvA CC1pi0 nu
} else if (!name.compare("MINERvA_CC1pi0_XSec_1DTpi_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1Dth_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1Dpmu_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1Dthmu_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1DQ2_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1DEnu_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1DWexp_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1DPPi0Mass_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1DPPi0MassDelta_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1DCosAdler_nu") ||
!name.compare("MINERvA_CC1pi0_XSec_1DPhiAdler_nu")) {
return (new MINERvA_CC1pi0_XSec_1D_nu(samplekey));
/*
CCINC
*/
} else if (!name.compare("MINERvA_CCinc_XSec_2DEavq3_nu")) {
return (new MINERvA_CCinc_XSec_2DEavq3_nu(samplekey));
} else if (!name.compare("MINERvA_CCinc_XSec_1Dx_ratio_C12_CH") ||
!name.compare("MINERvA_CCinc_XSec_1Dx_ratio_Fe56_CH") ||
!name.compare("MINERvA_CCinc_XSec_1Dx_ratio_Pb208_CH")) {
return (new MINERvA_CCinc_XSec_1Dx_ratio(samplekey));
} else if (!name.compare("MINERvA_CCinc_XSec_1DEnu_ratio_C12_CH") ||
!name.compare("MINERvA_CCinc_XSec_1DEnu_ratio_Fe56_CH") ||
!name.compare("MINERvA_CCinc_XSec_1DEnu_ratio_Pb208_CH")) {
return (new MINERvA_CCinc_XSec_1DEnu_ratio(samplekey));
/*
CCDIS
*/
} else if (!name.compare("MINERvA_CCDIS_XSec_1Dx_ratio_C12_CH") ||
!name.compare("MINERvA_CCDIS_XSec_1Dx_ratio_Fe56_CH") ||
!name.compare("MINERvA_CCDIS_XSec_1Dx_ratio_Pb208_CH")) {
return (new MINERvA_CCDIS_XSec_1Dx_ratio(samplekey));
} else if (!name.compare("MINERvA_CCDIS_XSec_1DEnu_ratio_C12_CH") ||
!name.compare("MINERvA_CCDIS_XSec_1DEnu_ratio_Fe56_CH") ||
!name.compare("MINERvA_CCDIS_XSec_1DEnu_ratio_Pb208_CH")) {
return (new MINERvA_CCDIS_XSec_1DEnu_ratio(samplekey));
/*
CC-COH
*/
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1DEnu_nu")) {
return (new MINERvA_CCCOHPI_XSec_1DEnu_nu(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1DEpi_nu")) {
return (new MINERvA_CCCOHPI_XSec_1DEpi_nu(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1Dth_nu")) {
return (new MINERvA_CCCOHPI_XSec_1Dth_nu(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1DQ2_nu")) {
return (new MINERvA_CCCOHPI_XSec_1DQ2_nu(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1DEnu_antinu")) {
return (new MINERvA_CCCOHPI_XSec_1DEnu_antinu(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1DEpi_antinu")) {
return (new MINERvA_CCCOHPI_XSec_1DEpi_antinu(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1Dth_antinu")) {
return (new MINERvA_CCCOHPI_XSec_1Dth_antinu(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1DQ2_antinu")) {
return (new MINERvA_CCCOHPI_XSec_1DQ2_antinu(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1DEnu_joint")) {
return (new MINERvA_CCCOHPI_XSec_joint(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1DEpi_joint")) {
return (new MINERvA_CCCOHPI_XSec_joint(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1Dth_joint")) {
return (new MINERvA_CCCOHPI_XSec_joint(samplekey));
} else if (!name.compare("MINERvA_CCCOHPI_XSec_1DQ2_joint")) {
return (new MINERvA_CCCOHPI_XSec_joint(samplekey));
/*
T2K Samples
*/
} else
#endif
#ifndef __NO_T2K__
if (!name.compare("T2K_CC0pi_XSec_2DPcos_nu") ||
!name.compare("T2K_CC0pi_XSec_2DPcos_nu_I") ||
!name.compare("T2K_CC0pi_XSec_2DPcos_nu_II")) {
return (new T2K_CC0pi_XSec_2DPcos_nu(samplekey));
} else if (!name.compare("T2K_CC0pi_XSec_2DPcos_nu_nonuniform")) {
return (new T2K_CC0pi_XSec_2DPcos_nu_nonuniform(samplekey));
} else if (!name.compare("T2K_CCinc_XSec_2DPcos_nu_nonuniform")) {
return (new T2K_CCinc_XSec_2DPcos_nu_nonuniform(samplekey));
/*
T2K CC1pi+ CH samples
*/
// Comment these out for now because we don't have the proper data
} else if (!name.compare("T2K_CC1pip_CH_XSec_2Dpmucosmu_nu")) {
return (new T2K_CC1pip_CH_XSec_2Dpmucosmu_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_CH_XSec_1Dppi_nu")) {
return (new T2K_CC1pip_CH_XSec_1Dppi_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_CH_XSec_1Dthpi_nu")) {
return (new T2K_CC1pip_CH_XSec_1Dthpi_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_CH_XSec_1Dthmupi_nu")) {
return (new T2K_CC1pip_CH_XSec_1Dthmupi_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_CH_XSec_1DQ2_nu")) {
return (new T2K_CC1pip_CH_XSec_1DQ2_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_CH_XSec_1DAdlerPhi_nu")) {
return (new T2K_CC1pip_CH_XSec_1DAdlerPhi_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_CH_XSec_1DCosThAdler_nu")) {
return (new T2K_CC1pip_CH_XSec_1DCosThAdler_nu(samplekey));
// Maybe something for the future: were in Raquel's thesis
//} else if (!name.compare("T2K_CC1pip_CH_XSec_1Dq3_nu")) {
//return (new T2K_CC1pip_CH_XSec_1Dq3_nu(file, rw, type, fkdt));
//} else if (!name.compare("T2K_CC1pip_CH_XSec_1Dthq3pi_nu")) {
//return (new T2K_CC1pip_CH_XSec_1Dthq3pi_nu(file, rw, type, fkdt));
//} else if (!name.compare("T2K_CC1pip_CH_XSec_1DWrec_nu")) {
//return (new T2K_CC1pip_CH_XSec_1DWrec_nu(file, rw, type, fkdt));
/*
T2K CC1pi+ H2O samples
*/
} else if (!name.compare("T2K_CC1pip_H2O_XSec_1DEnuDelta_nu")) {
return (new T2K_CC1pip_H2O_XSec_1DEnuDelta_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_H2O_XSec_1DEnuMB_nu")) {
return (new T2K_CC1pip_H2O_XSec_1DEnuMB_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dcosmu_nu")) {
return (new T2K_CC1pip_H2O_XSec_1Dcosmu_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dcosmupi_nu")) {
return (new T2K_CC1pip_H2O_XSec_1Dcosmupi_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dcospi_nu")) {
return (new T2K_CC1pip_H2O_XSec_1Dcospi_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dpmu_nu")) {
return (new T2K_CC1pip_H2O_XSec_1Dpmu_nu(samplekey));
} else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dppi_nu")) {
return (new T2K_CC1pip_H2O_XSec_1Dppi_nu(samplekey));
/*
T2K CC0pi + np CH samples
*/
} else if (!name.compare("T2K_CC0pinp_STV_XSec_1Ddpt_nu")) {
return (new T2K_CC0pinp_STV_XSec_1Ddpt_nu(samplekey));
} else if (!name.compare("T2K_CC0pinp_STV_XSec_1Ddphit_nu")) {
return (new T2K_CC0pinp_STV_XSec_1Ddphit_nu(samplekey));
} else if (!name.compare("T2K_CC0pinp_STV_XSec_1Ddat_nu")) {
return (new T2K_CC0pinp_STV_XSec_1Ddat_nu(samplekey));
} else if (!name.compare("T2K_CC0pi1p_XSec_3DPcoscos_nu_nonuniform")) {
return (new T2K_CC0pi1p_XSec_3DPcoscos_nu_nonuniform(samplekey));
} else if (!name.compare("T2K_CC0pinp_ifk_XSec_3Dinfp_nu")) {
return (new T2K_CC0pinp_ifk_XSec_3Dinfp_nu(samplekey));
} else if (!name.compare("T2K_CC0pinp_ifk_XSec_3Dinfa_nu")) {
return (new T2K_CC0pinp_ifk_XSec_3Dinfa_nu(samplekey));
} else if (!name.compare("T2K_CC0pinp_ifk_XSec_3Dinfip_nu")) {
return (new T2K_CC0pinp_ifk_XSec_3Dinfip_nu(samplekey));
// SciBooNE COH studies
} else
#endif
#ifndef __NO_SciBooNE__
if (!name.compare("SciBooNE_CCCOH_STOP_NTrks_nu")) {
return (new SciBooNE_CCCOH_STOP_NTrks_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_1TRK_1DQ2_nu")) {
return (new SciBooNE_CCCOH_1TRK_1DQ2_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_1TRK_1Dpmu_nu")) {
return (new SciBooNE_CCCOH_1TRK_1Dpmu_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_1TRK_1Dthetamu_nu")) {
return (new SciBooNE_CCCOH_1TRK_1Dthetamu_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPr_1DQ2_nu")) {
return (new SciBooNE_CCCOH_MuPr_1DQ2_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPr_1Dpmu_nu")) {
return (new SciBooNE_CCCOH_MuPr_1Dpmu_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPr_1Dthetamu_nu")) {
return (new SciBooNE_CCCOH_MuPr_1Dthetamu_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPiVA_1DQ2_nu")) {
return (new SciBooNE_CCCOH_MuPiVA_1DQ2_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPiVA_1Dpmu_nu")) {
return (new SciBooNE_CCCOH_MuPiVA_1Dpmu_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPiVA_1Dthetamu_nu")) {
return (new SciBooNE_CCCOH_MuPiVA_1Dthetamu_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPiNoVA_1DQ2_nu")) {
return (new SciBooNE_CCCOH_MuPiNoVA_1DQ2_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPiNoVA_1Dthetapr_nu")) {
return (new SciBooNE_CCCOH_MuPiNoVA_1Dthetapr_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPiNoVA_1Dthetapi_nu")) {
return (new SciBooNE_CCCOH_MuPiNoVA_1Dthetapi_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPiNoVA_1Dthetamu_nu")) {
return (new SciBooNE_CCCOH_MuPiNoVA_1Dthetamu_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_MuPiNoVA_1Dpmu_nu")) {
return (new SciBooNE_CCCOH_MuPiNoVA_1Dpmu_nu(samplekey));
} else if (!name.compare("SciBooNE_CCCOH_STOPFINAL_1DQ2_nu")) {
return (new SciBooNE_CCCOH_STOPFINAL_1DQ2_nu(samplekey));
/*
K2K Samples
*/
/*
NC1pi0
*/
} else
#endif
#ifndef __NO_K2K__
if (!name.compare("K2K_NC1pi0_Evt_1Dppi0_nu")) {
return (new K2K_NC1pi0_Evt_1Dppi0_nu(samplekey));
/*
Fake Studies
*/
} else
#endif
if (name.find("ExpMultDist_CCQE_XSec_1D") != std::string::npos &&
name.find("_FakeStudy") != std::string::npos) {
return (
new ExpMultDist_CCQE_XSec_1DVar_FakeStudy(name, file, rw, type, fkdt));
} else if (name.find("ExpMultDist_CCQE_XSec_2D") != std::string::npos &&
name.find("_FakeStudy") != std::string::npos) {
return (
new ExpMultDist_CCQE_XSec_2DVar_FakeStudy(name, file, rw, type, fkdt));
} else if (name.find("GenericFlux_") != std::string::npos) {
return (new GenericFlux_Tester(name, file, rw, type, fkdt));
} else if (name.find("GenericVectors_") != std::string::npos) {
return (new GenericFlux_Vectors(name, file, rw, type, fkdt));
} else if (!name.compare("T2K2017_FakeData")) {
return (new T2K2017_FakeData(samplekey));
} else if (!name.compare("MCStudy_CCQE")) {
return (new MCStudy_CCQEHistograms(name, file, rw, type, fkdt));
} else if (!name.compare("ElectronFlux_FlatTree")) {
return (new ElectronFlux_FlatTree(name, file, rw, type, fkdt));
} else if (name.find("ElectronData_") != std::string::npos) {
return new ElectronScattering_DurhamData(samplekey);
} else if (name.find("MuonValidation_") != std::string::npos) {
return (new MCStudy_MuonValidation(name, file, rw, type, fkdt));
} else if (!name.compare("NIWGOfficialPlots")) {
return (new OfficialNIWGPlots(samplekey));
} else if (!name.compare("Simple_Osc")) {
return (new Simple_Osc(samplekey));
} else if (!name.compare("Smear_SVDUnfold_Propagation_Osc")) {
return (new Smear_SVDUnfold_Propagation_Osc(samplekey));
} else {
THROW("Error: No such sample: " << name << std::endl);
}
// Return NULL if no sample loaded.
return NULL;
}
}
diff --git a/src/MicroBooNE/CMakeLists.txt b/src/MicroBooNE/CMakeLists.txt
new file mode 100644
index 0000000..775d829
--- /dev/null
+++ b/src/MicroBooNE/CMakeLists.txt
@@ -0,0 +1,48 @@
+# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+################################################################################
+# This file is part of NUISANCE.
+#
+# NUISANCE is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# NUISANCE is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with NUISANCE. If not, see <http://www.gnu.org/licenses/>.
+################################################################################
+set(IMPLFILES
+MicroBooNE_CCInc_XSec_2DPcos_nu.cxx
+)
+
+set(HEADERFILES
+MicroBooNE_CCInc_XSec_2DPcos_nu.h
+)
+
+set(LIBNAME expMicroBooNE)
+
+if(CMAKE_BUILD_TYPE MATCHES DEBUG)
+ add_library(${LIBNAME} STATIC ${IMPLFILES})
+else(CMAKE_BUILD_TYPE MATCHES RELEASE)
+ add_library(${LIBNAME} SHARED ${IMPLFILES})
+endif()
+
+include_directories(${MINIMUM_INCLUDE_DIRECTORIES})
+
+set_target_properties(${LIBNAME} PROPERTIES VERSION
+ "${NUISANCE_VERSION_MAJOR}.${NUISANCE_VERSION_MINOR}.${NUISANCE_VERSION_REVISION}")
+#set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS ${ROOT_LD_FLAGS})
+if(DEFINED PROJECTWIDE_EXTRA_DEPENDENCIES)
+ add_dependencies(${LIBNAME} ${PROJECTWIDE_EXTRA_DEPENDENCIES})
+endif()
+
+install(TARGETS ${LIBNAME} DESTINATION lib)
+#Can uncomment this to install the headers... but is it really neccessary?
+#install(FILES ${HEADERFILES} DESTINATION include)
+
+set(MODULETargets ${MODULETargets} ${LIBNAME} PARENT_SCOPE)
diff --git a/src/MicroBooNE/MicroBooNE_CCInc_XSec_2DPcos_nu.cxx b/src/MicroBooNE/MicroBooNE_CCInc_XSec_2DPcos_nu.cxx
new file mode 100644
index 0000000..12d845c
--- /dev/null
+++ b/src/MicroBooNE/MicroBooNE_CCInc_XSec_2DPcos_nu.cxx
@@ -0,0 +1,251 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+* This file is part of NUISANCE.
+*
+* NUISANCE is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* NUISANCE is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with NUISANCE. If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#include "MicroBooNE_CCInc_XSec_2DPcos_nu.h"
+
+//********************************************************************
+MicroBooNE_CCInc_XSec_2DPcos_nu::MicroBooNE_CCInc_XSec_2DPcos_nu(nuiskey samplekey) {
+//********************************************************************
+
+ // Sample overview ---------------------------------------------------
+ std::string descrip = "MicroBooNE_CCInc_XSec_2DPcos_nu sample. \n" \
+ "Target: Ar \n" \
+ "Flux: BNB FHC numu \n" \
+ "Signal: CC inclusive \n";
+
+ // Setup common settings
+ fSettings = LoadSampleSettings(samplekey);
+ fSettings.SetDescription(descrip);
+ fSettings.SetXTitle("P_{#mu}^{reco} (GeV)");
+ fSettings.SetYTitle("cos#theta_{#mu}^{reco}");
+ fSettings.SetZTitle("d^{2}#sigma/dP_{#mu}^{reco}dcos#theta_{#mu}^{reco} (cm^{2}/GeV)");
+ fSettings.SetAllowedTypes("FULL,DIAG/FREE,SHAPE,FIX/SYSTCOV/STATCOV","FIX/FULL");
+ fSettings.SetEnuRange(0.0, 10.0);
+ fSettings.DefineAllowedTargets("Ar");
+
+ // Plot information
+ fSettings.SetTitle("MicroBooNE_CCInc_XSec_2DPcos_nu");
+ fSettings.DefineAllowedSpecies("numu");
+
+ FinaliseSampleSettings();
+
+ // Scaling Setup ---------------------------------------------------
+ // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+ fScaleFactor = ((GetEventHistogram()->Integral("width")/(fNEvents+0.)) * 1E-38 / (TotalIntegratedFlux()));
+
+ // Setup Histograms
+ SetHistograms();
+
+ // Final setup ---------------------------------------------------
+ FinaliseMeasurement();
+};
+
+
+bool MicroBooNE_CCInc_XSec_2DPcos_nu::isSignal(FitEvent* event) {
+ return SignalDef::isCCINC(event, 14, EnuMin, EnuMax);
+};
+
+
+void MicroBooNE_CCInc_XSec_2DPcos_nu::FillEventVariables(FitEvent* event) {
+ if (event->NumFSParticle(13) == 0) {
+ return;
+ }
+
+ TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
+ TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+
+ double pmu = Pmu.Vect().Mag() / 1000;
+ double CosThetaMu = cos(Pnu.Vect().Angle(Pmu.Vect()));
+
+ fXVar = pmu;
+ fYVar = CosThetaMu;
+
+ return;
+};
+
+
+void MicroBooNE_CCInc_XSec_2DPcos_nu::FillHistograms() {
+ Measurement1D::FillHistograms();
+ if (Signal) {
+ fMCHist_Fine2D->Fill(fXVar, fYVar, Weight);
+ FillMCSlice(fXVar, fYVar, Weight);
+ }
+}
+
+
+void MicroBooNE_CCInc_XSec_2DPcos_nu::ConvertEventRates() {
+ for (size_t i=0; i<fMCHist_Slices.size(); i++) {
+ fMCHist_Slices[i]->GetSumw2();
+ }
+
+ // Do standard conversion
+ Measurement1D::ConvertEventRates();
+
+ // Apply MC truth -> reco smearing
+ std::vector<TH1D*> slices_true;
+ for (size_t i=0; i<fMCHist_Slices.size(); i++) {
+ TH1D* h = (TH1D*) fMCHist_Slices[i]->Clone(TString(fMCHist_Slices[i]->GetName()) + "_true");
+ slices_true.push_back(h);
+ }
+
+ for (int ireco=1; ireco<fMCHist->GetNbinsX()+1; ireco++) {
+ double total = 0;
+ for (int itrue=1; itrue<fMCHist->GetNbinsX()+1; itrue++) {
+ std::pair<size_t, size_t> idx = fPolyBinMap[itrue];
+ TH1D* h = slices_true[idx.first];
+ total += h->GetBinContent(idx.second+1) * h->GetBinWidth(idx.second+1) * fSmearingMatrix->operator()(ireco-1, itrue-1);
+ }
+ std::pair<size_t, size_t> idx = fPolyBinMap[ireco];
+ TH1D* h = fMCHist_Slices[idx.first];
+ h->SetBinContent(idx.second+1, total / h->GetBinWidth(idx.second+1));
+ }
+
+ for (size_t i=0; i<slices_true.size(); i++) {
+ delete slices_true[i];
+ }
+
+ // Scale MC slices also by their width in Y
+ for (size_t i=0; i<fMCHist_Slices.size(); i++) {
+ float w = fEdgesCt[i+1] - fEdgesCt[i];
+ fMCHist_Slices[i]->Scale(1.0 / w);
+ }
+
+ // Convert into 1D list
+ fMCHist->Reset();
+ int bincount = 0;
+ for (size_t i=0; i<fDataHist_Slices.size(); i++) {
+ for (int j=0; j<fDataHist_Slices[i]->GetNbinsX(); j++) {
+ fMCHist->SetBinContent(bincount+1, fMCHist_Slices[i]->GetBinContent(j+1));
+ fMCHist->SetBinError(bincount+1, fMCHist_Slices[i]->GetBinError(j+1));
+ bincount++;
+ }
+ }
+}
+
+
+void MicroBooNE_CCInc_XSec_2DPcos_nu::FillMCSlice(double x, double y, double w) {
+ if (y >= -1.00 && y < -0.50) fMCHist_Slices[0]->Fill(x, w);
+ else if (y >= -0.50 && y < 0.00) fMCHist_Slices[1]->Fill(x, w);
+ else if (y >= 0.00 && y < 0.27) fMCHist_Slices[2]->Fill(x, w);
+ else if (y >= 0.27 && y < 0.45) fMCHist_Slices[3]->Fill(x, w);
+ else if (y >= 0.45 && y < 0.62) fMCHist_Slices[4]->Fill(x, w);
+ else if (y >= 0.62 && y < 0.76) fMCHist_Slices[5]->Fill(x, w);
+ else if (y >= 0.76 && y < 0.86) fMCHist_Slices[6]->Fill(x, w);
+ else if (y >= 0.86 && y < 0.94) fMCHist_Slices[7]->Fill(x, w);
+ else if (y >= 0.94 && y <= 1.00) fMCHist_Slices[8]->Fill(x, w);
+}
+
+
+void MicroBooNE_CCInc_XSec_2DPcos_nu::SetHistograms() {
+ // Read in 1D Data Histograms
+ fInputFile = new TFile( (FitPar::GetDataBase() + "/MicroBooNE/CCinc/microboone_numu_cc_inclusive.root").c_str());
+
+ // Read in 1D Data
+ fDataHist = (TH1D*) fInputFile->Get("xsec_data");
+ fDataHist->Scale(1e-38);
+
+ fMCHist_Fine2D = new TH2D("MicroBooNE_CCInc_XSec_2DPcos_nu_Fine2D",
+ "MicroBooNE_CCInc_XSec_2DPcos_nu_Fine2D",
+ 400, 0.0, 2.5, 100, -1.0, 1.0);
+ SetAutoProcessTH1(fMCHist_Fine2D);
+
+ // Load covariance matrix
+ TH2D* tempcov = (TH2D*) fInputFile->Get("covariance_matrix");
+
+ fFullCovar = new TMatrixDSym(fDataHist->GetNbinsX());
+ for (int i=0; i<fDataHist->GetNbinsX(); i++) {
+ for (int j=0; j<fDataHist->GetNbinsX(); j++) {
+ (*fFullCovar)(i,j) = tempcov->GetBinContent(i+1, j+1);
+ }
+ }
+
+ fDecomp = StatUtils::GetDecomp(fFullCovar);
+
+ // Load smearing matrix
+ TH2D* tempsmear = (TH2D*) fInputFile->Get("smearing_matrix");
+
+ fSmearingMatrix = new TMatrixDSym(fDataHist->GetNbinsX());
+ for (int i=0; i<fDataHist->GetNbinsX(); i++) {
+ for (int j=0; j<fDataHist->GetNbinsX(); j++) {
+ (*fSmearingMatrix)(i,j) = tempsmear->GetBinContent(i+1, j+1);
+ }
+ }
+
+ // Mapping of polybins to costheta slices
+ fPolyBinIDs = {
+ { 1, 2, 3, 4, 5 },
+ { 6, 7, 8, 9, 10 },
+ { 11, 12, 13, 14, 15 },
+ { 16, 17, 18, 19 },
+ { 20, 21, 22, 23 },
+ { 24, 25, 26, 27 },
+ { 28, 29, 30, 31, 32 },
+ { 33, 34, 35, 36, 37 },
+ { 38, 39, 40, 41, 42 }
+ };
+
+ for (size_t i=0; i<fPolyBinIDs.size(); i++) {
+ for (size_t j=0; j<fPolyBinIDs[i].size(); j++) {
+ int id = fPolyBinIDs[i][j];
+ fPolyBinMap[id] = { i, j };
+ }
+ }
+
+ // Bin edges
+ fEdgesCt = { -1.00, -0.50, 0.00, 0.27, 0.45, 0.62, 0.76, 0.86, 0.94, 1.00 };
+
+ fEdgesP = {
+ { 0.00, 0.18, 0.30, 0.45, 0.77, 2.50 },
+ { 0.00, 0.18, 0.30, 0.45, 0.77, 2.50 },
+ { 0.00, 0.18, 0.30, 0.45, 0.77, 2.50 },
+ { 0.00, 0.30, 0.45, 0.77, 2.50 },
+ { 0.00, 0.30, 0.45, 0.77, 2.50 },
+ { 0.00, 0.30, 0.45, 0.77, 2.50 },
+ { 0.00, 0.30, 0.45, 0.77, 1.28, 2.50 },
+ { 0.00, 0.30, 0.45, 0.77, 1.28, 2.50 },
+ { 0.00, 0.30, 0.45, 0.77, 1.28, 2.50 }
+ };
+
+ // Split 1D data into cos(theta) slices
+ for (size_t i=0; i<fPolyBinIDs.size(); i++) {
+ TString name = Form("MicroBooNE_CCInc_XSec_2DPcos_nu_data_Slice%lu",i);
+ TH1D* h = new TH1D(name, name, fPolyBinIDs[i].size(), fEdgesP[i].data());
+ h->Sumw2();
+
+ fDataHist_Slices.push_back(h);
+
+ for (size_t j=0; j<fPolyBinIDs[i].size(); j++) {
+ int binid = fPolyBinIDs[i][j];
+ h->SetBinContent(j+1, fDataHist->GetBinContent(binid));
+
+ float err = sqrt((*fFullCovar)(binid-1, binid-1)) * 1e-38;
+ h->SetBinError(j+1, err);
+ fDataHist->SetBinError(binid, err);
+ }
+
+ fMCHist_Slices.push_back((TH1D*) h->Clone());
+ name = Form("MicroBooNE_CCInc_XSec_2DPcos_nu_MC_Slice%lu",i);
+ fMCHist_Slices[i]->SetNameTitle(name, name);
+ fMCHist_Slices[i]->Reset();
+
+ SetAutoProcessTH1(fDataHist_Slices[i], kCMD_Write);
+ SetAutoProcessTH1(fMCHist_Slices[i]);
+ }
+}
+
diff --git a/src/MicroBooNE/MicroBooNE_CCInc_XSec_2DPcos_nu.h b/src/MicroBooNE/MicroBooNE_CCInc_XSec_2DPcos_nu.h
new file mode 100644
index 0000000..e62812a
--- /dev/null
+++ b/src/MicroBooNE/MicroBooNE_CCInc_XSec_2DPcos_nu.h
@@ -0,0 +1,69 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+* This file is part of NUISANCE.
+*
+* NUISANCE is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* NUISANCE is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with NUISANCE. If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#ifndef MICROBOONE_CCINC_2DPCOS_NU_H_SEEN
+#define MICROBOONE_CCINC_2DPCOS_NU_H_SEEN
+
+#include "Measurement1D.h"
+#include "TH2Poly.h"
+#include "MeasurementVariableBox2D.h"
+
+class MicroBooNE_CCInc_XSec_2DPcos_nu : public Measurement1D {
+public:
+
+ /// Basic Constructor.
+ MicroBooNE_CCInc_XSec_2DPcos_nu(nuiskey samplekey);
+
+ /// Virtual Destructor
+ ~MicroBooNE_CCInc_XSec_2DPcos_nu() {};
+
+ /// Numu CCinc Signal Definition
+ bool isSignal(FitEvent* nvect);
+
+ /// Read histograms in a special way because format is different.
+ void SetHistograms();
+
+ /// Bin Pmu CosThetaMu
+ void FillEventVariables(FitEvent* customEvent);
+
+ /// Smear and build 1D MC histogram from slices
+ void ConvertEventRates();
+
+ // Fill Histograms
+ void FillHistograms();
+
+ private:
+
+ TFile* fInputFile;
+ TH2D* fMCHist_Fine2D;
+
+ TMatrixDSym* fSmearingMatrix;
+
+ std::vector<std::vector<int> > fPolyBinIDs;
+ std::vector<std::vector<float> > fEdgesP;
+ std::vector<float> fEdgesCt;
+ std::map<int, std::pair<size_t, size_t> > fPolyBinMap;
+
+ std::vector<TH1D*> fMCHist_Slices;
+ std::vector<TH1D*> fDataHist_Slices;
+
+ void FillMCSlice(double x, double y, double w);
+};
+
+#endif
+
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Jan 21, 1:47 AM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4189478
Default Alt Text
(92 KB)
Attached To
rNUISANCEGIT nuisancegit
Event Timeline
Log In to Comment