diff --git a/CMakeLists.txt b/CMakeLists.txt
index a76b261..a642d38 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,254 +1,256 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
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)
############################### HepMCNuEvt ###################################
include(${CMAKE_SOURCE_DIR}/cmake/HepMCNuEvtSetup.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
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)
#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}")
LIST(APPEND MODULETargets -Wl,--end-group)
LIST(REVERSE MODULETargets)
LIST(APPEND MODULETargets -Wl,--start-group)
LIST(REVERSE 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}")
string(REPLACE "${CMAKE_SOURCE_DIR}/src" "${CMAKE_INSTALL_PREFIX}/include"
ALL_INCLUDES_STR "${ALL_INCLUDES_STR}")
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}")
string(REPLACE "-l-" "-" ALL_MODULETARGETS_STR "${ALL_MODULETARGETS_STR}")
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)
+add_subdirectory(event_gen)
+
install(DIRECTORY ${PROJECT_SOURCE_DIR}/data DESTINATION
${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${PROJECT_SOURCE_DIR}/event_gen DESTINATION
${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${PROJECT_SOURCE_DIR}/parameters DESTINATION
${CMAKE_INSTALL_PREFIX})
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 8a18777..0349363 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -1,100 +1,103 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
set(TARGETS_TO_BUILD)
if(USE_MINIMIZER)
add_executable(nuismin nuismin.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuismin)
add_executable(nuissplines nuissplines.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuissplines)
endif()
include_directories(${RWENGINE_INCLUDE_DIRECTORIES})
include_directories(${CMAKE_SOURCE_DIR}/src/Routines)
include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
include_directories(${CMAKE_SOURCE_DIR}/src/Statistical)
include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
include_directories(${CMAKE_SOURCE_DIR}/src/Config)
include_directories(${CMAKE_SOURCE_DIR}/src/Logger)
include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
include_directories(${CMAKE_SOURCE_DIR}/src/FCN)
include_directories(${CMAKE_SOURCE_DIR}/src/MCStudies)
include_directories(${CMAKE_SOURCE_DIR}/src/Smearceptance)
include_directories(${EXP_INCLUDE_DIRECTORIES})
if (USE_NuWro AND NOT NUWRO_BUILT_FROM_FILE)
add_executable(nuwro_nuisance nuwro_NUISANCE.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuwro_nuisance)
endif()
if (USE_GiBUU)
add_executable(DumpGiBUUEvents DumpGiBUUEvents.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};DumpGiBUUEvents)
endif()
+add_executable(nuis_flat_tree_combiner nuis_flat_tree_combiner.cxx)
+set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuis_flat_tree_combiner)
+
add_executable(nuiscomp nuiscomp.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuiscomp)
add_executable(nuisflat nuisflat.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuisflat)
add_executable(nuissmear nuissmear.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuissmear)
add_executable(nuissyst nuissyst.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuissyst)
add_executable(nuisbayes nuisbayes.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuisbayes)
if(USE_GENIE)
add_executable(PrepareGENIE PrepareGENIE.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};PrepareGENIE)
endif()
if(USE_NEUT)
add_executable(PrepareNEUT PrepareNEUT.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};PrepareNEUT)
endif()
# PREPARE NUWRO
# Commented out for the time being until it is finished..
if(USE_NuWro)
add_executable(PrepareNuwro PrepareNuwroEvents.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};PrepareNuwro)
endif()
add_executable(nuisbac nuisbac.cxx)
set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuisbac)
foreach(targ ${TARGETS_TO_BUILD})
if(NOT "${CMAKE_LINK_FLAGS} ${NUIS_EXE_FLAGS}" STREQUAL " ")
set_target_properties(${targ} PROPERTIES LINK_FLAGS "${CMAKE_LINK_FLAGS} ${NUIS_EXE_FLAGS}")
endif()
target_link_libraries(${targ} ${MODULETargets})
target_link_libraries(${targ} ${CMAKE_DEPENDLIB_FLAGS})
endforeach()
install(TARGETS ${TARGETS_TO_BUILD} DESTINATION bin)
\ No newline at end of file
diff --git a/app/DumpGiBUUEvents.cxx b/app/DumpGiBUUEvents.cxx
index e3e571f..a91d614 100644
--- a/app/DumpGiBUUEvents.cxx
+++ b/app/DumpGiBUUEvents.cxx
@@ -1,49 +1,49 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include
#include "FitLogger.h"
#include "StdHepEvt.h"
int main(int argv, char const *argc[]) {
if (argv != 2) {
NUIS_ABORT("[ERROR]: expected a single input GiBUU rootracker file.");
}
std::string inpf(argc[1]);
if (!inpf.length()) {
NUIS_ABORT("[ERROR]: expected an input GiBUU rootracker file.");
}
TChain tn("giRooTracker");
tn.AddFile(inpf.c_str());
GiBUUStdHepReader giRead;
bool ok = giRead.SetBranchAddresses(&tn);
if (!ok) {
NUIS_ABORT("[ERROR]: Could not correctly set branch address for input file.");
}
for (Long64_t ievt = 0; ievt < tn.GetEntries(); ++ievt) {
tn.GetEntry(ievt);
NUIS_LOG(EVT, WriteGiBUUEvent(giRead));
}
}
diff --git a/app/DumpROOTClassesFromVector.cxx b/app/DumpROOTClassesFromVector.cxx
index 7c22652..c5692d4 100644
--- a/app/DumpROOTClassesFromVector.cxx
+++ b/app/DumpROOTClassesFromVector.cxx
@@ -1,128 +1,128 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "GeneralUtils.h"
#include "TCollection.h"
#include "TError.h"
#include "TFile.h"
#include "TStreamerInfo.h"
#include "TString.h"
#include "TTree.h"
#include
#include
#include
int main(int argc, char const* argv[]) {
// shhh ROOT it okay.
gErrorIgnoreLevel = kError;
if (argc != 4) {
std::cout << "[ERROR](DumpROOTClassesFromVector): Recieved " << (argc - 1)
<< " CLI opts." << std::endl;
for (int i = 1; i < argc; ++i) {
std::cout << "[" << i << "] \"" << argv[i] << "\"" << std::endl;
}
std::cout << "Usage: " << argv[0]
<< " "
""
<< std::endl;
return 1;
}
char const* ROOTFileName = argv[1];
char const* OutputDirectoryName = argv[2];
char const* CSLClasses = argv[3];
TFile* fl = TFile::Open(ROOTFileName);
if (!fl || !fl->IsOpen()) {
std::cerr
<< "[ERROR](DumpROOTClassesFromVector): Failed to open root file: "
<< fl << std::endl;
return 1;
}
std::cout << "[INFO]: Writing project files to " << OutputDirectoryName
<< std::endl;
fl->MakeProject(OutputDirectoryName);
TIter next(fl->GetStreamerInfoList());
TStreamerInfo* inf = 0;
std::vector ClassesToFind =
GeneralUtils::ParseToStr(CSLClasses, ",");
if (!ClassesToFind.size() || !ClassesToFind[0].length()) {
std::cerr
<< "[ERROR](DumpROOTClassesFromVector): No classes to find passed in."
<< std::endl;
return 2;
}
std::vector ClassesToLink;
while ((inf = dynamic_cast(next()))) {
std::cout << "[INFO]: Have StreamerInfo for class: " << inf->GetName()
<< std::endl;
for (size_t ClTF_it = 0; ClTF_it < ClassesToFind.size(); ++ClTF_it) {
if (std::string(inf->GetName()) == ClassesToFind[ClTF_it]) {
ClassesToLink.push_back(inf->GetName());
std::cout << "[INFO]: Including streamer info for: " << inf->GetName()
<< " in generated LinkDef" << std::endl;
}
}
}
if (ClassesToFind.size() > ClassesToLink.size()) {
std::cerr << "[ERROR](DumpROOTClassesFromVector): Only found "
<< ClassesToLink.size()
<< " classes to include in the ROOT library, expected at least "
<< ClassesToFind.size() << std::endl;
return 1;
}
std::string OutputDir(OutputDirectoryName);
size_t pos = OutputDir.find_last_of('/');
pos = (pos == std::string::npos) ? 0 : pos;
std::string LinkDef_loc =
OutputDir + "/" + OutputDir.substr(pos) + "LinkDef.h";
std::cout << "[INFO]: Writing LinkDef to: " << LinkDef_loc << std::endl;
std::ofstream LinkDefos(LinkDef_loc.c_str());
if (!LinkDefos.is_open()) {
std::cerr << "[ERROR] Couldn't open " << LinkDef_loc << " for writing."
<< std::endl;
}
LinkDefos << "#ifdef __CINT__" << std::endl;
for (size_t ClTL_it = 0; ClTL_it < ClassesToLink.size(); ++ClTL_it) {
LinkDefos << "#pragma link C++ class " << ClassesToLink[ClTL_it] << "+;"
<< std::endl;
}
LinkDefos << "#endif" << std::endl;
LinkDefos.close();
std::string Instances_loc =
OutputDir + "/" + OutputDir.substr(pos) + "ProjectInstances.h";
std::ofstream Instancesos(Instances_loc.c_str());
if (!Instancesos.is_open()) {
std::cerr << "[ERROR] Couldn't open " << Instances_loc << " for writing."
<< std::endl;
}
Instancesos.close();
}
diff --git a/app/PrepareGENIE.cxx b/app/PrepareGENIE.cxx
index 2999633..2a9cb69 100644
--- a/app/PrepareGENIE.cxx
+++ b/app/PrepareGENIE.cxx
@@ -1,989 +1,1009 @@
#include "FitLogger.h"
#include "PlotUtils.h"
#include "TFile.h"
#include "TH1D.h"
#include "TTree.h"
#include "TFolder.h"
#include
#include
#ifdef __GENIE_ENABLED__
#ifdef GENIE_PRE_R3
#include "Conventions/Units.h"
#include "GHEP/GHepParticle.h"
#include "PDG/PDGUtils.h"
#else
#include "Framework/Conventions/Units.h"
#include "Framework/GHEP/GHepParticle.h"
#include "Framework/ParticleData/PDGUtils.h"
#endif
#endif
std::string gInputFiles = "";
std::string gOutputFile = "";
std::string gFluxFile = "";
std::string gTarget = "";
double MonoEnergy;
int gNEvents = -999;
bool IsMonoE = false;
+bool useNOvAWeights = false;
void PrintOptions();
void ParseOptions(int argc, char *argv[]);
void RunGENIEPrepareMono(std::string input, std::string target,
std::string output);
void RunGENIEPrepare(std::string input, std::string flux, std::string target,
std::string output);
bool CheckConfig(std::string filename);
int main(int argc, char *argv[]) {
ParseOptions(argc, argv);
if (IsMonoE) {
RunGENIEPrepareMono(gInputFiles, gTarget, gOutputFile);
} else {
RunGENIEPrepare(gInputFiles, gFluxFile, gTarget, gOutputFile);
}
}
// CWret October 2019
// We have to scale the 2p2h cross-section when the 2p2h generator in GENIE is Nieves
// When the 2p2h generator is Empirical no such scaling is needed
// This is needed to match the output of PrepareGENIE to GENIE splines from gspl2root
// Allow the user to override this for debugging
// Search for what model the user ran with
bool CheckConfig(std::string filename) {
TFile *f = new TFile(filename.c_str());
// Get the config
TFolder *first = (TFolder*)f->Get("gconfig");
// Find the GlobalParameterList
TFolder *folder = (TFolder*)first->FindObject("GlobalParameterList/Default");
TIter iter(folder->GetListOfFolders());
TKey *key;
// Should we scale this? Only if Nieves 2p2h
bool ShouldScale = false;
while ((key = (TKey*)iter.Next())) {
std::string name = key->GetName();
// Look for XSecModel (specifies the interaction model GENIE was run with)
// Look for MEC (specifies it's a MEC setting)
// Look for Nieves 2p2h from 2016
if (name.find("XSecModel") != std::string::npos && name.find("MEC-CC") != std::string::npos && name.find("NievesSimoVacasMECPXSec2016") != std::string::npos) {
ShouldScale = true;
}
}
f->Close();
if (!ShouldScale) {
NUIS_LOG(FIT, "Not scaling 2p2h CC events with Nieves..." << std::endl);
} else {
NUIS_LOG(FIT, "Scaling 2p2h CC events with Nieves..." << std::endl);
}
return ShouldScale;
}
void RunGENIEPrepareMono(std::string input, std::string target,
std::string output) {
NUIS_LOG(FIT, "Running GENIE Prepare in mono energetic with E = " << MonoEnergy
<< " GeV");
// Setup TTree
TChain *tn = new TChain("gtree");
std::string first_file = "";
if (input.find_first_of(',') != std::string::npos) {
std::vector inputvect = GeneralUtils::ParseToStr(input, ",");
for (size_t iv_it = 0; iv_it < inputvect.size(); ++iv_it) {
tn->AddFile(inputvect[iv_it].c_str());
NUIS_LOG(FIT, "Added input file: " << inputvect[iv_it]);
if (!first_file.length()) {
first_file = inputvect[iv_it];
}
}
} else { // The Add form can accept wildcards.
tn->Add(input.c_str());
first_file = input;
}
if (tn->GetFile() == NULL) {
tn->Print();
NUIS_ERR(FTL, "gtree not located in GENIE file: " << input);
NUIS_ABORT("Check your inputs, they may need to be completely regenerated!");
throw;
}
int nevt = tn->GetEntries();
if (gNEvents != -999) {
NUIS_LOG(FIT, "Overriding number of events by user from " << nevt << " to "
<< gNEvents);
nevt = gNEvents;
}
if (!nevt) {
NUIS_ABORT("Couldn't load any events from input specification: \""
<< input.c_str() << "\"");
} else {
NUIS_LOG(FIT, "Found " << nevt << " input entries in " << input);
}
+ StopTalking();
NtpMCEventRecord *genientpl = NULL;
tn->SetBranchAddress("gmcrec", &genientpl);
+ StartTalking();
// Have the TH1D go from MonoEnergy/2 to MonoEnergy/2
TH1D *fluxhist =
new TH1D("flux", "flux", 1000, MonoEnergy / 2., MonoEnergy * 2.);
fluxhist->Fill(MonoEnergy);
fluxhist->Scale(1, "width");
// Make Event Hist
TH1D *eventhist = (TH1D *)fluxhist->Clone();
eventhist->Reset();
TH1D *xsechist = (TH1D *)eventhist->Clone();
// Create maps
std::map modexsec;
std::map modecount;
std::vector genieids;
std::vector targetids;
std::vector interids;
// Loop over all events
for (int i = 0; i < nevt; i++) {
tn->GetEntry(i);
StopTalking();
EventRecord &event = *(genientpl->event);
GHepParticle *neu = event.Probe();
StartTalking();
// Get XSec From Spline
GHepRecord genie_record = static_cast(event);
double xsec = (genie_record.XSec() / (1E-38 * genie::units::cm2));
// Parse Interaction String
std::string mode = genie_record.Summary()->AsString();
std::vector modevec = GeneralUtils::ParseToStr(mode, ";");
std::string targ = (modevec[0] + ";" + modevec[1]);
std::string inter = mode;
// Fill lists of Unique IDS
if (std::find(targetids.begin(), targetids.end(), targ) ==
targetids.end()) {
targetids.push_back(targ);
}
if (std::find(interids.begin(), interids.end(), inter) == interids.end()) {
interids.push_back(inter);
}
// Create entries Mode Maps
if (modexsec.find(mode) == modexsec.end()) {
genieids.push_back(mode);
modexsec[mode] = (TH1D *)xsechist->Clone();
modecount[mode] = (TH1D *)xsechist->Clone();
modexsec[mode]->GetYaxis()->SetTitle(
"d#sigma/dE_{#nu} #times 10^{-38} (events weighted by #sigma)");
modecount[mode]->GetYaxis()->SetTitle("Number of events in file");
}
// Fill XSec Histograms
modexsec[mode]->Fill(neu->E(), xsec);
modecount[mode]->Fill(neu->E());
// Fill total event hist
eventhist->Fill(neu->E());
// Clear Event
genientpl->Clear();
size_t freq = nevt / 20;
if (freq && !(i % freq)) {
NUIS_LOG(FIT, "Processed "
<< i << "/" << nevt << " GENIE events (E: " << neu->E()
<< " GeV, xsec: " << xsec << " E-38 cm^2/nucleon)");
}
}
NUIS_LOG(FIT, "Processed all events");
// Check if we need to correct MEC events before possibly deleting the TChain below
bool MECcorrect = CheckConfig(std::string(tn->GetFile()->GetName()));
TFile *outputfile;
// If no output is specified just append to the file
if (!gOutputFile.length()) {
// Shut the chain;
delete tn;
outputfile = new TFile(first_file.c_str(), "UPDATE");
} else {
outputfile = new TFile(gOutputFile.c_str(), "RECREATE");
outputfile->cd();
NUIS_LOG(FIT, "Cloning input vector to output file: " << gOutputFile);
TTree *cloneTree = tn->CloneTree(-1, "fast");
cloneTree->SetDirectory(outputfile);
cloneTree->Write();
- NUIS_LOG(FIT, "Cloning input nova_wgts to output file: " << gOutputFile);
- // ***********************************
- // ***********************************
- // FUDGE FOR NOVA MINERVA WORKSHOP
- // Also check for the nova_wgts tree from Jeremy
- TChain *nova_chain = new TChain("nova_wgts");
- nova_chain->AddFile(input.c_str());
- TTree *nova_tree = nova_chain->GetTree();
- if (!nova_tree) {
- NUIS_LOG(FIT, "Could not find nova_wgts tree in " << gOutputFile);
- } else {
- NUIS_LOG(FIT, "Found nova_wgts tree in " << gOutputFile);
- }
- if (nova_tree) {
- nova_tree->SetDirectory(outputfile);
- nova_tree->Write();
+ if (useNOvAWeights){
+ NUIS_LOG(FIT, "Cloning input nova_wgts to output file: " << gOutputFile);
+ // ***********************************
+ // ***********************************
+ // FUDGE FOR NOVA MINERVA WORKSHOP
+ // Also check for the nova_wgts tree from Jeremy
+ TChain *nova_chain = new TChain("nova_wgts");
+ nova_chain->AddFile(input.c_str());
+ TTree *nova_tree = nova_chain->GetTree();
+ if (!nova_tree) {
+ NUIS_LOG(FIT, "Could not find nova_wgts tree in " << gOutputFile);
+ } else {
+ NUIS_LOG(FIT, "Found nova_wgts tree in " << gOutputFile);
+ }
+ if (nova_tree) {
+ nova_tree->SetDirectory(outputfile);
+ nova_tree->Write();
+ }
}
NUIS_LOG(FIT, "Done cloning tree.");
}
NUIS_LOG(FIT, "Getting splines in mono-energetic...");
// Save each of the reconstructed splines to file
std::map modeavg;
TDirectory *inddir = (TDirectory *)outputfile->Get("IndividualGENIESplines");
if (!inddir) inddir = (TDirectory *)outputfile->mkdir("IndividualGENIESplines");
// Loop over GENIE ID's and get MEC count
int MECcount = 0;
// Count up the number of MEC splines
for (UInt_t i = 0; i < genieids.size(); i++) {
if (genieids[i].find("MEC") != std::string::npos && genieids[i].find("[CC]") != std::string::npos) {
MECcount++;
}
}
inddir->cd();
for (UInt_t i = 0; i < genieids.size(); i++) {
std::string mode = genieids[i];
modexsec[mode]->Write((mode + "_summed_xsec").c_str(), TObject::kOverwrite);
modecount[mode]->Write((mode + "_summed_evt").c_str(), TObject::kOverwrite);
// Form extra avg xsec map -> Reconstructed spline
modeavg[mode] = (TH1D *)modexsec[mode]->Clone();
modeavg[mode]->GetYaxis()->SetTitle(
"#sigma (E_{#nu}) #times 10^{-38} (cm^{2}/target)");
modeavg[mode]->Divide(modecount[mode]);
if (MECcorrect && mode.find("MEC") != std::string::npos && mode.find("[CC]") != std::string::npos) {
NUIS_LOG(FIT, "Scaling spline " << mode << " by 1/" << MECcount << " because there are " << MECcount << " repeated Nieves 2p2h instances.");
modeavg[mode]->Scale(1.0 / double(MECcount));
}
modeavg[mode]->Write((mode + "_rec_spline").c_str(), TObject::kOverwrite);
}
TDirectory *targdir = (TDirectory *)outputfile->Get("TargetGENIESplines");
if (!targdir)
targdir = (TDirectory *)outputfile->mkdir("TargetGENIESplines");
targdir->cd();
NUIS_LOG(FIT, "Getting Target Splines");
// For each target save a total spline
std::map targetsplines;
for (uint i = 0; i < targetids.size(); i++) {
std::string targ = targetids[i];
NUIS_LOG(FIT, "Getting target " << i << ": " << targ);
targetsplines[targ] = (TH1D *)xsechist->Clone();
targetsplines[targ]->GetYaxis()->SetTitle(
"#sigma (E_{#nu}) #times 10^{-38} (cm^{2}/target)");
NUIS_LOG(FIT, "Created target spline for " << targ);
for (uint j = 0; j < genieids.size(); j++) {
std::string mode = genieids[j];
if (mode.find(targ) != std::string::npos) {
NUIS_LOG(FIT, " Mode " << mode << " contains " << targ << " target");
targetsplines[targ]->Add(modeavg[mode]);
NUIS_LOG(FIT,
"Finished with Mode " << mode << " " << modeavg[mode]->Integral());
}
}
NUIS_LOG(FIT, "Saving target spline:" << targ);
targetsplines[targ]->Write(("Total_" + targ).c_str(), TObject::kOverwrite);
}
NUIS_LOG(FIT, "Getting total splines");
// Now we have each of the targets we need to create a total cross-section.
int totalnucl = 0;
// Get the targets specified by the user, separated by commas
// This has structure target1[fraction1], target2[fraction2]
std::vector targprs = GeneralUtils::ParseToStr(target, ",");
std::vector targ_list;
std::vector frac_list;
// Chop up the target string which has format
// TARGET1[fraction1],TARGET2[fraction2]
// Loop over the vector of strings "TARGET1[fraction1]" "TARGET2[fraction2]"
for (std::vector::iterator it = targprs.begin();
it != targprs.end(); ++it) {
// Cut into "TARGET1" and "fraction1]"
std::vector targind = GeneralUtils::ParseToStr(*it, "[");
// Cut into "TARGET1" and "fraction1"
for (std::vector::iterator jt = targind.begin();
jt != targind.end(); ++jt) {
if ((*jt).find("]") != std::string::npos) {
(*jt) = (*jt).substr(0, (*jt).find("]"));
frac_list.push_back(*jt);
// Won't find bracket for target
} else {
targ_list.push_back(*jt);
}
}
}
targprs = targ_list;
std::vector targ_fractions;
double minimum = 1.0;
for (std::vector::iterator it = frac_list.begin();
it != frac_list.end(); it++) {
double frac = std::atof((*it).c_str());
targ_fractions.push_back(frac);
if (frac < minimum)
minimum = frac;
}
std::vector::iterator it = targ_fractions.begin();
std::vector::iterator jt = targ_list.begin();
double scaling = 0;
for (; it != targ_fractions.end(); it++, jt++) {
// First get the mass number from the targ_list
int nucl = atoi((*jt).c_str());
nucl = (nucl % 10000) / 10;
// Gets the relative portions right
*it = (*it) / minimum;
// Scale relative the atomic mass
double tempscaling = double(nucl) / (*it);
if (tempscaling > scaling) scaling = tempscaling;
}
it = targ_fractions.begin();
for (; it != targ_fractions.end(); it++) {
// Round the scaling to nearest integer and multiply
*it *= int(scaling + 0.5);
// Round to nearest integer
*it = int(*it + 0.5);
totalnucl += *it;
}
if (totalnucl == 0) {
NUIS_ABORT("Didn't find any nucleons in input file. Did you really specify the "
"target ratios?\ne.g. TARGET1[fraction1],TARGET2[fraction2]");
}
TH1D *totalxsec = (TH1D *)xsechist->Clone();
for (uint i = 0; i < targprs.size(); i++) {
std::string targpdg = targprs[i];
// Check that we found the user requested target in GENIE
bool FoundTarget = false;
for (std::map::iterator iter = targetsplines.begin();
iter != targetsplines.end(); iter++) {
std::string targstr = iter->first;
TH1D *xsec = iter->second;
// Match the user targets to the targets found in GENIE
if (targstr.find(targpdg) != std::string::npos) {
FoundTarget = true;
NUIS_LOG(FIT, "Adding target spline "
<< targstr << " Integral = " << xsec->Integral("width"));
totalxsec->Add(xsec);
}
}
// Check that targets were all found
if (!FoundTarget) {
NUIS_ERR(WRN, "Didn't find target "
<< targpdg
<< " in the list of targets recorded by GENIE");
NUIS_ERR(WRN, " The list of targets you requested is: ");
for (uint i = 0; i < targprs.size(); ++i)
NUIS_ERR(WRN, " " << targprs[i]);
NUIS_ERR(WRN, " The list of targets found in GENIE is: ");
for (std::map::iterator iter = targetsplines.begin();
iter != targetsplines.end(); iter++)
NUIS_ERR(WRN, " " << iter->first);
}
}
outputfile->cd();
totalxsec->GetYaxis()->SetTitle(
"#sigma (E_{#nu}) #times 10^{-38} (cm^{2}/nucleon)");
totalxsec->Write("nuisance_xsec", TObject::kOverwrite);
eventhist = (TH1D *)fluxhist->Clone();
eventhist->Multiply(totalxsec);
eventhist->GetYaxis()->SetTitle(
(std::string("Event rate (N = #sigma #times #Phi) #times 10^{-38} "
"(cm^{2}/nucleon) #times ") +
eventhist->GetYaxis()->GetTitle())
.c_str());
NUIS_LOG(FIT, "Dividing by Total Nucl = " << totalnucl);
eventhist->Scale(1.0 / double(totalnucl));
eventhist->Write("nuisance_events", TObject::kOverwrite);
fluxhist->Write("nuisance_flux", TObject::kOverwrite);
NUIS_LOG(FIT, "Inclusive XSec Per Nucleon = " << eventhist->Integral("width") *
1E-38 /
fluxhist->Integral("width"));
NUIS_LOG(FIT, "XSec Hist Integral = " << totalxsec->Integral("width"));
outputfile->Close();
return;
}
void RunGENIEPrepare(std::string input, std::string flux, std::string target,
std::string output) {
NUIS_LOG(FIT, "Running GENIE Prepare with flux...");
// Get Flux Hist
std::vector fluxvect = GeneralUtils::ParseToStr(flux, ",");
TH1 *fluxhist = NULL;
if (fluxvect.size() == 3) {
double from = GeneralUtils::StrToDbl(fluxvect[0]);
double to = GeneralUtils::StrToDbl(fluxvect[1]);
double step = GeneralUtils::StrToDbl(fluxvect[2]);
int nstep = ceil((to - from) / step);
to = from + step * nstep;
NUIS_LOG(FIT, "Generating flat flux histogram from "
<< from << " to " << to << " with bins " << step
<< " wide (NBins = " << nstep << ").");
fluxhist =
new TH1D("spectrum", ";E_{#nu} (GeV);Count (A.U.)", nstep, from, to);
for (Int_t bi_it = 1; bi_it < fluxhist->GetXaxis()->GetNbins(); ++bi_it) {
fluxhist->SetBinContent(bi_it, 1.0 / double(step * nstep));
}
fluxhist->SetDirectory(0);
} else if (fluxvect.size() == 2) {
TFile *fluxfile = new TFile(fluxvect[0].c_str(), "READ");
if (!fluxfile->IsZombie()) {
fluxhist = dynamic_cast(fluxfile->Get(fluxvect[1].c_str()));
if (!fluxhist) {
NUIS_ERR(FTL, "Couldn't find histogram named: \""
<< fluxvect[1] << "\" in file: \"" << fluxvect[0]);
throw;
}
fluxhist->SetDirectory(0);
}
} else if (fluxvect.size() == 1) {
MonoEnergy = GeneralUtils::StrToDbl(fluxvect[0]);
RunGENIEPrepareMono(input, target, output);
return;
} else {
NUIS_LOG(FTL, "Bad flux specification: \"" << flux << "\".");
throw;
}
// Setup TTree
TChain *tn = new TChain("gtree");
std::string first_file = "";
if (input.find_first_of(',') != std::string::npos) {
std::vector inputvect = GeneralUtils::ParseToStr(input, ",");
for (size_t iv_it = 0; iv_it < inputvect.size(); ++iv_it) {
tn->AddFile(inputvect[iv_it].c_str());
NUIS_LOG(FIT, "Added input file: " << inputvect[iv_it]);
if (!first_file.length()) {
first_file = inputvect[iv_it];
}
}
} else { // The Add form can accept wildcards.
tn->Add(input.c_str());
first_file = input;
}
if (tn->GetFile() == NULL) {
tn->Print();
NUIS_ERR(FTL, "gtree not located in GENIE file: " << input);
NUIS_ABORT("Check your inputs, they may need to be completely regenerated!");
throw;
}
int nevt = tn->GetEntries();
if (gNEvents != -999) {
NUIS_LOG(FIT, "Overriding number of events by user from " << nevt << " to "
<< gNEvents);
nevt = gNEvents;
}
if (!nevt) {
NUIS_ABORT("Couldn't load any events from input specification: \""
<< input.c_str() << "\"");
} else {
NUIS_LOG(FIT, "Found " << nevt << " input entries in " << input);
}
+ StopTalking();
NtpMCEventRecord *genientpl = NULL;
tn->SetBranchAddress("gmcrec", &genientpl);
+ StartTalking();
// Make Event and xsec Hist
TH1D *eventhist = (TH1D *)fluxhist->Clone();
eventhist->SetDirectory(NULL);
eventhist->Reset();
TH1D *xsechist = (TH1D *)eventhist->Clone();
xsechist->SetDirectory(NULL);
// Create maps
std::map modexsec;
std::map modecount;
std::vector genieids;
std::vector targetids;
std::vector interids;
// Loop over all events
for (int i = 0; i < nevt; i++) {
tn->GetEntry(i);
// Hussssch GENIE
StopTalking();
// Get the event
EventRecord &event = *(genientpl->event);
// Get the neutrino
GHepParticle *neu = event.Probe();
StartTalking();
// Get XSec From Spline
// Get the GHepRecord
GHepRecord genie_record = static_cast(event);
double xsec = (genie_record.XSec() / (1E-38 * genie::units::cm2));
// Parse Interaction String
std::string mode = genie_record.Summary()->AsString();
std::vector modevec = GeneralUtils::ParseToStr(mode, ";");
std::string targ = (modevec[0] + ";" + modevec[1]);
std::string inter = mode;
// Get target nucleus
// Alternative ways of getting the summaries
// GHepParticle *target = genie_record.TargetNucleus();
// int pdg = target->Pdg();
// Fill lists of Unique IDS (neutrino and target)
if (std::find(targetids.begin(), targetids.end(), targ) ==
targetids.end()) {
targetids.push_back(targ);
}
// The full interaction list
if (std::find(interids.begin(), interids.end(), inter) == interids.end()) {
interids.push_back(inter);
}
// Create entries Mode Maps
if (modexsec.find(mode) == modexsec.end()) {
genieids.push_back(mode);
modexsec[mode] = (TH1D *)xsechist->Clone();
modecount[mode] = (TH1D *)xsechist->Clone();
modexsec[mode]->SetDirectory(NULL);
modecount[mode]->SetDirectory(NULL);
modexsec[mode]->GetYaxis()->SetTitle(
"d#sigma/dE_{#nu} #times 10^{-38} (events weighted by #sigma)");
modecount[mode]->GetYaxis()->SetTitle("Number of events in file");
}
// Fill XSec Histograms
modexsec[mode]->Fill(neu->E(), xsec);
modecount[mode]->Fill(neu->E());
// Fill total event hist
eventhist->Fill(neu->E());
if (i % (nevt / 20) == 0) {
NUIS_LOG(FIT, "Processed "
<< i << "/" << nevt << " GENIE events (E: " << neu->E()
<< " GeV, xsec: " << xsec << " E-38 cm^2/nucleon)");
}
// Clear Event
genientpl->Clear();
}
NUIS_LOG(FIT, "Processed all events");
// Check if we need to correct MEC events before possibly deleting the TChain below
bool MECcorrect = CheckConfig(std::string(tn->GetFile()->GetName()));
// Once event loop is done we can start saving stuff into the file
TFile *outputfile;
if (!gOutputFile.length()) {
// Shut the chain;
delete tn;
outputfile = new TFile(first_file.c_str(), "UPDATE");
} else {
outputfile = new TFile(gOutputFile.c_str(), "RECREATE");
outputfile->cd();
NUIS_LOG(FIT, "Cloning input vector to output file: " << gOutputFile);
TTree *cloneTree = tn->CloneTree(-1, "fast");
cloneTree->SetDirectory(outputfile);
cloneTree->Write();
- // ********************************
- // CLUDGE KLUDGE KLUDGE FOR NOVA
- NUIS_LOG(FIT, "Cloning input nova_wgts to output file: " << gOutputFile);
- // Also check for the nova_wgts tree from Jeremy
- TChain *nova_chain = new TChain("nova_wgts");
- nova_chain->AddFile(input.c_str());
- TTree *nova_tree = nova_chain->CloneTree(-1, "fast");
- if (!nova_tree) {
- NUIS_LOG(FIT, "Could not find nova_wgts tree in " << input);
- } else {
- NUIS_LOG(FIT, "Found nova_wgts tree in " << input);
- nova_tree->SetDirectory(outputfile);
- nova_tree->Write();
+ if (useNOvAWeights){
+ // ********************************
+ // CLUDGE KLUDGE KLUDGE FOR NOVA
+ NUIS_LOG(FIT, "Cloning input nova_wgts to output file: " << gOutputFile);
+ // Also check for the nova_wgts tree from Jeremy
+ TChain *nova_chain = new TChain("nova_wgts");
+ nova_chain->AddFile(input.c_str());
+ TTree *nova_tree = nova_chain->CloneTree(-1, "fast");
+ if (!nova_tree) {
+ NUIS_LOG(FIT, "Could not find nova_wgts tree in " << input);
+ } else {
+ NUIS_LOG(FIT, "Found nova_wgts tree in " << input);
+ nova_tree->SetDirectory(outputfile);
+ nova_tree->Write();
+ }
}
NUIS_LOG(FIT, "Done cloning tree.");
}
NUIS_LOG(FIT, "Getting splines...");
// Save each of the reconstructed splines to file
std::map modeavg;
TDirectory *inddir = (TDirectory *)outputfile->Get("IndividualGENIESplines");
if (!inddir) inddir = (TDirectory *)outputfile->mkdir("IndividualGENIESplines");
// Loop over GENIE ID's and get MEC count
int MECcount = 0;
for (UInt_t i = 0; i < genieids.size(); i++) {
if (genieids[i].find("MEC") != std::string::npos && genieids[i].find("[CC]") != std::string::npos) {
MECcount++;
}
}
inddir->cd();
for (UInt_t i = 0; i < genieids.size(); i++) {
std::string mode = genieids[i];
modexsec[mode]->Write((mode + "_summed_xsec").c_str(), TObject::kOverwrite);
modecount[mode]->Write((mode + "_summed_evt").c_str(), TObject::kOverwrite);
// Form extra avg xsec map -> Reconstructed spline
modeavg[mode] = (TH1D *)modexsec[mode]->Clone();
modeavg[mode]->GetYaxis()->SetTitle(
"#sigma (E_{#nu}) #times 10^{-38} (cm^{2}/target)");
modeavg[mode]->Divide(modecount[mode]);
if (MECcorrect && mode.find("MEC") != std::string::npos && mode.find("[CC]") != std::string::npos) {
NUIS_LOG(FIT, "Scaling spline " << mode << " by 1/" << MECcount << " because there are " << MECcount << " repeated Nieves 2p2h instances.");
modeavg[mode]->Scale(1.0 / double(MECcount));
}
modeavg[mode]->Write((mode + "_rec_spline").c_str(), TObject::kOverwrite);
}
TDirectory *targdir = (TDirectory *)outputfile->Get("TargetGENIESplines");
if (!targdir)
targdir = (TDirectory *)outputfile->mkdir("TargetGENIESplines");
targdir->cd();
NUIS_LOG(FIT, "Getting Target Splines");
// For each target save a total spline
std::map targetsplines;
for (uint i = 0; i < targetids.size(); i++) {
std::string targ = targetids[i];
NUIS_LOG(FIT, "Getting target " << i << ": " << targ);
targetsplines[targ] = (TH1D *)xsechist->Clone();
targetsplines[targ]->GetYaxis()->SetTitle(
"#sigma (E_{#nu}) #times 10^{-38} (cm^{2}/target)");
NUIS_LOG(FIT, "Created target spline for " << targ);
for (uint j = 0; j < genieids.size(); j++) {
std::string mode = genieids[j];
// Look at all matching modes/targets
if (mode.find(targ) != std::string::npos) {
NUIS_LOG(FIT, " Mode " << mode << " contains " << targ << " target");
targetsplines[targ]->Add(modeavg[mode]);
NUIS_LOG(FIT,
"Finished with Mode " << mode << " " << modeavg[mode]->Integral());
}
}
NUIS_LOG(FIT, "Saving target spline: " << targ);
targetsplines[targ]->Write(("Total_" + targ).c_str(), TObject::kOverwrite);
}
NUIS_LOG(FIT, "Getting total splines");
// Now we have each of the targets we need to create a total cross-section.
int totalnucl = 0;
// This has structure target1[fraction1], target2[fraction2]
std::vector targprs = GeneralUtils::ParseToStr(target, ",");
std::vector targ_list;
std::vector frac_list;
// Chop up the target string which has format
// TARGET1[fraction1],TARGET2[fraction2]
// Loop over the vector of strings "TARGET1[fraction1]" "TARGET2[fraction2]"
for (std::vector::iterator it = targprs.begin();
it != targprs.end(); ++it) {
// Cut into "TARGET1" and "fraction1]"
std::vector targind = GeneralUtils::ParseToStr(*it, "[");
// Cut into "TARGET1" and "fraction1"
for (std::vector::iterator jt = targind.begin();
jt != targind.end(); ++jt) {
if ((*jt).find("]") != std::string::npos) {
(*jt) = (*jt).substr(0, (*jt).find("]"));
frac_list.push_back(*jt);
// Won't find bracket for target
} else {
targ_list.push_back(*jt);
}
}
}
targprs = targ_list;
std::vector targ_fractions;
double minimum = 1.0;
for (std::vector::iterator it = frac_list.begin();
it != frac_list.end(); it++) {
double frac = std::atof((*it).c_str());
targ_fractions.push_back(frac);
if (frac < minimum)
minimum = frac;
}
std::vector::iterator it = targ_fractions.begin();
std::vector::iterator jt = targ_list.begin();
double scaling = 0;
for (; it != targ_fractions.end(); it++, jt++) {
// First get the mass number from the targ_list
int nucl = atoi((*jt).c_str());
nucl = (nucl % 10000) / 10;
// Gets the relative portions right
*it = (*it) / minimum;
// Scale relative the atomic mass
//(*it) *= (double(nucl)/(*it));
double tempscaling = double(nucl) / (*it);
if (tempscaling > scaling)
scaling = tempscaling;
}
it = targ_fractions.begin();
for (; it != targ_fractions.end(); it++) {
// Round the scaling to nearest integer and multiply
*it *= int(scaling + 0.5);
// Round to nearest integer
*it = int(*it + 0.5);
totalnucl += *it;
}
if (totalnucl == 0) {
NUIS_ABORT("Didn't find any nucleons in input file. Did you really specify the "
"target ratios?\ne.g. TARGET1[fraction1],TARGET2[fraction2]");
}
TH1D *totalxsec = (TH1D *)xsechist->Clone();
// Loop over the specified targets by the user
for (uint i = 0; i < targprs.size(); i++) {
std::string targpdg = targprs[i];
// Check that we found the user requested target in GENIE
bool FoundTarget = false;
for (std::map::iterator iter = targetsplines.begin();
iter != targetsplines.end(); iter++) {
std::string targstr = iter->first;
TH1D *xsec = iter->second;
// Match the user targets to the targets found in GENIE
if (targstr.find(targpdg) != std::string::npos) {
FoundTarget = true;
NUIS_LOG(FIT, "Adding target spline "
<< targstr << " Integral = " << xsec->Integral("width"));
totalxsec->Add(xsec);
// int nucl = atoi(targpdg.c_str());
// totalnucl += int((nucl % 10000) / 10);
}
} // Looped over target splines
// Check that targets were all found
if (!FoundTarget) {
NUIS_ERR(WRN, "Didn't find target "
<< targpdg
<< " in the list of targets recorded by GENIE");
NUIS_ERR(WRN, " The list of targets you requested is: ");
for (uint i = 0; i < targprs.size(); ++i)
NUIS_ERR(WRN, " " << targprs[i]);
NUIS_ERR(WRN, " The list of targets found in GENIE is: ");
for (std::map::iterator iter = targetsplines.begin();
iter != targetsplines.end(); iter++)
NUIS_ERR(WRN, " " << iter->first);
}
}
outputfile->cd();
totalxsec->GetYaxis()->SetTitle(
"#sigma (E_{#nu}) #times 10^{-38} (cm^{2}/nucleon)");
totalxsec->Write("nuisance_xsec", TObject::kOverwrite);
eventhist = (TH1D *)fluxhist->Clone();
eventhist->Multiply(totalxsec);
eventhist->GetYaxis()->SetTitle(
(std::string("Event rate (N = #sigma #times #Phi) #times 10^{-38} "
"(cm^{2}/nucleon) #times ") +
eventhist->GetYaxis()->GetTitle())
.c_str());
NUIS_LOG(FIT, "Dividing by Total Nucl = " << totalnucl);
eventhist->Scale(1.0 / double(totalnucl));
eventhist->Write("nuisance_events", TObject::kOverwrite);
fluxhist->Write("nuisance_flux", TObject::kOverwrite);
NUIS_LOG(FIT, "Inclusive XSec Per Nucleon = " << eventhist->Integral("width") *
1E-38 /
fluxhist->Integral("width"));
NUIS_LOG(FIT, "XSec Hist Integral = " << totalxsec->Integral());
outputfile->Close();
return;
};
void PrintOptions() {
std::cout << "PrepareGENIE events NUISANCE app. " << std::endl
<< "Takes GHep Outputs and prepares events for NUISANCE."
<< std::endl
<< std::endl
<< "PrepareGENIE [-h,-help,--h,--help] [-i "
"inputfile1.root,inputfile2.root,inputfile3.root,...] "
<< "[-f flux_root_file.root,flux_hist_name] [-t "
"target1[frac1],target2[frac2],...]"
<< "[-n number_of_events (experimental)]" << std::endl
<< std::endl;
std::cout << "Prepare Mode [Default] : Takes a single GHep file, "
"reconstructs the original GENIE splines, "
<< " and creates a duplicate file that also contains the flux, "
"event rate, and xsec predictions that NUISANCE needs. "
<< std::endl;
std::cout << "Following options are required for Prepare Mode:" << std::endl;
std::cout << " [ -i inputfile.root ] : Reads in a single GHep input file "
"that needs the xsec calculation ran on it. "
<< std::endl;
std::cout << " [ -f flux_file.root,hist_name ] : Path to root file "
"containing the flux histogram the GHep records were generated "
"with."
<< " A simple method is to point this to the flux histogram genie "
"generatrs '-f /path/to/events/input-flux.root,spectrum'. "
<< std::endl;
std::cout << " [ -f elow,ehigh,estep ] : Energy range specification when no "
"flux file was used."
<< std::endl;
std::cout << " [ -t target ] : Target that GHepRecords were generated with. "
- "Comma seperated list with fractions. E.g. for CH2 "
+ "Comma separated list with fractions. E.g. for CH2 "
"target=1000060120[0.923076],1000010010[0.076924]"
<< std::endl;
std::cout << " [ -o outputfile.root ] : File to write prepared input file to."
<< std::endl;
std::cout << " [ -m Mono_E_nu_GeV ] : Run in mono-energetic mode with m GeV "
"neutrino energy."
<< std::endl;
std::cout << " [ -n number_of_evt ] : Run with a reduced number of events "
"for debugging purposes"
<< std::endl;
}
void ParseOptions(int argc, char *argv[]) {
bool flagopt = false;
+ int verbocount = 0;
+ int errorcount = 0;
+ verbocount += Config::GetParI("VERBOSITY");
+ errorcount += Config::GetParI("ERROR");
+ bool trace = Config::GetParB("TRACE");
+ std::cout << "[ NUISANCE ]: Setting VERBOSITY=" << verbocount << std::endl;
+ std::cout << "[ NUISANCE ]: Setting ERROR=" << errorcount << std::endl;
+ SETVERBOSITY(verbocount);
+ SETTRACE(trace);
+
+
// If No Arguments print commands
for (int i = 1; i < argc; ++i) {
if (!std::strcmp(argv[i], "-h")) {
flagopt = true;
break;
}
if (i + 1 != argc) {
// Cardfile
if (!std::strcmp(argv[i], "-h")) {
flagopt = true;
break;
} else if (!std::strcmp(argv[i], "-i")) {
gInputFiles = argv[i + 1];
++i;
} else if (!std::strcmp(argv[i], "-o")) {
gOutputFile = argv[i + 1];
++i;
} else if (!std::strcmp(argv[i], "-f")) {
gFluxFile = argv[i + 1];
++i;
} else if (!std::strcmp(argv[i], "-t")) {
gTarget = argv[i + 1];
++i;
} else if (!std::strcmp(argv[i], "-n")) {
gNEvents = GeneralUtils::StrToInt(argv[i + 1]);
++i;
} else if (!std::strcmp(argv[i], "-m")) {
MonoEnergy = GeneralUtils::StrToDbl(argv[i + 1]);
IsMonoE = true;
++i;
} else {
NUIS_ERR(FTL, "ERROR: unknown command line option given! - '"
<< argv[i] << " " << argv[i + 1] << "'");
PrintOptions();
break;
}
}
}
if (gInputFiles == "" && !flagopt) {
NUIS_ERR(FTL, "No input file(s) specified!");
flagopt = true;
}
if (gFluxFile == "" && !flagopt && !IsMonoE) {
NUIS_ERR(FTL, "No flux input specified for Prepare Mode");
flagopt = true;
}
if (gTarget == "" && !flagopt) {
NUIS_ERR(FTL, "No target specified for Prepare Mode");
flagopt = true;
}
if (gTarget.find("[") == std::string::npos ||
gTarget.find("]") == std::string::npos) {
NUIS_ERR(FTL, "Didn't specify target ratios in Prepare Mode");
NUIS_ERR(FTL, "Are you sure you gave it as -t "
"\"TARGET1[fraction1],TARGET2[fraction]\"?");
flagopt = true;
}
if (argc < 1 || flagopt) {
PrintOptions();
exit(-1);
}
return;
}
diff --git a/app/PrepareNEUT.cxx b/app/PrepareNEUT.cxx
index faefc6b..0516e76 100644
--- a/app/PrepareNEUT.cxx
+++ b/app/PrepareNEUT.cxx
@@ -1,419 +1,416 @@
#include "FitLogger.h"
#include "PlotUtils.h"
#include "StatUtils.h"
#include "TFile.h"
#include "TH1D.h"
#include "TTree.h"
#include
#include
// If you don't have NEUT enabled, you shouldn't compile this...
#include "neutpart.h"
#include "neutvect.h"
std::string fInputFiles = "";
std::string fOutputFile = "";
std::string fFluxFile = "";
bool fFluxInGeV = false;
bool fIsMonoEFlux = false;
double fMonoEEnergy = 0xdeadbeef;
void PrintOptions();
void ParseOptions(int argc, char *argv[]);
void AddMonoRateHistogram(std::string inputList, double MonoE,
std::string output);
void CreateRateHistogram(std::string inputList, std::string flux,
std::string output);
//*******************************
int main(int argc, char *argv[]) {
//*******************************
SETVERBOSITY(FitPar::Config().GetParI("VERBOSITY"));
SETERRVERBOSITY(FitPar::Config().GetParI("ERROR"));
ParseOptions(argc, argv);
NUIS_LOG(FIT, "Running PrepareNEUT");
if (fIsMonoEFlux) {
AddMonoRateHistogram(fInputFiles, fMonoEEnergy, fOutputFile);
} else {
CreateRateHistogram(fInputFiles, fFluxFile, fOutputFile);
}
};
void AddMonoRateHistogram(std::string inputList, double MonoE,
std::string output) {
// Need to allow for more than one file... will do soon
TChain *tn = new TChain("neuttree");
std::vector inputs = GeneralUtils::ParseToStr(inputList, ",");
for (std::vector::iterator it = inputs.begin();
it != inputs.end(); ++it) {
NUIS_LOG(FIT, "Adding " << *it << " to the output");
tn->AddFile((*it).c_str());
}
if (inputs.size() > 1 && output.empty()) {
NUIS_ABORT("You must provide a new output file name if you want to have "
"more than 1 input file!");
}
int nevts = tn->GetEntries();
if (!nevts) {
NUIS_ABORT("Either the input file is not from NEUT, or it's empty...");
}
//for mono-e all events have the same totcrs.
nevts = 1;
NeutVect *fNeutVect = NULL;
tn->SetBranchAddress("vectorbranch", &fNeutVect);
TH1D *fluxHist = new TH1D("flux", "flux", 1000, 0, fFluxInGeV ? 10 : 10000);
fluxHist->Fill(MonoE);
fluxHist->Scale(1, "width");
// Make Event Hist
TH1D *xsecHist = (TH1D *)fluxHist->Clone();
xsecHist->Reset();
// Make a total cross section hist for shits and giggles
TH1D *entryHist = (TH1D *)xsecHist->Clone();
double MeanE = 0;
for (int i = 0; i < nevts; ++i) {
tn->GetEntry(i);
NeutPart *part = fNeutVect->PartInfo(0);
double E = part->fP.E();
double xsec = fNeutVect->Totcrs;
// Unit conversion
if (fFluxInGeV)
E *= 1E-3;
xsecHist->Fill(E, xsec);
entryHist->Fill(E);
MeanE += E;
- if (i % (nevts / 20) == 0) {
- NUIS_LOG(FIT, "Processed " << i << "/" << nevts << " NEUT events.");
- }
}
MeanE /= double(nevts);
NUIS_LOG(FIT, "Processed all events");
xsecHist->Divide(entryHist);
// This will be the evtrt histogram
TH1D *evtHist = (TH1D *)xsecHist->Clone();
evtHist->Multiply(fluxHist);
// Check whether the overflow is empty. If not, advise that either the wrong
// flux histogram or units were used...
// If the events were generated with a limited range of the flux histogram,
// this may be benign
if (evtHist->Integral(0, -1) != evtHist->Integral() ||
evtHist->Integral(0, -1) == 0) {
NUIS_ERR(WRN, "The input file("
<< evtHist->Integral(0, -1)
<< ") and flux histogram provided do not match... ");
NUIS_ERR(WRN, "Are the units correct (MeanE = "
<< MeanE << ", FluxHistoUpperLim: "
<< fluxHist->GetXaxis()->GetBinUpEdge(1000)
<< ")? Did you provide the correct flux file?");
NUIS_ERR(WRN, "Use output with caution...");
}
// Pick where the output should go
TFile *outFile = NULL;
if (!output.empty()) {
NUIS_LOG(FIT, "Saving histograms in " << output);
outFile = new TFile(output.c_str(), "RECREATE");
} else {
NUIS_LOG(FIT, "Saving histograms in " << inputs[0]);
outFile = new TFile(inputs[0].c_str(), "UPDATE");
}
outFile->cd();
std::string xsec_name = "xsec_PrepareNeut";
std::string flux_name = "flux_PrepareNeut";
std::string rate_name = "evtrt_PrepareNeut";
if (output.empty()) {
// Check whether we should overwrite existing histograms
std::string input_xsec = PlotUtils::GetObjectWithName(outFile, "xsec");
std::string input_flux = PlotUtils::GetObjectWithName(outFile, "flux");
std::string input_rate = PlotUtils::GetObjectWithName(outFile, "evtrt");
if (!input_xsec.empty()) {
NUIS_LOG(FIT, "Updating histogram: " << input_xsec);
xsec_name = input_xsec;
}
if (!input_flux.empty()) {
NUIS_LOG(FIT, "Updating histogram: " << input_flux);
flux_name = input_flux;
}
if (!input_rate.empty()) {
NUIS_LOG(FIT, "Updating histogram: " << input_rate);
rate_name = input_rate;
}
} else {
NUIS_LOG(FIT, "Cloning neuttree into output file.");
StopTalking();
TTree *newtree = (TTree *)tn->CloneTree(-1, "fast");
StartTalking();
newtree->Write();
}
xsecHist->Write(xsec_name.c_str(), TObject::kOverwrite);
fluxHist->Write(flux_name.c_str(), TObject::kOverwrite);
evtHist->Write(rate_name.c_str(), TObject::kOverwrite);
outFile->Close();
}
//*******************************
void CreateRateHistogram(std::string inputList, std::string flux,
std::string output) {
//*******************************
// Need to allow for more than one file... will do soon
TChain *tn = new TChain("neuttree");
std::vector inputs = GeneralUtils::ParseToStr(inputList, ",");
for (std::vector::iterator it = inputs.begin();
it != inputs.end(); ++it) {
NUIS_LOG(FIT, "Adding " << *it << " to the output");
tn->AddFile((*it).c_str());
}
if (inputs.size() > 1 && output.empty()) {
NUIS_ABORT("You must provide a new output file name if you want to have "
"more than 1 input file!");
}
int nevts = tn->GetEntries();
if (!nevts) {
NUIS_ABORT("Either the input file is not from NEUT, or it's empty...");
}
NeutVect *fNeutVect = NULL;
tn->SetBranchAddress("vectorbranch", &fNeutVect);
// Get Flux Hist
std::vector fluxvect = GeneralUtils::ParseToStr(flux, ",");
TH1D *fluxHist = NULL;
if (fluxvect.size() > 1) {
TFile *fluxfile = new TFile(fluxvect[0].c_str(), "READ");
fluxHist = (TH1D *)fluxfile->Get(fluxvect[1].c_str());
fluxHist->SetDirectory(0);
} else {
NUIS_ABORT("NO FLUX SPECIFIED");
}
// Decide what type of flux was given
if (fFluxInGeV) {
NUIS_LOG(FIT, "Assuming flux histogram is in GeV");
} else {
NUIS_LOG(FIT, "Assuming flux histogram is in MeV");
}
// Make Event Hist
TH1D *xsecHist = (TH1D *)fluxHist->Clone();
xsecHist->Reset();
// Make a total cross section hist for shits and giggles
TH1D *entryHist = (TH1D *)xsecHist->Clone();
for (int i = 0; i < nevts; ++i) {
tn->GetEntry(i);
NeutPart *part = fNeutVect->PartInfo(0);
double E = part->fP.E();
double xsec = fNeutVect->Totcrs;
// Unit conversion
if (fFluxInGeV)
E *= 1E-3;
xsecHist->Fill(E, xsec);
entryHist->Fill(E);
if (i % (nevts / 20) == 0) {
NUIS_LOG(FIT, "Processed " << i << "/" << nevts << " NEUT events."
<< "(Enu = " << E << ", xsec = " << xsec << ") ");
}
}
NUIS_LOG(FIT, "Processed all events");
xsecHist->Divide(entryHist);
// This will be the evtrt histogram
TH1D *evtHist = NULL;
// If the integral of xsecHist is 0 the input file used a really old version
// of NEUT without Totcrs
if (!xsecHist->Integral(0, -1)) {
NUIS_ERR(WRN, "Old NEUT input file: events will not be correctly normalized");
evtHist = (TH1D *)entryHist->Clone();
if (evtHist->Integral() != 0)
evtHist->Scale(fluxHist->Integral() / float(evtHist->Integral()));
} else {
evtHist = (TH1D *)xsecHist->Clone();
evtHist->Multiply(fluxHist);
}
// Check whether the overflow is empty. If not, advise that either the wrong
// flux histogram or units were used...
// If the events were generated with a limited range of the flux histogram,
// this may be benign
if (evtHist->Integral(0, -1) != evtHist->Integral() ||
evtHist->Integral(0, -1) == 0) {
NUIS_ERR(WRN, "The input file("
<< evtHist->Integral(0, -1)
<< ") and flux histogram provided do not match... ");
NUIS_ERR(WRN,
"Are the units correct? Did you provide the correct flux file?");
NUIS_ERR(WRN, "Use output with caution...");
}
// Pick where the output should go
TFile *outFile = NULL;
if (!output.empty()) {
NUIS_LOG(FIT, "Saving histograms in " << output);
outFile = new TFile(output.c_str(), "RECREATE");
} else {
NUIS_LOG(FIT, "Saving histograms in " << inputs[0]);
outFile = new TFile(inputs[0].c_str(), "UPDATE");
}
outFile->cd();
std::string xsec_name = "xsec_PrepareNeut";
std::string flux_name = "flux_PrepareNeut";
std::string rate_name = "evtrt_PrepareNeut";
if (output.empty()) {
// Check whether we should overwrite existing histograms
std::string input_xsec = PlotUtils::GetObjectWithName(outFile, "xsec");
std::string input_flux = PlotUtils::GetObjectWithName(outFile, "flux");
std::string input_rate = PlotUtils::GetObjectWithName(outFile, "evtrt");
if (!input_xsec.empty()) {
NUIS_LOG(FIT, "Updating histogram: " << input_xsec);
xsec_name = input_xsec;
}
if (!input_flux.empty()) {
NUIS_LOG(FIT, "Updating histogram: " << input_flux);
flux_name = input_flux;
}
if (!input_rate.empty()) {
NUIS_LOG(FIT, "Updating histogram: " << input_rate);
rate_name = input_rate;
}
} else {
NUIS_LOG(FIT, "Cloning neuttree into output file.");
StopTalking();
TTree *newtree = (TTree *)tn->CloneTree(-1, "fast");
StartTalking();
newtree->Write();
}
xsecHist->Write(xsec_name.c_str(), TObject::kOverwrite);
fluxHist->Write(flux_name.c_str(), TObject::kOverwrite);
evtHist->Write(rate_name.c_str(), TObject::kOverwrite);
outFile->Close();
return;
}
void PrintOptions() {
std::cout << "PrepareNEUT NUISANCE app. " << std::endl
<< "Produces or recalculates evtrt and flux histograms necessary "
"for NUISANCE normalization."
<< std::endl;
std::cout << "PrepareNEUT: " << std::endl;
std::cout << " [-h,-help,--h,--help]" << std::endl;
std::cout << " -i inputfile1.root,inputfile2.root,inputfile3.root,..."
<< std::endl;
std::cout << " Takes any number of files, but assumes all are "
"produced with a single flux"
<< std::endl;
std::cout << " -f flux_root_file.root,flux_hist_name" << std::endl;
std::cout << " Path to root file containing the flux histogram used "
"when generating the NEUT files"
<< std::endl;
std::cout << " [-o outputfile.root] " << std::endl;
std::cout
<< " If an output file is not given, the input file will be used"
<< std::endl;
std::cout << " If more than one input file is given, an output file "
"must be given"
<< std::endl;
std::cout << " [-G]" << std::endl;
std::cout << " Flux is assumed to be in MeV. This switch indicates "
"the input flux is in GeV"
<< std::endl;
std::cout << " [-m E_nu]" << std::endl;
std::cout << " Used to add dummy flux and evt rate histograms to "
"mono-energetic vectors. Adheres to the -G flag."
<< std::endl;
}
void ParseOptions(int argc, char *argv[]) {
bool flagopt = false;
// If No Arguments print commands
for (int i = 1; i < argc; ++i) {
if (!std::strcmp(argv[i], "-h")) {
flagopt = true;
break;
} else if (!std::strcmp(argv[i], "-G")) {
fFluxInGeV = true;
continue;
}
if (i + 1 != argc) {
// Cardfile
if (!std::strcmp(argv[i], "-h")) {
flagopt = true;
break;
} else if (!std::strcmp(argv[i], "-i")) {
fInputFiles = argv[i + 1];
++i;
} else if (!std::strcmp(argv[i], "-o")) {
fOutputFile = argv[i + 1];
++i;
} else if (!std::strcmp(argv[i], "-f")) {
fFluxFile = argv[i + 1];
++i;
} else if (!std::strcmp(argv[i], "-m")) {
fIsMonoEFlux = true;
fMonoEEnergy = GeneralUtils::StrToDbl(argv[i + 1]);
++i;
} else {
NUIS_ERR(FTL, "ERROR: unknown command line option given! - '"
<< argv[i] << " " << argv[i + 1] << "'");
PrintOptions();
break;
}
}
}
if (fInputFiles == "" && !flagopt) {
NUIS_ERR(FTL, "No input file(s) specified!");
flagopt = true;
}
if (fFluxFile == "" && (!flagopt) && (!fIsMonoEFlux)) {
NUIS_ERR(FTL, "No flux input specified!");
flagopt = true;
}
if (argc < 1 || flagopt) {
PrintOptions();
exit(-1);
}
return;
}
diff --git a/app/PrepareNuwroEvents.cxx b/app/PrepareNuwroEvents.cxx
index 2f777b9..720be7b 100644
--- a/app/PrepareNuwroEvents.cxx
+++ b/app/PrepareNuwroEvents.cxx
@@ -1,492 +1,507 @@
#include "event1.h"
#include
#include
// 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 ,[,PDG[,speciesFraction]] [-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 &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 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()) {
NUIS_ABORT("Cannot open input root file: " << rootFile
<< " to read input histo.");
}
TH1D *histD = dynamic_cast(inpFile->Get(histName.c_str()));
if (!histD) {
TH1F *histF = dynamic_cast(inpFile->Get(histName.c_str()));
if (!histF) {
NUIS_ABORT("Cannot find TH1D/F: " << histName << " in root file: "
<< rootFile << ".");
}
histD = F2D(histF);
} else {
histD = static_cast(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;
}
+
+ int verbocount = 0;
+ int errorcount = 0;
+ verbocount += Config::GetParI("VERBOSITY");
+ errorcount += Config::GetParI("ERROR");
+ bool trace = Config::GetParB("TRACE");
+ std::cout << "[ NUISANCE ]: Setting VERBOSITY=" << verbocount << std::endl;
+ std::cout << "[ NUISANCE ]: Setting ERROR=" << errorcount << std::endl;
+ SETVERBOSITY(verbocount);
+ SETTRACE(trace);
+
std::vector 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 fluxInputDescriptor =
GeneralUtils::ParseToStr(inpLine, ",");
if ((fluxInputDescriptor.size() != 2) &&
(fluxInputDescriptor.size() != 3) &&
(fluxInputDescriptor.size() != 4)) {
NUIS_ABORT("Received -F argument with option: \""
<< inpLine
<< "\", was expecting "
",[,PDG[,speciesFraction]].");
}
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()) {
NUIS_ABORT("Received -F argument with option: \""
<< inpLine
<< "\", was expecting "
",[,PDG[,speciesFraction]].");
}
} 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);
NUIS_LOG(FIT, "Finished NUWRO Prep.");
};
//*******************************
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()) {
NUIS_ABORT("Cannot open input root file: " << inputs);
}
TTree *inpTree = dynamic_cast(inpFile->Get("treeout"));
if (!inpTree) {
NUIS_ABORT("Cannot find TTree \"treeout\" in input root file: "
<< inputs.c_str());
}
outRootFile = new TFile(ofile.c_str(), force_out ? "RECREATE" : "CREATE");
if (!outRootFile || !outRootFile->IsOpen()) {
NUIS_ABORT("Couldn't open root file: "
<< ofile << " for writing, does it already exist?");
}
nuwrotree = inpTree->CloneTree(-1, "fast");
nuwrotree->SetDirectory(outRootFile);
nuwrotree->Write(nuwrotree->GetName());
} else {
outRootFile = new TFile(inputs.c_str(), "UPDATE");
if (!outRootFile || !outRootFile->IsOpen()) {
NUIS_ABORT("Cannot open input root file: " << inputs);
}
nuwrotree = dynamic_cast(outRootFile->Get("treeout"));
if (!nuwrotree) {
NUIS_ABORT("Cannot find TTree \"treeout\" in input root file: "
<< inputs.c_str());
}
}
// Get Flux Histogram
event *evt = new event();
nuwrotree->SetBranchAddress("e", &evt);
nuwrotree->GetEntry(0);
int fluxtype = evt->par.beam_type;
std::map fluxlist;
std::map eventlist;
std::vector allpdg;
std::map nevtlist;
std::map 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);
NUIS_LOG(FIT, "Nuwro fluxtype = " << fluxtype);
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);
NUIS_LOG(FIT, "Adding new nuwro flux "
<< "pdg: " << pdg << " pctg: " << pctg
<< " Elow: " << Elow << " Ehigh: " << Ehigh);
// 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) {
NUIS_ABORT("Total species fraction for input flux histos = "
<< totalFraction << ", expected to sum to 1.");
}
} else if (fluxtype == 0) {
std::string fluxstring = evt->par.beam_energy;
std::vector 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) {
NUIS_LOG(FIT, "Adding new nuwro flux "
<< "pdg: " << pdg << " Elow: " << Elow
<< " Ehigh: " << Ehigh);
fluxplot =
new TH1D("fluxplot", "fluxplot", fluxvals.size() - 4, Elow, Ehigh);
for (uint j = 2; j < fluxvals.size(); j++) {
NUIS_LOG(DEB, j << " " << fluxvals[j]);
fluxplot->SetBinContent(j - 1, fluxvals[j]);
}
} else { // For monoenergetic fluxes
NUIS_LOG(FIT, "Adding mono-energetic nuwro flux "
<< "pdg: " << pdg << " E: " << Elow);
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 fluxlines =
GeneralUtils::ParseToStr(fluxstring, "\n");
for (uint i = 0; i < fluxlines.size(); i++) {
std::vector 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;
NUIS_LOG(FIT, "Adding new nuwro flux "
<< "pdg: " << pdg << " pctg: " << pctg
<< " Elow: " << Elow << " Ehigh: " << Ehigh);
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;
+
+ if (std::find(allpdg.begin(), allpdg.end(), pdg) == allpdg.end()) {
+ NUIS_ABORT("Not set up to handle PDG: " << pdg << " check your inputs");
+ }
eventlist[0]->Fill(Enu);
eventlist[pdg]->Fill(Enu);
nevtlist[0] += 1;
nevtlist[pdg] += 1;
intxseclist[0] += TotXSec;
intxseclist[pdg] += TotXSec;
if (i % countwidth == 0) {
NUIS_LOG(FIT, "Processed " << i << " events "
<< " (" << int(i * 100.0 / nevents) << "%)"
<< " : E, W, PDG = " << Enu << ", " << TotXSec
<< ", " << pdg)
}
}
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]);
NUIS_LOG(FIT, pdg << " Avg XSec = " << AvgXSec);
NUIS_LOG(FIT, pdg << " nevents = " << double(nevtlist[pdg]));
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 &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] + " ";
}
NUIS_LOG(FIT, " Running HADD from PrepareNuwro: " << cmd);
// Start HADD
system(cmd.c_str());
// Return name of output file
inputs.clear();
inputs.push_back(outputname);
haddedFiles = true;
return;
}
diff --git a/app/neut_NUISANCE.cxx b/app/neut_NUISANCE.cxx
index c3d0a39..55bfa30 100644
--- a/app/neut_NUISANCE.cxx
+++ b/app/neut_NUISANCE.cxx
@@ -1,911 +1,911 @@
#ifdef __NEUT_ENABLED__
#include "ComparisonRoutines.h"
#include "ParserUtils.h"
#include "TargetUtils.h"
#ifdef WINDOWS
#include
#define GetCurrentDir _getcwd
#else
#include
#define GetCurrentDir getcwd
#endif
// All possible inputs
std::string gOptEnergyDef;
std::vector gOptEnergyRange;
int gOptNumberEvents = -1;
int gOptNumberTestEvents = 5E6;
std::string gOptGeneratorList = "Default";
std::string gOptCrossSections =
"Default"; // If default this will look in
// $NUISANCE/data/neut/Default_params.txt
int gOptSeed = time(NULL);
std::string gOptTargetDef = "";
std::string gOptFluxDef = "";
std::string gOptOutputFile = "";
int gOptRunNumber = -1;
using namespace TargetUtils;
void GetCommandLineArgs(int argc, char **argv);
void PrintSyntax(void);
std::string GETCWD() {
char cCurrentPath[FILENAME_MAX];
if (!GetCurrentDir(cCurrentPath, sizeof(cCurrentPath))) {
NUIS_ABORT("CANT FIND CURRENT DIRECTORY!");
}
std::string curdir = std::string(cCurrentPath);
return curdir;
}
std::string ExpandPath(std::string name) {
// Get Current
char cCurrentPath[FILENAME_MAX];
if (!GetCurrentDir(cCurrentPath, sizeof(cCurrentPath))) {
NUIS_ABORT("CANT FIND CURRENT DIRECTORY!");
}
std::string curdir = std::string(cCurrentPath);
// If first entry is not / then add the current working directory
if (!name.empty() and name.at(0) != '/') {
name = curdir + "/" + name;
}
return name;
}
std::string GetBaseName(std::string name) {
std::vector splitfile = GeneralUtils::ParseToStr(name, "/");
std::string filename = "";
if (splitfile.size() == 1) {
filename = splitfile[0];
} else if (splitfile.size() > 1) {
filename = splitfile[splitfile.size() - 1];
} else {
NUIS_ABORT("Cannot split filename: " << name);
}
return filename;
}
std::string GetDynamicModes(std::string list, bool neutrino) {
NUIS_LOG(FIT, "Using " << list << " to define interaction modes for Neutrino="
<< neutrino);
std::map modes;
std::vector ids;
// Create vector of ids for the print out and future reference
/*
C
C nu nub
C 1: CC Q.E. CC Q.E.( Free )
C 2-4: CC 1pi CC 1pi
C 5: CC DIS 1320 CC DIS 1.3 < W < 2.0
C 6-9: NC 1pi NC 1pi
C 10: NC DIS 1320 NC DIS 1.3 < W < 2.0
C 11: NC els CC Q.E.( Bound )
C 12: NC els NC els
C 13: NC els NC els
C 14: coherent NC els
C 15: coherent coherent
C 16: CC eta coherent
C 17 NC eta CC eta
C 18: NC eta NC eta
C 19: CC K NC eta
C 20 NC K CC K
C 21: NC K NC K
C 22: N/A NC K
C 23: CC DIS CC DIS (W > 2.0)
C 24: NC DIS NC DIS (W > 2.0)
C 25: CC 1 gamma CC 1 gamma
C 26: NC 1 gamma NC 1 gamma
C 27: NC 1 gamma NC 1 gamma
C 28: 2p2h 2p2h
*/
ids.push_back("crsmode_CCQE");
ids.push_back("crsmode_CC2P2H");
ids.push_back("crsmode_CC1pi");
ids.push_back("crsmode_CCDIS_lowW");
ids.push_back("crsmode_NC1pi");
ids.push_back("crsmode_NCDIS_lowW");
ids.push_back("crsmode_NCEL");
ids.push_back("crsmode_CCCOH");
ids.push_back("crsmode_NCCOH");
ids.push_back("crsmode_CCETA");
ids.push_back("crsmode_NCETA");
ids.push_back("crsmode_CCKAON");
ids.push_back("crsmode_NCKAON");
ids.push_back("crsmode_CCDIS_highW");
ids.push_back("crsmode_NCDIS_highW");
ids.push_back("crsmode_CCGAMMA");
ids.push_back("crsmode_NCGAMMA");
// Now define possible models
if (!list.compare("Default")) { // Everything but MEC
modes["crsmode_CCQE"] = 1;
modes["crsmode_CC2P2H"] = 0;
modes["crsmode_CC1pi"] = 1;
modes["crsmode_CCDIS_lowW"] = 1;
modes["crsmode_CCCOH"] = 1;
modes["crsmode_CCETA"] = 1;
modes["crsmode_CCKAON"] = 1;
modes["crsmode_CCDIS_highW"] = 1;
modes["crsmode_CCGAMMA"] = 1;
modes["crsmode_NC1pi"] = 1;
modes["crsmode_NCDIS_lowW"] = 1;
modes["crsmode_NCEL"] = 1;
modes["crsmode_NCCOH"] = 1;
modes["crsmode_NCETA"] = 1;
modes["crsmode_NCKAON"] = 1;
modes["crsmode_NCDIS_highW"] = 1;
modes["crsmode_NCGAMMA"] = 1;
} else if (!list.compare("DefaultFree")) {
modes["crsmode_CCQE"] = 1;
modes["crsmode_CC2P2H"] = 0;
modes["crsmode_CC1pi"] = 1;
modes["crsmode_CCDIS_lowW"] = 1;
modes["crsmode_CCCOH"] = 0;
modes["crsmode_CCETA"] = 1;
modes["crsmode_CCKAON"] = 1;
modes["crsmode_CCDIS_highW"] = 1;
modes["crsmode_CCGAMMA"] = 1;
modes["crsmode_NC1pi"] = 1;
modes["crsmode_NCDIS_lowW"] = 1;
modes["crsmode_NCEL"] = 1;
modes["crsmode_NCCOH"] = 0;
modes["crsmode_NCETA"] = 1;
modes["crsmode_NCKAON"] = 1;
modes["crsmode_NCDIS_highW"] = 1;
modes["crsmode_NCGAMMA"] = 1;
} else if (!list.compare("Default+MEC")) {
modes["crsmode_CCQE"] = 1;
modes["crsmode_CC2P2H"] = 1;
modes["crsmode_CC1pi"] = 1;
modes["crsmode_CCDIS_lowW"] = 1;
modes["crsmode_CCCOH"] = 1;
modes["crsmode_CCETA"] = 1;
modes["crsmode_CCKAON"] = 1;
modes["crsmode_CCDIS_highW"] = 1;
modes["crsmode_CCGAMMA"] = 1;
modes["crsmode_NC1pi"] = 1;
modes["crsmode_NCDIS_lowW"] = 1;
modes["crsmode_NCEL"] = 1;
modes["crsmode_NCCOH"] = 1;
modes["crsmode_NCETA"] = 1;
modes["crsmode_NCKAON"] = 1;
modes["crsmode_NCDIS_highW"] = 1;
modes["crsmode_NCGAMMA"] = 1;
} else {
NUIS_ABORT("Event generator list " << list << " not found!");
}
// Now we actually have to make the conversion because NEUTS modes
// organisation are a mess.
/*
C
C nu nub
C 1: CC Q.E. CC Q.E.( Free )
C 2-4: CC 1pi CC 1pi
C 5: CC DIS 1320 CC DIS 1.3 < W < 2.0
C 6-9: NC 1pi NC 1pi
C 10: NC DIS 1320 NC DIS 1.3 < W < 2.0
C 11: NC els CC Q.E.( Bound )
C 12: NC els NC els
C 13: NC els NC els
C 14: coherent NC els
C 15: coherent coherent
C 16: CC eta coherent
C 17 NC eta CC eta
C 18: NC eta NC eta
C 19: CC K NC eta
C 20 NC K CC K
C 21: NC K NC K
C 22: N/A NC K
C 23: CC DIS CC DIS (W > 2.0)
C 24: NC DIS NC DIS (W > 2.0)
C 25: CC 1 gamma CC 1 gamma
C 26,27: NC 1 gamma NC 1 gamma
*/
std::string modestring_neutrino = "NEUT-CRS ";
std::string modestring_antineutrino = "NEUT-CRSB ";
// Neutrino First
if (neutrino) {
// Fill empty NEUT-CRSB
for (size_t i = 0; i < 27; i++) {
modestring_antineutrino += " 0";
}
modestring_neutrino += (modes["crsmode_CCQE"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_CC1pi"] ? " 1 1 1" : " 0 0 0");
modestring_neutrino += (modes["crsmode_CCDIS_lowW"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_NC1pi"] ? " 1 1 1 1" : " 0 0 0 0");
modestring_neutrino += (modes["crsmode_NCDIS_lowW"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_NCEL"] ? " 1 1 1" : " 0 0 0");
modestring_neutrino += (modes["crsmode_CCCOH"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_NCCOH"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_CCETA"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_NCETA"] ? " 1 1" : " 0 0");
modestring_neutrino += (modes["crsmode_CCKAON"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_NCKAON"] ? " 1 1" : " 0 0");
modestring_neutrino += " 1"; // /NA
modestring_neutrino += (modes["crsmode_CCDIS_highW"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_NCDIS_highW"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_CCGAMMA"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_NCGAMMA"] ? " 1" : " 0");
modestring_neutrino += (modes["crsmode_CC2P2H"] ? " 1" : " 0");
} else {
// Fill Empty NEUT CRS
for (size_t i = 0; i < 27; i++) {
modestring_neutrino += " 0";
}
modestring_antineutrino += (modes["crsmode_CCQE"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_CC1pi"] ? " 1 1 1" : " 0 0 0");
modestring_antineutrino += (modes["crsmode_CCDIS_lowW"] ? " 1" : " 0");
modestring_antineutrino +=
(modes["crsmode_NC1pi"] ? " 1 1 1 1" : " 0 0 0 0");
modestring_antineutrino += (modes["crsmode_NCDIS_lowW"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_CCQE"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_NCEL"] ? " 1 1 1" : " 0 0 0");
modestring_antineutrino += (modes["crsmode_CCCOH"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_NCCOH"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_CCETA"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_NCETA"] ? " 1 1" : " 0 0");
modestring_antineutrino += (modes["crsmode_CCKAON"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_NCKAON"] ? " 1 1" : " 0 0");
modestring_antineutrino += (modes["crsmode_CCDIS_highW"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_NCDIS_highW"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_CCGAMMA"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_NCGAMMA"] ? " 1" : " 0");
modestring_antineutrino += (modes["crsmode_CC2P2H"] ? " 1" : " 0");
}
return "NEUT-MODE -1 \n" + modestring_neutrino + "\n" +
modestring_antineutrino;
}
std::map MakeNewFluxFile(std::string flux,
std::string out) {
NUIS_LOG(FIT, "Using " << flux << " to define NEUT beam.");
std::vector fluxargs = GeneralUtils::ParseToStr(flux, ",");
if (fluxargs.size() < 2) {
NUIS_ABORT("Expected flux in the format: file.root,hist_name1[pdg1],... : "
"reveived : "
<< flux);
}
// Build Map
std::map fluxmap;
fluxmap["beam_type"] = "6";
fluxmap["beam_inputroot"] = fluxargs[0];
fluxmap["beam_inputroot_nue"] = "";
fluxmap["beam_inputroot_nueb"] = "";
fluxmap["beam_inputroot_numu"] = "";
fluxmap["beam_inputroot_numub"] = "";
fluxmap["beam_inputroot_nutau"] = "";
fluxmap["beam_inputroot_nutaub"] = "";
// Split by beam bdgs
for (uint i = 1; i < fluxargs.size(); i++) {
std::string histdef = fluxargs[i];
string::size_type open_bracket = histdef.find("[");
string::size_type close_bracket = histdef.find("]");
string::size_type ibeg = 0;
string::size_type iend = open_bracket;
string::size_type jbeg = open_bracket + 1;
string::size_type jend = close_bracket - 1;
std::string name = std::string(histdef.substr(ibeg, iend).c_str());
int pdg = atoi(histdef.substr(jbeg, jend).c_str());
if (pdg == 12)
fluxmap["beam_inputroot_nue"] = name;
else if (pdg == -12)
fluxmap["beam_inputroot_nueb"] = name;
else if (pdg == 14)
fluxmap["beam_inputroot_numu"] = name;
else if (pdg == -14)
fluxmap["beam_inputroot_numub"] = name;
else if (pdg == 16)
fluxmap["beam_inputroot_tau"] = name;
else if (pdg == -16)
fluxmap["beam_inputroot_taub"] = name;
}
// Now create a new flux file matching the output file
std::cout << " -> Moving flux from '" + fluxmap["beam_inputroot"] +
"' to current directory to keep everything organised."
<< std::endl;
TFile *fluxread = new TFile(fluxmap["beam_inputroot"].c_str(), "READ");
TFile *fluxwrite = new TFile((out + ".flux.root").c_str(), "RECREATE");
for (std::map::iterator iter = fluxmap.begin();
iter != fluxmap.end(); iter++) {
TH1 *temp = (TH1 *)fluxread->Get(iter->second.c_str());
if (!temp)
continue;
TH1D *cuthist = (TH1D *)temp->Clone();
// Restrict energy range if required
if (gOptEnergyRange.size() == 2) {
for (int i = 0; i < cuthist->GetNbinsX(); i++) {
if (cuthist->GetXaxis()->GetBinCenter(i + 1) < gOptEnergyRange[0] or
cuthist->GetXaxis()->GetBinCenter(i + 1) > gOptEnergyRange[1]) {
cuthist->SetBinContent(i + 1, 0.0);
}
}
}
// Check Flux
if (cuthist->Integral() <= 0.0) {
NUIS_ABORT("Flux histogram " << iter->second << " has integral <= 0.0");
}
// Save
fluxwrite->cd();
cuthist->Write();
}
std::cout << " ->-> Saved to : " << (out + ".flux.root") << std::endl;
fluxmap["beam_inputroot"] = (out + ".flux.root");
fluxwrite->Close();
return fluxmap;
}
std::string GetFluxDefinition(std::string fluxfile, std::string fluxhist,
std::string fluxid) {
// Get base name of flux file as its being copied to NEUT Run Directory
std::vector splitfluxfile =
GeneralUtils::ParseToStr(fluxfile, "/");
std::string filename = "";
if (splitfluxfile.size() == 1) {
filename = splitfluxfile[0];
} else if (splitfluxfile.size() > 1) {
filename = splitfluxfile[splitfluxfile.size() - 1];
} else {
NUIS_ABORT("NO FILENAME FOR FLUX DEFINITION FOUND!");
}
// Build string
std::string fluxparams = "";
fluxparams += "EVCT-FILENM \'" + filename + "\' \n";
fluxparams += "EVCT-HISTNM \'" + fluxhist + "\' \n";
fluxparams += "EVCT-INMEV 0 \n";
fluxparams += "EVCT-MPV 3 \n";
// Set PDG Code
if (!fluxid.compare("nue"))
fluxparams += "EVCT-IDPT 12";
else if (!fluxid.compare("nueb"))
fluxparams += "EVCT-IDPT -12";
else if (!fluxid.compare("numu"))
fluxparams += "EVCT-IDPT 14";
else if (!fluxid.compare("numub"))
fluxparams += "EVCT-IDPT -14";
else if (!fluxid.compare("nutau"))
fluxparams += "EVCT-IDPT 16";
else if (!fluxid.compare("nutaub"))
fluxparams += "EVCT-IDPT -16";
else {
NUIS_ABORT("UNKNOWN FLUX ID GIVEN!");
}
return fluxparams;
}
std::string GetTargetDefinition(std::string target) {
NUIS_LOG(FIT, "Defining NEUT Target from : " << target);
// Target is given as either a single PDG, or a combo with the total number of
// nucleons
std::vector trgts = GeneralUtils::ParseToStr(target, ",");
std::string targetstring = "";
// NEUT only lets us pass C and CH type inputs.
// Single Target
if (trgts.size() == 1) {
int PDG = GeneralUtils::StrToInt(trgts[0]);
int Z = TargetUtils::GetTargetZFromPDG(PDG);
int N = TargetUtils::GetTargetAFromPDG(PDG) - Z;
targetstring += "NEUT-NUMBNDP " + GeneralUtils::IntToStr(Z) + "\n";
targetstring += "NEUT-NUMBNDN " + GeneralUtils::IntToStr(N) + "\n";
targetstring += "NEUT-NUMFREP 0\n";
targetstring += "NEUT-NUMATOM " + GeneralUtils::IntToStr(Z + N) + "\n";
// Combined target
} else if (trgts.size() == 3) {
int NUCLEONS = GeneralUtils::StrToInt(trgts[0]);
std::string target1 = trgts[1];
std::string target2 = trgts[2];
// Parse target strings
string::size_type open_bracket = target1.find("[");
string::size_type close_bracket = target1.find("]");
string::size_type ibeg = 0;
string::size_type iend = open_bracket;
string::size_type jbeg = open_bracket + 1;
string::size_type jend = close_bracket - 1;
int PDG1 = atoi(target1.substr(ibeg, iend).c_str());
double W1 = atof(target1.substr(jbeg, jend).c_str());
open_bracket = target2.find("[");
close_bracket = target2.find("]");
ibeg = 0;
iend = open_bracket;
jbeg = open_bracket + 1;
jend = close_bracket - 1;
int PDG2 = atoi(target2.substr(ibeg, iend).c_str());
double W2 = atof(target2.substr(jbeg, jend).c_str());
// Can only have H as a secondary target!
if (PDG1 != 1000010010 && PDG2 != 1000010010) {
NUIS_ABORT(
"NEUT Doesn't support composite targets apart fromn Target+H. E.g. "
"CH");
}
// Switch so H is PDG2 if given
if (PDG1 == 1000010010 && PDG2 != 1000010010) {
PDG1 = PDG2;
PDG2 = 1000010010;
double temp1 = W1;
W1 = W2;
W2 = temp1;
}
// Now build string
int Z = TargetUtils::GetTargetZFromPDG(PDG1);
int N = TargetUtils::GetTargetAFromPDG(PDG1) - Z;
int NHydrogen = int(W2 * double(NUCLEONS));
if (double(W2 * double(NUCLEONS)) - (double(NHydrogen)) > 0.5) {
NHydrogen++; // awkward rounding bug fix
}
targetstring += "NEUT-NUMBNDP " + GeneralUtils::IntToStr(Z) + "\n";
targetstring += "NEUT-NUMBNDN " + GeneralUtils::IntToStr(N) + "\n";
targetstring += "NEUT-NUMFREP " + GeneralUtils::IntToStr(NHydrogen) + "\n";
targetstring += "NEUT-NUMATOM " + GeneralUtils::IntToStr(Z + N) + "\n";
} else {
NUIS_ABORT("NEUT only supports single targets or ones with a secondary H!");
}
return targetstring;
}
std::string GetEventAndSeedDefinition(int nevents, int seed) {
std::string eventdef = "";
eventdef += "EVCT-NEVT " + GeneralUtils::IntToStr(nevents) + "\n";
NUIS_LOG(FIT, "Event Definition: ");
std::cout << " -> EVCT-NEVT : " << nevents << std::endl;
return eventdef;
}
//____________________________________________________________________________
int main(int argc, char **argv) {
NUIS_LOG(FIT, "==== RUNNING neut_nuisance Event Generator =====");
GetCommandLineArgs(argc, argv);
std::string neutroot = std::string(getenv("NEUT_ROOT")) + "/src/neutsmpl/";
// Calculate the dynamic modes definition
// Read Target string
std::string targetparamsdef = GetTargetDefinition(gOptTargetDef);
//____________________________
// NEUT doesn't let us do combined flux inputs so have to loop over each flux.
std::map newfluxdef =
MakeNewFluxFile(gOptFluxDef, gOptOutputFile);
// Quick fix to make flux also save to pid_time.root.flux.root
std::stringstream ss;
ss << getpid() << "_" << time(NULL) << ".root";
newfluxdef = MakeNewFluxFile(gOptFluxDef, ss.str());
// Copy this file to the NEUT working directory
NUIS_LOG(FIT, "Copying flux to NEUT working directory");
system(
("cp -v " + newfluxdef["beam_inputroot"] + " " + neutroot + "/").c_str());
TFile *fluxrootfile = new TFile(newfluxdef["beam_inputroot"].c_str(), "READ");
// Setup possible beams and get relative fractions
std::vector possiblefluxids;
std::vector fluxfractions;
possiblefluxids.push_back("nue");
possiblefluxids.push_back("nueb");
possiblefluxids.push_back("numu");
possiblefluxids.push_back("numub");
possiblefluxids.push_back("tau");
possiblefluxids.push_back("taub");
// Total up integrals
double totintflux = 0.0;
for (size_t i = 0; i < possiblefluxids.size(); i++) {
if (newfluxdef["beam_inputroot_" + possiblefluxids[i]].empty()) {
fluxfractions.push_back(0.0);
} else {
TH1D *fluxhist = (TH1D *)fluxrootfile->Get(
newfluxdef["beam_inputroot_" + possiblefluxids[i]].c_str());
if (!fluxhist) {
NUIS_ABORT("FLUX HIST : "
<< newfluxdef["beam_inputroot_" + possiblefluxids[i]]
<< " not found!");
}
fluxfractions.push_back(fluxhist->Integral());
totintflux += fluxhist->Integral();
}
}
fluxrootfile->Close();
// Now loop over and actually generate jobs!
for (size_t i = 0; i < possiblefluxids.size(); i++) {
if (fluxfractions[i] == 0.0)
continue;
// Get number of events for this subbeam
int nevents = int(double(gOptNumberEvents) * fluxfractions[i] / totintflux);
std::cout << "NEVENTS = " << gOptNumberEvents << " " << fluxfractions[i]
<< " " << totintflux << " " << nevents << std::endl;
std::string eventparamsdef = GetEventAndSeedDefinition(nevents, gOptSeed);
bool neutrino = true;
if (possiblefluxids[i].find("b") != std::string::npos)
neutrino = false;
std::string dynparamsdef = GetDynamicModes(gOptGeneratorList, neutrino);
std::string fluxparamsdef = GetFluxDefinition(
newfluxdef["beam_inputroot"],
newfluxdef["beam_inputroot_" + possiblefluxids[i]], possiblefluxids[i]);
NUIS_LOG(FIT,"==== Generating CardFiles NEUT! ===");
std::cout << dynparamsdef << std::endl;
std::cout << targetparamsdef << std::endl;
std::cout << eventparamsdef << std::endl;
std::cout << fluxparamsdef << std::endl;
// Create card file
std::ifstream incardfile;
std::ofstream outcardfile;
std::string line;
incardfile.open(gOptCrossSections.c_str(), ios::in);
outcardfile.open(
(gOptOutputFile + "." + possiblefluxids[i] + ".par").c_str(), ios::out);
// Copy base card file
if (incardfile.is_open()) {
while (getline(incardfile, line)) {
outcardfile << line << '\n';
}
} else {
NUIS_ABORT("Cannot find card file : " << gOptCrossSections);
}
// Now copy our strings
outcardfile << eventparamsdef << '\n';
outcardfile << dynparamsdef << '\n';
outcardfile << targetparamsdef << '\n';
outcardfile << fluxparamsdef << '\n';
// Close card and keep name for future use.
outcardfile.close();
}
NUIS_LOG(FIT, "GENERATING");
for (size_t i = 0; i < possiblefluxids.size(); i++) {
if (fluxfractions[i] == 0.0)
continue;
int nevents = int(double(gOptNumberEvents) * fluxfractions[i] / totintflux);
if (nevents <= 0)
continue;
std::string cardfile =
ExpandPath(gOptOutputFile + "." + possiblefluxids[i] + ".par");
std::string outputfile =
ExpandPath(gOptOutputFile + "." + possiblefluxids[i] + ".root");
std::string basecardfile = GetBaseName(cardfile);
std::string baseoutputfile = ss.str();
std::cout << "CARDFILE = " << cardfile << " : " << basecardfile
<< std::endl;
std::cout << "OUTPUTFILE = " << outputfile << " : " << baseoutputfile
<< std::endl;
system(("cp " + cardfile + " " + neutroot).c_str());
std::string cwd = GETCWD();
chdir(neutroot.c_str());
// int attempts = 0;
// while(true){
// Break if too many attempts
// attempts++;
// if (attempts > 20) continue;
// Actually run neutroot2
system(("./neutroot2 " + basecardfile + " " + baseoutputfile).c_str());
// Check the output is valid, sometimes NEUT aborts mid run.
// TFile* f = new TFile(baseoutputfile.c_str(),"READ");
// if (!f or f->IsZombie()) continue;
// Check neutttree is there and filled correctly.
// TTree* tn = (TTree*) f->Get("neuttree");
// if (!tn) continue;
// if (tn->GetEntries() < nevents * 0.9) continue;
// break;
// }
// Move the finished file back and clean this directory of card files
system(("mv -v " + baseoutputfile + " " + outputfile).c_str());
system(("rm -v " + basecardfile).c_str());
chdir(cwd.c_str());
}
return 0;
}
//____________________________________________________________________________
void GetCommandLineArgs(int argc, char **argv) {
// Check for -h flag.
for (int i = 0; i < argc; i++) {
if (!std::string(argv[i]).compare("-h"))
PrintSyntax();
}
// Format is neut -r run_number -n n events
std::vector args = GeneralUtils::LoadCharToVectStr(argc, argv);
ParserUtils::ParseArgument(args, "-n", gOptNumberEvents, false);
if (gOptNumberEvents == -1) {
NUIS_ABORT("No event count passed to neut_NUISANCE!");
}
// Flux/Energy Specs
ParserUtils::ParseArgument(args, "-e", gOptEnergyDef, false);
gOptEnergyRange = GeneralUtils::ParseToDbl(gOptEnergyDef, ",");
ParserUtils::ParseArgument(args, "-f", gOptFluxDef, false);
if (gOptFluxDef.empty() and gOptEnergyRange.size() < 1) {
NUIS_ABORT("No flux or energy range given to neut_nuisance!");
} else if (gOptFluxDef.empty() and gOptEnergyRange.size() == 1) {
// Fixed energy, make sure -p is given
NUIS_ABORT("neut_NUISANCE cannot yet do fixed energy!");
} else if (gOptFluxDef.empty() and gOptEnergyRange.size() == 2) {
// Uniform energy range
NUIS_ABORT("neut_NUISANCE cannot yet do a uniform energy range!");
} else if (!gOptFluxDef.empty()) {
// Try to convert the flux definition if possible.
std::string convflux = BeamUtils::ConvertFluxIDs(gOptFluxDef);
if (!convflux.empty())
gOptFluxDef = convflux;
} else {
NUIS_ABORT("Unknown flux energy range combination!");
}
ParserUtils::ParseArgument(args, "-t", gOptTargetDef, false);
if (gOptTargetDef.empty()) {
NUIS_ABORT("No Target passed to neut_nuisance! use the '-t' argument.");
} else {
std::string convtarget = TargetUtils::ConvertTargetIDs(gOptTargetDef);
if (!convtarget.empty())
gOptTargetDef = convtarget;
}
ParserUtils::ParseArgument(args, "-r", gOptRunNumber, false);
ParserUtils::ParseArgument(args, "-o", gOptOutputFile, false);
if (gOptOutputFile.empty()) {
if (gOptRunNumber == -1)
gOptRunNumber = 1;
NUIS_LOG(FIT, "No output file given! Saving file to : neutgen."
<< gOptRunNumber << ".neutvect.root");
gOptOutputFile =
"neutgen." + GeneralUtils::IntToStr(gOptRunNumber) + ".neutvect.root";
} else {
// if no run number given leave as is, else add run number.
if (gOptRunNumber != -1) {
gOptOutputFile += "." + GeneralUtils::IntToStr(gOptRunNumber) + ".root";
} else {
gOptRunNumber = 0;
}
}
ParserUtils::ParseArgument(args, "--cross-section", gOptCrossSections, false);
if (!gOptCrossSections.compare("Default")) {
NUIS_LOG(FIT, "No Parameters File passed. Using default neut one.");
char *const var = getenv("NUISANCE");
if (!var) {
std::cout << "Cannot find top level directory! Set the NUISANCE "
"environmental variable"
<< std::endl;
exit(-1);
}
std::string topnuisancedir = string(var);
gOptCrossSections = topnuisancedir + "/neut/Default_params.txt";
}
ParserUtils::ParseArgument(args, "--event-generator-list", gOptGeneratorList,
false);
// Final Check and output
if (args.size() > 0) {
PrintSyntax();
ParserUtils::CheckBadArguments(args);
}
NUIS_LOG(FIT, "Generating Neut Events with the following properties:"
<< std::endl
<< " -> Energy : " << gOptEnergyDef << " ("
<< gOptEnergyRange.size() << ")" << std::endl
<< " -> NEvents : " << gOptNumberEvents << std::endl
<< " -> Generators : " << gOptGeneratorList << std::endl
<< " -> XSecPars : " << gOptCrossSections << std::endl
<< " -> Target : " << gOptTargetDef << std::endl
<< " -> Flux : " << gOptFluxDef << std::endl
<< " -> Output : " << gOptOutputFile << std::endl
<< " -> Run : " << gOptRunNumber);
return;
}
//____________________________________________________________________________
void PrintSyntax(void) {
NUIS_LOG(FIT, "\n\n"
<< "Syntax:"
<< "\n"
<< "\n neut_nuisance [-h]"
<< "\n -n nev"
<< "\n -f flux_description"
<< "\n -t target_description"
<< "\n [ -r run_number ]"
<< "\n [ -o output_file ]"
<< "\n [ --cross-section /path/to/params.txt ]"
<< "\n [ --event-generator-list mode_definition ]"
<< "\n \n");
NUIS_LOG(
FIT,
"\n\n Arguments:"
<< "\n"
<< "\n -n nev"
<< "\n -> Total number of events to generate (e.g. 2500000)"
<< "\n"
<< "\n -f flux_description"
<< "\n Definition of the flux to be read in from a ROOT file."
<< "\n"
<< "\n Multiple histograms can be read in from the same file using"
<< "\n the format '-f file.root,hist1[pdg1],hist2[pdg2]"
<< "\n e.g. \'-f "
"./flux/myfluxfile.root,numu_flux[14],numubar_flux[-14]\'"
<< "\n"
<< "\n A flux can also be given according to any of the flux IDs "
"shown"
<< "\n at the end of this help message."
<< "\n e.g. \' -f MINERvA_fhc_numu\' "
<< "\n"
<< "\n WARNING: NEUT can't actually generate combined fluxes yet"
<< "\n if you want a composite flux, pass them in as normal, but "
"the "
"app"
- << "\n will generate you the files seperately, with reduced "
+ << "\n will generate you the files separately, with reduced "
"nevents "
"in each"
<< "\n so that the statistics are roughly okay."
<< "\n"
<< "\n -t target_description"
<< "\n Definition of the target to be used. Multiple targets can "
"be "
"given."
<< "\n"
<< "\n To pass a single target just provide the target PDG"
<< "\n e.g. \' -t 1000060120 \'"
<< "\n"
<< "\n To pass a combined target provide a list containing the "
"following"
<< "\n \' -t TotalNucleons,Target1[Weight1],Target2[Weight2],.. "
"where "
"the "
<< "\n TotalNucleons is the total nucleons combined, Target1 is "
"the "
"PDG "
<< "\n of the first target, and Weight1 is the fractional weight "
"of "
"the "
<< "\n first target."
<< "\n e.g. \' -t 13,1000060120[0.9231],1000010010[0.0769] \'"
<< "\n"
<< "\n Target can also be specified by the target IDs given at "
"the "
"end of"
<< "\n this help message."
<< "\n e.g. \' -t CH2 \'"
<< "\n"
<< "\n WARNING: NEUT can only generate A+H targets. E.g. CH or "
"CH2 "
"will work, but "
- << "\n Fe+Pb will not. You will have to generate each seperately "
+ << "\n Fe+Pb will not. You will have to generate each separately "
"if "
"you want"
<< "\n something other than A+NH."
<< "\n"
<< "\n -r run_number"
<< "\n run number ID that can be used when generating large "
"samples "
"in small "
<< "\n jobs. Must be an integer. When given neut_nuisance will "
"update "
"the "
<< "\n output file from 'output.root' to "
"'output.root.run_number.root'"
<< "\n"
<< "\n -o output_file"
<< "\n Path to the output_file you want to save events to."
<< "\n"
<< "\n If this is not given but '-r' is then events will be saved "
"to "
<< "\n the file 'neutgen.run_number.neutvect.root'"
<< "\n"
<< "\n If a run number is given alongside '-o' then events will "
"be "
"saved "
<< "\n to 'output.root.run_number.root'"
<< "\n"
<< "\n --cross-section /path/to/params.txt"
<< "\n Path to the neut model definition. If this is not given, "
"then "
"this "
<< "\n will default to $NUISANCE/data/neut/Default_params.txt"
<< "\n"
<< "\n Look in $NUISANCE/data/neut/Default_params.txt for "
"examples "
"when "
<< "\n writing your own card files."
<< "\n"
<< "\n --event-generator-list mode_definition"
<< "\n Name of modes to run. This sets the CRS and CRSB values in "
"NEUT."
<< "\n e.g. --event-generator-list Default+MEC"
<< "\n"
<< "\n Allowed mode_definitions are given at the end of this help "
"message."
<< "\n"
<< "\n\n");
std::cout << "-----------------" << std::endl;
TargetUtils::ListTargetIDs();
std::cout << "-----------------" << std::endl;
BeamUtils::ListFluxIDs();
std::cout << "-----------------" << std::endl;
NUIS_LOG(FIT) << "Allowed Mode Definitions:" << std::endl
<< " - Default : Default CC+NC modes, no MEC" << std::endl
<< " - Default+MEC : Default CC+NC modes + 2p2h MEC " << std::endl
<< " - DefaultFree : Default CC+NC modes, no Coherent or MEC ");
std::cout << "----------------" << std::endl;
exit(0);
}
//____________________________________________________________________________
#endif
diff --git a/app/nuis_flat_tree_combiner.cxx b/app/nuis_flat_tree_combiner.cxx
new file mode 100644
index 0000000..7920efe
--- /dev/null
+++ b/app/nuis_flat_tree_combiner.cxx
@@ -0,0 +1,112 @@
+#include
+#include
+#include
+
+#include "TChain.h"
+#include "TFile.h"
+#include "TTree.h"
+
+std::vector inputdescriptors;
+std::string outputfilename;
+std::string treename;
+std::string branchname;
+bool isdouble = true;
+
+void SayUsage(char const *argv[]) {
+ std::cout
+ << "[USAGE]: " << argv[0] << "\n"
+ << "\t-i : Input file list\n"
+ << "\t-o : Input file list\n"
+ << "\t-t : flat tree name\n"
+ << "\t-b : xsec weighting "
+ "branch name\n"
+ << "\t-f : xsec weighting "
+ "branch is float\n"
+ << std::endl;
+}
+
+void handleOpts(int argc, char const *argv[]) {
+ int opt = 1;
+ while (opt < argc) {
+ if (std::string(argv[opt]) == "-?" || std::string(argv[opt]) == "--help") {
+ SayUsage(argv);
+ exit(0);
+ } else if (std::string(argv[opt]) == "-i") {
+ // Keep adding until run out of options or the next string starts with a -
+ while (((opt + 1) != argc) && (argv[opt + 1][0] != '-')) {
+ inputdescriptors.push_back(argv[++opt]);
+ }
+ } else if (std::string(argv[opt]) == "-o") {
+ outputfilename = argv[++opt];
+ } else if (std::string(argv[opt]) == "-t") {
+ treename = argv[++opt];
+ } else if (std::string(argv[opt]) == "-b") {
+ branchname = argv[++opt];
+ } else if (std::string(argv[opt]) == "-f") {
+ isdouble = false;
+ } else {
+ std::cout << "[ERROR]: Unknown option: " << argv[opt] << std::endl;
+ SayUsage(argv);
+ exit(1);
+ }
+ opt++;
+ }
+}
+
+int main(int argc, char const *argv[]) {
+ handleOpts(argc, argv);
+
+ TChain ch(treename.c_str());
+ for (size_t i = 0; i < inputdescriptors.size(); ++i) {
+ ch.Add(inputdescriptors[i].c_str());
+ std::cout << "Added: " << inputdescriptors[i] << " to input file list."
+ << std::endl;
+ }
+
+ TFile *outfile = new TFile(outputfilename.c_str(), "RECREATE");
+ std::cout << "Writing to " << outputfilename << std::endl;
+ TTree *outtree = ch.CloneTree(0, "");
+ outtree->SetDirectory(outfile);
+
+ size_t nents = ch.GetEntries();
+ double ntrees = ch.GetNtrees();
+
+ if (isdouble) {
+ double fScaleFactor;
+ ch.SetBranchAddress(branchname.c_str(), &fScaleFactor);
+ std::cout << "recalculating " << branchname << "(double) for " << ntrees
+ << " input trees." << std::endl;
+
+ for (size_t ent_it = 0; ent_it < nents; ++ent_it) {
+ if ((nents/100) && ent_it && !(ent_it % (nents/100))) {
+ std::cout << "Processed " << ent_it << "/" << nents << std::endl;
+ }
+
+ ch.GetEntry(ent_it);
+
+ fScaleFactor /= ntrees;
+
+ outtree->Fill();
+ }
+ } else {
+ float fScaleFactor;
+ ch.SetBranchAddress(branchname.c_str(), &fScaleFactor);
+ std::cout << "recalculating " << branchname << "(float) for " << ntrees
+ << " input trees." << std::endl;
+
+ for (size_t ent_it = 0; ent_it < nents; ++ent_it) {
+ if ((nents/100) && ent_it && !(ent_it % (nents/100))) {
+ std::cout << "Processed " << ent_it << "/" << nents << std::endl;
+ }
+
+ ch.GetEntry(ent_it);
+
+ fScaleFactor /= ntrees;
+
+ outtree->Fill();
+ }
+ }
+
+ outfile->Write();
+ outfile->Close();
+}
\ No newline at end of file
diff --git a/app/nuisbayes.cxx b/app/nuisbayes.cxx
index 98c9c3f..08429ad 100644
--- a/app/nuisbayes.cxx
+++ b/app/nuisbayes.cxx
@@ -1,68 +1,68 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
// Author: Patrick Stowell 09/2016
/*
Usage: ./nuissyst -c card file -o output file, where the results of the throws are stored
where:
*/
#include "BayesianRoutines.h"
//*******************************
void printInputCommands(){
//*******************************
exit(-1);
};
//*******************************
int main(int argc, char* argv[]){
//*******************************
// Program status;
int status = 0;
// If No Arguments print commands
if (argc == 1) printInputCommands();
for (int i = 1; i< argc; ++i){
// Cardfile
if (!std::strcmp(argv[i], "-h")) printInputCommands();
else break;
}
// Read input arguments such as card file, parameter arguments, and fit routines
NUIS_LOG(FIT,"Starting nuissyst");
// Make systematic class and run fit
BayesianRoutines* min = new BayesianRoutines(argc, argv);
min->Run();
// Show Final Status
NUIS_LOG(FIT,"-------------------------------------");
NUIS_LOG(FIT,"FINISHED");
NUIS_LOG(FIT,"-------------------------------------");
return status;
}
diff --git a/app/nuiscomp.cxx b/app/nuiscomp.cxx
index b04cef7..2766244 100644
--- a/app/nuiscomp.cxx
+++ b/app/nuiscomp.cxx
@@ -1,293 +1,293 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ComparisonRoutines.h"
//*******************************
void printInputCommands() {
//*******************************
std::cout << "nuiscomp : NUISANCE Data Comparison App \n" << std::endl;
std::cout
<< "# Running nuiscomp with a card file #\n"
<< "######################################\n"
<< "nuiscomp -c cardfile.xml [ -o outputfile.root ] [ -f routines ] [ "
"-n maxevents ] \n"
<< " [ -i 'cardstructure' ] [ -d fakedata ] [ -q config=val ] [ "
"+e/-e ] [ +v/-v ] \n"
<< "\n"
<< "# Running nuiscomp with structures at cmd line #\n"
<< "################################################\n"
<< "nuiscomp -i 'cardstructure' -o outputfile.root [ -c cardfile.xml [ "
"-f routines ] [ -n maxevents ] \n"
<< " [ -d fakedata ] [ -q config=val ] [ +e/-e ] [ +v/-v ] \n"
<< std::endl;
sleep(4);
std::cout
<< ""
<< "\n"
<< " \n"
<< " -c cardfile.xml : NUISANCE format card file defining "
"comparisons. \n"
<< " \n"
<< " -o outputfile.root : Output file that histograms will be "
"saved in. If a card file is \n"
<< " given but no output file this will "
"default to cardfile.xml.root \n"
<< " \n"
<< " -f routines : Comma separated list of comparison "
"routines to run in order. \n"
<< " Allowed Routines : "
" \n"
<< " Compare : Fixed comparison at "
"nominal dial values. \n"
<< " \n"
<< " -n maxevents : Set limit on the number of event "
"entries to process. \n"
<< " \n"
<< " -i \'cardstructure\' : Define card structure like those "
"available in the standard NUISANCE \n"
<< " card format, but on the command line "
"at runtime. MUST be enclosed \n"
<< " in single quotation marks. See "
"examples below for usage. \n"
<< " \n"
<< " It is possible to entirely define "
"the comparison using \' -i\' commands \n"
<< " without the need to write a card "
"file explicitly. If you do this, \n"
<< " make sure to also use the \' -o\' "
"flag to tell it where to go. \n"
<< " \n"
<< " -d fakedata : Define a fake data set to be used. "
"All data in NUISANCE will be set \n"
<< " to the values defined in this fake "
"data before comparisons are made. \n"
<< " \n"
<< " There are two possible methods. Fake "
"data from MC or a previous file.\n"
<< " fakedata = \'MC\' : Sets the MC to "
"the values defined by \'fake_parameters\' \n"
<< " shown in the "
"examples below, and then sets the data \n"
<< " to be equal to "
"this MC prediction. \n"
<< " fakedata = \'file.root\' : Reads in "
"the ROOT file at the specified path \n"
<< " assuming "
"its a standard NUISANCE file. Takes \n"
<< " MC "
"predictions in this file and uses them as \n"
<< " fake data. "
"\n"
<< " \n"
<< " -q config=val : Overrides default configurations "
"provided in the cardfile and in \n"
<< " '$NUISANCE/parameters/config.xml\'. "
"Any config parameter can be set. \n"
<< " Examples : \n"
<< " \'-q VERBOSITY=4\' \n"
<< " \'-q EventManager=1\' \n"
<< " \'-q drawOpts=DATA/MC\' \n"
<< " \n"
<< " +e/-e : Increase/Decrease the default error "
"verbosity by 1. \n"
<< " \n"
<< " +v/-v : Increase/Decrease the default "
"logging verbosity by 1.\n"
<< " \n\n"
<< std::endl;
sleep(4);
std::cout
<< "# nuiscomp Running Examples #"
<< "############################# \n"
<< " \n"
<< " 1. Generate cardfile comparisons with increased verbosity and only "
"50000 events \n\n"
<< " nuiscomp -c cardfile.card -o mycomp.root -n 50000 +v +v \n"
<< " \n\n"
<< " 2. Generate a comparison to MiniBooNE data using simple structure, "
"saving it to outfile.root \n\n"
<< " nuiscomp -o outfile.root -i \'sample "
"MiniBooNE_CCQE_XSec_1DQ2_nu NEUT:neutevents.root\' \n"
<< " \n\n"
<< " 3. Generate a comparison to MiniBooNE data using xml structure, "
"reweight MaCCQE, and save the prediction to outfile.root \n\n"
<< " nuiscomp -o outfile.root -i \'sample "
"name=\"MiniBooNE_CCQE_XSec_1DQ2_nu\" "
"input=\"NEUT:neutevents.root\"\' \\ \n"
<< " -i \'sample "
"name=\"MiniBooNE_CC1pip_XSec_1DQ2_nu\" "
"input=\"NEUT:neutevents.root\"\' \\ \n"
<< " -i \'parameter name=\"MaCCQE\" "
"nominal=\"1.0\" type=\"neut_parameter\"\' \n "
<< " \n\n"
<< " 4. Generate a comparison, using fake data from the MC predictions "
"inside the fakedata.root \n\n"
<< " nuiscomp -c cardfile.card -o myfakecomp.root -d fakedata.root "
"\n"
<< " \n\n"
<< " 5. Generate a comparison using fake data defined on the command "
"line use fake parameters \n\n"
<< " nuiscomp -c cardfile.card -d MC -i \'fakeparameter "
"name=\"MaCCQE\" nominal=\"1.0\"\' \n "
<< " -i \'parameter name=\"MaCCQE\" "
"nominal=\"1.0\" type=\"neut_parameter\"' "
<< " \n\n"
<< std::endl;
sleep(4);
std::cout << "# NUISANCE Card Format Structure Examples # \n"
<< "########################################### \n"
<< "\n"
<< "The NUISANCE card can be defined as a simple text file, or an "
"xml file. \n"
<< "Examples for both with relevant structures are given below. \n"
<< std::endl;
std::cout
<< "# XML Card File Example # \n"
<< "cardfile.xml: \n"
<< ""
<< "\n"
<< " \n"
<< " \n"
<< " \n"
<< "\n"
<< " \n"
<< " "
"\n"
<< " \n"
<< " \n"
<< " \n"
<< " \n"
<< " \n"
<< "\n"
<< " \n"
<< " \n"
<< "\n"
<< "\n"
<< " \n"
<< " \n"
<< " \n"
<< " \n"
<< " \n"
<< "\n"
<< " \n"
<< "\n"
<< " \n"
<< " \n"
<< " \n"
<< " \n"
<< " \n"
<< "\n"
<< " \n"
<< "\n"
<< " \n\n"
<< std::endl;
std::cout
<< "# Simple Card File Example # \n"
<< "cardfile.card: \n"
<< "\n"
<< "# CONFIG STRUCTURE \n"
<< "# config name val \n"
<< "config VERBOSITY 4 \n"
<< "\n"
<< "# Sample Structure \n"
<< "# ID Corresponds to names given in src/FCN/SampleList.cxx \n"
<< "# TYPE is the generator type (NEUT,NUWRO,GENIE,GIBUU). \n"
<< "# FILE is the input generator events file. \n"
<< "# TYPE is optional and used to define options for a class. e.g. FREE "
" \n"
<< "# NORM is optional and sets sample normalisations. \n"
<< "# sample ID TYPE:FILE TYPE 1.0 \n"
<< "\n"
<< "sample MiniBooNE_CCQE_XSec_1DQ2_nu GENIE:genieevents.root \n"
<< "sample MiniBooNE_CC1pip_XSec_1DQ2_nu GENIE:genieevents.root SHAPE \n"
<< "\n"
<< "\n"
<< "# Parameter Structure \n"
<< "# ID is the name of the dial in each generator RW engine \n"
<< "# TYPE is the dial type (neut,newer,genie,niwg,t2k,custom,norm) \n"
<< "# VAL is the nominal value in 1-sigma variation for the comparison \n"
<< "# TYPE_parameter ID VAL \n"
<< "\n"
<< "neut_parameter MaCCQE 0.5 \n"
<< "\n"
<< "# Fake Parameter Structure \n"
<< "# Sets values for fake data defined using the ‘MC’ flag. \n"
<< "# ID is the dial name, it MUST be specified before hand using a "
"normal parameter structure \n"
<< "# VAL is the value to use for the fake data \n"
<< "# fake_parameter ID VAL \n"
<< "\n"
<< "fake_parameter MaCCQE 1.0 \n"
<< "\n"
<< std::endl;
exit(-1);
};
//*******************************
int main(int argc, char *argv[]) {
//*******************************
// Program status;
int status = 0;
// If No Arguments print commands
if (argc == 1)
printInputCommands();
for (int i = 1; i < argc; ++i) {
// Cardfile
if (!std::strcmp(argv[i], "-h"))
printInputCommands();
else
break;
}
// Read input arguments such as card file, parameter arguments, and fit
// routines
NUIS_LOG(FIT, "Starting nuiscomp.exe");
// Make minimizer class and run fit
ComparisonRoutines *comp = new ComparisonRoutines(argc, argv);
comp->Run();
delete comp;
// Show Final Status
NUIS_LOG(FIT, "------------------------------------ -");
NUIS_LOG(FIT, "Comparison Complete.");
NUIS_LOG(FIT, "------------------------------------ -");
return status;
}
diff --git a/app/nuisflat.cxx b/app/nuisflat.cxx
index 25fa4ed..968c97e 100644
--- a/app/nuisflat.cxx
+++ b/app/nuisflat.cxx
@@ -1,391 +1,391 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ComparisonRoutines.h"
#include "GenericFlux_Tester.h"
#include "GenericFlux_Vectors.h"
#include "InputUtils.h"
#include "MeasurementBase.h"
#include "Smearceptance_Tester.h"
// Global Arguments
std::string gOptInputFile = "";
std::string gOptFormat = "";
std::string gOptOutputFile = "";
std::string gOptType = "DEFAULT";
std::string gOptNumberEvents = "NULL";
std::string gOptCardInput = "";
std::string gOptOptions = "";
// Input Dial Vals
std::vector fParams; ///< Vector of dial names.
std::map fStateVals; ///< Map of dial states
std::map fCurVals; ///< Map of dial values
std::map fTypeVals; ///< Map of dial type enums.
// Fake Dial Vals
std::map fFakeVals; ///< Map of fake data settings.
void SetupComparisonsFromXML();
void SetupRWEngine();
//*******************************
void PrintSyntax() {
//*******************************
std::cout << "nuisflat -i input [-f format] [-o outfile] [-n nevents] [-t "
"options] [-q con=val] \n";
std::cout
<< "\n Arguments : "
<< "\n\t -i input : Path to input vector of events to flatten"
<< "\n\t"
<< "\n\t This should be given in the same format a normal "
"input file"
<< "\n\t is given to NUISANCE. {e.g. NUWRO:eventsout.root}."
<< "\n\t"
<< "\n\t -f format : FlatTree format to output. If none given "
"GenericVectors used."
<< "\n\t\t GenericFlux : Flat event summary format."
<< "\n\t\t GenericVectors : Standard event summary format with "
"particle vectors."
<< "\n\t "
<< "\n\t[-c crd.xml]: Input card file to override configs or set dial "
"values."
<< "\n\t "
<< "\n\t[-o outfile]: Optional output file path. "
<< "\n\t "
<< "\n\t If none given, input.format.root is chosen."
<< "\n\t"
<< "\n\t[-n nevents]: Optional choice of Nevents to run over. Default is "
"all."
<< "\n\t"
<< "\n\t[-t options]: Pass OPTION to the FlatTree sample. "
<< "\n\t Similar to type field in comparison xml configs."
<< "\n\t"
<< "\n\t[-q con=val]: Configuration overrides." << std::endl;
exit(-1);
};
//____________________________________________________________________________
void GetCommandLineArgs(int argc, char **argv) {
// Check for -h flag.
for (int i = 0; i < argc; i++) {
if ((!std::string(argv[i]).compare("-h")) ||
(!std::string(argv[i]).compare("-?")) ||
(!std::string(argv[i]).compare("--help")))
PrintSyntax();
}
// Format is nuwro -r run_number -n n events
std::vector args = GeneralUtils::LoadCharToVectStr(argc, argv);
// Parse input file
ParserUtils::ParseArgument(args, "-i", gOptInputFile, false);
if (gOptInputFile == "") {
NUIS_ABORT("Need to provide a valid input file to nuisflat using -i flag!");
} else {
NUIS_LOG(FIT, "Reading Input File = " << gOptInputFile);
}
// Get Output Format
ParserUtils::ParseArgument(args, "-f", gOptFormat, false);
if (gOptFormat == "") {
gOptFormat = "GenericVectors";
NUIS_LOG(FIT, "Saving flattree in default format = " << gOptFormat);
} else {
NUIS_LOG(FIT, "Saving flattree in format = " << gOptFormat);
}
// Get Output File
ParserUtils::ParseArgument(args, "-o", gOptOutputFile, false);
if (gOptOutputFile == "") {
gOptOutputFile = gOptInputFile + "." + gOptFormat + ".root";
NUIS_LOG(FIT, "No output file given so saving nuisflat output to:"
<< gOptOutputFile);
} else {
NUIS_LOG(FIT, "Saving nuisflat output to " << gOptOutputFile);
}
// Get N Events and Configs
nuisconfig configuration = Config::Get();
ParserUtils::ParseArgument(args, "-n", gOptNumberEvents, false);
if (gOptNumberEvents.compare("NULL")) {
configuration.OverrideConfig("MAXEVENTS=" + gOptNumberEvents);
}
std::vector configargs;
ParserUtils::ParseArgument(args, "-q", configargs);
for (size_t i = 0; i < configargs.size(); i++) {
configuration.OverrideConfig(configargs[i]);
}
ParserUtils::ParseArgument(args, "-c", gOptCardInput, false);
if (gOptCardInput != "") {
NUIS_LOG(FIT, "Reading cardfile: " << gOptCardInput);
configuration.LoadSettings(gOptCardInput, "");
}
ParserUtils::ParseArgument(args, "-t", gOptOptions, false);
if (gOptOptions != "") {
NUIS_LOG(FIT, "Read options: \"" << gOptOptions << "\'");
}
return;
}
//*******************************
int main(int argc, char *argv[]) {
//*******************************
// Parse
GetCommandLineArgs(argc, argv);
// Make output file
TFile *f = new TFile(gOptOutputFile.c_str(), "RECREATE");
if (f->IsZombie()) {
NUIS_ABORT("Cannot create output file!");
}
f->cd();
FitPar::Config().out = f;
// Create a new measurementbase class depending on the Format
MeasurementBase *flattreecreator = NULL;
SetupComparisonsFromXML();
SetupRWEngine();
// SetupFCN();
// Make a new sample key for the format of interest.
nuiskey samplekey = Config::CreateKey("sample");
if (!gOptFormat.compare("GenericFlux")) {
samplekey.Set("name", "FlatTree");
samplekey.Set("input", gOptInputFile);
samplekey.Set("type", gOptType);
flattreecreator = new GenericFlux_Tester("FlatTree", gOptInputFile,
FitBase::GetRW(), gOptType, "");
} else if (!gOptFormat.compare("GenericVectors")) {
samplekey.Set("name", "FlatTree");
samplekey.Set("input", gOptInputFile);
samplekey.Set("type", gOptType);
flattreecreator = new GenericFlux_Vectors("FlatTree", gOptInputFile,
FitBase::GetRW(), gOptType, "");
} else {
NUIS_ERR(FTL, "Unknown FlatTree format!");
}
// Make the FlatTree reconfigure
flattreecreator->Reconfigure();
f->cd();
flattreecreator->Write();
f->Close();
// Show Final Status
NUIS_LOG(FIT, "-------------------------------------");
NUIS_LOG(FIT, "Flattree Generation Complete.");
NUIS_LOG(FIT, "-------------------------------------");
return 0;
}
//*************************************
void SetupComparisonsFromXML() {
//*************************************
NUIS_LOG(FIT, "Setting up nuiscomp");
// Setup Parameters ------------------------------------------
std::vector parkeys = Config::QueryKeys("parameter");
if (!parkeys.empty()) {
NUIS_LOG(FIT, "Number of parameters : " << parkeys.size());
}
for (size_t i = 0; i < parkeys.size(); i++) {
nuiskey key = parkeys.at(i);
// Check for type,name,nom
if (!key.Has("type")) {
NUIS_ERR(FTL, "No type given for parameter " << i);
NUIS_ERR(FTL, "type='PARAMETER_TYPE'");
throw;
} else if (!key.Has("name")) {
NUIS_ERR(FTL, "No name given for parameter " << i);
NUIS_ERR(FTL, "name='SAMPLE_NAME'");
throw;
} else if (!key.Has("nominal")) {
NUIS_ERR(FTL, "No nominal given for parameter " << i);
NUIS_ERR(FTL, "nominal='NOMINAL_VALUE'");
throw;
}
// Get Inputs
std::string partype = key.GetS("type");
std::string parname = key.GetS("name");
double parnom = key.GetD("nominal");
double parlow = parnom - 1;
double parhigh = parnom + 1;
double parstep = 1;
// override if state not given
if (!key.Has("state")) {
key.SetS("state", "FIX");
}
std::string parstate = key.GetS("state");
// Check for incomplete limtis
int limdef =
((int)key.Has("low") + (int)key.Has("high") + (int)key.Has("step"));
if (limdef > 0 and limdef < 3) {
NUIS_ERR(FTL, "Incomplete limit set given for parameter : " << parname);
NUIS_ERR(
FTL,
"Requires: low='LOWER_LIMIT' high='UPPER_LIMIT' step='STEP_SIZE' ");
throw;
}
// Extra limits
if (key.Has("low")) {
parlow = key.GetD("low");
parhigh = key.GetD("high");
parstep = key.GetD("step");
NUIS_LOG(FIT, "Read " << partype << " : " << parname << " = " << parnom
<< " : " << parlow << " < p < " << parhigh << " : "
<< parstate);
} else {
NUIS_LOG(FIT, "Read " << partype << " : " << parname << " = " << parnom
<< " : " << parstate);
}
// Convert if required
if (parstate.find("ABS") != std::string::npos) {
parnom = FitBase::RWAbsToSigma(partype, parname, parnom);
parlow = FitBase::RWAbsToSigma(partype, parname, parlow);
parhigh = FitBase::RWAbsToSigma(partype, parname, parhigh);
parstep = FitBase::RWAbsToSigma(partype, parname, parstep);
} else if (parstate.find("FRAC") != std::string::npos) {
parnom = FitBase::RWFracToSigma(partype, parname, parnom);
parlow = FitBase::RWFracToSigma(partype, parname, parlow);
parhigh = FitBase::RWFracToSigma(partype, parname, parhigh);
parstep = FitBase::RWFracToSigma(partype, parname, parstep);
}
// Push into vectors
fParams.push_back(parname);
fTypeVals[parname] = FitBase::ConvDialType(partype);
;
fCurVals[parname] = parnom;
fStateVals[parname] = parstate;
}
// Setup Samples ----------------------------------------------
std::vector samplekeys = Config::QueryKeys("sample");
if (!samplekeys.empty()) {
NUIS_LOG(FIT,"Number of samples : " << samplekeys.size());
}
for (size_t i = 0; i < samplekeys.size(); i++) {
nuiskey key = samplekeys.at(i);
// Get Sample Options
std::string samplename = key.GetS("name");
std::string samplefile = key.GetS("input");
std::string sampletype = key.Has("type") ? key.GetS("type") : "DEFAULT";
double samplenorm = key.Has("norm") ? key.GetD("norm") : 1.0;
// Print out
NUIS_LOG(FIT, "Read Sample " << i << ". : " << samplename << " ("
<< sampletype << ") [Norm=" << samplenorm << "]" << std::endl
<< " -> input='" << samplefile
<< "'");
// If FREE add to parameters otherwise continue
if (sampletype.find("FREE") == std::string::npos) {
continue;
}
// Form norm dial from samplename + sampletype + "_norm";
std::string normname = samplename + "_norm";
// Check normname not already present
if (fTypeVals.find("normname") != fTypeVals.end()) {
continue;
}
// Add new norm dial to list if its passed above checks
fParams.push_back(normname);
fTypeVals[normname] = kNORM;
fStateVals[normname] = sampletype;
fCurVals[normname] = samplenorm;
}
// Setup Fake Parameters -----------------------------
std::vector fakekeys = Config::QueryKeys("fakeparameter");
if (!fakekeys.empty()) {
NUIS_LOG(FIT,"Number of fake parameters : " << fakekeys.size());
}
for (size_t i = 0; i < fakekeys.size(); i++) {
nuiskey key = fakekeys.at(i);
// Check for type,name,nom
if (!key.Has("name")) {
NUIS_ERR(FTL, "No name given for fakeparameter " << i);
throw;
} else if (!key.Has("nominal")) {
NUIS_ERR(FTL, "No nominal given for fakeparameter " << i);
throw;
}
// Get Inputs
std::string parname = key.GetS("name");
double parnom = key.GetD("nominal");
// Push into vectors
fFakeVals[parname] = parnom;
}
}
//*************************************
void SetupRWEngine() {
//*************************************
NUIS_LOG(FIT,"Setting up FitWeight Engine");
for (UInt_t i = 0; i < fParams.size(); i++) {
std::string name = fParams[i];
FitBase::GetRW()->IncludeDial(name, fTypeVals.at(name));
}
for (UInt_t i = 0; i < fParams.size(); i++) {
std::string name = fParams[i];
if (fCurVals.find(name) == fCurVals.end())
continue;
FitBase::GetRW()->SetDialValue(name, fCurVals.at(name));
}
FitBase::GetRW()->Reconfigure();
return;
}
diff --git a/app/nuismin.cxx b/app/nuismin.cxx
index 7b965d5..ec47e63 100644
--- a/app/nuismin.cxx
+++ b/app/nuismin.cxx
@@ -1,141 +1,141 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
// Author: Callum Wilkinson 01/2014
// Patrick Stowell 09/2015
/**
Usage: ./GSLminimizerWithReWeight.exe -c card file, where samples and
parameters are defined -o output file, where the results of the fit are stored
where:
*/
#include "MinimizerRoutines.h"
//*******************************
void printInputCommands() {
//*******************************
std::cout
- << "ExtFit_minimizer.exe -c cardFile -o outFile [-f fitStategy] [-d "
+ << "nuismin -c cardFile -o outFile [-f fitStategy] [-d "
"fakeDataFile] [-i inputFile] [-q config_name=config_val] \n";
std::cout << std::endl;
std::cout << "Arguments:" << std::endl;
std::cout << " -c cardFile: Path to card file that defines fit "
"samples, free parameters, and config overrides \n";
std::cout << " -o outFile: Path to root file that will be created to "
"save output file.\n";
std::cout << " To turn automatically overwrite outFile if "
"one exists turn off use 'config overwrite_output 1'\n";
std::cout << " To automatically use previous outFile as "
"an inputFile if it exists so that the fit can be continued\n";
std::cout << " use the flag 'config use_previous_output "
"1'. (A warning will be printed when doing this). \n";
- std::cout << " -f fitStategy: Pass a comma seperated list of fit "
+ std::cout << " -f fitStategy: Pass a comma separated list of fit "
"routines to run in order. Default is Migrad,FixAtLim \n";
std::cout << " Possible Options: \n";
std::cout << " 1. Migrad - Minuit2 Migrad Minimizer \n";
std::cout << " 2. Simplex - Simplex Minimizer \n";
std::cout << " 3. Scan - Brute force scan of parameter "
"space \n";
std::cout << " 4. FixAtLim - Takes any free parameters "
"close to a limit and fixes them \n";
std::cout << " 5. Scan1D - Make 1D Scans and save them "
"in a folder \n";
std::cout << " 6. Contours - Make Contour Scans \n";
std::cout << " 7. Save - Will save the state of the "
"fitter (Always done by default at the end) \n";
std::cout << " Extra option LowStatFit will perform "
"each of these options with a lower number \n";
std::cout << " of fit events (config lowstat). Example: "
"LowStatMigrad, LowStatScan \n";
std::cout << " -d fakeDataFile: Uses the MC generated from a previous "
"fit as a fake data set for these fits \n";
std::cout << " Can also specify MC to set the fake-data "
"to the Monte-Carlo prediction\n";
std::cout << " In this case, you can specify "
"fake_parameter PARAM_NAME PARAM_VALUE in the card\n";
std::cout << " to reweight the MC parameter "
"PARAM_NAME to some PARAM_VALUE. The minimiser will start\n";
std::cout << " at whatever neut_parameter or "
"genie_parameter is set to in the cardfile.\n";
std::cout << " -i inputFile: Uses the results from a previous fit file "
"as starting input for these fits \n";
std::cout << " -q config_name=config_val : Allows any config parameter "
"to be overridden from the command line.\n";
std::cout << " This will take priority over "
"those given in the default, or cardFile. \n";
std::cout << " example: -q verbosity=6 -q "
"maxevents=10000 \n";
exit(-1);
};
//*******************************
int main(int argc, char *argv[]) {
//*******************************
// Program status;
int status = 0;
// If No Arguments print commands
if (argc == 1)
printInputCommands();
for (int i = 1; i < argc; ++i) {
// Cardfile
if (!std::strcmp(argv[i], "-h"))
printInputCommands();
else
break;
}
// Read input arguments such as card file, parameter arguments, and fit
// routines
- NUIS_LOG(FIT, "Starting ExtFit_minimizer.exe");
+ NUIS_LOG(FIT, "Starting nuismin");
// Make minimizer class and run fit
MinimizerRoutines *min = new MinimizerRoutines(argc, argv);
// Save Starting States
if (FitPar::Config().GetParB("savenominal"))
min->SaveNominal();
if (FitPar::Config().GetParB("saveprefit"))
min->SavePrefit();
// Run the fit routines
min->Run();
// Save by default
min->SaveResults();
// Get Status
status = min->GetStatus();
// Show Final Status
NUIS_LOG(FIT, "-------------------------------------");
if (status == 0) {
NUIS_LOG(FIT, "Minimizer Complete.");
} else {
NUIS_ERR(WRN, "Minimizer Failed (error state = " << status << ")");
}
NUIS_LOG(FIT, "-------------------------------------");
return status;
}
diff --git a/app/nuissmear.cxx b/app/nuissmear.cxx
index d085fbe..48a6752 100644
--- a/app/nuissmear.cxx
+++ b/app/nuissmear.cxx
@@ -1,218 +1,218 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ComparisonRoutines.h"
#include "InputUtils.h"
#include "Smearceptance_Tester.h"
// Global Arguments
std::string gOptInputFile = "";
std::string gOptOutputFile = "";
std::string gOptType = "DEFAULT";
std::string gOptNumberEvents = "NULL";
std::string gOptCardInput = "";
std::string gOptOptions = "";
//*******************************
void PrintSyntax() {
//*******************************
std::cout << "nuisflat -i input [-o outfile] [-n nevents] [-t "
"options] [-q con=val] \n";
std::cout
<< "\n Arguments : "
<< "\n\t -i input : Path to input vector of events to flatten"
<< "\n\t"
<< "\n\t This should be given in the same format a normal "
"input file"
<< "\n\t is given to NUISANCE. {e.g. NUWRO:eventsout.root}."
<< "\n\t"
<< "\n\t[-c crd.xml]: Input card file to override configs or define "
"smearcepters."
<< "\n\t "
<< "\n\t[-o outfile]: Optional output file path. "
<< "\n\t "
<< "\n\t If none given, input.smear.root is chosen."
<< "\n\t"
<< "\n\t[-n nevents]: Optional choice of Nevents to run over. Default is "
"all."
<< "\n\t"
<< "\n\t[-t options]: Pass OPTION to the smearception sample. "
<< "\n\t Similar to type field in comparison xml configs."
<< "\n\t"
<< "\n\t[-q con=val]: Configuration overrides." << std::endl;
exit(-1);
};
//____________________________________________________________________________
void GetCommandLineArgs(int argc, char **argv) {
// Check for -h flag.
for (int i = 0; i < argc; i++) {
if ((!std::string(argv[i]).compare("-h")) ||
(!std::string(argv[i]).compare("-?")) ||
(!std::string(argv[i]).compare("--help")))
PrintSyntax();
}
// Format is nuwro -r run_number -n n events
std::vector args = GeneralUtils::LoadCharToVectStr(argc, argv);
// Parse input file
ParserUtils::ParseArgument(args, "-i", gOptInputFile, false);
if (gOptInputFile == "") {
NUIS_ABORT("Need to provide a valid input file to nuisflat using -i flag!");
} else {
NUIS_LOG(FIT, "Reading Input File = " << gOptInputFile);
gOptInputFile = InputUtils::PrependGuessedInputTypeToName(gOptInputFile);
}
// Get Output File
ParserUtils::ParseArgument(args, "-o", gOptOutputFile, false);
if (gOptOutputFile == "") {
gOptOutputFile = gOptInputFile + ".smear.root";
NUIS_LOG(FIT, "No output file given so saving nuisflat output to:"
<< gOptOutputFile);
} else {
NUIS_LOG(FIT, "Saving nuisflat output to " << gOptOutputFile);
}
// Get N Events and Configs
nuisconfig configuration = Config::Get();
ParserUtils::ParseArgument(args, "-n", gOptNumberEvents, false);
if (gOptNumberEvents.compare("NULL")) {
configuration.OverrideConfig("MAXEVENTS=" + gOptNumberEvents);
}
std::vector configargs;
ParserUtils::ParseArgument(args, "-q", configargs);
for (size_t i = 0; i < configargs.size(); i++) {
configuration.OverrideConfig(configargs[i]);
}
ParserUtils::ParseArgument(args, "-c", gOptCardInput, false);
if (gOptCardInput != "") {
NUIS_LOG(FIT, "Reading cardfile: " << gOptCardInput);
configuration.LoadSettings(gOptCardInput, "");
}
ParserUtils::ParseArgument(args, "-t", gOptOptions, false);
if (gOptOptions != "") {
NUIS_LOG(FIT, "Read options: \"" << gOptOptions << "\'");
}
return;
}
void SetupRW() {
std::vector parkeys = Config::QueryKeys("parameter");
if (!parkeys.empty()) {
NUIS_LOG(FIT, "Number of parameters : " << parkeys.size());
}
std::vector Params;
std::map TypeVals;
std::map CurrVals;
for (size_t i = 0; i < parkeys.size(); i++) {
nuiskey key = parkeys.at(i);
// Check for type,name,nom
if (!key.Has("type")) {
NUIS_ERR(FTL, "No type given for parameter " << i);
NUIS_ABORT("type='PARAMETER_TYPE'");
} else if (!key.Has("name")) {
NUIS_ERR(FTL, "No name given for parameter " << i);
NUIS_ABORT("name='SAMPLE_NAME'");
} else if (!key.Has("nominal")) {
NUIS_ERR(FTL, "No nominal given for parameter " << i);
NUIS_ABORT("nominal='NOMINAL_VALUE'");
}
// Get Inputs
std::string partype = key.GetS("type");
std::string parname = key.GetS("name");
double parnom = key.GetD("nominal");
// Push into vectors
Params.push_back(parname);
TypeVals[parname] = FitBase::ConvDialType(partype);
CurrVals[parname] = parnom;
}
for (UInt_t i = 0; i < Params.size(); i++) {
FitBase::GetRW()->IncludeDial(Params[i], TypeVals[Params[i]]);
FitBase::GetRW()->SetDialValue(Params[i], CurrVals[Params[i]]);
}
FitBase::GetRW()->Reconfigure();
}
//*******************************
int main(int argc, char *argv[]) {
//*******************************
// Parse
GetCommandLineArgs(argc, argv);
// Make output file
TFile *f = new TFile(gOptOutputFile.c_str(), "RECREATE");
if (f->IsZombie()) {
NUIS_ABORT("Cannot create output file!");
}
f->cd();
Config::Get().out = f;
// Create a new measurementbase class depending on the Format
MeasurementBase *flattreecreator = NULL;
// Make a new sample key for the format of interest.
nuiskey samplekey = Config::CreateKey("sample");
samplekey.Set("name", "FlatTree");
samplekey.Set("smearceptor", gOptOptions);
samplekey.Set("input", gOptInputFile);
samplekey.Set("type", gOptType);
if (gOptOptions == "") {
NUIS_ABORT("Attempting to flatten with Smearceptor, but no Smearceptor given. "
"Please supply a -t option.");
}
if (gOptCardInput == "") {
NUIS_ABORT("Attempting to flatten with Smearceptor, but no card passed with "
"Smearceptors configured. Please supply a -c option.");
}
SetupRW();
flattreecreator = new Smearceptance_Tester(samplekey);
// Make the FlatTree reconfigure
flattreecreator->Reconfigure();
f->cd();
flattreecreator->Write();
f->Close();
// Show Final Status
NUIS_LOG(FIT, "-------------------------------------");
NUIS_LOG(FIT, "Flattree Generation Complete.");
NUIS_LOG(FIT, "-------------------------------------");
return 0;
}
diff --git a/app/nuissplines.cxx b/app/nuissplines.cxx
index 2ab79eb..f5efb45 100644
--- a/app/nuissplines.cxx
+++ b/app/nuissplines.cxx
@@ -1,105 +1,105 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
// Author: Callum Wilkinson 01/2014
// Patrick Stowell 09/2015
/**
Usage: ./GSLminimizerWithReWeight.exe -c card file, where samples and
parameters are defined -o output file, where the results of the fit are stored
where:
*/
#include "SplineRoutines.h"
//*******************************
void printInputCommands(){
//*******************************
/*
- std::cout<<"ExtFit_splines.exe -c cardFile -f [spline_routines] [-q
+ std::cout<<"nuissplines -c cardFile -f [spline_routines] [-q
config_name=config_val] \n"; std::cout<Run();
// Show Final Status
NUIS_LOG(FIT, "-------------------------------------");
NUIS_LOG(FIT, "Spline Generation/Validation Finished.");
NUIS_LOG(FIT, "-------------------------------------");
return 0;
}
diff --git a/app/nuissyst.cxx b/app/nuissyst.cxx
index 5e66265..4597443 100644
--- a/app/nuissyst.cxx
+++ b/app/nuissyst.cxx
@@ -1,83 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
// Author: Patrick Stowell 09/2016
/*
Usage: ./nuissyst -c card file -o output file, where the results of the throws
are stored where:
*/
#include "SystematicRoutines.h"
//*******************************
void printInputCommands() {
//*******************************
std::cout << "nuissyst.exe -c cardFile -o outFile [-f fitStategy] [-d "
"fakeDataFile] [-i inputFile] [-q config_name=config_val] \n";
std::cout << std::endl;
std::cout << "Arguments:" << std::endl;
std::cout << " -c cardFile: Path to card file that defines fit "
"samples, free parameters, and config overrides \n";
std::cout << " -o outFile: Path to root file that will be created to "
"save output file.\n";
std::cout << " -f Strategy: ErrorBands (default) or PlotLimits\n"
<< std::endl;
exit(-1);
};
//*******************************
int main(int argc, char *argv[]) {
//*******************************
// Program status;
int status = 0;
// If No Arguments print commands
if (argc == 1)
printInputCommands();
for (int i = 1; i < argc; ++i) {
// Cardfile
if (!std::strcmp(argv[i], "-h"))
printInputCommands();
else
break;
}
// Read input arguments such as card file, parameter arguments, and fit
// routines
NUIS_LOG(FIT, "Starting nuissyst");
// Make systematic class and run fit
SystematicRoutines *min = new SystematicRoutines(argc, argv);
min->Run();
// Show Final Status
NUIS_LOG(FIT, "-------------------------------------");
if (status == 0) {
NUIS_LOG(FIT, "Systematic Complete.");
} else {
NUIS_ERR(FTL, "Systematic Failed (error state = " << status << ")");
}
NUIS_LOG(FIT, "-------------------------------------");
return status;
}
diff --git a/cmake/BuildDynamicSample.in b/cmake/BuildDynamicSample.in
index 97a340e..64f4a50 100644
--- a/cmake/BuildDynamicSample.in
+++ b/cmake/BuildDynamicSample.in
@@ -1,87 +1,87 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
#!/bin/bash
if [ ! "${1}" ] || [ ! -e ${1} ] || [ ! "${2}" ]; then
echo "[USAGE]: ${0} input.cxx outputLibName.so [classname]"
exit 1
fi
if [ ! "${3}" ]; then
CN=$(grep "class .*" $1 | sed "s/^class \([0-9a-zA-Z]\+\).*$/\1/g")
else
CN=${3}
fi
if [ ! "${CN}" ]; then
echo "[ERROR]: Couldn't find class name -- Expected to find a line like: \"class XXXX : public Measurement1D\" in \"$1\". You can also forcibly specify your classes name by passing a third argument to this script."
exit 1
fi
if [ ! -e compile.tmp ]; then
mkdir compile.tmp
fi
cat $1 > compile.tmp/$1
echo -e "static char const * SampleNames[] = {\"${CN}\"};\n"\
"static int const NSamples = 1;\n"\
"\n"\
"extern \"C\" {\n"\
"int DSF_NSamples() { return NSamples; }\n"\
"char const* DSF_GetSampleName(int i) {\n"\
" if (i < NSamples) {\n"\
" return SampleNames[i];\n"\
" }\n"\
" return 0;\n"\
"}\n"\
"MeasurementBase* DSF_GetSample(int i, void* samplekey) {\n"\
" nuiskey* sk = reinterpret_cast(samplekey);\n"\
" if (!sk) {\n"\
" return 0;\n"\
" }\n"\
"\n"\
" if (sk->GetS(\"name\") != DSF_GetSampleName(i)) {\n"\
" std::cout\n"\
" << \"[ERROR]: When instantiating dynamic sample. Samplekey named: \"\n"\
" << sk->GetS(\"name\") << \", but requested sample named: \"\n"\
" << DSF_GetSampleName(i)\n"\
" << \". It is possible that the nuiskey object is lost in translation. \"\n"\
" \"Was NUISANCE and this dynamic sample manifest built with the same \"\n"\
" \"environment and compiler?\"\n"\
" << std::endl;\n"\
" }\n"\
"\n"\
" if (i == 0) {\n"\
" return new ${CN}(*sk);\n"\
" }\n"\
" return 0;\n"\
"}\n"\
"void DSF_DestroySample(MeasurementBase* mb) { delete mb; }\n"\
"}" >> compile.tmp/$1
echo "g++ ${DYNSAMPLE_EXTRA_BUILD_FLAGS} compile.tmp/$1 -shared -o $2 -fPIC @CMAKE_CXX_FLAGS@ -I. -I@ALL_INCLUDES_STR@ -L@CMAKE_INSTALL_PREFIX@/lib @ALL_MODULETARGETS_STR@ @CMAKE_LINK_FLAGS@ @CMAKE_DEPENDLIB_FLAGS@"
if ! g++ ${DYNSAMPLE_EXTRA_BUILD_FLAGS} compile.tmp/$1 -shared -o $2 -fPIC @CMAKE_CXX_FLAGS@ -I. -I@ALL_INCLUDES_STR@ -L@CMAKE_INSTALL_PREFIX@/lib @ALL_MODULETARGETS_STR@ @CMAKE_LINK_FLAGS@ @CMAKE_DEPENDLIB_FLAGS@; then
echo "[ERROR]: Failed to compile $1. Generated code can be found in ./compile.tmp/$1"
else
rm -r compile.tmp
echo "Successfully build: $2."
fi
diff --git a/cmake/BuildDynamicSmearcepter.in b/cmake/BuildDynamicSmearcepter.in
index dce4633..1ae40b5 100644
--- a/cmake/BuildDynamicSmearcepter.in
+++ b/cmake/BuildDynamicSmearcepter.in
@@ -1,89 +1,89 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
#!/bin/bash
if [ ! "${1}" ] || [ ! -e ${1} ] || [ ! "${2}" ]; then
echo "[USAGE]: ${0} input.cxx outputLibName.so [classname]"
exit 1
fi
if [ ! "${3}" ]; then
CN=$(grep "class .*" $1 | sed "s/^class \([0-9a-zA-Z]\+\).*$/\1/g")
else
CN=${3}
fi
if [ ! "${CN}" ]; then
echo "[ERROR]: Couldn't find class name -- Expected to find a line like: \"class XXXX : public ISmearcepter\" in \"$1\". You can also forcibly specify your classes name by passing a third argument to this script."
exit 1
fi
if [ ! -e compile.tmp ]; then
mkdir compile.tmp
fi
cat $1 > compile.tmp/$1
echo -e "static char const * SmearceptorNames[] = {\"${CN}\"};\n"\
"static int const NSmearceptors = 1;\n"\
"\n"\
"extern \"C\" {\n"\
"int DSF_NSmearceptors() { return NSmearceptors; }\n"\
"char const* DSF_GetSmearceptorName(int i) {\n"\
" if (i < NSmearceptors) {\n"\
" return SmearceptorNames[i];\n"\
" }\n"\
" return 0;\n"\
"}\n"\
"ISmearcepter* DSF_GetSmearceptor(int i, void* smearceptorkey) {\n"\
" nuiskey* sk = reinterpret_cast(smearceptorkey);\n"\
" if (!sk) {\n"\
" return 0;\n"\
" }\n"\
"\n"\
" if (sk->GetElementName() != DSF_GetSmearceptorName(i)) {\n"\
" std::cout\n"\
" << \"[ERROR]: When instantiating dynamic smearceptor. Smearceptorkey named: \"\n"\
" << sk->GetElementName() << \", but requested smearceptor named: \"\n"\
" << DSF_GetSmearceptorName(i)\n"\
" << \". It is possible that the nuiskey object is lost in translation. \"\n"\
" \"Was NUISANCE and this dynamic smearceptor manifest built with the same \"\n"\
" \"environment and compiler?\"\n"\
" << std::endl;\n"\
" }\n"\
"\n"\
" if (i == 0) {\n"\
" ISmearcepter* sm = new ${CN}();\n"\
" sm->Setup(*sk);\n"\
" return sm;\n"\
" }\n"\
" return 0;\n"\
"}\n"\
"void DSF_DestroySmearceptor(ISmearcepter* mb) { delete mb; }\n"\
"}" >> compile.tmp/$1
echo "g++ ${DYNSAMPLE_EXTRA_BUILD_FLAGS} compile.tmp/$1 -shared -o $2 -fPIC @CMAKE_CXX_FLAGS@ -I. -I@ALL_INCLUDES_STR@ -L@CMAKE_INSTALL_PREFIX@/lib -l@ALL_MODULETARGETS_STR@ @CMAKE_LINK_FLAGS@ @CMAKE_DEPENDLIB_FLAGS@"
if ! g++ ${DYNSAMPLE_EXTRA_BUILD_FLAGS} compile.tmp/$1 -shared -o $2 -fPIC @CMAKE_CXX_FLAGS@ -I. -I@ALL_INCLUDES_STR@ -L@CMAKE_INSTALL_PREFIX@/lib -l@ALL_MODULETARGETS_STR@ @CMAKE_LINK_FLAGS@ @CMAKE_DEPENDLIB_FLAGS@; then
echo "[ERROR]: Failed to compile $1. Generated code can be found in ./compile.tmp/$1"
else
rm -r compile.tmp
echo "Successfully build: $2."
fi
diff --git a/cmake/GENIESetup.cmake b/cmake/GENIESetup.cmake
index 3102253..6801e79 100644
--- a/cmake/GENIESetup.cmake
+++ b/cmake/GENIESetup.cmake
@@ -1,249 +1,249 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
# TODO
# check system for libxml2
# check whether we need the includes
# check if we can use a subset of the GENIE libraries
include(${CMAKE_SOURCE_DIR}/cmake/parseConfigApp.cmake)
################################################################################
# Check Dependencies
################################################################################
################################# GENIE ######################################
if(GENIE STREQUAL "")
cmessage(FATAL_ERROR "Variable GENIE is not defined. "
"The location of a pre-built GENIE install must be defined either as"
" $ cmake -DGENIE=/path/to/GENIE or as an environment variable"
" $ export GENIE=/path/to/GENIE")
endif()
execute_process(COMMAND genie-config --version
OUTPUT_VARIABLE GENIE_VER OUTPUT_STRIP_TRAILING_WHITESPACE)
cmessage(STATUS "genie_ver: ${GENIE_VER}")
if(GENIE_VER VERSION_GREATER 3.0.0)
set(GENIE_POST_R3 1)
string(REPLACE "." "" GENIE_VERSION ${GENIE_VER})
cmessage(STATUS "set genie_post_r3")
endif()
if(NOT GENIE_POST_R3)
LIST(APPEND EXTRA_CXX_FLAGS -DGENIE_PRE_R3)
cmessage(STATUS "setting genie_pre_r3 ${EXTRA_CXX_FLAGS}")
if(GENIE_EMPMEC_REWEIGHT)
cmessage(STATUS "Enable EMPMEC dials")
LIST(APPEND EXTRA_CXX_FLAGS -D__GENIE_EMP_MECRW_ENABLED)
endif()
else()
cmessage(STATUS "Enable EMPMEC dials")
LIST(APPEND EXTRA_CXX_FLAGS -D__GENIE_EMP_MECRW_ENABLED)
if(USE_GENIE_XSECMEC)
LIST(APPEND EXTRA_CXX_FLAGS -DUSE_GENIE_XSECMEC)
endif()
endif()
execute_process (COMMAND genie-config
--topsrcdir OUTPUT_VARIABLE GENIE_INCLUDES_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
#Allows for external override in the case where genie-config lies.
if(NOT DEFINED GENIE_LIB_DIR OR GENIE_LIB_DIR STREQUAL "")
#This looks like it should call libdir, but it strips the argument with -L from the response of --libs
GETLIBDIRS(genie-config --libs GENIE_LIB_DIR)
endif()
GETLIBS(genie-config --libs GENIE_LIBS)
cmessage(STATUS "GENIE version : ${GENIE_VERSION}")
cmessage(STATUS "GENIE libdir : ${GENIE_LIB_DIR}")
cmessage(STATUS "GENIE libs : ${GENIE_LIBS}")
string(REGEX MATCH "ReinSeghal" WASMATCHED ${GENIE_LIBS})
if(WASMATCHED AND GENIE_VERSION STREQUAL "210")
set(GENIE_SEHGAL ${GENIE_LIBS})
STRING(REPLACE "ReinSeghal" "ReinSehgal" GENIE_LIBS ${GENIE_SEHGAL})
cmessage(DEBUG "Fixed inconsistency in library naming: ${GENIE_LIBS}")
endif()
if(NOT USE_REWEIGHT)
SET(USING_GENIE_RW FALSE)
elseif(NOT GENIE_POST_R3)
LIST(FIND GENIE_LIBS GReWeight FOUND_GENIE_RW)
if(FOUND_GENIE_RW EQUAL -1)
cmessage(DEBUG "Did NOT find ReWeight library. Here are libs: ${GENIE_LIBS}")
SET(USING_GENIE_RW FALSE)
else()
SET(USING_GENIE_RW TRUE)
endif()
elseif(DEFINED GENIE_REWEIGHT AND NOT GENIE_REWEIGHT STREQUAL "")
LIST(FIND GENIE_LIBS GRwFwk FOUND_GENIE_RW)
if(FOUND_GENIE_RW EQUAL -1)
LIST(APPEND GENIE_LIBS GRwClc GRwFwk GRwIO)
cmessage(DEBUG "Force added ReWeight library. Here are libs: ${GENIE_LIBS}")
SET(USING_GENIE_RW TRUE)
else()
SET(USING_GENIE_RW FALSE)
endif()
endif()
if(USING_GENIE_RW)
cmessage(STATUS "Using GENIE ReWeight library.")
else()
cmessage(STATUS "Building without GENIE ReWeight support.")
endif()
LIST(APPEND GENIE_LIBS -Wl,--end-group )
LIST(REVERSE GENIE_LIBS)
LIST(APPEND GENIE_LIBS -Wl,--start-group -Wl,--no-as-needed )
LIST(REVERSE GENIE_LIBS)
cmessage(DEBUG "GENIE_LIBS: ${GENIE_LIBS}")
################################ LHAPDF ######################################
if(LHAPDF_LIB STREQUAL "")
cmessage(FATAL_ERROR "Variable LHAPDF_LIB is not defined. The location of a pre-built lhapdf install must be defined either as $ cmake -DLHAPDF_LIB=/path/to/LHAPDF_libraries or as an environment variable $ export LHAPDF_LIB=/path/to/LHAPDF_libraries")
endif()
if(LHAPDF_INC STREQUAL "")
cmessage(FATAL_ERROR "Variable LHAPDF_INC is not defined. The location of a pre-built lhapdf install must be defined either as $ cmake -DLHAPDF_INC=/path/to/LHAPDF_includes or as an environment variable $ export LHAPDF_INC=/path/to/LHAPDF_includes")
endif()
if(LHAPATH STREQUAL "")
cmessage(FATAL_ERROR "Variable LHAPATH is not defined. The location of a the LHAPATH directory must be defined either as $ cmake -DLHAPATH=/path/to/LHAPATH or as an environment variable $ export LHAPATH=/path/to/LHAPATH")
endif()
################################ LIBXML ######################################
if(LIBXML2_LIB STREQUAL "")
GETLIBDIR(xml2-config --libs LIBXML2_LIB IGNORE_EMPTY_RESPONSE)
if(LIBXML2_LIB STREQUAL "")
message(WARNING "Variable LIBXML2_LIB is not defined, as xml2-config was found and didn't report a library include path, it is likely that libxml2.so can be found in the standard system location, lets hope so. Alternativly, a location can be forced by configering with -DLIBXML2_LIB=/path/to/LIBXML2_libraries or as an environment variable LIBXML2_LIB.")
endif()
endif()
if(LIBXML2_INC STREQUAL "")
GETINCDIR(xml2-config --cflags LIBXML2_INC IGNORE_EMPTY_RESPONSE)
if(LIBXML2_INC STREQUAL "")
message(WARNING "Variable LIBXML2_INC is not defined, as xml2-config was found and didn't report an include path, it is likely that libxml2.so can be found in the standard system location, lets hope so. Alternativly, a location can be forced by configering with -DLIBXML2_INC=/path/to/LIBXML2_includes or as an environment variable LIBXML2_INC.")
endif()
endif()
############################### log4cpp ######################################
if(LOG4CPP_LIB STREQUAL "")
GETLIBDIR(log4cpp-config --libs LOG4CPP_LIB IGNORE_EMPTY_RESPONSE)
if(LOG4CPP_LIB STREQUAL "")
message(WARNING "Variable LOG4CPP_LIB is not defined, as xml2-config was found and didn't report a library include path, it is likely that liblog4cpp.so can be found in the standard system location, lets hope so. Alternativly, a location can be forced by configering with -DLOG4CPP_LIB=/path/to/LOG4CPP_libraries or as an environment variable LOG4CPP_LIB.")
endif()
endif()
if(LOG4CPP_INC STREQUAL "")
GETINCDIR(log4cpp-config --cflags LOG4CPP_INC IGNORE_EMPTY_RESPONSE)
if(LOG4CPP_INC STREQUAL "")
message(WARNING "Variable LOG4CPP_LIB is not defined, as xml2-config was found and didn't report an include path, it is likely that log4cpp headers can be found in the standard system location, lets hope so. Alternativly, a location can be forced by configering with -DLOG4CPP_INC=/path/to/LOG4CPP_includes or as an environment variable LOG4CPP_INC.")
endif()
endif()
################################################################################
# Set the compiler defines
LIST(APPEND EXTRA_CXX_FLAGS -D__GENIE_ENABLED__ -D__GENIE_VERSION__=${GENIE_VERSION})
LIST(APPEND EXTRA_LIBS ${GENIE_LIBS})
############################### GSL ######################################
if(GENIE_POST_R3)
if(GSL_LIB STREQUAL "")
GETLIBDIR(gsl-config --libs GSL_LIB)
if(GSL_LIB STREQUAL "")
message(FATAL_ERROR "Variable GSL_LIB is not defined and could not be found with gsl-config. The location of a pre-built gsl install must be defined either as $ cmake -DGSL_LIB=/path/to/GSL_libraries or as an environment variable $ export GSL_LIB=/path/to/GSL_libraries")
endif()
endif()
if(GSL_INC STREQUAL "")
GETINCDIR(gsl-config --cflags GSL_INC)
if(GSL_INC STREQUAL "")
message(FATAL_ERROR "Variable GSL_INC is not defined and could not be found with gsl-config. The location of a pre-built gsl install must be defined either as $ cmake -DGSL_INC=/path/to/GSL_includes or as an environment variable $ export GSL_INC=/path/to/GSL_includes")
endif()
endif()
GETLIBS(gsl-config --libs GSL_LIB_LIST)
if(USING_GENIE_RW AND GENIE_REWEIGHT STREQUAL "")
message(FATAL_ERROR "Variable GENIE_REWEIGHT is not defined. When using GENIE v3+, we require the reweight product to be built and accessible via the environment variable GENIE_REWEIGHT")
endif()
endif()
################################################################################
LIST(APPEND EXTRA_LIBS LHAPDF xml2 log4cpp)
LIST(APPEND EXTRA_LINK_DIRS
${GENIE_LIB_DIR}
${LHAPDF_LIB}
${LOG4CPP_LIB})
# Append only if we have found GENIE ReWeight
if(NOT GENIE_POST_R3)
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES
${GENIE_INCLUDES_DIR}
${GENIE_INCLUDES_DIR}/GHEP
${GENIE_INCLUDES_DIR}/Ntuple)
if(USING_GENIE_RW)
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${GENIE_INCLUDES_DIR}/ReWeight)
endif()
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES
${GENIE_INCLUDES_DIR}/Apps
${GENIE_INCLUDES_DIR}/FluxDrivers
${GENIE_INCLUDES_DIR}/EVGDrivers
${LHAPDF_INC}
${LIBXML2_INC}
${LOG4CPP_INC})
else()
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES
${GENIE_INCLUDES_DIR})
if(USING_GENIE_RW)
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${GENIE_REWEIGHT}/src)
endif()
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${GSL_INC}
${LHAPDF_INC}
${LIBXML2_INC}
${LOG4CPP_INC})
if(USING_GENIE_RW)
LIST(APPEND EXTRA_LINK_DIRS
${GENIE_REWEIGHT}/lib)
endif()
LIST(APPEND EXTRA_LINK_DIRS
${GSL_LIB}
)
LIST(APPEND EXTRA_LIBS ${GSL_LIB_LIST})
endif()
if(USE_PYTHIA8)
set(NEED_PYTHIA8 TRUE)
set(NEED_ROOTPYTHIA8 TRUE)
else()
set(NEED_PYTHIA6 TRUE)
set(NEED_ROOTPYTHIA6 TRUE)
endif()
set(NEED_ROOTEVEGEN FALSE)
SET(USE_GENIE TRUE CACHE BOOL "Whether to enable GENIE (reweight) support. Requires external libraries. " FORCE)
diff --git a/cmake/GiBUUSetup.cmake b/cmake/GiBUUSetup.cmake
index 6bbe0b0..e7a1eeb 100644
--- a/cmake/GiBUUSetup.cmake
+++ b/cmake/GiBUUSetup.cmake
@@ -1,45 +1,45 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(USE_GiBUU)
LIST(APPEND EXTRA_CXX_FLAGS -D__GiBUU_ENABLED__)
if(BUILD_GiBUU)
if (NO_EXTERNAL_UPDATE)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY EP_UPDATE_DISCONNECTED 1)
cmessage(STATUS "Will not attempt to update third party GiBUU tools for each build.")
endif()
ExternalProject_Add(GiBUUTools
PREFIX "${PROJECT_BINARY_DIR}/GiBUUTools"
GIT_REPOSITORY https://github.com/luketpickering/GiBUU-t2k-dev.git
CMAKE_ARGS
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DUSE_GiBUU=1
-DFORCECPP03=1
-DNO_EXTERNAL_UPDATE=${NO_EXTERNAL_UPDATE})
cmessage(STATUS "Building GiBUU and GiBUUTools")
SET(BUILD_GiBUU TRUE CACHE BOOL "Whether to build supporting GiBUU event tools along with a patched version of GiBUU. " FORCE)
endif()
SET(USE_GiBUU TRUE CACHE BOOL "Whether to enable GiBUU event support. " FORCE)
endif()
diff --git a/cmake/HepMC.cmake b/cmake/HepMC.cmake
index 2ade454..37e8bb3 100644
--- a/cmake/HepMC.cmake
+++ b/cmake/HepMC.cmake
@@ -1,61 +1,61 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(USE_HEPMC)
LIST(APPEND EXTRA_CXX_FLAGS -D__HEPMC_ENABLED__)
if(HEPMC STREQUAL "")
if (NO_EXTERNAL_UPDATE)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY EP_UPDATE_DISCONNECTED 1)
cmessage(STATUS "Will not attempt to update third party HepMC tools for each build.")
endif()
ExternalProject_Add(HepMC
PREFIX "${PROJECT_BINARY_DIR}/HepMC"
GIT_REPOSITORY https://gitlab.cern.ch/hepmc/HepMC.git
GIT_TAG HEPMC_02_06_09
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-Dmomentum=${HEPMC_MOMUNIT}
-Dlength=${HEPMC_LENUNIT})
#Have to re-include the doc string here as the whole cache entry will be
#overwritten when this happens
set(HEPMC "${CMAKE_INSTALL_PREFIX}" CACHE PATH
"Path to HEPMC source tree root directory. Overrides environment variable \$HEPMC <>"
FORCE)
set(HEPMC_USED_EP TRUE CACHE INTERNAL "Whether the we built HepMC or not. "
FORCE)
cmessage(STATUS "Building HepMC")
endif()
LIST(APPEND EXTRA_CXX_FLAGS
-I${HEPMC}/include/)
LIST(APPEND EXTRA_LINK_DIRS ${HEPMC}/lib/)
LIST(APPEND EXTRA_LIBS HepMC HepMCfio)
endif()
diff --git a/cmake/MINERvASetup.cmake b/cmake/MINERvASetup.cmake
index 0ccfcd9..cc4f881 100644
--- a/cmake/MINERvASetup.cmake
+++ b/cmake/MINERvASetup.cmake
@@ -1,19 +1,19 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
LIST(APPEND EXTRA_CXX_FLAGS -D__MINERVA_RW_ENABLED__)
diff --git a/cmake/MakeBinaryBlob.in b/cmake/MakeBinaryBlob.in
index b6554b9..c545b6e 100644
--- a/cmake/MakeBinaryBlob.in
+++ b/cmake/MakeBinaryBlob.in
@@ -1,173 +1,173 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
#!/bin/sh
if [ ! ${NUISANCE} ]; then
echo "[ERROR]; NUISANCE envrionment variable is not defined, please source NUSIANCE before trying to make a binary blob."
exit 1
fi
mkdir BinBlob
cd BinBlob
echo "#!/bin/sh" > setup.sh
cat @PROJECT_SOURCE_DIR@/cmake/BinBlobSetup.header >> setup.sh
mkdir deps exes
mkdir root
mkdir -p root/lib/root
echo "[INFO]: Copying ROOT libraries from @CMAKE_ROOTSYS@/lib/root"
cp @CMAKE_ROOTSYS@/lib/root/*.so* root/lib/root/
mkdir root/bin
echo "[INFO]: Copying ROOT binary from @CMAKE_ROOTSYS@/bin"
cp @CMAKE_ROOTSYS@/bin/* root/bin
mkdir -p root/share/man/man1
echo "[INFO]: Copying ROOT man pages from @CMAKE_ROOTSYS@/share/man/man1"
cp -r @CMAKE_ROOTSYS@/share/man/man1 root/share/man/man1
cat root/bin/thisroot.sh | sed 's:@CMAKE_ROOTSYS@:__INST_ROOT__:g' > root/bin/thisroot.sh_tmp
rm root/bin/thisroot.sh
echo "cat \$NUISANCE/root/bin/thisroot.sh_tmp | sed \"s:__INST_ROOT__:\$NUISANCE/root:g\" > \$NUISANCE/root/bin/thisroot.sh" >> setup.sh
cat root/bin/thisroot.csh | sed 's:@CMAKE_ROOTSYS@:__INST_ROOT__:g' > root/bin/thisroot.csh_tmp
rm root/bin/thisroot.csh
echo "cat \$NUISANCE/root/bin/thisroot.csh_tmp | sed \"s:__INST_ROOT__:\$NUISANCE/root:g\" > \$NUISANCE/root/bin/thisroot.csh" >> setup.sh
echo "source \$NUISANCE/root/bin/thisroot.sh" >> setup.sh
if [ "@USE_T2K@" != "FALSE" ]; then
mkdir deps/t2k
echo "[INFO]: Copying T2K libraries from @T2KREWEIGHT@"
cp @T2KREWEIGHT@/lib/*.so deps/t2k/
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/t2k" >> setup.sh
fi
if [ "@USE_NIWG@" != "FALSE" ]; then
mkdir deps/niwg
echo "[INFO]: Copying NIWG libraries from @NIWG@"
cp @NIWG@/lib/*.so deps/niwg/
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/niwg" >> setup.sh
fi
if [ "@USE_NEUT@" != "FALSE" ]; then
mkdir deps/neut
mkdir exes/neut
echo "[INFO]: Copying NEUT libraries from @NEUT_ROOT@"
cp @NEUT_ROOT@/src/reweight/*.so* deps/neut
cp @NEUT_ROOT@/src/neutclass/*.so* deps/neut
cp @NEUT_ROOT@/src/neutsmpl/neutroot2 exes/neut
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/neut" >> setup.sh
fi
if [ "@USE_NuWro@" != "FALSE" ]; then
if [ "@NUWRO_BUILT_FROM_FILE@" == "FALSE" ]; then
mkdir deps/nuwro
mkdir exes/nuwro
mkdir data
mkdir data/nuwro
echo "[INFO]: Copying NuWro libraries from @NUWRO@"
cp @NUWRO@/lib/*.so deps/nuwro
cp @NUWRO@/bin/nuwro exes/nuwro/
cp -r @NUWRO@/data data/nuwro
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/nuwro" >> setup.sh
echo "export NUWRO=\$NUISANCE/data/nuwro" >> setup.sh
else
echo "[INFO]: NuWro support included from input event file."
fi
fi
if [ "@NEED_PYTHIA6@" != "FALSE" ]; then
mkdir deps/pythia
echo "[INFO]: Copying PYTHIA libraries from @PYTHIA6@"
cp @PYTHIA6@/*.so deps/pythia/
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/pythia" >> setup.sh
fi
if [ "@USE_GENIE@" != "FALSE" ]; then
mkdir -p deps/genie/{,libxml2,lhapdf,log4cpp}
mkdir exes/genie
echo "[INFO]: Copying LHAPDF libraries from @LHAPDF_LIB@"
cp @LHAPDF_LIB@/libLHAPDF.so* deps/genie/lhapdf
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/genie/lhapdf" >> setup.sh
echo "[INFO]: Copying LIBXML2 libraries from @LIBXML2_LIB@"
cp @LIBXML2_LIB@/libxml2.so* deps/genie/libxml2
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/genie/libxml2" >> setup.sh
echo "[INFO]: Copying LOG4CPP libraries from @LOG4CPP_LIB@"
cp @LOG4CPP_LIB@/liblog4cpp.so* deps/genie/log4cpp
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/genie/log4cpp" >> setup.sh
if [ "@LHAPATH@" ]; then
mkdir -p data/genie/lhapdf
cp @LHAPATH@/*.LHgrid data/genie/lhapdf/
echo "export LHAPATH=\"\$NUISANCE/data/genie/lhapdf\"" >> setup.sh
fi
echo "[INFO]: Copying GENIE libraries from @GENIE@/lib"
cp @GENIE@/lib/*.so* deps/genie/
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/genie" >> setup.sh
echo "[INFO]: Copying GENIE binaries from @GENIE@/bin"
cp @GENIE@/bin/* exes/genie/
echo "add_to_PATH \$NUISANCE/exes/genie" >> setup.sh
fi
mkdir exes/nuisance
cp @CMAKE_INSTALL_PREFIX@/bin/* exes/nuisance/
echo "add_to_PATH \$NUISANCE/exes/nuisance" >> setup.sh
rm exes/nuisance/BuildDynamic*
if [ @CMAKE_BUILD_TYPE@ == "RELEASE" ]; then
mkdir deps/nuisance
echo "add_to_LD_LIBRARY_PATH \$NUISANCE/deps/nuisance" >> setup.sh
cp @CMAKE_INSTALL_PREFIX@/lib/*.so deps/nuisance/
fi
if [ -e data ]; then
tar -zcvf nuisblob.tar.gz setup.sh exes/* deps/* root/* data/*
else
tar -zcvf nuisblob.tar.gz setup.sh exes/* deps/* root/*
fi
cd ../
diff --git a/cmake/NEUTSetup.cmake b/cmake/NEUTSetup.cmake
index fed7715..5fc724b 100644
--- a/cmake/NEUTSetup.cmake
+++ b/cmake/NEUTSetup.cmake
@@ -1,246 +1,246 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
include(cmake/parseConfigApp.cmake)
find_program(NEUTCONFIG NAMES neut-config)
LIST(APPEND EXTRA_CXX_FLAGS -DNEED_FILL_NEUT_COMMONS)
SET(HAVENEUTCONFIG FALSE)
# We are dealing with shiny NEUT
if(NOT "${NEUTCONFIG}" STREQUAL "NEUTCONFIG-NOTFOUND")
SET(HAVENEUTCONFIG TRUE)
cmessage(STATUS "Found neut-config, using it to determine configuration.")
else()
cmessage(STATUS "Failed to find neut-config, assuming older NEUT build.")
endif()
if(HAVENEUTCONFIG)
execute_process (COMMAND neut-config
--version OUTPUT_VARIABLE NEUT_VER
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND neut-config
--incdir OUTPUT_VARIABLE NEUT_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND neut-config
--libdir OUTPUT_VARIABLE NEUT_LINK_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
GETLIBDIRS(neut-config --cernflags CERN_LIB_DIR)
LIST(APPEND NEUT_LINK_DIRS ${CERN_LIB_DIR})
GETLIBS(neut-config --cernflags CERN_LIBS)
if(USE_REWEIGHT)
execute_process (COMMAND neut-config
--rwlibflags OUTPUT_VARIABLE NEUT_RWLIBS
OUTPUT_STRIP_TRAILING_WHITESPACE)
GETLIBS(neut-config --rwlibflags NEUT_RWLIBS)
LIST(APPEND NEUT_LIBS ${NEUT_RWLIBS})
else()
GETLIBS(neut-config --libflags NEUT_GENLIBS)
GETLIBS(neut-config --iolibflags NEUT_LIBS)
LIST(APPEND NEUT_LIBS ${NEUT_IOLIBS})
LIST(APPEND NEUT_LIBS ${NEUT_GENLIBS})
endif()
LIST(APPEND NEUT_LIBS ${CERN_LIBS};gfortran)
LIST(APPEND EXTRA_LIBS ${NEUT_LIBS})
string(REPLACE "." "" NEUT_VERSION ${NEUT_VER})
PrefixList(NEUT_INCLUDE_DIRS "-I" ${NEUT_INCLUDE_DIRS})
LIST(APPEND EXTRA_CXX_FLAGS ${NEUT_INCLUDE_DIRS} -D__NEUT_ENABLED__ -D__NEUT_VERSION__=${NEUT_VERSION})
LIST(APPEND EXTRA_LINK_DIRS ${NEUT_LINK_DIRS})
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-no-pie COMPILER_SUPPORTS_NO_PIE)
CHECK_CXX_COMPILER_FLAG(-fno-pie COMPILER_SUPPORTS_FNO_PIE)
CHECK_CXX_COMPILER_FLAG(-fno-PIE COMPILER_SUPPORTS_FNO_PIE_CAP)
if(COMPILER_SUPPORTS_NO_PIE)
set(PIE_FLAGS "-no-pie")
elseif(COMPILER_SUPPORTS_FNO_PIE)
set(PIE_FLAGS "-fno-pie")
elseif(COMPILER_SUPPOERTS_FNO_PIE_CAP)
set(PIE_FLAGS "-fno-PIE")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
LIST(APPEND EXTRA_EXE_FLAGS
${PIE_FLAGS})
cmessage(STATUS "NEUT")
cmessage(STATUS " Version : ${NEUT_VER}")
cmessage(STATUS " Flags : ${NEUT_CXX_FLAGS}")
cmessage(STATUS " Includes : ${NEUT_INCLUDE_DIRS}")
cmessage(STATUS " Link Dirs : ${NEUT_LINK_DIRS}")
cmessage(STATUS " Libs : ${NEUT_LIBS}")
cmessage(STATUS " Exe Flags : ${EXTRA_EXE_FLAGS}")
else() # Everything better be set up already
if(NEUT_ROOT STREQUAL "")
cmessage(FATAL_ERROR "Variable NEUT_ROOT is not defined. Please export environment variable NEUT_ROOT or configure with -DNEUT_ROOT=/path/to/NEUT. This must be set to point to a prebuilt NEUT instance.")
endif()
if(CERN STREQUAL "")
cmessage(FATAL_ERROR "Variable CERN is not defined. Please export environment variable CERN or configure with -DCERN=/path/to/CERNLIB. This must be set to point to a prebuilt CERNLIB instance.")
endif()
if(CERN_LEVEL STREQUAL "")
cmessage(FATAL_ERROR "Variable CERN_LEVEL is not defined. Please export environment variable CERN_LEVEL or configure with -DCERN_LEVEL=XXXX (likely to be 2005).")
endif()
if(${NEUT_VERSION} VERSION_LESS 5.4.0)
set(NEUT_LIB_DIR ${NEUT_ROOT}/lib/Linux_pc)
else()
set(NEUT_LIB_DIR ${NEUT_ROOT}/lib)
endif()
set(NEUT_CLASS ${NEUT_ROOT}/src/neutclass)
LIST(APPEND EXTRA_CXX_FLAGS -D__NEUT_ENABLED__ -DNEUT_VERSION=${NEUT_VERSION})
LIST(APPEND EXTRA_CXX_FLAGS
-I${NEUT_ROOT}/include
-I${NEUT_ROOT}/src/neutclass)
LIST(APPEND EXTRA_LINK_DIRS
${NEUT_LIB_DIR}
${CERN}/${CERN_LEVEL}/lib)
if(USE_REWEIGHT)
LIST(APPEND EXTRA_CXX_FLAGS
-I${NEUT_ROOT}/src/reweight)
LIST(APPEND EXTRA_LINK_DIRS
${NEUT_ROOT}/src/reweight)
endif()
if(${NEUT_VERSION} VERSION_EQUAL 5.4.2)
LIST(APPEND EXTRA_LIBS
-Wl,--as-needed)
if(USE_REWEIGHT)
LIST(APPEND EXTRA_LIBS
NReWeight)
endif()
LIST(APPEND EXTRA_LIBS
-Wl,--start-group
neutcore_5.4.2
nuccorspl_5.4.2 #typo in NEUT, may hopefully disappear
nuceff_5.4.2
partnuck_5.4.2
skmcsvc_5.4.2
tauola_5.4.2
HT2p2h_5.4.0
N1p1h_5.4.0
-Wl,--end-group
jetset74
pdflib804
mathlib
packlib
pawlib)
LIST(APPEND EXTRA_CXX_FLAGS -DNEUT_COMMON_QEAV)
elseif(${NEUT_VERSION} VERSION_EQUAL 5.4.0)
LIST(APPEND EXTRA_LIBS
-Wl,--as-needed)
if(USE_REWEIGHT)
LIST(APPEND EXTRA_LIBS
NReWeight)
endif()
LIST(APPEND EXTRA_LIBS
-Wl,--start-group
neutcore_5.4.0
nuccorspl_5.4.0 #typo in NEUT, may hopefully disappear
nuceff_5.4.0
partnuck_5.4.0
skmcsvc_5.4.0
tauola_5.4.0
HT2p2h_5.4.0
N1p1h_5.4.0
specfunc_5.4.0
radcorr_5.4.0
gfortran
-Wl,--end-group
jetset74
pdflib804
mathlib
packlib
pawlib)
else()
LIST(APPEND EXTRA_LIBS
-Wl,--as-needed)
if(USE_REWEIGHT)
LIST(APPEND EXTRA_LIBS
NReWeight)
endif()
LIST(APPEND EXTRA_LIBS
-Wl,--start-group
neutcore
nuccorrspl
nuceff
partnuck
skmcsvc
tauola
-Wl,--end-group
jetset74
pdflib804
mathlib
packlib
pawlib)
endif()
set(NEUT_ROOT_LIBS)
LIST(APPEND NEUT_ROOT_LIBS
${NEUT_CLASS}/neutctrl.so
${NEUT_CLASS}/neutfsivert.so)
# Check for new versions of NEUT with NUCLEON FSI
if(EXISTS "${NEUT_CLASS}/neutnucfsistep.so")
set(NEUT_NUCFSI 1)
LIST(APPEND EXTRA_CXX_FLAGS -DNEUT_NUCFSI_ENABLED)
LIST(APPEND NEUT_ROOT_LIBS
${NEUT_CLASS}/neutnucfsistep.so
${NEUT_CLASS}/neutnucfsivert.so
)
endif()
if(${NEUT_VERSION} VERSION_LESS 5.4.0)
LIST(APPEND NEUT_ROOT_LIBS
${NEUT_CLASS}/neutrootTreeSingleton.so)
endif()
LIST(APPEND NEUT_ROOT_LIBS
${NEUT_CLASS}/neutvtx.so
${NEUT_CLASS}/neutfsipart.so
${NEUT_CLASS}/neutpart.so
${NEUT_CLASS}/neutvect.so
)
foreach(OBJ ${NEUT_ROOT_LIBS})
LIST(APPEND EXTRA_SHAREDOBJS ${OBJ})
endforeach()
endif()
diff --git a/cmake/NIWGSetup.cmake b/cmake/NIWGSetup.cmake
index 293d296..5b5444f 100644
--- a/cmake/NIWGSetup.cmake
+++ b/cmake/NIWGSetup.cmake
@@ -1,56 +1,56 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(NIWG_ROOT STREQUAL "")
cmessage(FATAL_ERROR "Variable NIWG_ROOT is not defined. Either configure with -DNIWG_ROOT or \"\$ export NIWG=/path/to/NIWGReWeight\". This must be set to point to a prebuilt NIWGReWeight instance.")
endif()
LIST(APPEND EXTRA_CXX_FLAGS -D__NIWG_ENABLED__)
# Look for CCQE low Q2 suppression in NIWG
find_file(NIWGRWLOWQE NIWGReWeightEffectiveQELowQ2Suppression.h
PATHS ${NIWG_ROOT})
# Look for 2p2h energy dependent parameter in NIWG
find_file(NIWG2P2HENU NIWGReWeight2p2hEdep.h
PATH ${NIWG_ROOT})
# Look for resonant low Q2 suppression in NIWG
find_file(NIWGRESLOWQ2 NIWGReWeightSPPLowQ2Suppression.h
PATH ${NIWG_ROOT})
if( NOT "${NIWGRWLOWQE} " STREQUAL "NIWGRWLOWQE-NOTFOUND ")
cmessage(STATUS "Found ${NIWGRWLOWQE}")
LIST(APPEND EXTRA_CXX_FLAGS -DHAVE_NIWGRW_LOWQ2)
endif()
if( NOT "${NIWG2P2HENU} " STREQUAL "NIWG2P2HENU-NOTFOUND ")
cmessage(STATUS "Found ${NIWG2P2HENU}")
LIST(APPEND EXTRA_CXX_FLAGS -DHAVE_NIWGRW_2P2HENU)
endif()
if( NOT "${NIWGRESLOWQ2} " STREQUAL "NIWGRESLOWQ2-NOTFOUND ")
cmessage(STATUS "Found ${NIWGRESLOWQ2}")
LIST(APPEND EXTRA_CXX_FLAGS -DHAVE_NIWGRW_RESLOWQ2)
endif()
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${NIWG_ROOT})
LIST(APPEND EXTRA_LINK_DIRS ${NIWG_ROOT})
LIST(APPEND EXTRA_LIBS NIWGReWeight)
diff --git a/cmake/NuWroSetup.cmake b/cmake/NuWroSetup.cmake
index af9d455..c662c1a 100644
--- a/cmake/NuWroSetup.cmake
+++ b/cmake/NuWroSetup.cmake
@@ -1,111 +1,111 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(NOT NUWRO_INPUT_FILE STREQUAL "")
if(NOT EXISTS ${NUWRO_INPUT_FILE})
cmessage(FATAL_ERROR "Expected -DNUWRO_INPUT_FILE to point to a valid input file. Cannot find: '${NUWRO_INPUT_FILE}'")
endif()
if(CMAKE_BUILD_TYPE MATCHES DEBUG)
BuildROOTProject(NuWro_event1 ${NUWRO_INPUT_FILE} "event,vec,vect,particle,flags,params,line" STATIC)
SET(ROOTLIBNAME "libNuWro_event1.a")
else(CMAKE_BUILD_TYPE MATCHES RELEASE)
BuildROOTProject(NuWro_event1 ${NUWRO_INPUT_FILE} "event,vec,vect,particle,flags,params,line" SHARED)
SET(ROOTLIBNAME "libNuWro_event1.so")
endif()
ADD_CUSTOM_TARGET(NuWro_event1HeaderLink ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_BINARY_DIR}/NuWro_event1/event.h
${CMAKE_BINARY_DIR}/NuWro_event1/event1.h
DEPENDS NuWro_event1)
LIST(APPEND EXTRA_CXX_FLAGS -D__NUWRO_ENABLED__)
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/NuWro_event1)
LIST(APPEND EXTRA_LINK_DIRS ${CMAKE_BINARY_DIR})
LIST(APPEND EXTRA_LIBS NuWro_event1)
LIST(APPEND PROJECTWIDE_EXTRA_DEPENDENCIES NuWro_event1HeaderLink )
install(TARGETS NuWro_event1 DESTINATION lib)
SET(NUWRO_BUILT_FROM_FILE TRUE)
else()
if(NUWRO STREQUAL "")
cmessage(FATAL_ERROR "Variable NUWRO is not defined. "
"This must be set to point to a prebuilt NuWro instance.")
endif()
# If you are using a version of NuWro without reweighting use this to compile.
if(USE_NuWro_RW)
if(NUWRO_INC STREQUAL "")
cmessage(FATAL_ERROR "Variable NUWRO_INC is not defined. "
"This must be set to point to an installed NuWro instance.")
endif()
LIST(APPEND EXTRA_CXX_FLAGS -D__NUWRO_ENABLED__ -D__NUWRO_REWEIGHT_ENABLED__)
if(USE_NuWro_SRW_Event)
LIST(APPEND EXTRA_CXX_FLAGS -D__USE_NUWRO_SRW_EVENTS__)
endif()
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES
${NUWRO}/src
${NUWRO}/src/reweight
${NUWRO_INC}/nuwro)
LIST(APPEND EXTRA_LINK_DIRS ${NUWRO}/build/${CMAKE_SYSTEM_NAME}/lib)
LIST(APPEND EXTRA_LIBS reweight event)
else ()
LIST(APPEND EXTRA_CXX_FLAGS -D__NUWRO_ENABLED__)
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${NUWRO}/src)
if(NOT EXISTS ${NUWRO}/bin/event1.so)
if(EXISTS ${NUWRO}/build/${CMAKE_SYSTEM_NAME}/lib)
if(NUWRO_INC STREQUAL "")
cmessage(FATAL_ERROR "Variable NUWRO_INC is not defined. "
"This must be set to point to an installed NuWro instance.")
endif()
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${NUWRO_INC}/nuwro)
LIST(APPEND EXTRA_LINK_DIRS ${NUWRO}/build/${CMAKE_SYSTEM_NAME}/lib)
LIST(APPEND EXTRA_LIBS -Wl,--no-as-needed event -Wl,--as-needed)
else()
cmessage(FATAL_ERROR "Expected to find the NuWro event library in: ${NUWRO}/bin/event1.so, or if using NuWro with reweight support: ${NUWRO}/build/${CMAKE_SYSTEM_NAME}/lib/libevent.a. Is NuWro built?")
endif()
else()
LIST(APPEND EXTRA_SHAREDOBJS -Wl,--no-as-needed ${NUWRO}/bin/event1.so -Wl,--as-needed)
endif()
endif()
set(NEED_PYTHIA6 TRUE)
set(NEED_ROOTPYTHIA6 TRUE)
endif()
diff --git a/cmake/Prob3++Setup.cmake b/cmake/Prob3++Setup.cmake
index 03de820..3cde3fe 100644
--- a/cmake/Prob3++Setup.cmake
+++ b/cmake/Prob3++Setup.cmake
@@ -1,42 +1,42 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(USE_PROB3PP)
LIST(APPEND EXTRA_CXX_FLAGS -D__PROB3PP_ENABLED__)
ExternalProject_Add(prob3pp
PREFIX "${CMAKE_BINARY_DIR}/Ext"
URL "http://webhome.phy.duke.edu/~raw22/public/Prob3++/Prob3++.20121225.tar.gz"
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
BUILD_COMMAND CXXFLAGS=-fPIC CFLAGS=-fPIC make
INSTALL_COMMAND ""
)
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/Ext/src/prob3pp)
LIST(APPEND EXTRA_LINK_DIRS ${CMAKE_BINARY_DIR}/Ext/src/prob3pp)
LIST(APPEND EXTRA_LIBS ThreeProb_2.10)
cmessage(STATUS "Using Prob3++ 2.10")
endif()
diff --git a/cmake/ROOTSetup.cmake b/cmake/ROOTSetup.cmake
index 151ce2f..00520a2 100644
--- a/cmake/ROOTSetup.cmake
+++ b/cmake/ROOTSetup.cmake
@@ -1,172 +1,172 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if ( NOT DEFINED ENV{ROOTSYS} )
cmessage (FATAL_ERROR "$ROOTSYS is not defined, please set up ROOT first.")
else()
cmessage(STATUS "Using ROOT installed at $ENV{ROOTSYS}")
set(CMAKE_ROOTSYS $ENV{ROOTSYS})
endif()
# Get cflags from ROOT
execute_process (COMMAND root-config
--cflags OUTPUT_VARIABLE ROOT_CXX_FLAGS_RAW OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" ROOT_CXX_FLAGS "${ROOT_CXX_FLAGS_RAW}")
# Get libdir from ROOT
execute_process (COMMAND root-config
--libdir OUTPUT_VARIABLE ROOT_LIBDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get version from ROOT
execute_process (COMMAND root-config
--version OUTPUT_VARIABLE ROOT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get features from ROOT
execute_process (COMMAND root-config
--features OUTPUT_VARIABLE ROOT_FEATURES OUTPUT_STRIP_TRAILING_WHITESPACE)
LIST(APPEND EXTRA_LINK_DIRS ${ROOT_LIBDIR})
LIST(APPEND ROOT_LIBS
Core
Cint
RIO
XMLIO
Net
Hist
Graf
Graf3d
Gpad
Tree
Rint
Postscript
Matrix
Physics
MathMore
MathCore
Thread
EG
Geom
GenVector)
cmessage(STATUS "Checking ROOT version: ${ROOT_VERSION}")
string(REGEX MATCH "^6.*" ROOTVERSIXMATCH ${ROOT_VERSION})
if(ROOTVERSIXMATCH)
cmessage(STATUS "Using ROOT6, We are essentially flying blind here.")
LIST(REMOVE_ITEM ROOT_LIBS Cint)
LIST(APPEND EXTRA_CXX_FLAGS -DROOT6_USE_FIT_FITTER_INTERFACE -DROOT6)
set(USE_ROOT6 True)
else()
string(REGEX MATCH "5.34/([0-9]+)" ROOTVERSMATCH ${ROOT_VERSION})
if(NOT ROOTVERSMATCH OR ${CMAKE_MATCH_1} LESS "19")
cmessage(FATAL_ERROR "ROOT Version: ${ROOT_VERSION} has out of date minimizer interface, but minimizer functionality requested. Please configure with -DUSE_MINIMIZER=FALSE or update to 5.34/19 or greater to enable minimization features.")
endif()
endif()
if(USE_MINIMIZER)
if("${ROOT_FEATURES}" MATCHES "minuit2")
cmessage(STATUS "ROOT built with MINUIT2 support")
LIST(APPEND EXTRA_CXX_FLAGS -D__MINUIT2_ENABLED__)
else()
cmessage(FATAL_ERROR "ROOT built without MINUIT2 support but minimizer functionality requested. Either configure with -DUSE_MINIMIZER=FALSE or use a version of ROOT with MINUIT2 support.")
endif()
endif()
if("${ROOT_FEATURES}" MATCHES "opengl")
cmessage(STATUS "ROOT built with OpenGL support")
LIST(APPEND ROOT_LIBS RGL)
endif()
if(DEFINED NEED_ROOTPYTHIA6 AND NEED_ROOTPYTHIA6)
LIST(APPEND ROOT_LIBS EGPythia6 Pythia6)
endif()
cmessage ( STATUS "[ROOT]: root-config --version: ${ROOT_VERSION} ")
cmessage ( STATUS "[ROOT]: root-config --cflags : ${ROOT_CXX_FLAGS} ")
cmessage ( STATUS "[ROOT]: root-config --libs : ${ROOT_LD_FLAGS} ")
LIST(APPEND EXTRA_CXX_FLAGS ${ROOT_CXX_FLAGS})
#Helper functions for building dictionaries
function(GenROOTDictionary OutputDictName Header LinkDef)
get_directory_property(incdirs INCLUDE_DIRECTORIES)
string(REPLACE ";" ";-I" LISTDIRINCLUDES "-I${incdirs}")
string(REPLACE " " ";" LISTCPPFLAGS "${EXTRA_CXX_FLAGS}")
#ROOT5 CINT cannot handle it.
list(REMOVE_ITEM LISTCPPFLAGS "-std=c++11")
message(STATUS "LISTCPPFLAGS: ${LISTCPPFLAGS}")
message(STATUS "LISTINCLUDES: ${LISTDIRINCLUDES}")
#Learn how to generate the Dict.cxx and Dict.hxx
add_custom_command(
OUTPUT "${OutputDictName}.cxx" "${OutputDictName}.h"
COMMAND rootcint
ARGS -f ${OutputDictName}.cxx -c
-p ${LISTDIRINCLUDES} ${LISTCPPFLAGS} ${Header} ${LinkDef}
DEPENDS ${Header};${LinkDef})
endfunction()
function(BuildROOTProject ProjectName InputFile CommaSeparatedClassesToDump LIBLINKMODE)
string(REPLACE "," ";" HeadersToDump ${CommaSeparatedClassesToDump})
set(OUTPUTFILES ${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}ProjectSource.cxx
${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}LinkDef.h
${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}ProjectHeaders.h
${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}ProjectInstances.h)
cmessage(STATUS "As part of ROOT project: ${ProjectName}")
foreach (header ${HeadersToDump})
LIST(APPEND OUTPUTFILES "${CMAKE_BINARY_DIR}/${ProjectName}/${header}.h")
cmessage(STATUS "Will generate: ${CMAKE_BINARY_DIR}/${ProjectName}/${header}.h")
endforeach()
add_custom_command(
OUTPUT ${OUTPUTFILES}
COMMAND ${CMAKE_BINARY_DIR}/src/Utils/DumpROOTClassesFromVector
ARGS ${InputFile}
${CMAKE_BINARY_DIR}/${ProjectName}
${CommaSeparatedClassesToDump}
VERBATIM
DEPENDS DumpROOTClassesFromVector)
add_custom_target(${ProjectName}_sources
DEPENDS ${OUTPUTFILES})
GenROOTDictionary(
${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}ProjectDict
${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}ProjectHeaders.h
${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}LinkDef.h
)
add_custom_target(${ProjectName}ProjectDict
DEPENDS
${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}ProjectDict.cxx
${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}ProjectDict.h )
# add_dependencies(${ProjectName}ProjectDict ${ProjectName}_sources)
#ProjectSource.cxx includes ProjectDict.cxx, so no need to add to compilation.
set(ROAA_SOURCEFILES
${CMAKE_BINARY_DIR}/${ProjectName}/${ProjectName}ProjectSource.cxx)
add_library(${ProjectName} ${LIBLINKMODE} ${ROAA_SOURCEFILES})
add_dependencies(${ProjectName} ${ProjectName}ProjectDict)
endfunction()
diff --git a/cmake/ReweightEnginesSetup.cmake b/cmake/ReweightEnginesSetup.cmake
index 59f745a..46810fc 100644
--- a/cmake/ReweightEnginesSetup.cmake
+++ b/cmake/ReweightEnginesSetup.cmake
@@ -1,101 +1,101 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(NOT USE_REWEIGHT)
LIST(APPEND EXTRA_CXX_FLAGS -D__NO_REWEIGHT__)
endif()
################################## T2K ######################################
if(USE_T2K)
include(${CMAKE_SOURCE_DIR}/cmake/T2KSetup.cmake)
cmessage(STATUS "Using T2K Reweight engine.")
set(USE_T2K TRUE CACHE BOOL "Whether to enable T2KReWeight support. Requires external libraries. " FORCE)
endif()
################################## NIWG ######################################
if(USE_NIWG)
include(${CMAKE_SOURCE_DIR}/cmake/NIWGSetup.cmake)
cmessage(STATUS "Using NIWG Reweight engine.")
set(USE_NIWG TRUE CACHE BOOL "Whether to enable (T2K) NIWG ReWeight support. Requires external libraries. " FORCE)
endif()
################################## MINERvA ######################################
if(USE_MINERvA_RW)
include(${CMAKE_SOURCE_DIR}/cmake/MINERvASetup.cmake)
cmessage(STATUS "Using MINERvA Reweight engine.")
set(USE_MINERvA_RW TRUE CACHE BOOL "Whether to enable MINERvA ReWeight support. " FORCE)
endif()
################################## NEUT ######################################
if(USE_NEUT)
include(${CMAKE_SOURCE_DIR}/cmake/NEUTSetup.cmake)
cmessage(STATUS "Using NEUT Reweight engine.")
set(USE_NEUT TRUE CACHE BOOL "Whether to enable NEUT (reweight) support. Requires external libraries. " FORCE)
endif()
################################# NuWro ######################################
if(USE_NuWro)
include(${CMAKE_SOURCE_DIR}/cmake/NuWroSetup.cmake)
cmessage(STATUS "Using NuWro Reweight engine.")
set(USE_NuWro TRUE CACHE BOOL "Whether to enable NuWro support. " FORCE)
endif()
################################## GENIE #####################################
if(USE_GENIE)
include(${CMAKE_SOURCE_DIR}/cmake/GENIESetup.cmake)
cmessage(STATUS "Using GENIE.")
set(USE_GENIE TRUE CACHE BOOL "Whether to enable GENIE support. Requires external libraries. " FORCE)
endif()
################################################################################
################################ NOvARwgt ####################################
if(USE_NOvARwgt)
include(${CMAKE_SOURCE_DIR}/cmake/NOvARwgtSetup.cmake)
cmessage(STATUS "Using NOvARwgt Reweight engine.")
set(USE_NOvARwgt TRUE CACHE BOOL "Whether to enable NOvARwgt (reweight) support. Requires external libraries. " FORCE)
endif()
################################################################################
if(USE_NUSYST)
include(${CMAKE_SOURCE_DIR}/cmake/nusystematicsSetup.cmake)
cmessage(STATUS "Using NOvARwgt Reweight engine.")
set(USE_NUSYST TRUE CACHE BOOL "Whether to enable DUNERwt (reweight) support. Requires external libraries. " FORCE)
endif()
################################ Prob3++ ####################################
include(${CMAKE_SOURCE_DIR}/cmake/Prob3++Setup.cmake)
################################################################################
cmessage(STATUS "Reweight engine include directories: ${RWENGINE_INCLUDE_DIRECTORIES}")
if(NEED_ROOTEVEGEN)
cmessage(STATUS "Require ROOT eve generation libraries")
LIST(REVERSE ROOT_LIBS)
LIST(APPEND ROOT_LIBS
Gui
Ged
Geom
TreePlayer
EG
Eve)
LIST(REVERSE ROOT_LIBS)
endif()
if(NEED_ROOTPYTHIA6)
cmessage(STATUS "Require ROOT Pythia6 libraries")
LIST(APPEND ROOT_LIBS
EGPythia6)
endif()
LIST(APPEND EXTRA_LIBS ${ROOT_LIBS})
diff --git a/cmake/T2KSetup.cmake b/cmake/T2KSetup.cmake
index 5e59737..c67ef53 100644
--- a/cmake/T2KSetup.cmake
+++ b/cmake/T2KSetup.cmake
@@ -1,40 +1,40 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(T2KREWEIGHT STREQUAL "")
cmessage(FATAL_ERROR "Variable T2KREWEIGHT is not defined. Either configure with -DT2KREWEIGHT or \"\$ export T2KREWEIGHT=/path/to/T2KReWeight\". This must be set to point to a prebuilt T2KReWeight instance.")
endif()
LIST(APPEND EXTRA_CXX_FLAGS -D__T2KREW_ENABLED__ )
# First check the OAANALYSIS libs (need to grab some headers for T2KReWeight linking if compiled with oaAnalysisReader)
IF(NOT $ENV{OAANALYSISREADERROOT} STREQUAL "")
cmessage(STATUS "Found OAANALYSISREADERROOT $ENV{OAANALYSISREADERROOT}, appending...")
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES $ENV{OAANALYSISREADERROOT}/$ENV{OAANALYSISREADERCONFIG})
LIST(APPEND EXTRA_LINK_DIRS $ENV{OAANALYSISREADERROOT}/$ENV{OAANALYSISREADERCONFIG})
LIST(APPEND EXTRA_LIBS oaAnalysisReader)
# Don't have to append this; should be appeneded in ${T2KReWeight/src/T2KBuild.h}
#LIST(APPEND EXTRA_CXX_FLAGS -D__T2KRW_OAANALYSIS_ENABLED__)
endif()
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${T2KREWEIGHT}/src/)
LIST(APPEND EXTRA_LINK_DIRS ${T2KREWEIGHT}/lib)
LIST(APPEND EXTRA_LIBS T2KReWeight)
diff --git a/cmake/c++CompilerSetup.cmake b/cmake/c++CompilerSetup.cmake
index 11f6f33..9ac7ddc 100644
--- a/cmake/c++CompilerSetup.cmake
+++ b/cmake/c++CompilerSetup.cmake
@@ -1,122 +1,122 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(USE_OMP)
LIST(APPEND EXTRA_CXX_FLAGS -fopenmp)
endif()
if(USE_DYNSAMPLES)
LIST(APPEND EXTRA_LIBS dl)
LIST(APPEND EXTRA_CXX_FLAGS -D__USE_DYNSAMPLES__)
endif()
set(CXX_WARNINGS -Wall )
cmessage(DEBUG "EXTRA_CXX_FLAGS: ${EXTRA_CXX_FLAGS}")
string(REPLACE ";" " " STR_EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STR_EXTRA_CXX_FLAGS} ${CXX_WARNINGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-fPIC")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
if(USE_DYNSAMPLES)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC")
set(CMAKE_Fortran_FLAGS_DEBUG "-fPIC")
endif()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC -O3")
if(CMAKE_BUILD_TYPE MATCHES DEBUG)
set(CURRENT_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_DEBUG})
elseif(CMAKE_BUILD_TYPE MATCHES RELEASE)
set(CURRENT_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_RELEASE})
else()
cmessage(FATAL_ERROR "[ERROR]: Unknown CMAKE_BUILD_TYPE (\"${CMAKE_BUILD_TYPE}\"): Should be \"DEBUG\" or \"RELEASE\".")
endif()
SET(STR_EXTRA_LINK_DIRS)
if(NOT EXTRA_LINK_DIRS STREQUAL "")
string(REPLACE ";" " -L" STR_EXTRA_LINK_DIRS "-L${EXTRA_LINK_DIRS}")
endif()
SET(STR_EXTRA_LIBS)
if(NOT EXTRA_LIBS STREQUAL "")
SET(STR_EXTRA_LIBS_NO_SCRUB_LINKOPTS)
string(REPLACE ";" " -l" STR_EXTRA_LIBS_NO_SCRUB_LINKOPTS "-l${EXTRA_LIBS}")
string(REPLACE "-l-" "-" STR_EXTRA_LIBS ${STR_EXTRA_LIBS_NO_SCRUB_LINKOPTS})
endif()
SET(STR_EXTRA_SHAREDOBJS)
if(NOT EXTRA_SHAREDOBJS STREQUAL "")
string(REPLACE ";" " " STR_EXTRA_SHAREDOBJS "${EXTRA_SHAREDOBJS}")
endif()
SET(STR_EXTRA_LINK_FLAGS)
if(NOT EXTRA_LINK_FLAGS STREQUAL "")
string(REPLACE ";" " " STR_EXTRA_LINK_FLAGS "${EXTRA_LINK_FLAGS}")
endif()
cmessage(DEBUG "EXTRA_LINK_DIRS: ${STR_EXTRA_LINK_DIRS}")
cmessage(DEBUG "EXTRA_LIBS: ${STR_EXTRA_LIBS}")
cmessage(DEBUG "EXTRA_SHAREDOBJS: ${STR_EXTRA_SHAREDOBJS}")
cmessage(DEBUG "EXTRA_LINK_FLAGS: ${STR_EXTRA_LINK_FLAGS}")
if(NOT STR_EXTRA_LINK_DIRS STREQUAL "" AND NOT STR_EXTRA_LIBS STREQUAL "")
SET(CMAKE_DEPENDLIB_FLAGS "${STR_EXTRA_LINK_DIRS} ${STR_EXTRA_LIBS}")
endif()
if(NOT EXTRA_SHAREDOBJS STREQUAL "")
if(NOT STR_EXTRA_LINK_FLAGS STREQUAL "")
SET(STR_EXTRA_LINK_FLAGS "${STR_EXTRA_SHAREDOBJS} ${STR_EXTRA_LINK_FLAGS}")
else()
SET(STR_EXTRA_LINK_FLAGS "${STR_EXTRA_SHAREDOBJS}")
endif()
endif()
if(NOT EXTRA_LINK_FLAGS STREQUAL "")
if(NOT CMAKE_LINK_FLAGS STREQUAL "")
SET(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS} ${STR_EXTRA_LINK_FLAGS}")
else()
SET(CMAKE_LINK_FLAGS "${STR_EXTRA_LINK_FLAGS}")
endif()
endif()
if(USE_OMP)
cmessage(FATAL_ERROR "No OMP features currently enabled so this is a FATAL_ERROR to let you know that you don't gain anything with this declaration.")
endif()
string(REPLACE ";" " " NUIS_EXE_FLAGS "${EXTRA_EXE_FLAGS}")
string(STRIP ${CMAKE_CXX_FLAGS} CMAKE_CXX_FLAGS)
string(STRIP ${CMAKE_CXX_FLAGS_RELEASE} CMAKE_CXX_FLAGS_RELEASE)
string(STRIP ${CMAKE_CXX_FLAGS_DEBUG} CMAKE_CXX_FLAGS_DEBUG)
string(STRIP ${CMAKE_LINK_FLAGS} CMAKE_LINK_FLAGS)
string(STRIP ${CMAKE_DEPENDLIB_FLAGS} CMAKE_DEPENDLIB_FLAGS)
if (VERBOSE)
cmessage (STATUS "C++ Compiler : ${CXX_COMPILER_NAME}")
cmessage (STATUS " flags : ${CMAKE_CXX_FLAGS}")
cmessage (STATUS " Release flags : ${CMAKE_CXX_FLAGS_RELEASE}")
cmessage (STATUS " Debug flags : ${CMAKE_CXX_FLAGS_DEBUG}")
cmessage (STATUS " Link Flags : ${CMAKE_LINK_FLAGS}")
cmessage (STATUS " Lib Flags : ${CMAKE_DEPENDLIB_FLAGS}")
endif()
diff --git a/cmake/cacheVariables.cmake b/cmake/cacheVariables.cmake
index c23094a..c180ab6 100644
--- a/cmake/cacheVariables.cmake
+++ b/cmake/cacheVariables.cmake
@@ -1,247 +1,247 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
function(CheckAndSetDefaultEnv VARNAME DEFAULT CACHETYPE DOCSTRING ENVNAME)
#cmessage(DEBUG "Trying to assign variable ${VARNAME} into the cache.")
if(NOT DEFINED ${VARNAME})
if(DEFINED ENV{${ENVNAME}} AND NOT $ENV{${ENVNAME}} STREQUAL "")
set(${VARNAME} $ENV{${ENVNAME}} CACHE ${CACHETYPE} ${DOCSTRING})
cmessage(DEBUG " Read ${VARNAME} from ENVVAR ${ENVNAME} as $ENV{${ENVNAME}}.")
else()
set(${VARNAME} ${DEFAULT} CACHE ${CACHETYPE} ${DOCSTRING})
endif()
else()
set(${VARNAME} ${${VARNAME}} CACHE ${CACHETYPE} ${DOCSTRING})
unset(${VARNAME})
endif()
cmessage(CACHE "--Set cache variable: \"${VARNAME}\" to \"${${VARNAME}}\", in cache ${CACHETYPE}.")
endfunction()
function(CheckAndSetDefaultCache VARNAME DEFAULT CACHETYPE DOCSTRING)
# cmessage(DEBUG "Trying to assign variable ${VARNAME} into the cache.")
if(NOT DEFINED ${VARNAME})
set(${VARNAME} ${DEFAULT} CACHE ${CACHETYPE} ${DOCSTRING})
else()
set(${VARNAME} ${${VARNAME}} CACHE ${CACHETYPE} ${DOCSTRING})
unset(${VARNAME})
endif()
cmessage(CACHE "--Set cache variable: \"${VARNAME}\" to \"${${VARNAME}}\", in cache ${CACHETYPE}.")
endfunction()
function(CheckAndSetDefault VARNAME DEFAULT)
# cmessage(DEBUG "Trying to assign variable ${VARNAME}.")
if(NOT DEFINED ${VARNAME})
set(${VARNAME} ${DEFAULT} PARENT_SCOPE)
set(${VARNAME} ${DEFAULT})
endif()
cmessage(CACHE "--Set variable: \"${VARNAME}\" to \"${${VARNAME}}\".")
endfunction()
CheckAndSetDefaultCache(VERBOSE TRUE BOOL "Whether to configure loudly.")
set (CMAKE_SKIP_BUILD_RPATH TRUE)
#Changes default install path to be a subdirectory of the build dir.
#Can set build dir at configure time with -DCMAKE_INSTALL_PREFIX=/install/path
if(CMAKE_INSTALL_PREFIX STREQUAL "" OR CMAKE_INSTALL_PREFIX STREQUAL
"/usr/local")
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}")
elseif(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}")
endif()
if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE DEBUG)
elseif(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE DEBUG)
endif()
CheckAndSetDefaultCache(EXTRA_SETUP_SCRIPT "" PATH "The path to an extra script to inject into the NUISANCE setup script. <>")
CheckAndSetDefaultCache(USE_MINIMIZER TRUE BOOL "Whether we are using the ROOT minimization libraries. ")
CheckAndSetDefaultCache(USE_REWEIGHT TRUE BOOL "Whether we are expect to be able to build the reweighting libraries of enabled generators. ")
CheckAndSetDefaultCache(USE_ROOT6 FALSE INTERNAL "Whether we are using the ROOT 6. ")
CheckAndSetDefaultCache(USE_HEPMCNUEVT FALSE BOOL "Whether to enable HepMC3 input support. ")
CheckAndSetDefaultCache(USE_NUSYST FALSE BOOL "Whether to enable DUNE Reweight support. ")
CheckAndSetDefaultEnv(NUSYST_ROOT "" PATH "Path to nusystematics install directory <>" NUSYST_ROOT)
CheckAndSetDefaultEnv(SYSTTOOLS_ROOT "" PATH "Path to systematicstools install directory <>" SYSTTOOLS_ROOT)
CheckAndSetDefaultCache(USE_HEPMC FALSE BOOL "Whether to enable HepMC input support. ")
CheckAndSetDefaultEnv(HEPMC "" PATH "Path to HepMC source tree root directory. Overrides environment variable \$HEPMC <>" HEPMC)
CheckAndSetDefaultCache(HEPMC_MOMUNIT "GEV" STRING "HepMC momentum units [MEV|GEV]. ")
CheckAndSetDefaultCache(HEPMC_LENUNIT "CM" STRING "HepMC momentum units [MM|CM]. ")
CheckAndSetDefaultCache(HEPMC_USED_EP FALSE INTERNAL "Whether we built HepMC or not. ")
CheckAndSetDefaultCache(USE_NEUT FALSE BOOL "Whether to enable NEUT (reweight) support. Requires external libraries. ")
CheckAndSetDefaultEnv(NEUT_VERSION FALSE STRING "NEUT version string, e.g. 5.4.0. <5.4.0>" NEUT_VERSION)
CheckAndSetDefaultEnv(NEUT_ROOT "" PATH "Path to NEUT source tree root directory. Overrides environment variable \$NEUT_ROOT <>" NEUT_ROOT)
CheckAndSetDefaultEnv(CERN "" PATH "Path to CERNLIB source tree root directory that NEUT was built against. Overrides environment variable \$CERN <>" CERN)
CheckAndSetDefaultEnv(CERN_LEVEL "" STRING "CERNLIB Library version. Overrides environment variable \$CERN_LEVEL <>" CERN_LEVEL)
CheckAndSetDefaultCache(USE_NuWro FALSE BOOL "Whether to enable NuWro support. ")
CheckAndSetDefaultEnv(NUWRO "" PATH "Path to NuWro source tree root directory. Overrides environment variable \$NUWRO <>" NUWRO)
CheckAndSetDefaultEnv(NUWRO_INC "" PATH "Path to NuWro installed includes directory, needs to contain \"params_all.h\". Overrides environment variable \$NUWRO_INC <>" NUWRO_INC)
CheckAndSetDefaultCache(NUWRO_INPUT_FILE "" FILEPATH "Path to an input NuWro event vector, which can be used to build NuWro i/o libraries. <>")
CheckAndSetDefaultCache(NUWRO_BUILT_FROM_FILE FALSE INTERNAL "Whether the NuWro libraries were built by NUISANCE. ")
CheckAndSetDefaultCache(USE_NuWro_RW FALSE BOOL "Whether to try and build support for NuWro reweighting. ")
CheckAndSetDefaultCache(USE_NuWro_SRW_Event FALSE BOOL "Whether to use cut down NuWro reweight event format. Requires NuWro reweight. ")
CheckAndSetDefaultCache(USE_GENIE FALSE BOOL "Whether to enable GENIE support. Requires external libraries. ")
CheckAndSetDefaultCache(GENIE_VERSION "AUTO" STRING "GENIE Version ")
CheckAndSetDefaultEnv(GENIE "" PATH "Path to GENIE source tree root directory. Overrides environment variable \$GENIE <>" GENIE)
CheckAndSetDefaultEnv(GENIE_REWEIGHT "" PATH "Path to GENIE ReWeight directory. Only relevant for GENIE v3+. Overrides environment variable \$GENIE_REWEIGHT <>" GENIE_REWEIGHT)
CheckAndSetDefaultCache(GENIE_EMPMEC_REWEIGHT FALSE BOOL "Whether to use GENIE EMP MEC reweight (requires custom GENIE) ")
CheckAndSetDefaultCache(USE_GENIE_XSECMEC FALSE BOOL "Whether to use GENIE MEC reweight (requires custom GENIE) ")
CheckAndSetDefaultEnv(LHAPDF_LIB "" PATH "Path to pre-built LHAPDF libraries. Overrides environment variable \$LHAPDF_LIB. <>" LHAPDF_LIB)
CheckAndSetDefaultEnv(LHAPDF_INC "" PATH "Path to installed LHAPDF headers. Overrides environment variable \$LHAPDF_INC. <>" LHAPDF_INC)
CheckAndSetDefaultEnv(LHAPATH "" PATH "Path to LHA PDF inputs. Overrides environment variable \$LHAPATH. <>" LHAPATH)
CheckAndSetDefaultEnv(LIBXML2_LIB "" PATH "Path to pre-built LIBXML2 libraries. Overrides environment variable \$LIBXML2_LIB. <>" LIBXML2_LIB)
CheckAndSetDefaultEnv(LIBXML2_INC "" PATH "Path to installed LIBXML2 headers. Overrides environment variable \$LIBXML2_INC. <>" LIBXML2_INC)
CheckAndSetDefaultEnv(LOG4CPP_LIB "" PATH "Path to pre-built LOG4CPP libraries. Overrides environment variable \$LOG4CPP_LIB. <>" LOG4CPP_LIB)
CheckAndSetDefaultEnv(LOG4CPP_INC "" PATH "Path to installed LOG4CPP headers. Overrides environment variable \$LOG4CPP_INC. <>" LOG4CPP_INC)
CheckAndSetDefaultEnv(GSL_LIB "" PATH "Path to pre-built gsl libraries. Overrides environment variable \$GSL_LIB. <>" GSL_LIB)
CheckAndSetDefaultEnv(GSL_INC "" PATH "Path to installed gsl headers. Overrides environment variable \$GSL_INC. <>" GSL_INC)
CheckAndSetDefaultCache(USE_T2K FALSE BOOL "Whether to enable T2KReWeight support. Requires external libraries. ")
CheckAndSetDefaultEnv(T2KREWEIGHT "" PATH "Path to installed T2KReWeight. Overrides environment variable \$T2KREWEIGHT. <>" T2KREWEIGHT)
CheckAndSetDefaultCache(USE_NIWG FALSE BOOL "Whether to enable (T2K) NIWG ReWeight support. Requires external libraries. ")
CheckAndSetDefaultEnv(NIWG_ROOT "" PATH "Path to installed NIWGReWeight. Overrides environment variable \$NIWG. <>" NIWG)
CheckAndSetDefaultCache(USE_MINERvA_RW FALSE BOOL "Whether to enable MINERvA ReWeight support. ")
CheckAndSetDefaultCache(USE_NOvARwgt FALSE BOOL "Whether to enable NOvA ReWeight support. ")
CheckAndSetDefaultEnv(NOVARWGT "" PATH "Path to directory containing libPythia6.so. Overrides environment variable \$NOVARWGT <>" NOVARWGT)
CheckAndSetDefaultEnv(PYTHIA6 "" PATH "Path to directory containing libPythia6.so. Overrides environment variable \$PYTHIA6 <>" PYTHIA6)
CheckAndSetDefaultEnv(PYTHIA8 "" PATH "Path to directory containing libPythia8.so. Overrides environment variable \$PYTHIA8 <>" PYTHIA8)
CheckAndSetDefaultCache(USE_PYTHIA8 FALSE BOOL "Whether to enable PYTHIA8 event support. ")
CheckAndSetDefaultCache(USE_GiBUU TRUE BOOL "Whether to enable GiBUU event support. ")
CheckAndSetDefaultCache(BUILD_GiBUU FALSE BOOL "Whether to build supporting GiBUU event tools along with a patched version of GiBUU. ")
CheckAndSetDefaultCache(USE_NUANCE TRUE BOOL "Whether to enable NUANCE event support. ")
CheckAndSetDefaultCache(USE_PROB3PP FALSE BOOL "Whether to download and compile in Prob3++ support. ")
CheckAndSetDefaultCache(NO_EXTERNAL_UPDATE FALSE BOOL "Whether to perform the update target for external dependencies. Note this may produce errors for CMake < 3.8 where a bug was fixed for the feature that this option invokes. ")
CheckAndSetDefaultCache(USE_GPERFTOOLS FALSE BOOL "Whether to compile in google performance tools. ")
CheckAndSetDefault(NEED_PYTHIA6 FALSE)
CheckAndSetDefault(NEED_PYTHIA8 FALSE)
CheckAndSetDefault(NEED_ROOTEVEGEN FALSE)
CheckAndSetDefault(NEED_ROOTPYTHIA6 FALSE)
CheckAndSetDefaultCache(USE_OMP FALSE BOOL "Whether to enable multicore features (there currently are none...). ")
CheckAndSetDefaultCache(USE_DYNSAMPLES TRUE BOOL "Whether to enable the dynamic sample loader. ")
CheckAndSetDefault(NO_EXPERIMENTS FALSE)
cmessage(STATUS "NO_EXPERIMENTS: ${NO_EXPERIMENTS}")
CheckAndSetDefaultCache(NO_ANL ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build ANL samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_ArgoNeuT ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build ArgoNeuT samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_BEBC ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build BEBC samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_BNL ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build BNL samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_FNAL ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build FNAL samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_GGM ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build GGM samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_K2K ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build K2K samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_MINERvA ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build MINERvA samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_MiniBooNE ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build MiniBooNE samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_T2K ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build T2K samples. <-DNO_EXPERIMENTS=FALSE>")
CheckAndSetDefaultCache(NO_SciBooNE ${NO_EXPERIMENTS} BOOL "Whether to *NOT* build SciBooNE samples. <-DNO_EXPERIMENTS=FALSE>")
function(SAYVARS)
LIST(APPEND VARS
USE_HEPMC
HEPMC
HEPMC_MOMUNIT
HEPMC_LENUNIT
HEPMC_USED_EP
USE_NEUT
NEUT_VERSION
NEUT_ROOT
CERN
CERN_LEVEL
USE_NuWro
NUWRO
NUWRO_INC
NUWRO_INPUT_FILE
NUWRO_BUILT_FROM_FILE
USE_GENIE
GENIE_VERSION
GENIE
GENIE_REWEIGHT
LHAPDF_LIB
LHAPDF_INC
LHAPATH
LIBXML2_LIB
LIBXML2_INC
LOG4CPP_LIB
LOG4CPP_INC
GSL_LIB
GSL_INC
PYTHIA6
PYTHIA8
USE_PYTHIA8
USE_T2K
T2KREWEIGHT
USE_NIWG
NIWG_ROOT
USE_MINERvA_RW
USE_NOvARwgt
NOVARWGT
USE_GiBUU
BUILD_GiBUU
USE_NUANCE
USE_PROB3PP
NO_EXTERNAL_UPDATE
USE_GPERFTOOLS
NO_EXPERIMENTS
NO_ANL
NO_ArgoNeuT
NO_BEBC
NO_BNL
NO_FNAL
NO_GGM
NO_K2K
NO_MINERvA
NO_MiniBooNE
NO_T2K
NO_SciBooNE)
foreach(v ${VARS})
if(DEFINED ${v})
cmessage(DEBUG "VARIABLE: \"${v}\" = \"${${v}}\"")
endif()
endforeach(v)
endfunction()
diff --git a/cmake/docsSetup.cmake b/cmake/docsSetup.cmake
index 618a51f..24fd680 100644
--- a/cmake/docsSetup.cmake
+++ b/cmake/docsSetup.cmake
@@ -1,43 +1,43 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
add_custom_target(doc_generate
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/doc
COMMENT "Generating documentation with Doxygen... (this will take a while)" VERBATIM
)
add_custom_target(docs
make
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/doc/latex
COMMENT "Building latex documentation with Doxygen... (this will also take a while)" VERBATIM
)
add_dependencies(docs doc_generate)
install(FILES ${CMAKE_BINARY_DIR}/doc/latex/refman.pdf
DESTINATION ${CMAKE_BINARY_DIR}/doc
RENAME NUISANCE_${NUISANCE_VERSION_STRING}.pdf OPTIONAL)
endif(DOXYGEN_FOUND)
diff --git a/cmake/gperfSetup.cmake b/cmake/gperfSetup.cmake
index dc33da7..ab1cf8e 100644
--- a/cmake/gperfSetup.cmake
+++ b/cmake/gperfSetup.cmake
@@ -1,59 +1,59 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(USE_GPERFTOOLS)
ExternalProject_Add(libunwind
PREFIX "${CMAKE_BINARY_DIR}/Ext"
GIT_REPOSITORY "git://git.sv.gnu.org/libunwind.git"
CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/Ext/src/libunwind/autogen.sh --prefix=${CMAKE_INSTALL_PREFIX}
UPDATE_COMMAND ""
BUILD_COMMAND make -j6
INSTALL_COMMAND make install
)
ExternalProject_Add(gperftools
PREFIX "${CMAKE_BINARY_DIR}/Ext"
GIT_REPOSITORY "https://github.com/gperftools/gperftools.git"
GIT_TAG "gperftools-2.5"
CONFIGURE_COMMAND ./autogen.sh && ./configure --prefix=${CMAKE_INSTALL_PREFIX} CPPFLAGS=-I${CMAKE_INSTALL_PREFIX}/include LDFLAGS=-L${CMAKE_INSTALL_PREFIX}/lib
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
BUILD_COMMAND make -j6
INSTALL_COMMAND make install
)
add_dependencies(gperftools libunwind)
LIST(APPEND EXTRA_CXX_FLAGS
-fno-builtin-malloc
-fno-builtin-calloc
-fno-builtin-realloc
-fno-builtin-free)
LIST(APPEND EXTRA_LINK_DIRS ${CMAKE_INSTALL_PREFIX}/lib)
##Want to prepend them
LIST(REVERSE EXTRA_LIBS)
LIST(APPEND EXTRA_LIBS tcmalloc_and_profiler)
LIST(REVERSE EXTRA_LIBS)
cmessage(STATUS "Using google performance libraries")
endif()
diff --git a/cmake/nusystematicsSetup.cmake b/cmake/nusystematicsSetup.cmake
index a15790c..42cc440 100644
--- a/cmake/nusystematicsSetup.cmake
+++ b/cmake/nusystematicsSetup.cmake
@@ -1,39 +1,39 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(NUSYST_ROOT STREQUAL "")
cmessage(FATAL_ERROR "Variable NUSYST_ROOT is not defined. Either configure with -DNUSYST_ROOT or \"\$ export NUSYST_ROOT=/path/to/nusystematics\". This must be set to point to a prebuilt NuSystematics instance.")
endif()
if(SYSTTOOLS_ROOT STREQUAL "")
cmessage(FATAL_ERROR "Variable SYSTTOOLS_ROOT is not defined. Either configure with -DSYSTTOOLS_ROOT or \"\$ export SYSTTOOLS_ROOT=/path/to/systematicstools\". This must be set to point to a prebuilt ART Systematics Tools instance.")
endif()
LIST(APPEND EXTRA_CXX_FLAGS -D__NUSYST_ENABLED__ -DNO_ART -std=c++1y -Wno-deprecated-declarations -Wno-deprecated)
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES
${NUSYST_ROOT}/include
${SYSTTOOLS_ROOT}/include)
LIST(APPEND EXTRA_LINK_DIRS ${NUSYST_ROOT}/lib ${SYSTTOOLS_ROOT}/lib)
LIST(APPEND EXTRA_LIBS nusystematics_systproviders
systematicstools_interface
systematicstools_interpreters
systematicstools_systproviders
systematicstools_utility)
diff --git a/cmake/pythia6Setup.cmake b/cmake/pythia6Setup.cmake
index 3a496e6..97c54c7 100644
--- a/cmake/pythia6Setup.cmake
+++ b/cmake/pythia6Setup.cmake
@@ -1,36 +1,36 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(NEED_PYTHIA6)
if(DEFINED ENV{PYTHIA6_LIBRARY} AND PYTHIA6 STREQUAL "")
SET(PYTHIA6 $ENV{PYTHIA6_LIBRARY} CACHE PATH
"Path to directory containing libPythia6.so. Overrides environment variable \$PYTHIA6 <>"
FORCE)
endif()
if(PYTHIA6 STREQUAL "")
cmessage(FATAL_ERROR "Variable PYTHIA6 is not defined. This must be set to point to a prebuilt PYTHIA6 instance, please set the \$PYTHIA6 environment variable or configure with -DPYTHIA6=/path/to/pythia6.")
endif()
LIST(APPEND EXTRA_LINK_DIRS ${PYTHIA6})
LIST(APPEND EXTRA_LIBS Pythia6 gfortran)
endif()
diff --git a/cmake/pythia8Setup.cmake b/cmake/pythia8Setup.cmake
index d46002d..0ddd603 100644
--- a/cmake/pythia8Setup.cmake
+++ b/cmake/pythia8Setup.cmake
@@ -1,30 +1,30 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
if(NEED_PYTHIA8)
if(PYTHIA8 STREQUAL "")
cmessage(FATAL_ERROR "Variable PYTHIA8 is not defined. This must be set to point to a prebuilt PYTHIA8 instance, please set the \$PYTHIA8 environment variable or configure with -DPYTHIA8=/path/to/pythia8.")
endif()
LIST(APPEND EXTRA_LINK_DIRS ${PYTHIA8})
LIST(REVERSE EXTRA_LIBS)
LIST(APPEND EXTRA_LIBS Pythia8 gfortran)
LIST(REVERSE EXTRA_LIBS)
endif()
diff --git a/cmake/setup.sh.in b/cmake/setup.sh.in
index eb10e30..7e55613 100644
--- a/cmake/setup.sh.in
+++ b/cmake/setup.sh.in
@@ -1,170 +1,170 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
#!/bin/sh
### Adapted from https://unix.stackexchange.com/questions/4965/keep-duplicates-out-of-path-on-source
function add_to_PATH () {
for d; do
d=$(cd -- "$d" && { pwd -P || pwd; }) 2>/dev/null # canonicalize symbolic links
if [ -z "$d" ]; then continue; fi # skip nonexistent directory
if [ "$d" == "/usr/bin" ] || [ "$d" == "/usr/bin64" ] || [ "$d" == "/usr/local/bin" ] || [ "$d" == "/usr/local/bin64" ]; then
case ":$PATH:" in
*":$d:"*) :;;
*) export PATH=$PATH:$d;;
esac
else
case ":$PATH:" in
*":$d:"*) :;;
*) export PATH=$d:$PATH;;
esac
fi
done
}
function add_to_LD_LIBRARY_PATH () {
for d; do
d=$(cd -- "$d" && { pwd -P || pwd; }) 2>/dev/null # canonicalize symbolic links
if [ -z "$d" ]; then continue; fi # skip nonexistent directory
if [ "$d" == "/usr/lib" ] || [ "$d" == "/usr/lib64" ] || [ "$d" == "/usr/local/lib" ] || [ "$d" == "/usr/local/lib64" ]; then
case ":$LD_LIBRARY_PATH:" in
*":$d:"*) :;;
*) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$d;;
esac
else
case ":$LD_LIBRARY_PATH:" in
*":$d:"*) :;;
*) export LD_LIBRARY_PATH=$d:$LD_LIBRARY_PATH;;
esac
fi
done
}
if [ "@EXTRA_SETUP_SCRIPT@" ]; then
if [ ! -e @EXTRA_SETUP_SCRIPT@ ]; then
echo "[WARN]: Extra setup script \"@EXTRA_SETUP_SCRIPT@\" requested, but could not be found. Skipping..."
else
echo "[INFO]: Sourcing extra setup from \"@EXTRA_SETUP_SCRIPT@\"."
. @EXTRA_SETUP_SCRIPT@
fi
fi
add_to_PATH "@CMAKE_INSTALL_PREFIX@/bin"
add_to_LD_LIBRARY_PATH "@CMAKE_INSTALL_PREFIX@/lib"
if [ ! "${ROOTSYS}" ]; then
echo "[INFO]: Sourcing ROOT from: @CMAKE_ROOTSYS@"
source "@CMAKE_ROOTSYS@/bin/thisroot.sh"
fi
if [ "@USE_T2K@" != "FALSE" ]; then
echo "[INFO]: Adding T2K paths to the environment."
export T2KREWEIGHT=@T2KREWEIGHT@
add_to_LD_LIBRARY_PATH "@T2KREWEIGHT@/lib"
fi
if [ "@USE_NIWG@" != "FALSE" ]; then
echo "[INFO]: Adding NIWG paths to the environment."
export NIWG=@NIWG_ROOT@
export NIWGREWEIGHT_INPUTS=@NIWG_ROOT@/inputs
add_to_LD_LIBRARY_PATH "@NIWG_ROOT@"
fi
if [ "@USE_NEUT@" != "FALSE" ]; then
echo "[INFO]: Adding NEUT library paths to the environment."
export NEUT_ROOT=@NEUT_ROOT@
export CERN=@CERN@
export CERN_LEVEL=@CERN_LEVEL@
add_to_LD_LIBRARY_PATH "${NEUT_LIB_DIR}" "${NEUT_ROOT}/src/reweight"
fi
if [ "@USE_NuWro@" != "FALSE" ]; then
if [ "@NUWRO_BUILT_FROM_FILE@" == "FALSE" ]; then
echo "[INFO]: Adding NuWro library paths to the environment."
export NUWRO="@NUWRO@"
add_to_PATH "@NUWRO@/bin"
add_to_LD_LIBRARY_PATH "@NUWRO@/build/@CMAKE_SYSTEM_NAME@/lib"
if [ "@NUWRO_INC@" ]; then
export NUWRO_INC=@NUWRO_INC@
fi
else
echo "[INFO]: NuWro support included from input event file."
fi
fi
if [ "@NEED_PYTHIA6@" != "FALSE" ]; then
echo "[INFO]: Adding PYTHIA6 library paths to the environment."
export PYTHIA6="@PYTHIA6@"
add_to_LD_LIBRARY_PATH "@PYTHIA6@"
fi
if [ "@USE_GENIE@" != "FALSE" ]; then
echo "[INFO]: Adding GENIE paths to the environment."
export GENIE="@GENIE@"
export LHAPDF_LIB="@LHAPDF_LIB@"
export LHAPDF_INC="@LHAPDF_INC@"
export LIBXML2_LIB="@LIBXML2_LIB@"
export LIBXML2_INC="@LIBXML2_INC@"
export LOG4CPP_LIB="@LOG4CPP_LIB@"
export LOG4CPP_INC="@LOG4CPP_INC@"
if [ "@LHAPATH@" ]; then
export LHAPATH="@LHAPATH@"
fi
add_to_PATH "@GENIE@/bin"
add_to_LD_LIBRARY_PATH "@GENIE@/lib" "@LHAPDF_LIB@" "@LIBXML2_LIB@" "@LOG4CPP_LIB@"
if [ "@GENIE_REWEIGHT@" ]; then
export GENIE_REWEIGHT="@GENIE_REWEIGHT@"
add_to_LD_LIBRARY_PATH "@GENIE_REWEIGHT@/lib"
fi
fi
if [ "@BUILD_GiBUU@" != "FALSE" ]; then
echo "[INFO]: Sourcing GiBUU tools."
source @CMAKE_BINARY_DIR@/GiBUUTools/src/GiBUUTools-build/Linux/setup.sh
fi
if [ "@USE_NOvARwgt@" != "FALSE" ]; then
export NOVARWGT=@NOVARWGT@
add_to_LD_LIBRARY_PATH @NOVARWGT@/lib
fi
if [ "@USE_HEPMCNUEVT@" == "TRUE" ]; then
add_to_LD_LIBRARY_PATH @HEPMC_LIBDIR@
add_to_LD_LIBRARY_PATH @HEPMCNUEVTTOOLSROOT@/lib
fi
export NUISANCE="@CMAKE_SOURCE_DIR@"
diff --git a/data/ANL/CC1pi0_on_n/ANL_CC1pi0_WNmu_per_0.04GeV.txt b/data/ANL/CC1pi0_on_n/ANL_CC1pi0_WNmu_per_0.04GeV.txt
new file mode 100644
index 0000000..0e5189f
--- /dev/null
+++ b/data/ANL/CC1pi0_on_n/ANL_CC1pi0_WNmu_per_0.04GeV.txt
@@ -0,0 +1,22 @@
+1 0
+1.04 3.8501848126140423
+1.08 12.489870397230145
+1.12 17.285547185701585
+1.16 24.223599868993585
+1.20 21.39329995789079
+1.24 26.251579095120007
+1.28 14.471950591868241
+1.32 14.471950591868241
+1.36 17.949328592148973
+1.40 16.379497496841807
+1.44 9.830533851120581
+1.48 10.403078650633976
+1.52 5.871286202217757
+1.56 0
+1.60 0.7145931783090766
+1.64 1.728442427361614
+1.68 0
+1.72 0
+1.76 0
+1.80 0.6793618116314946
+1.84 0
diff --git a/data/ANL/CC1pi0_on_n/ANL_CC1pi0_WNpi_per_0.03GeV.txt b/data/ANL/CC1pi0_on_n/ANL_CC1pi0_WNpi_per_0.03GeV.txt
new file mode 100644
index 0000000..b5df0d5
--- /dev/null
+++ b/data/ANL/CC1pi0_on_n/ANL_CC1pi0_WNpi_per_0.03GeV.txt
@@ -0,0 +1,26 @@
+1 0
+1.03 0
+1.06 0
+1.09 4.631980108288985
+1.12 22.3389491785374
+1.15 14.030534705923358
+1.18 24.531313178258547
+1.21 20.741849278460716
+1.24 20.128180698533683
+1.27 16.583180349963982
+1.30 17.557316478051728
+1.33 19.38623846815235
+1.36 5.459624009481093
+1.39 8.387609508981477
+1.42 2.1553691353147535
+1.45 3.2516440870959507
+1.48 6.302140217972251
+1.51 3.611925731415422
+1.54 1.53259126716706
+1.57 1.0408756070922287
+1.60 1.5264564404062
+1.63 1.0349266841726106
+1.66 3.596681616433898
+1.69 0
+1.72 0.41475146980224054
+1.75 0
diff --git a/data/ANL/CC1pi0_on_n/ANL_CC1pi0_Wmupi_per_0.04GeV.txt b/data/ANL/CC1pi0_on_n/ANL_CC1pi0_Wmupi_per_0.04GeV.txt
new file mode 100644
index 0000000..2ca20b1
--- /dev/null
+++ b/data/ANL/CC1pi0_on_n/ANL_CC1pi0_Wmupi_per_0.04GeV.txt
@@ -0,0 +1,21 @@
+0 0
+0.24 4.534883720930228
+0.28 12.500000000000002
+0.32 11.569767441860467
+0.36 15.000000000000002
+0.40 19.883720930232563
+0.44 25.000000000000007
+0.48 18.081395348837212
+0.52 17.616279069767447
+0.56 13.779069767441865
+0.60 18.197674418604656
+0.64 10.98837209302326
+0.68 7.79069767441861
+0.72 7.79069767441861
+0.76 5.872093023255815
+0.80 2.9069767441860463
+0.84 5.406976744186046
+0.88 0.9302325581395365
+0.92 0.9302325581395365
+0.96 0
+1.00 0
diff --git a/data/ANL/CC1pip_on_n/ANL_CC1npip_WNmu_per_0.04GeV.txt b/data/ANL/CC1pip_on_n/ANL_CC1npip_WNmu_per_0.04GeV.txt
new file mode 100644
index 0000000..0e5189f
--- /dev/null
+++ b/data/ANL/CC1pip_on_n/ANL_CC1npip_WNmu_per_0.04GeV.txt
@@ -0,0 +1,22 @@
+1 0
+1.04 3.8501848126140423
+1.08 12.489870397230145
+1.12 17.285547185701585
+1.16 24.223599868993585
+1.20 21.39329995789079
+1.24 26.251579095120007
+1.28 14.471950591868241
+1.32 14.471950591868241
+1.36 17.949328592148973
+1.40 16.379497496841807
+1.44 9.830533851120581
+1.48 10.403078650633976
+1.52 5.871286202217757
+1.56 0
+1.60 0.7145931783090766
+1.64 1.728442427361614
+1.68 0
+1.72 0
+1.76 0
+1.80 0.6793618116314946
+1.84 0
diff --git a/data/ANL/CC1pip_on_n/ANL_CC1npip_WNpi_per_0.02GeV.txt b/data/ANL/CC1pip_on_n/ANL_CC1npip_WNpi_per_0.02GeV.txt
new file mode 100644
index 0000000..4053207
--- /dev/null
+++ b/data/ANL/CC1pip_on_n/ANL_CC1npip_WNpi_per_0.02GeV.txt
@@ -0,0 +1,30 @@
+1 0
+1.02 0
+1.04 0
+1.06 0
+1.08 4.834829378202567
+1.10 6.840680306719484
+1.12 8.846531235236402
+1.14 13.68699349493041
+1.16 11.79543554893339
+1.18 13.801104771595744
+1.20 26.082603481484178
+1.22 14.978195297452487
+1.24 23.83453864883527
+1.26 10.95868008867246
+1.28 8.948649925500604
+1.30 9.773776211069524
+1.32 6.110404477232258
+1.34 8.94301704400916
+1.36 2.917287495003091
+1.38 3.978449685648876
+1.40 3.978449685648876
+1.42 0.9036232147399801
+1.44 5.507867863502565
+1.46 2.7893665733909963
+1.48 3.7322382527165026
+1.50 1.1318457680706508
+1.52 2.0748991532507226
+1.54 2.072718682995969
+1.56 1.362248791656068
+1.58 0
diff --git a/data/ANL/CC1pip_on_n/ANL_CC1npip_Wmupi_per_0.04GeV.txt b/data/ANL/CC1pip_on_n/ANL_CC1npip_Wmupi_per_0.04GeV.txt
new file mode 100644
index 0000000..9400a59
--- /dev/null
+++ b/data/ANL/CC1pip_on_n/ANL_CC1npip_Wmupi_per_0.04GeV.txt
@@ -0,0 +1,21 @@
+0.2 0
+0.24 9.863813229571985
+0.28 18.910505836575872
+0.32 28.83268482490272
+0.36 23.75486381322957
+0.40 9.45525291828794
+0.44 20.019455252918288
+0.48 12.2568093385214
+0.52 23.929961089494164
+0.56 13.48249027237354
+0.60 7.52918287937743
+0.64 5.6614785992217875
+0.68 10.330739299610894
+0.72 8.11284046692607
+0.76 3.9688715953307394
+0.80 3.2684824902723726
+0.84 0.8754863813229612
+0.88 1.6926070038910481
+0.92 0.7587548638132269
+0.96 0
+1.00 0
diff --git a/data/ANL/CC1pip_on_p/ANL_CC1ppip_WNmu_per_0.04GeV.txt b/data/ANL/CC1pip_on_p/ANL_CC1ppip_WNmu_per_0.04GeV.txt
new file mode 100644
index 0000000..281b1da
--- /dev/null
+++ b/data/ANL/CC1pip_on_p/ANL_CC1ppip_WNmu_per_0.04GeV.txt
@@ -0,0 +1,30 @@
+1 0
+1.04 9.560871650061287
+1.08 21.673468662866085
+1.12 37.87109950805407
+1.16 49.98582769460281
+1.20 64.14094162359922
+1.24 69.95719892730924
+1.28 60.11273909105441
+1.32 62.693590494965115
+1.36 61.1908288489886
+1.40 52.1974177278136
+1.44 49.16347878594138
+1.48 48.33942493828477
+1.52 33.902143605590794
+1.56 35.971655389205615
+1.60 31.233487843429785
+1.64 25.135773527270153
+1.68 18.184879322286747
+1.72 17.02253716234216
+1.76 13.816257303710003
+1.80 13.816257303710003
+1.84 8.764665139325515
+1.88 7.773243113644838
+1.92 3.8861242829488276
+1.96 5.447848402507674
+2.00 3.6032464880032506
+2.04 1.9281439252668093
+2.08 6.2132239330811245
+2.12 0
+2.16 4.567957802759864
diff --git a/data/ANL/CC1pip_on_p/ANL_CC1ppip_WNpi_per_0.02GeV.txt b/data/ANL/CC1pip_on_p/ANL_CC1ppip_WNpi_per_0.02GeV.txt
new file mode 100644
index 0000000..19c3a3d
--- /dev/null
+++ b/data/ANL/CC1pip_on_p/ANL_CC1ppip_WNpi_per_0.02GeV.txt
@@ -0,0 +1,31 @@
+1 0
+1.02 0
+1.04 0
+1.06 0
+1.08 0
+1.10 3.1853281853281885
+1.12 11.583011583011597
+1.14 22.007722007722037
+1.16 47.4903474903475
+1.18 74.13127413127414
+1.20 110.61776061776064
+1.22 122.7799227799228
+1.24 86.8725868725869
+1.26 58.49420849420851
+1.28 48.06949806949808
+1.30 28.95752895752898
+1.32 23.74517374517373
+1.34 14.478764478764475
+1.36 9.266409266409255
+1.38 8.976833976833973
+1.4 8.108108108108127
+1.42 2.3166023166023137
+1.44 2.3166023166023137
+1.46 0
+1.48 0.2895752895752821
+1.50 2.8957528957529064
+1.52 1.7374517374517495
+1.54 1
+1.56 0
+1.58 0
+1.60 0
diff --git a/data/ANL/CC1pip_on_p/ANL_CC1ppip_Wmupi_per_0.02GeV.txt b/data/ANL/CC1pip_on_p/ANL_CC1ppip_Wmupi_per_0.02GeV.txt
new file mode 100644
index 0000000..dda6b69
--- /dev/null
+++ b/data/ANL/CC1pip_on_p/ANL_CC1ppip_Wmupi_per_0.02GeV.txt
@@ -0,0 +1,65 @@
+0.2 0
+0.22 0
+0.24 10.569829934476914
+0.26 12.664254688108024
+0.28 17.775475647079844
+0.30 28.106982467580266
+0.32 34.146885287281364
+0.34 22.43781617778525
+0.36 45.41338437753073
+0.38 25.352488930490843
+0.40 34.87132024274039
+0.42 30.1220012410471
+0.44 48.45794638255802
+0.46 34.312743871015236
+0.48 42.323492601045416
+0.50 26.90222021224009
+0.52 25.284441686561983
+0.54 31.09233180130625
+0.56 25.183580315730794
+0.58 21.825075461974528
+0.60 19.975915272241565
+0.62 26.015187051040684
+0.64 23.934014156350898
+0.66 20.113377015386874
+0.68 22.789095613213995
+0.70 20.12725991523017
+0.72 17.93071170896394
+0.74 17.93071170896394
+0.76 17.93071170896394
+0.78 14.934739853388159
+0.80 8.909982015334293
+0.82 6.94544651402488
+0.84 10.08392843996171
+0.86 10.08392843996171
+0.88 13.807490455506361
+0.90 8.944058224040553
+0.92 8.944058224040553
+0.94 6.869826779272415
+0.96 3.9772404581356966
+0.98 5.955658859288391
+1.00 3.87511700550057
+1.02 2.7226259715400403
+1.04 3.656987200387036
+1.06 1.8071959697521152
+1.08 4.830302584112488
+1.10 1.8210788695953966
+1.12 1.8210788695953966
+1.14 0.3281412690232628
+1.16 0.683732817282106
+1.18 3.7049463089365844
+1.20 1.6244044551487633
+1.22 0.12389436375300988
+1.24 0.12389436375300988
+1.26 0.12389436375300988
+1.28 2.58022107466266
+1.30 0.3836728683964168
+1.32 2.8261166794627712
+1.34 0.9775875306317658
+1.36 0.9775875306317658
+1.38 0.9775875306317658
+1.40 0.9775875306317658
+1.42 0.9775875306317658
+1.44 0
+1.48 0
+1.50 0
diff --git a/data/BNL/CC1pi0_on_n/BNL_CC1pi0_WNmu_per_0.05GeV.txt b/data/BNL/CC1pi0_on_n/BNL_CC1pi0_WNmu_per_0.05GeV.txt
new file mode 100644
index 0000000..b73bc62
--- /dev/null
+++ b/data/BNL/CC1pi0_on_n/BNL_CC1pi0_WNmu_per_0.05GeV.txt
@@ -0,0 +1,41 @@
+1.00 0
+1.05 24.302197673602166
+1.10 49.37182577761135
+1.15 57.80373066211061
+1.20 59.507103236829174
+1.25 50.515599035738525
+1.30 41.52339270250661
+1.35 48.305989187165025
+1.40 41.03119807147705
+1.45 46.82378823694619
+1.50 45.486226507828775
+1.55 33.19470124277389
+1.60 38.91918459053994
+1.65 30.915580312214757
+1.70 35.586865448077326
+1.75 25.6713553490767
+1.80 21.629180611791135
+1.85 25.641163667002132
+1.90 23.44629859339527
+1.95 16.36950874154516
+2.00 12.853230978070066
+2.05 12.108970908324949
+2.10 6.088889929084651
+2.15 9.373464085940967
+2.20 7.444707093875067
+2.25 11.653287148641368
+2.30 6.289699721487587
+2.35 4.622838018115004
+2.40 5.3333957450792155
+2.45 3.4088515458609265
+2.50 4.511901139794503
+2.55 3.1729351463945505
+2.60 2.2341844735179137
+2.65 2.2341844735179137
+2.70 1.1486881831160503
+2.75 1.1486881831160503
+2.80 0.5224822593257556
+2.85 3.2177175374216205
+2.90 0.8155292036538597
+2.95 1.4572100501688396
+3.00 0
diff --git a/data/BNL/CC1pi0_on_n/BNL_CC1pi0_WNpi_per_0.05GeV.txt b/data/BNL/CC1pi0_on_n/BNL_CC1pi0_WNpi_per_0.05GeV.txt
new file mode 100644
index 0000000..7145fe9
--- /dev/null
+++ b/data/BNL/CC1pi0_on_n/BNL_CC1pi0_WNpi_per_0.05GeV.txt
@@ -0,0 +1,41 @@
+1.00 0
+1.05 5.2226268322379354
+1.10 38.085751938459666
+1.15 80.39334780270758
+1.20 101.34682198490468
+1.25 85.74887370130867
+1.30 73.02622597299113
+1.35 57.84062699383427
+1.40 59.080461051100684
+1.45 41.01733260150621
+1.50 54.988730047726655
+1.55 24.60805919998664
+1.60 20.09784937548585
+1.65 27.91019700823864
+1.70 17.239822912690613
+1.75 19.712804281746045
+1.80 19.712804281746045
+1.85 9.8721438541844
+1.90 21.173022325371477
+1.95 12.763604044366573
+2.00 6.200006129516709
+2.05 7.235615835327778
+2.10 4.368673711896022
+2.15 4.993605799637265
+2.20 6.233439856903658
+2.25 5.215661472365653
+2.30 2.3476048913543366
+2.35 3.7938922152352177
+2.40 0.5168297025234523
+2.45 1.756663759789845
+2.50 5.460563525475138
+2.55 3.622544362377056
+2.60 0.9603838191904401
+2.65 1.7895402583870208
+2.70 0.15463098916471552
+2.75 1.3955795040106835
+2.80 0
+2.85 1.8235312145637579
+2.90 0
+2.95 1.4290132313976471
+3.00 0
diff --git a/data/BNL/CC1pi0_on_n/BNL_CC1pi0_Wmupi_per_0.05GeV.txt b/data/BNL/CC1pi0_on_n/BNL_CC1pi0_Wmupi_per_0.05GeV.txt
new file mode 100644
index 0000000..08c84cd
--- /dev/null
+++ b/data/BNL/CC1pi0_on_n/BNL_CC1pi0_Wmupi_per_0.05GeV.txt
@@ -0,0 +1,51 @@
+0 0
+0.05 0
+0.10 0
+0.15 0
+0.20 0
+0.25 21.876805757734743
+0.30 29.02128854438378
+0.35 26.32057695576033
+0.40 41.54014970701466
+0.45 38.60911395024054
+0.50 43.36766890069535
+0.55 59.66504348597145
+0.60 52.27427566485138
+0.65 56.95546474939225
+0.70 45.71458128588425
+0.75 39.62972267994769
+0.80 34.62089247844176
+0.85 31.53556834723753
+0.90 33.14118716332549
+0.95 37.899298756382514
+1.00 24.27736438805597
+1.05 24.27736438805597
+1.10 17.797696019389505
+1.15 16.942237920358245
+1.20 11.932521004056738
+1.25 13.848046641198259
+1.30 18.33453794527619
+1.35 7.7872999483737715
+1.40 5.237480640165195
+1.45 8.841507485802786
+1.50 8.841507485802786
+1.55 8.841507485802786
+1.60 8.841507485802786
+1.65 3.7207021166752483
+1.70 4.865771812080531
+1.75 2.084150748580285
+1.80 2.084150748580285
+1.85 5.447599380485286
+1.90 1.8213732576148587
+1.95 1.8213732576148587
+2.00 4.492514197212159
+2.05 2.3278265358802273
+2.10 1.47237996902426
+2.15 0
+2.20 3.0665978316984948
+2.25 0
+2.30 5.6608156943727295
+2.35 3.1115126484253963
+2.40 2.562725864739285
+2.45 2.009808982963328
+2.50 0
diff --git a/data/BNL/CC1pip_on_n/BNL_CC1npip_WNmu_per_0.05GeV.txt b/data/BNL/CC1pip_on_n/BNL_CC1npip_WNmu_per_0.05GeV.txt
new file mode 100644
index 0000000..ba083b4
--- /dev/null
+++ b/data/BNL/CC1pip_on_n/BNL_CC1npip_WNmu_per_0.05GeV.txt
@@ -0,0 +1,41 @@
+1.00 0
+1.05 13.845619662536016
+1.10 41.320756276816496
+1.15 42.73145889997602
+1.20 49.604087267797055
+1.25 52.21153925645456
+1.30 42.90903679698415
+1.35 53.083886541943265
+1.40 40.55984986896604
+1.45 43.31875563198055
+1.50 33.714999049280316
+1.55 41.48973636130653
+1.60 32.411107712403144
+1.65 27.603442431858188
+1.70 29.910467010028018
+1.75 26.749778854341457
+1.80 26.959598548292416
+1.85 16.75829399558534
+1.90 22.133745587420734
+1.95 14.930101437653413
+2.00 14.163738725704967
+2.05 16.699597390894574
+2.10 12.338026305999442
+2.15 7.527880887228115
+2.20 10.73453427137671
+2.25 10.323554895407852
+2.30 5.898584808350876
+2.35 2.9655485414861644
+2.40 3.5496142261831096
+2.45 6.750340388661968
+2.50 1.4282295663654807
+2.55 4.479432272971081
+2.60 3.268391302553951
+2.65 4.971407352395104
+2.70 1.5166893592441326
+2.75 3.1482444196889148
+2.80 2.310186904319842
+2.85 0.8000990221562176
+2.90 2.6526385278706144
+2.95 0.767091636753733
+3.00 0
diff --git a/data/BNL/CC1pip_on_n/BNL_CC1npip_WNpi_per_0.05GeV.txt b/data/BNL/CC1pip_on_n/BNL_CC1npip_WNpi_per_0.05GeV.txt
new file mode 100644
index 0000000..aea69cd
--- /dev/null
+++ b/data/BNL/CC1pip_on_n/BNL_CC1npip_WNpi_per_0.05GeV.txt
@@ -0,0 +1,41 @@
+1.00 0
+1.05 8.840769678562665
+1.10 47.021831847648905
+1.15 82.20052985692276
+1.20 96.57525512729605
+1.25 72.55760907013688
+1.30 74.06306802206561
+1.35 59.69784691174236
+1.40 45.760946614341606
+1.45 57.77578894428623
+1.50 59.066453879083696
+1.55 39.55409649098563
+1.60 23.47274088095746
+1.65 26.479223510124868
+1.70 18.76311277082017
+1.75 14.477370198915324
+1.80 11.478807703122953
+1.85 8.265767995534318
+1.90 5.696476728669452
+1.95 5.696476728669452
+2.00 8.063962997138162
+2.05 4.422602476627063
+2.10 4.422602476627063
+2.15 5.073954245390837
+2.20 4.220480672895903
+2.25 0.3649597459235565
+2.30 2.728010739702256
+2.35 1.6600599554110573
+2.40 1.450651628974839
+2.45 2.740682953102322
+2.50 1.0293005334223864
+2.55 0
+2.60 0
+2.65 1.2577171799587177
+2.70 2.333904902959972
+2.75 0.1932512543525604
+2.80 1.9131874180775128
+2.85 0
+2.90 0
+2.95 0
+3.00 0
diff --git a/data/BNL/CC1pip_on_n/BNL_CC1npip_Wmupi_per_0.05GeV.txt b/data/BNL/CC1pip_on_n/BNL_CC1npip_Wmupi_per_0.05GeV.txt
new file mode 100644
index 0000000..4b09e49
--- /dev/null
+++ b/data/BNL/CC1pip_on_n/BNL_CC1npip_Wmupi_per_0.05GeV.txt
@@ -0,0 +1,51 @@
+0 0
+0.05 0
+0.10 0
+0.15 0
+0.20 2.6600624595998426
+0.25 31.24132613723978
+0.30 40.9999766360599
+0.35 35.914737194613835
+0.40 48.2701079154433
+0.45 51.090706603428266
+0.50 35.454415654878254
+0.55 35.454415654878254
+0.60 40.61358898675783
+0.65 42.10628515948484
+0.70 44.321082840743586
+0.75 39.18236593641374
+0.80 27.523552149612282
+0.85 27.523552149612282
+0.90 31.83996220233691
+0.95 25.671258978891974
+1.00 37.96318362239718
+1.05 30.34840826668119
+1.10 27.196872347219294
+1.15 19.82155141754216
+1.20 14.197695277109297
+1.25 17.319325353249774
+1.30 15.55477675755239
+1.35 7.395777357226862
+1.40 8.28516467683776
+1.45 4.1092497838835484
+1.50 2.8883021943931553
+1.55 4.019636093653048
+1.60 5.272877840341202
+1.65 1.43145409375171084
+1.70 3.5555763235022866
+1.75 6.580275775035439
+1.80 0
+1.85 1.1989386902237484
+1.90 4.553184446536271
+1.95 1.9553029284288428
+2.00 0.8566507711564029
+2.05 0
+2.10 1.9739223981877032
+2.15 2.5039049165744487
+2.20 0.5046910719642739
+2.25 0
+2.30 0
+2.35 1.486299173502431
+2.40 2.316468921001743
+2.45 0.4994155555325861
+2.50 0
diff --git a/data/BNL/CC1pip_on_p/BNL_CC1ppip_WNmu_per_0.05GeV.txt b/data/BNL/CC1pip_on_p/BNL_CC1ppip_WNmu_per_0.05GeV.txt
new file mode 100644
index 0000000..5045666
--- /dev/null
+++ b/data/BNL/CC1pip_on_p/BNL_CC1ppip_WNmu_per_0.05GeV.txt
@@ -0,0 +1,41 @@
+1.00 0
+1.05 7.54271628670304
+1.10 18.375726785763945
+1.15 39.31582018703142
+1.20 67.09084638155907
+1.25 82.97707141094108
+1.30 80.58728049312734
+1.35 89.64314962019981
+1.40 87.25270486082167
+1.45 108.78844792724054
+1.50 104.4657378847245
+1.55 106.3881955443967
+1.60 84.67836716446127
+1.65 78.57393885600612
+1.70 73.51091670221936
+1.75 68.44527918217503
+1.80 58.776760509277224
+1.85 52.67298604538644
+1.90 40.3253515624322
+1.95 44.92104045808145
+2.00 37.33141103913408
+2.05 33.1579403336881
+2.10 19.029241429363083
+2.15 14.413283445222007
+2.20 22.423823371239862
+2.25 22.423823371239862
+2.30 17.943374051316823
+2.35 16.148578957090066
+2.40 13.90671969321761
+2.45 6.317744115834657
+2.50 12.69580511598339
+2.55 14.465100389199264
+2.60 5.241684361254073
+2.65 7.0109796344699475
+2.70 5.512047848125761
+2.75 5.512047848125761
+2.80 4.894821411349781
+2.85 4.894821411349781
+2.90 3.5340136554811465
+2.95 3.5340136554811465
+3.00 0
diff --git a/data/BNL/CC1pip_on_p/BNL_CC1ppip_WNpi_per_0.05GeV.txt b/data/BNL/CC1pip_on_p/BNL_CC1ppip_WNpi_per_0.05GeV.txt
new file mode 100644
index 0000000..f0ce7aa
--- /dev/null
+++ b/data/BNL/CC1pip_on_p/BNL_CC1ppip_WNpi_per_0.05GeV.txt
@@ -0,0 +1,23 @@
+1.00 0
+1.05 4.487848713509834
+1.10 93.23386766396652
+1.15 313.7212406337963
+1.20 569.4176104452168
+1.25 285.1290454731668
+1.30 137.79122781514718
+1.35 72.62227273327971
+1.40 47.89549497165376
+1.45 30.98280715201338
+1.50 21.915925519683924
+1.55 8.92415852836632
+1.60 14.189055252342428
+1.65 6.418575147678894
+1.70 0
+1.75 5.213357825322873
+1.80 5.213357825322873
+1.85 5.213357825322873
+1.90 0
+1.95 0
+2.00 0
+2.05 4.23015422024298
+2.10 0
diff --git a/data/BNL/CC1pip_on_p/BNL_CC1ppip_Wmupi_per_0.05GeV.txt b/data/BNL/CC1pip_on_p/BNL_CC1ppip_Wmupi_per_0.05GeV.txt
new file mode 100644
index 0000000..2afb8a6
--- /dev/null
+++ b/data/BNL/CC1pip_on_p/BNL_CC1ppip_Wmupi_per_0.05GeV.txt
@@ -0,0 +1,51 @@
+0 0
+0.05 0
+0.10 0
+0.15 0
+0.20 0
+0.25 26.98939274453741
+0.30 58.469136455153006
+0.35 98.09192758929083
+0.40 92.09147821643032
+0.45 119.27060616874391
+0.50 104.8234155568185
+0.55 100.82032575126772
+0.60 93.13017568129186
+0.65 106.32910834732117
+0.70 102.63499909684867
+0.75 97.248986341121
+0.80 81.87925968024037
+0.85 85.09712181088452
+0.90 68.49808135411021
+0.95 48.366030348821994
+1.00 48.366030348821994
+1.05 39.591364404676426
+1.10 34.972956858736836
+1.15 20.371716530900244
+1.20 22.512992896678
+1.25 18.663071683782448
+1.30 14.1987138537541
+1.35 14.1987138537541
+1.40 15.716742369839722
+1.45 6.182401325209355
+1.50 6.182401325209355
+1.55 12.615922778357884
+1.60 6.461864251214081
+1.65 4.4543717664612075
+1.70 4.4543717664612075
+1.75 2.9962711377863513
+1.80 4.214229431941703
+1.85 3.595291029933435
+1.90 3.595291029933435
+1.95 3.595291029933435
+2.00 0
+2.05 4.642184474693266
+2.10 0
+2.15 2.336616958267797
+2.20 0
+2.25 2.9359297696775855
+2.30 1.401325752582892
+2.35 1.401325752582892
+2.40 0
+2.45 0
+2.50 0
diff --git a/data/BNL/CCmultipi/BNL_CC1pim1pip1p_Wpimpip_per_0.05GeV.txt b/data/BNL/CCmultipi/BNL_CC1pim1pip1p_Wpimpip_per_0.05GeV.txt
new file mode 100644
index 0000000..8f6718a
--- /dev/null
+++ b/data/BNL/CCmultipi/BNL_CC1pim1pip1p_Wpimpip_per_0.05GeV.txt
@@ -0,0 +1,52 @@
+0.0 0.0
+0.05 0.0
+0.10 0.0
+0.15 0.0
+0.20 0.0
+0.25 1.871680373359517
+0.30 20.676600588767982
+0.35 33.83922716394946
+0.40 40.85379874581631
+0.45 23.63667848555474
+0.50 32.67645297095052
+0.55 30.649206128410466
+0.60 12.853196919329704
+0.65 13.719713507881941
+0.70 5.833401937767739
+0.75 11.690876934999892
+0.80 5.61265652456558
+0.85 3.802521425874559
+0.90 6.7668007528508625
+0.95 2.6416776197194594
+1.00 4.810069806194839
+1.05 3.795594743670172
+1.10 0.0
+1.15 1
+1.20 1
+1.25 2.631117268161951
+1.30 0.0
+1.35 1
+1.40 0.0
+1.45 2.6237363772884237
+1.50 0.0
+1.55 1
+1.60 1
+1.65 0.0
+1.70 1
+1.75 0.0
+1.80 0.0
+1.85 0.0
+1.90 1
+1.95 0.0
+2.00 0.0
+2.05 0.0
+2.10 0.0
+2.15 0.0
+2.20 1
+2.25 1
+2.30 1
+2.35 0
+2.40 0
+2.45 0
+2.50 0
+
diff --git a/data/BNL/CCmultipi/BNL_CC1pim1pip1p_Wppip_per_0.05GeV.txt b/data/BNL/CCmultipi/BNL_CC1pim1pip1p_Wppip_per_0.05GeV.txt
new file mode 100644
index 0000000..836a14f
--- /dev/null
+++ b/data/BNL/CCmultipi/BNL_CC1pim1pip1p_Wppip_per_0.05GeV.txt
@@ -0,0 +1,61 @@
+0.05 0.0
+0.10 0.0
+0.15 0.0
+0.20 0.0
+0.25 0.0
+0.30 0.0
+0.35 0.0
+0.40 0.0
+0.45 0.0
+0.50 0.0
+0.55 0.0
+0.60 0.0
+0.65 0.0
+0.70 0.0
+0.75 0.0
+0.80 0.0
+0.85 0.0
+0.90 0.0
+0.95 0.0
+1.00 0.0
+1.05 2.4652320992294534
+1.10 29.92811501597445
+1.15 44.75404059387334
+1.20 58.671537305017864
+1.25 32.318643112196966
+1.30 25.14494455929337
+1.35 12.882211990227404
+1.40 17.618163878970122
+1.45 5.8092933659086725
+1.50 6.545057320052628
+1.55 8.646635970682212
+1.60 4.927645179477551
+1.65 3.7549332832174542
+1.70 2
+1.75 1
+1.80 4.417402743845159
+1.85 1
+1.90 1
+2.00 2
+2.05 1
+2.10 0
+2.15 0
+2.25 2
+2.30 0
+2.35 0
+2.40 0
+2.45 0
+2.50 0
+2.55 1
+2.60 0
+2.65 0
+2.70 1
+2.75 0
+2.80 0
+2.85 0
+2.90 0
+2.95 1
+3.00 0
+3.05 0
+3.10 1
+3.15 0
diff --git a/data/BNL/CCmultipi/BNL_CC1pim1pip1p_xsec.txt b/data/BNL/CCmultipi/BNL_CC1pim1pip1p_xsec.txt
new file mode 100644
index 0000000..633aa22
--- /dev/null
+++ b/data/BNL/CCmultipi/BNL_CC1pim1pip1p_xsec.txt
@@ -0,0 +1,11 @@
+1.0 0.019582245 0.032637076
+1.2 0.084856397 0.026109661
+1.4 0.045691906 0.045691906
+1.6 0.104438642 0.032637076
+1.8 0.124020888 0.039164491
+2.0 0.22845953 0.052219321
+2.4 0.306788512 0.084856397
+3.0 0.587467363 0.130548303
+4.0 0.633159269 0.156657963
+6.0 0.809399478 0.182767624
+15.0 0 0
diff --git a/data/BNL/CCmultipi/BNL_CC1pim2pip1p_Wpippim_per_0.05GeV.txt b/data/BNL/CCmultipi/BNL_CC1pim2pip1p_Wpippim_per_0.05GeV.txt
new file mode 100644
index 0000000..7ffe314
--- /dev/null
+++ b/data/BNL/CCmultipi/BNL_CC1pim2pip1p_Wpippim_per_0.05GeV.txt
@@ -0,0 +1,41 @@
+0.00 0.0
+0.05 0.0
+0.10 0.0
+0.15 0.0
+0.20 0.0
+0.25 1
+0.30 7.925742764778324
+0.35 11.804283405172413
+0.40 9.001789562807883
+0.45 5.940675030788176
+0.50 13.913754618226601
+0.55 5.938943195812808
+0.60 6.843153479064041
+0.65 10.893915486453203
+0.70 5.979256465517242
+0.75 6.840363300492612
+0.80 3.908559113300491
+0.85 3.0457204433497544
+0.90 3.9069234913793096
+0.95 1.9664024014778327
+1.00 1
+1.05 0
+1.10 1
+1.15 1
+1.20 0
+1.25 1
+1.30 1
+1.35 1
+1.40 1
+1.45 0.0
+1.50 0.0
+1.55 0.0
+1.60 0.0
+1.65 0.0
+1.70 0.0
+1.75 0.0
+1.80 0.0
+1.85 1
+1.90 0.0
+1.95 0.0
+2.00 0.0
diff --git a/data/BNL/CCmultipi/BNL_CC1pip1pim1p_1DQ2_per_0.1GeV.txt b/data/BNL/CCmultipi/BNL_CC1pip1pim1p_1DQ2_per_0.1GeV.txt
new file mode 100644
index 0000000..2fd8b7d
--- /dev/null
+++ b/data/BNL/CCmultipi/BNL_CC1pip1pim1p_1DQ2_per_0.1GeV.txt
@@ -0,0 +1,51 @@
+0.0 11.094812263557213
+0.1 13.971823972446423
+0.2 18.063918224509138
+0.3 26.771444972370343
+0.4 19.022276628559183
+0.5 18.032795955488243
+0.6 21.844582304569442
+0.7 17.032733710950204
+0.8 13.059319044753824
+0.9 13.059319044753824
+1.0 11.080980143992367
+1.1 11.080980143992367
+1.2 8.029268764999209
+1.3 10.024344530434124
+1.4 7.169671694642133
+1.5 6.086340090323745
+1.6 6.086340090323745
+1.7 4.153992987115384
+1.8 6.054595375922435
+1.9 3.155175633338178
+2.0 2.1178358265728896
+2.1 2.1178358265728896
+2.2 1.1177735820348467
+2.3 2.9263923757356984
+2.4 0
+2.5 0
+2.6 0
+2.7 1.999017919510898
+2.8 1.999017919510898
+2.9 1.0928066062203072
+3.0 1.0928066062203072
+3.1 1.0928066062203072
+3.2 1.9939691958697345
+3.3 1.9939691958697345
+3.4 0
+3.5 0
+3.6 1.020602942091834
+3.7 0
+3.8 0
+3.9 1.0820867135575547
+4.0 1.0820867135575547
+4.1 0
+4.2 1.050964444536664
+4.3 0
+4.4 0
+4.5 0
+4.6 0
+4.7 0
+4.8 0
+4.9 0
+5.0 0
diff --git a/data/BNL/CCmultipi/BNL_CC2pim2pip1p_xsec.txt b/data/BNL/CCmultipi/BNL_CC2pim2pip1p_xsec.txt
new file mode 100644
index 0000000..85984d2
--- /dev/null
+++ b/data/BNL/CCmultipi/BNL_CC2pim2pip1p_xsec.txt
@@ -0,0 +1,5 @@
+4.0 0.065274151 0.045691906
+5.0 0.104438642 0.071801567
+6.0 0.150130548 0.071801567
+8.0 0.182767624 0.084856397
+15.0 0 0
diff --git a/data/BNL/CCmultipi/BNL_CC2pip1pim1p_1DQ2_per_0.1GeV.txt b/data/BNL/CCmultipi/BNL_CC2pip1pim1p_1DQ2_per_0.1GeV.txt
new file mode 100644
index 0000000..fe3dbad
--- /dev/null
+++ b/data/BNL/CCmultipi/BNL_CC2pip1pim1p_1DQ2_per_0.1GeV.txt
@@ -0,0 +1,9 @@
+0.0 1.4888099733036153
+0.2 4.51536497534119
+0.6 2.2453905073976435
+1.0 1.2461972205819976
+1.4 0.9911095217105643
+2.2 0.624379371429046
+3.0 0.09956670353706265
+4.0 0.09021881055546732
+5.0 0.0
diff --git a/data/BNL/CCmultipi/BNL_CC2pip1pim1p_xsec.txt b/data/BNL/CCmultipi/BNL_CC2pip1pim1p_xsec.txt
new file mode 100644
index 0000000..ca1ef6d
--- /dev/null
+++ b/data/BNL/CCmultipi/BNL_CC2pip1pim1p_xsec.txt
@@ -0,0 +1,6 @@
+1.5 0.019582245 0.01305483
+2.0 0.019582245 0.026109661
+3.0 0.274151436 0.071801567
+4.0 0.195822454 0.078328982
+6.0 0.274151436 0.097911227
+15.0 0 0
diff --git a/data/MINERvA/CC1pi0/2017_nu/data/XSec_Table_Enu_xsec.csv b/data/MINERvA/CC1pi0/2017_nu/data/XSec_Table_Enu_xsec.csv
index 929d2a9..a894ccd 100755
--- a/data/MINERvA/CC1pi0/2017_nu/data/XSec_Table_Enu_xsec.csv
+++ b/data/MINERvA/CC1pi0/2017_nu/data/XSec_Table_Enu_xsec.csv
@@ -1,12 +1,11 @@
-0.00 0.00 0
1.50 11.80 19
3.00 15.47 11
3.50 15.47 13
4.00 15.96 19
5.00 20.77 18
6.00 21.96 20
8.00 31.90 18
10.00 33.46 20
12.00 25.30 23
15.00 25.59 31
20.00 0.00 0.00
diff --git a/data/MINERvA/CC1pip/070717/cc1pip_updated_1DEnu_ratecov.txt b/data/MINERvA/CC1pip/070717/cc1pip_updated_1DEnu_ratecov.txt
index f22130e..4806b26 100644
--- a/data/MINERvA/CC1pip/070717/cc1pip_updated_1DEnu_ratecov.txt
+++ b/data/MINERvA/CC1pip/070717/cc1pip_updated_1DEnu_ratecov.txt
@@ -1,8 +1,8 @@
-.0000 0.5408 0.4099 0.2066 0.1154 0.2021 0.2040 0.1936
+1.0000 0.5408 0.4099 0.2066 0.1154 0.2021 0.2040 0.1936
0.5408 1.0000 0.9010 0.7637 0.6321 0.6400 0.6705 0.5944
0.4099 0.9010 1.0000 0.8451 0.7414 0.7061 0.7173 0.6315
0.2066 0.7637 0.8451 1.0000 0.8775 0.7643 0.7365 0.6491
0.1154 0.6321 0.7414 0.8775 1.0000 0.7774 0.7091 0.6295
0.2021 0.6400 0.7061 0.7643 0.7774 1.0000 0.7719 0.7003
0.2040 0.6705 0.7173 0.7365 0.7091 0.7719 1.0000 0.7850
0.1936 0.5944 0.6315 0.6491 0.6295 0.7003 0.7850 1.0000
diff --git a/data/MINERvA/CCQE/20deg_Q2QE_joint_covar_fluxfix.txt b/data/MINERvA/CCQE/20deg_Q2QE_joint_covar_fluxfix.txt
index e1d4bbc..33f0622 100755
--- a/data/MINERvA/CCQE/20deg_Q2QE_joint_covar_fluxfix.txt
+++ b/data/MINERvA/CCQE/20deg_Q2QE_joint_covar_fluxfix.txt
@@ -1,17 +1,16 @@
-1.00000 0.84420 0.87998 0.86569 0.78476 0.62381 0.24728 0.19878 0.62528 0.63894 0.66536 0.65954 0.61511 0.45521 0.23740 0.16111
-0.84420 1.00000 0.88323 0.87029 0.77574 0.59187 0.22371 0.17721 0.62191 0.64260 0.66813 0.67050 0.61030 0.42813 0.19379 0.11603
-0.87998 0.88323 1.00000 0.91996 0.84521 0.64905 0.22549 0.22917 0.62295 0.64287 0.68272 0.67722 0.62627 0.43831 0.20208 0.12285
-0.86569 0.87029 0.91996 1.00000 0.91825 0.77865 0.31484 0.34392 0.58506 0.61811 0.65356 0.66573 0.65684 0.53413 0.28701 0.22623
-0.78476 0.77574 0.84521 0.91825 1.00000 0.88165 0.43137 0.51379 0.50559 0.53918 0.58565 0.59417 0.64211 0.57702 0.38284 0.33938
-0.62381 0.59187 0.64905 0.77865 0.88165 1.00000 0.57473 0.60981 0.36100 0.39675 0.43615 0.46291 0.58124 0.68305 0.53204 0.52863
-0.24728 0.22371 0.22549 0.31484 0.43137 0.57473 1.00000 0.63099 0.14081 0.15678 0.16848 0.18330 0.29378 0.42692 0.36427 0.38416
-0.19878 0.17721 0.22917 0.34392 0.51379 0.60981 0.63099 1.00000 0.05727 0.06556 0.07932 0.09301 0.18312 0.31164 0.21226 0.25193
-0.62528 0.62191 0.62295 0.58506 0.50559 0.36100 0.14081 0.05727 1.00000 0.86268 0.87173 0.85717 0.78925 0.61255 0.33485 0.26221
-0.63894 0.64260 0.64287 0.61811 0.53918 0.39675 0.15678 0.06556 0.86268 1.00000 0.89943 0.90673 0.84935 0.65496 0.37352 0.28123
-0.66536 0.66813 0.68272 0.65356 0.58565 0.43615 0.16848 0.07932 0.87173 0.89943 1.00000 0.94091 0.89597 0.67705 0.37483 0.28261
-0.65954 0.67050 0.67722 0.66573 0.59417 0.46291 0.18330 0.09301 0.85717 0.90673 0.94091 1.00000 0.92754 0.72891 0.40198 0.30629
-0.61511 0.61030 0.62627 0.65684 0.64211 0.58124 0.29378 0.18312 0.78925 0.84935 0.89597 0.92754 1.00000 0.85614 0.57853 0.49184
-0.45521 0.42813 0.43831 0.53413 0.57702 0.68305 0.42692 0.31164 0.61255 0.65496 0.67705 0.72891 0.85614 1.00000 0.75302 0.72746
-0.23740 0.19379 0.20208 0.28701 0.38284 0.53204 0.36427 0.21226 0.33485 0.37352 0.37483 0.40198 0.57853 0.75302 1.00000 0.89935
-0.16111 0.11603 0.12285 0.22623 0.33938 0.52863 0.38416 0.25193 0.26221 0.28123 0.28261 0.30629 0.49184 0.72746 0.89935 1.00000
-
+0.0104330415 0.0123973932 0.0136821977 0.0145256938 0.0093296793 0.0038321515 0.0011020691 0.0002068501 0.005954586 0.0077288382 0.0083716276 0.0070462335 0.0045217793 0.0013718926 0.0002005103 2.25116407182462E-05
+0.0123973932 0.0197946034 0.0194451167 0.0211650108 0.0138295061 0.0056439648 0.0016932865 0.0003055851 0.0083811596 0.0110001001 0.0119000238 0.0102538831 0.0066422217 0.00207681 0.0003075105 3.54972686147115E-05
+0.0136821977 0.0194451167 0.0236124756 0.0239874199 0.0159335811 0.0063721548 0.0018558897 0.0003353919 0.0095323586 0.0124914023 0.0138027359 0.0118413511 0.0078797005 0.0024935518 0.0003609393 4.69047034559794E-05
+0.0145256938 0.0211650108 0.0239874199 0.0275253392 0.0178093493 0.0074068432 0.0021489042 0.0003924658 0.0102018705 0.0135346504 0.014782482 0.0130231318 0.0086314562 0.0028574231 0.0004239705 5.93808778550909E-05
+0.0093296793 0.0138295061 0.0159335811 0.0178093493 0.0133935568 0.0060686071 0.002157357 0.0004396139 0.0066370249 0.0085935315 0.0095359336 0.0089630315 0.0065067148 0.0025027539 0.0004739872 8.15538973159876E-05
+0.0038321515 0.0056439648 0.0063721548 0.0074068432 0.0060686071 0.003751363 0.0014861092 0.0003441108 0.0025994055 0.0031904082 0.0035320515 0.003857352 0.0030944625 0.0015565296 0.0003645399 7.34537131351162E-05
+0.0011020691 0.0016932865 0.0018558897 0.0021489042 0.002157357 0.0014861092 0.0010382349 0.0002238065 0.0007131731 0.0007597266 0.0008567063 0.0010904073 0.0010801037 0.0006378265 0.0001636324 2.63202251320494E-05
+0.0002068501 0.0003055851 0.0003353919 0.0003924658 0.0004396139 0.0003441108 0.0002238065 5.96477613712978E-05 0.00011601 0.0001090294 0.0001248346 0.0002060168 0.0002295017 0.0001519003 4.13628947849761E-05 7.48774138864445E-06
+0.005954586 0.0083811596 0.0095323586 0.0102018705 0.0066370249 0.0025994055 0.0007131731 0.00011601 0.0086924164 0.009576327 0.0107942985 0.0095165412 0.006406317 0.0021638723 0.0003214171 0.000071321
+0.0077288382 0.0110001001 0.0124914023 0.0135346504 0.0085935315 0.0031904082 0.0007597266 0.0001090294 0.009576327 0.0148034156 0.0141385691 0.0124850967 0.0082641634 0.0026792725 0.0003794611 8.29713822752219E-05
+0.0083716276 0.0119000238 0.0138027359 0.014782482 0.0095359336 0.0035320515 0.0008567063 0.0001248346 0.0107942985 0.0141385691 0.017310168 0.0142714315 0.0097368805 0.0031771683 0.0004135937 0.0001160307
+0.0070462335 0.0102538831 0.0118413511 0.0130231318 0.0089630315 0.003857352 0.0010904073 0.0002060168 0.0095165412 0.0124850967 0.0142714315 0.013902582 0.0094800441 0.0034158607 0.0005175328 0.0001560553
+0.0045217793 0.0066422217 0.0078797005 0.0086314562 0.0065067148 0.0030944625 0.0010801037 0.0002295017 0.006406317 0.0082641634 0.0097368805 0.0094800441 0.0076666751 0.0028721732 0.0005265683 0.0001731238
+0.0013718926 0.00207681 0.0024935518 0.0028574231 0.0025027539 0.0015565296 0.0006378265 0.0001519003 0.0021638723 0.0026792725 0.0031771683 0.0034158607 0.0028721732 0.0013842745 0.0002981118 8.7312417134487E-05
+0.0002005103 0.0003075105 0.0003609393 0.0004239705 0.0004739872 0.0003645399 0.0001636324 4.13628947849761E-05 0.0003214171 0.0003794611 0.0004135937 0.0005175328 0.0005265683 0.0002981118 0.0001943598 0.000033853
+2.25116407182462E-05 3.54972686147115E-05 4.69047034559794E-05 5.93808778550909E-05 8.15538973159876E-05 7.34537131351162E-05 2.63202251320494E-05 7.48774138864445E-06 0.000071321 8.29713822752219E-05 0.0001160307 0.0001560553 0.0001731238 8.7312417134487E-05 0.000033853 1.48094226663759E-05
diff --git a/data/MINERvA/CCQE/20deg_Q2QE_joint_data_fluxfix.txt b/data/MINERvA/CCQE/20deg_Q2QE_joint_data_fluxfix.txt
index f6e7713..e0fc414 100755
--- a/data/MINERvA/CCQE/20deg_Q2QE_joint_data_fluxfix.txt
+++ b/data/MINERvA/CCQE/20deg_Q2QE_joint_data_fluxfix.txt
@@ -1,17 +1,18 @@
-0.0 9.95248E-39 9.32331E-40
-0.025 1.29836E-38 1.21669E-39
-0.05 1.45069E-38 1.31568E-39
-0.1 1.34021E-38 1.17909E-39
-0.2 9.20783E-39 8.75596E-40
-0.4 3.44229E-39 3.72058E-40
-0.8 8.80692E-40 1.39413E-40
-1.2 1.79399E-40 3.84830E-41
-2.0 9.33281E-39 1.02142E-39
-2.025 1.40601E-38 1.40693E-39
-2.05 1.65064E-38 1.53664E-39
-2.1 1.82744E-38 1.65908E-39
-2.2 1.24987E-38 1.15731E-39
-2.4 5.52559E-39 6.12484E-40
-2.8 1.52186E-39 3.22217E-40
-3.2 3.07422E-40 7.72320E-41
-4.0 0.0 0.0
+0.0 0.9332809991 0.1021422611
+0.025 1.4060130845 0.1406932955
+0.05 1.6506448977 0.1536635144
+0.1 1.8274369355 0.1659076225
+0.2 1.2498736571 0.1157305354
+0.4 0.5525585931 0.0612483717
+0.8 0.1521861493 0.0322216522
+1.2 0.0307422352 0.0077231963
+2.0 0.9952482173 0.0932331293
+2.025 1.2983599761 0.1216692878
+2.05 1.4506853551 0.1315681118
+2.1 1.3402050761 0.117909211
+2.2 0.9207828367 0.0875595515
+2.4 0.3442289658 0.0372058391
+2.8 0.0880692404 0.0139412973
+3.2 0.017939888 0.0038483013
+4.0 0.0 0.0
+
diff --git a/data/MINERvA/CCQE/20deg_Q2QE_numu_covar_fluxfix.txt b/data/MINERvA/CCQE/20deg_Q2QE_numu_covar_fluxfix.txt
index 03fd1bd..5eb50a6 100755
--- a/data/MINERvA/CCQE/20deg_Q2QE_numu_covar_fluxfix.txt
+++ b/data/MINERvA/CCQE/20deg_Q2QE_numu_covar_fluxfix.txt
@@ -1,8 +1,8 @@
-1.00000 0.86268 0.87173 0.85717 0.78925 0.61255 0.33485 0.26221
-0.86268 1.00000 0.89943 0.90673 0.84935 0.65496 0.37352 0.28123
-0.87173 0.89943 1.00000 0.94091 0.89597 0.67705 0.37483 0.28261
-0.85717 0.90673 0.94091 1.00000 0.92754 0.72891 0.40198 0.30629
-0.78925 0.84935 0.89597 0.92754 1.00000 0.85614 0.57853 0.49184
-0.61255 0.65496 0.67705 0.72891 0.85614 1.00000 0.75302 0.72746
-0.33485 0.37352 0.37483 0.40198 0.57853 0.75302 1.00000 0.89935
-0.26221 0.28123 0.28261 0.30629 0.49184 0.72746 0.89935 1.00000
+0.0104330415 0.0123973932 0.0136821977 0.0145256938 0.0093296793 0.0038321515 0.0011020691 0.0002068501
+0.0123973932 0.0197946034 0.0194451167 0.0211650108 0.0138295061 0.0056439648 0.0016932865 0.0003055851
+0.0136821977 0.0194451167 0.0236124756 0.0239874199 0.0159335811 0.0063721548 0.0018558897 0.0003353919
+0.0145256938 0.0211650108 0.0239874199 0.0275253392 0.0178093493 0.0074068432 0.0021489042 0.0003924658
+0.0093296793 0.0138295061 0.0159335811 0.0178093493 0.0133935568 0.0060686071 0.002157357 0.0004396139
+0.0038321515 0.0056439648 0.0063721548 0.0074068432 0.0060686071 0.003751363 0.0014861092 0.0003441108
+0.0011020691 0.0016932865 0.0018558897 0.0021489042 0.002157357 0.0014861092 0.0010382349 0.0002238065
+0.0002068501 0.0003055851 0.0003353919 0.0003924658 0.0004396139 0.0003441108 0.0002238065 5.96477613712978E-05
diff --git a/data/MINERvA/CCQE/20deg_Q2QE_numu_data_fluxfix.txt b/data/MINERvA/CCQE/20deg_Q2QE_numu_data_fluxfix.txt
index 3be431d..c8fa732 100755
--- a/data/MINERvA/CCQE/20deg_Q2QE_numu_data_fluxfix.txt
+++ b/data/MINERvA/CCQE/20deg_Q2QE_numu_data_fluxfix.txt
@@ -1,9 +1,10 @@
-0.0 9.33281E-39 1.02142E-39
-0.025 1.40601E-38 1.40693E-39
-0.05 1.65064E-38 1.53664E-39
-0.1 1.82744E-38 1.65908E-39
-0.2 1.24987E-38 1.15731E-39
-0.4 5.52559E-39 6.12484E-40
-0.8 1.52186E-39 3.22217E-40
-1.2 3.07422E-40 7.72320E-41
-2.0 0.0 0.0
+0.0 0.9332809991 0.1021422611
+0.025 1.4060130845 0.1406932955
+0.05 1.6506448977 0.1536635144
+0.1 1.8274369355 0.1659076225
+0.2 1.2498736571 0.1157305354
+0.4 0.5525585931 0.0612483717
+0.8 0.1521861493 0.0322216522
+1.2 0.0307422352 0.0077231963
+2.0 0.0 0.0
+
diff --git a/data/MINERvA/CCQE/20deg_Q2QE_numubar_covar_fluxfix.txt b/data/MINERvA/CCQE/20deg_Q2QE_numubar_covar_fluxfix.txt
index 0e4f2ab..823f792 100755
--- a/data/MINERvA/CCQE/20deg_Q2QE_numubar_covar_fluxfix.txt
+++ b/data/MINERvA/CCQE/20deg_Q2QE_numubar_covar_fluxfix.txt
@@ -1,8 +1,8 @@
-1.00000 0.84420 0.87998 0.86569 0.78476 0.62381 0.24728 0.19878
-0.84420 1.00000 0.88323 0.87029 0.77574 0.59187 0.22371 0.17721
-0.87998 0.88323 1.00000 0.91996 0.84521 0.64905 0.22549 0.22917
-0.86569 0.87029 0.91996 1.00000 0.91825 0.77865 0.31484 0.34392
-0.78476 0.77574 0.84521 0.91825 1.00000 0.88165 0.43137 0.51379
-0.62381 0.59187 0.64905 0.77865 0.88165 1.00000 0.57473 0.60981
-0.24728 0.22371 0.22549 0.31484 0.43137 0.57473 1.00000 0.63099
-0.19878 0.17721 0.22917 0.34392 0.51379 0.60981 0.63099 1.00000
+0.0086924164 0.009576327 0.0107942985 0.0095165412 0.006406317 0.0021638723 0.0003214171 0.000071321
+0.009576327 0.0148034156 0.0141385691 0.0124850967 0.0082641634 0.0026792725 0.0003794611 8.29713822752219E-05
+0.0107942985 0.0141385691 0.017310168 0.0142714315 0.0097368805 0.0031771683 0.0004135937 0.0001160307
+0.0095165412 0.0124850967 0.0142714315 0.013902582 0.0094800441 0.0034158607 0.0005175328 0.0001560553
+0.006406317 0.0082641634 0.0097368805 0.0094800441 0.0076666751 0.0028721732 0.0005265683 0.0001731238
+0.0021638723 0.0026792725 0.0031771683 0.0034158607 0.0028721732 0.0013842745 0.0002981118 8.7312417134487E-05
+0.0003214171 0.0003794611 0.0004135937 0.0005175328 0.0005265683 0.0002981118 0.0001943598 0.000033853
+0.000071321 8.29713822752219E-05 0.0001160307 0.0001560553 0.0001731238 8.7312417134487E-05 0.000033853 1.48094226663759E-05
diff --git a/data/MINERvA/CCQE/20deg_Q2QE_numubar_data_fluxfix.txt b/data/MINERvA/CCQE/20deg_Q2QE_numubar_data_fluxfix.txt
index d1c5102..fd6a5bf 100755
--- a/data/MINERvA/CCQE/20deg_Q2QE_numubar_data_fluxfix.txt
+++ b/data/MINERvA/CCQE/20deg_Q2QE_numubar_data_fluxfix.txt
@@ -1,9 +1,10 @@
-0.0 9.95248E-39 9.32331E-40
-0.025 1.29836E-38 1.21669E-39
-0.05 1.45069E-38 1.31568E-39
-0.1 1.34021E-38 1.17909E-39
-0.2 9.20783E-39 8.75596E-40
-0.4 3.44229E-39 3.72058E-40
-0.8 8.80692E-40 1.39413E-40
-1.2 1.79399E-40 3.84830E-41
-2.0 0.0 0.0
+0.0 0.9952482173 0.0932331293
+0.025 1.2983599761 0.1216692878
+0.05 1.4506853551 0.1315681118
+0.1 1.3402050761 0.117909211
+0.2 0.9207828367 0.0875595515
+0.4 0.3442289658 0.0372058391
+0.8 0.0880692404 0.0139412973
+1.2 0.017939888 0.0038483013
+2.0 0.0 0.0
+
diff --git a/data/MINERvA/CCQE/Q2QE_joint_covar_fluxfix.txt b/data/MINERvA/CCQE/Q2QE_joint_covar_fluxfix.txt
index f9ec1fd..0aff3c0 100755
--- a/data/MINERvA/CCQE/Q2QE_joint_covar_fluxfix.txt
+++ b/data/MINERvA/CCQE/Q2QE_joint_covar_fluxfix.txt
@@ -1,16 +1,16 @@
-0.010850693024217059 0.013190744200435017 0.014861923720325191 0.015889891078358833 0.010843787943299682 0.005624107037659058 0.0025710258458044675 0.0009246286420048676 0.008378114641718152 0.01067988363734119 0.011671724037168296 0.011431916393507763 0.0075471933941027415 0.003337914774220062 0.0014762551985362713 0.0004353654993927686
-0.013190744200435013 0.021186385260613207 0.021325301678827638 0.023317896472491724 0.015995395778463838 0.008142232076509406 0.003820676949165565 0.001342344168977523 0.011383354694144905 0.015277579700374168 0.016602514706689588 0.0166790277728349 0.01114454636902864 0.004836926009715195 0.0022763117600187047 0.0006583745056070657
-0.014861923720325191 0.02132530167882763 0.02612909633343725 0.026685112166221082 0.01869227729887766 0.00936112702492297 0.004242783507762443 0.001493691722655789 0.012744957539571802 0.016978636754317572 0.019420931847406217 0.01889459835452953 0.012999056272922806 0.0054797213853813795 0.0024290417320247904 0.0006903759773339679
-0.015889891078358837 0.023317896472491724 0.02668511216622108 0.03044348696552605 0.020557479283651925 0.010557606715164931 0.004816165433252427 0.0017313742322655548 0.01355452765171317 0.018512820512922235 0.020560023709156015 0.02102481933089481 0.014254197614929898 0.006260756975227824 0.00281070492616775 0.0008434210310601616
-0.010843787943299677 0.015995395778463834 0.018692277298877655 0.020557479283651925 0.015594411756460633 0.008520161551433196 0.004474689044173032 0.0017588384894984984 0.009031547360726156 0.01241291600059451 0.014151257204516404 0.014243139013575705 0.010491346278831672 0.00515343955084002 0.0028162564753531362 0.001010219685988915
-0.005624107037659056 0.008142232076509406 0.00936112702492297 0.010557606715164935 0.008520161551433196 0.006366051976845064 0.003724161849033904 0.0016865661669981432 0.004411070223107368 0.005946880071711517 0.006617602657956641 0.006874016482775016 0.005571412982647025 0.003932187259372631 0.0024941113830112332 0.0011138225101299368
-0.0025710258458044666 0.0038206769491655667 0.004242783507762443 0.004816165433252426 0.004474689044173032 0.0037241618490339045 0.0035181427821568347 0.0014757595136650808 0.0019165190628176803 0.002748500263194058 0.0029273785507615796 0.0031345641912810564 0.003016986685834871 0.0025043121828085056 0.0025952761869889604 0.0011307124381884845
-0.0009246286420048678 0.001342344168977523 0.001493691722655789 0.0017313742322655548 0.0017588384894984986 0.0016865661669981432 0.0014757595136650808 0.0007557442312393396 0.0006267246244974173 0.0008752851232593777 0.0009259621021978419 0.00102430329840903 0.0011222333581824024 0.0011347659976868717 0.0011376463706516797 0.0005314493307075546
-0.008378114641718152 0.011383354694144907 0.012744957539571802 0.01355452765171317 0.009031547360726156 0.004411070223107367 0.0019165190628176803 0.0006267246244974175 0.011085113377011332 0.012621627014913907 0.013832714262523093 0.013401259193064174 0.008923750033807087 0.003885418978731057 0.0016291066134889655 0.0004716445929751694
-0.010679883637341188 0.015277579700374168 0.016978636754317565 0.018512820512922232 0.01241291600059451 0.0059468800717115185 0.0027485002631940578 0.0008752851232593775 0.012621627014913907 0.019105115622487668 0.018409058234818636 0.01831649562590485 0.012284115416167968 0.005275820923080161 0.002386362596766497 0.0006793779278293267
-0.011671724037168296 0.01660251470668959 0.019420931847406217 0.020560023709156015 0.014151257204516404 0.006617602657956642 0.0029273785507615796 0.0009259621021978418 0.013832714262523093 0.01840905823481864 0.022176021170818364 0.020322539107765183 0.013987338716624179 0.005845702036277676 0.002507832884304526 0.0006995651114106596
-0.011431916393507763 0.0166790277728349 0.018894598354529536 0.02102481933089481 0.014243139013575705 0.006874016482775016 0.0031345641912810564 0.00102430329840903 0.013401259193064174 0.01831649562590485 0.02032253910776518 0.021554051514934544 0.01404118372663557 0.006103945117658788 0.0027066040836864983 0.000794821074894569
-0.007547193394102741 0.011144546369028643 0.012999056272922808 0.014254197614929898 0.010491346278831672 0.005571412982647023 0.0030169866858348704 0.0011222333581824024 0.008923750033807087 0.01228411541616797 0.01398733871662418 0.014041183726635568 0.010675116970821609 0.004989338359384158 0.0026883620446813143 0.0009466333007327206
-0.003337914774220062 0.004836926009715194 0.005479721385381378 0.006260756975227823 0.0051534395508400195 0.003932187259372631 0.0025043121828085056 0.0011347659976868717 0.003885418978731058 0.005275820923080161 0.0058457020362776765 0.006103945117658788 0.004989338359384159 0.0037426211973084875 0.0022848867020996656 0.0010196253808122193
-0.001476255198536271 0.0022763117600187047 0.0024290417320247904 0.00281070492616775 0.0028162564753531367 0.0024941113830112332 0.0025952761869889604 0.0011376463706516797 0.0016291066134889653 0.002386362596766497 0.0025078328843045265 0.0027066040836864983 0.0026883620446813148 0.0022848867020996656 0.0026553447279390363 0.0010653625389391973
-0.0004353654993927686 0.00065837
+0.0096930415 0.0114894507 0.012845455 0.0136344392 0.0091071066 0.0045260971 0.0020446583 0.0007039216 0.005844586 0.0076058382 0.0081556276 0.0067435159 0.0042994312 0.0014936413 0.0002473258 3.7821293258615E-05
+0.0114894507 0.0186747974 0.0183460918 0.0199892579 0.0134686233 0.0066082656 0.0031109271 0.001050355 0.0082081343 0.0108140536 0.0115539604 0.0097807516 0.0063070236 0.0022561059 0.0004097294 7.22250727970645E-05
+0.012845455 0.0183460918 0.022595752 0.0227365352 0.0156988646 0.007547666 0.0034073543 0.0011508288 0.0093878293 0.0122978045 0.0135096029 0.0113824228 0.0076181033 0.002739018 0.0005020412 0.0001066455
+0.0136344392 0.0199892579 0.0227365352 0.0260338784 0.0172119818 0.0085327539 0.003878305 0.0013451015 0.0100044033 0.0132982522 0.0143876179 0.0124253227 0.0082555006 0.003102352 0.0006126334 0.0001322437
+0.0091071066 0.0134686233 0.0156988646 0.0172119818 0.0129612184 0.0067724393 0.0035876707 0.0013754622 0.0066690577 0.0086333976 0.0095314112 0.0086187151 0.0063190518 0.0027230733 0.0007345664 0.0002078268
+0.0045260971 0.0066082656 0.007547666 0.0085327539 0.0067724393 0.0049806388 0.0029048415 0.0013074482 0.0032001095 0.003919217 0.004344278 0.0045122103 0.0037094384 0.0021232196 0.0007128489 0.000228726
+0.0020446583 0.0031109271 0.0034073543 0.003878305 0.0035876707 0.0029048415 0.0029964681 0.0012279239 0.0012883279 0.0013726179 0.001535455 0.0018866961 0.0019039152 0.001312352 0.0004606773 0.0001302912
+0.0007039216 0.001050355 0.0011508288 0.0013451015 0.0013754622 0.0013074482 0.0012279239 0.0006369953 0.0003846875 0.0003587196 0.0004088789 0.0006770389 0.0007936145 0.0006174815 0.0002379365 7.30561434556777E-05
+0.005844586 0.0082081343 0.0093878293 0.0100044033 0.0066690577 0.0032001095 0.0012883279 0.0003846875 0.0085774164 0.009457327 0.0105692985 0.0092361143 0.0062598002 0.0024641652 0.0004642017 0.0001556402
+0.0076058382 0.0108140536 0.0122978045 0.0132982522 0.0086333976 0.003919217 0.0013726179 0.0003587196 0.009457327 0.0146944156 0.0138695691 0.012148389 0.0080693276 0.0030412996 0.0005348885 0.0001727616
+0.0081556276 0.0115539604 0.0135096029 0.0143876179 0.0095314112 0.004344278 0.001535455 0.0004088789 0.0105692985 0.0138695691 0.016912168 0.0138095926 0.0095121223 0.0036483991 0.0005980594 0.0002476779
+0.0067435159 0.0097807516 0.0113824228 0.0124253227 0.0086187151 0.0045122103 0.0018866961 0.0006770389 0.0092361143 0.012148389 0.0138095926 0.0133556822 0.0092625716 0.0039387367 0.0008117617 0.0003562485
+0.0042994312 0.0063070236 0.0076181033 0.0082555006 0.0063190518 0.0037094384 0.0019039152 0.0007936145 0.0062598002 0.0080693276 0.0095121223 0.0092625716 0.0078015263 0.0034992871 0.0009299144 0.0004441312
+0.0014936413 0.0022561059 0.002739018 0.003102352 0.0027230733 0.0021232196 0.001312352 0.0006174815 0.0024641652 0.0030412996 0.0036483991 0.0039387367 0.0034992871 0.0019954274 0.0006164624 0.0002744646
+0.0002473258 0.0004097294 0.0005020412 0.0006126334 0.0007345664 0.0007128489 0.0004606773 0.0002379365 0.0004642017 0.0005348885 0.0005980594 0.0008117617 0.0009299144 0.0006164624 0.0005799549 0.0001762902
+3.7821293258615E-05 7.22250727970645E-05 0.0001066455 0.0001322437 0.0002078268 0.000228726 0.0001302912 7.30561434556777E-05 0.0001556402 0.0001727616 0.0002476779 0.0003562485 0.0004441312 0.0002744646 0.0001762902 0.0001018105
diff --git a/data/MINERvA/CCQE/Q2QE_joint_data_fluxfix.txt b/data/MINERvA/CCQE/Q2QE_joint_data_fluxfix.txt
index ddd7a97..9f7576d 100755
--- a/data/MINERvA/CCQE/Q2QE_joint_data_fluxfix.txt
+++ b/data/MINERvA/CCQE/Q2QE_joint_data_fluxfix.txt
@@ -1,17 +1,56 @@
-0.0 9.0727046436e-39 1.0416665985e-39
-0.025 1.36713686945e-38 1.4555543707e-39
-0.05 1.60374921161e-38 1.61644970022e-39
-0.1 1.77779397112e-38 1.74480620602e-39
-0.2 1.26437732963e-38 1.24877587086e-39
-0.4 6.86399152713e-39 7.97875427422e-40
-0.8 2.81795050914e-39 5.93139341315e-40
-1.2 1.11818649182e-39 2.74908026663e-40
-2.0 9.74134032934e-39 1.05285865039e-39
-2.025 1.27053453213e-38 1.38221256044e-39
-2.05 1.41936302043e-38 1.48916154835e-39
-2.1 1.31214085033e-38 1.46812981425e-39
-2.2 9.27620248836e-39 1.03320457659e-39
-2.4 4.0394169746e-39 6.11769662317e-40
-2.8 1.44869365053e-39 5.15300371428e-40
-3.2 4.79844766693e-40 2.36519334495e-40
-4.0 0.0 0.0
+0.0 0.9332809991 0.0984532452
+0.025 1.4060183024 0.1366557622
+0.05 1.6494167393 0.1503188345
+0.1 1.8286652702 0.1613501732
+0.2 1.3013376283 0.1138473469
+0.4 0.7072418247 0.0705736411
+0.8 0.2907306883 0.0547400042
+1.2 0.1154299504 0.0252387653
+2.0 0.9952482173 0.0926143423
+2.025 1.2983599761 0.1212205247
+2.05 1.4506853551 0.1300467917
+2.1 1.3414290077 0.1155667869
+2.2 0.9488877949 0.0883262492
+2.4 0.4136671604 0.0446702069
+2.8 0.1485557073 0.0240822527
+3.2 0.0492103402 0.0100901183
+4.0 0.0 0.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/MINERvA/CCQE/Q2QE_numu_covar_fluxfix.txt b/data/MINERvA/CCQE/Q2QE_numu_covar_fluxfix.txt
index c0b618e..3053567 100755
--- a/data/MINERvA/CCQE/Q2QE_numu_covar_fluxfix.txt
+++ b/data/MINERvA/CCQE/Q2QE_numu_covar_fluxfix.txt
@@ -1,8 +1,9 @@
-0.010850693024217059 0.013190744200435017 0.014861923720325191 0.015889891078358833 0.010843787943299682 0.005624107037659058 0.0025710258458044675 0.0009246286420048676
-0.013190744200435013 0.021186385260613207 0.021325301678827638 0.023317896472491724 0.015995395778463838 0.008142232076509406 0.003820676949165565 0.001342344168977523
-0.014861923720325191 0.02132530167882763 0.02612909633343725 0.026685112166221082 0.01869227729887766 0.00936112702492297 0.004242783507762443 0.001493691722655789
-0.015889891078358837 0.023317896472491724 0.02668511216622108 0.03044348696552605 0.020557479283651925 0.010557606715164931 0.004816165433252427 0.0017313742322655548
-0.010843787943299677 0.015995395778463834 0.018692277298877655 0.020557479283651925 0.015594411756460633 0.008520161551433196 0.004474689044173032 0.0017588384894984984
-0.005624107037659056 0.008142232076509406 0.00936112702492297 0.010557606715164935 0.008520161551433196 0.006366051976845064 0.003724161849033904 0.0016865661669981432
-0.0025710258458044666 0.0038206769491655667 0.004242783507762443 0.004816165433252426 0.004474689044173032 0.0037241618490339045 0.0035181427821568347 0.0014757595136650808
-0.0009246286420048678 0.001342344168977523 0.001493691722655789 0.0017313742322655548 0.0017588384894984986 0.0016865661669981432 0.0014757595136650808 0.0007557442312393396
+0.0096930415 0.0114894507 0.012845455 0.0136344392 0.0091071066 0.0045260971 0.0020446583 0.0007039216
+0.0114894507 0.0186747974 0.0183460918 0.0199892579 0.0134686233 0.0066082656 0.0031109271 0.001050355
+0.012845455 0.0183460918 0.022595752 0.0227365352 0.0156988646 0.007547666 0.0034073543 0.0011508288
+0.0136344392 0.0199892579 0.0227365352 0.0260338784 0.0172119818 0.0085327539 0.003878305 0.0013451015
+0.0091071066 0.0134686233 0.0156988646 0.0172119818 0.0129612184 0.0067724393 0.0035876707 0.0013754622
+0.0045260971 0.0066082656 0.007547666 0.0085327539 0.0067724393 0.0049806388 0.0029048415 0.0013074482
+0.0020446583 0.0031109271 0.0034073543 0.003878305 0.0035876707 0.0029048415 0.0029964681 0.0012279239
+0.0007039216 0.001050355 0.0011508288 0.0013451015 0.0013754622 0.0013074482 0.0012279239 0.0006369953
+
diff --git a/data/MINERvA/CCQE/Q2QE_numu_data_fluxfix.txt b/data/MINERvA/CCQE/Q2QE_numu_data_fluxfix.txt
index f000e17..0cde57d 100755
--- a/data/MINERvA/CCQE/Q2QE_numu_data_fluxfix.txt
+++ b/data/MINERvA/CCQE/Q2QE_numu_data_fluxfix.txt
@@ -1,9 +1,49 @@
-0.0 9.74134032934e-39 1.05285865039e-39
-0.025 1.27053453213e-38 1.38221256044e-39
-0.05 1.41936302043e-38 1.48916154835e-39
-0.1 1.31214085033e-38 1.46812981425e-39
-0.2 9.27620248836e-39 1.03320457659e-39
-0.4 4.0394169746e-39 6.11769662317e-40
-0.8 1.44869365053e-39 5.15300371428e-40
-1.2 4.79844766693e-40 2.36519334495e-40
-2.0 0.0 0.0
+0.0 0.9332809991 0.0984532452
+0.025 1.4060183024 0.1366557622
+0.05 1.6494167393 0.1503188345
+0.1 1.8286652702 0.1613501732
+0.2 1.3013376283 0.1138473469
+0.4 0.7072418247 0.0705736411
+0.8 0.2907306883 0.0547400042
+1.2 0.1154299504 0.0252387653
+2.0 0.0 0.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/MINERvA/CCQE/Q2QE_numubar_covar_fluxfix.txt b/data/MINERvA/CCQE/Q2QE_numubar_covar_fluxfix.txt
index df6892c..50f54fa 100755
--- a/data/MINERvA/CCQE/Q2QE_numubar_covar_fluxfix.txt
+++ b/data/MINERvA/CCQE/Q2QE_numubar_covar_fluxfix.txt
@@ -1,8 +1,8 @@
-1 0.842391544 0.877542734 0.862934862 0.765230795 0.595625939 0.208128425 0.166551002
-0.842391544 1 0.879806501 0.867180477 0.753652944 0.561649115 0.183227219 0.141245581
-0.877542734 0.879806501 1 0.918857542 0.828109935 0.628036282 0.19096228 0.188751891
-0.862934862 0.867180477 0.918857542 1 0.907420841 0.762967333 0.291674481 0.305508832
-0.765230795 0.753652944 0.828109935 0.907420841 1 0.886894213 0.437175781 0.49833938
-0.595625939 0.561649115 0.628036282 0.762967333 0.886894213 1 0.573048687 0.608936733
-0.208128425 0.183227219 0.19096228 0.291674481 0.437175781 0.573048687 1 0.725495759
-0.166551002 0.141245581 0.188751891 0.305508832 0.49833938 0.608936733 0.725495759 1
+0.0085774164 0.009457327 0.0105692985 0.0092361143 0.0062598002 0.0024641652 0.0004642017 0.0001556402
+0.009457327 0.0146944156 0.0138695691 0.012148389 0.0080693276 0.0030412996 0.0005348885 0.0001727616
+0.0105692985 0.0138695691 0.016912168 0.0138095926 0.0095121223 0.0036483991 0.0005980594 0.0002476779
+0.0092361143 0.012148389 0.0138095926 0.0133556822 0.0092625716 0.0039387367 0.0008117617 0.0003562485
+0.0062598002 0.0080693276 0.0095121223 0.0092625716 0.0078015263 0.0034992871 0.0009299144 0.0004441312
+0.0024641652 0.0030412996 0.0036483991 0.0039387367 0.0034992871 0.0019954274 0.0006164624 0.0002744646
+0.0004642017 0.0005348885 0.0005980594 0.0008117617 0.0009299144 0.0006164624 0.0005799549 0.0001762902
+0.0001556402 0.0001727616 0.0002476779 0.0003562485 0.0004441312 0.0002744646 0.0001762902 0.0001018105
diff --git a/data/MINERvA/CCQE/Q2QE_numubar_data_fluxfix.txt b/data/MINERvA/CCQE/Q2QE_numubar_data_fluxfix.txt
index 88ef834..3dbc115 100755
--- a/data/MINERvA/CCQE/Q2QE_numubar_data_fluxfix.txt
+++ b/data/MINERvA/CCQE/Q2QE_numubar_data_fluxfix.txt
@@ -1,9 +1,48 @@
-0 0.995248217E-38 0.092614342E-38
-0.025 1.298359976E-38 0.121220525E-38
-0.05 1.450685355E-38 0.130046792E-38
-0.1 1.341429008E-38 0.115566787E-38
-0.2 0.948887795E-38 0.088326249E-38
-0.4 0.41366716E-38 0.044670207E-38
-0.8 0.148555707E-38 0.024082253E-38
-1.2 0.04921034E-38 0.010090118E-38
-2 0.0 0.0
+0.0 0.9952482173 0.0926143423
+0.025 1.2983599761 0.1212205247
+0.05 1.4506853551 0.1300467917
+0.1 1.3414290077 0.1155667869
+0.2 0.9488877949 0.0883262492
+0.4 0.4136671604 0.0446702069
+0.8 0.1485557073 0.0240822527
+1.2 0.0492103402 0.0100901183
+2.0 0.0 0.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/flux/MicroBooNE_FHC_numu_flux.root b/data/flux/MicroBooNE_FHC_numu_flux.root
new file mode 100644
index 0000000..9de8508
Binary files /dev/null and b/data/flux/MicroBooNE_FHC_numu_flux.root differ
diff --git a/data/flux/input-flux.root b/data/flux/input-flux.root
deleted file mode 100644
index 0143be9..0000000
Binary files a/data/flux/input-flux.root and /dev/null differ
diff --git a/doc/tutorial_dialtuning.dox b/doc/tutorial_dialtuning.dox
index 100637c..f783388 100644
--- a/doc/tutorial_dialtuning.dox
+++ b/doc/tutorial_dialtuning.dox
@@ -1,108 +1,108 @@
/*!
\page tutorial_dialtuning Dial Tuning
The main purpose of the fitter is to allow ReWeight dials to be quickly tuned to datasets. In this tutorial
we go through how to include dials in a simple fit and define their state.
\section tutorial_dialtuning_parcard Extending the Fit Card
First, copy the fit card from the previous tutorial using the sample definition given there.
Now we want to add in a NEUT ReWeight dials, so a quick grep of the NEUT systematics file will return what the dial names are.
Below is a shortened output. Some dials (especially ones that are discontinous) cannot be used with the fitter so check what little
notes there are inside the RW functions themselves when including new dials.
\code
$ grep case $NEUT_REWEIGHT/NSyst.h
case ( kXSecTwkDial_NormNCEL ) : return "NormNCEL"; break;
//case ( kXSecTwkDial_NormNCELenu ) : return "NormNCELenu"; break;
case ( kXSecTwkDial_MaNCEL ) : return "MaNCEL"; break;
case ( kXSecTwkDial_MaNCELshape ) : return "MaNCELshape"; break;
case ( kXSecTwkDial_1overMaNCEL2 ) : return "1overMaNCEL2"; break;
case ( kXSecTwkDial_AxlFFNCEL ) : return "AxlFFNCEL"; break;
case ( kXSecTwkDial_VecFFNCEL ) : return "VecFFNCEL"; break;
//case ( kXSecTwkDial_VecFFNCELshape ) : return "VecFFNCELshape"; break;
//case ( kXSecTwkDial_EtaNCEL ) : return "EtaNCEL"; break;
case ( kXSecTwkDial_NormCCQE ) : return "NormCCQE"; break;
//case ( kXSecTwkDial_NormCCQEenu ) : return "NormCCQEenu"; break;
case ( kXSecTwkDial_MaCCQE ) : return "MaCCQE"; break;
\endcode
So lets say we want to include two modifications to the MC. Firstly, we want to scale down the CCQE normalisation by a fixed 10%. Then we want to vary the axial mass freely in the fit between 0.8 and 1.4 GeV and try to converge on a best fit for this dial. To figure out what values we need to include in the card file we must determine the 1-sigma uncertainty on these parameters.
Again a grep will do the trick for the 1-sigma uncertainty:
\code
$ grep NormCCQE $NEUT_REWEIGHT/NSystUncertainty.cc
this->SetUncertainty( kXSecTwkDial_NormCCQE, 0.15, 0.15);
$ grep NormCCQE $NEUT_REWEIGHT/NSystUncertainty.cc
this->SetUncertainty( kXSecTwkDial_MaCCQE, 0.165289256, 0.165289256);
\endcode
Unfortunately the default values for these parameters is a bit more akward to find. These are given in each of the RW objects in the NEUT_REWEIGHT folder. For the purpose of this excerices we just explicitly state them here.
\code
Nominal MaCCQE = 1.21 GeV/c^2
Nominal NormCCQE = 1.0
\endcode
We must then convert the true values we have for the nominal and limits into 1-sigma dial values using the following equation.
\code
true.value = nominal.value * ( 1.0 + sig.err * dial.value)
dial.value = ( (true.value / nominal.value) - 1.0 ) / sig.err
\endcode
To finally include these dials the following lines should be added to the fit card with the neut_parameter identifier.
\code
# ident --------- Parameter --- Nom. ---- Low. ---- Upp. --- Stp. --- State ----
neut_parameter NormCCQE -0.10 -1.00 1.00 1.0 FIX
neut_parameter MaCCQE 0.00 -2.11 0.98 1.0 FREE
\endcode
Alternative parameter types can be supplied for each of the different generators. These are:
- neut_parameter -> NEUT
- nuwro_parameter -> NuWro (Make sure you have built with NuWro AND NuWroReWeight)
- genie_parameter -> GENIE
- niwg_parameter -> NIWG
- custom_parameter -> Custom dials that can be added to FitWeight if required. Currently a placeholder.
The nominal value should always be within the lower and upper limits otherwise ROOT's minimizer libraries will complain. The step size seems to currently be ignored by most of the libraries but it is used by the PlotLimits and GridScan function so it is best to choose something reasonable just to be safe.
\section tutorial_dialtuning_absolute Using absolute dial values
There has recently been a modification to FitBase to allow dials to be shown in the fit card in terms of true values provided a conversion function is given in the card file contained in FitBase.
If you want to use this method, you should also provide the state "ABS" in the card file. So for example the MaCCQE dial line would become.
\code
# ident --------- Parameter --- Nom. ---- Low. ---- Upp. --- Stp. --- State ----
neut_parameter MaCCQE 0.0 0.8 1.4 0.4 FREE/ABS
\endcode
Alternative parameter types can be supplied for each of the different generators. These are:
- neut_parameter -> NEUT
- nuwro_parameter -> NuWro (Make sure you have built with NuWro AND NuWroReWeight)
- genie_parameter -> GENIE
- niwg_parameter -> NIWG
- custom_parameter -> Custom dials that can be added to FitWeight if required. Currently a placeholder.
\section tutorial_dialtuning_runfit Running the Fit
Once you have written the fit card it should be as simple as running the minimizer again.
\code
-ExtFit_minimizer.exe -c fittertutorial2.card -o fittertutorial2.root
+nuismin -c fittertutorial2.card -o fittertutorial2.root
\endcode
The finished fit should produce the following output table for each parameter involved.
The specified output root file should also contain MC histograms for the best fit point.
There are cases where strong parameter correlations and bumpy chi2 spaces will mean the fit has problems converging. As a general guide fitting 4 parameters will usually take around 400 reconfigures. If it takes significantly longer than this (3x) then you may be having trouble. Alternative fit routines are available to try and fix problems like this. See \ref tutorial_fitroutines for more information.
*/
\ No newline at end of file
diff --git a/doc/tutorial_inputs.dox b/doc/tutorial_inputs.dox
index 54433b2..afcb575 100644
--- a/doc/tutorial_inputs.dox
+++ b/doc/tutorial_inputs.dox
@@ -1,149 +1,149 @@
/*!
\page tutorial_inputs Fitting Input Card
To determine what samples need to be loaded and the location of the event files to be read the fitter parses a premade input fit card which contains everything piece of information for the fit.
This tutorial details how to load a simple sample of events from each of the generators and compare them against each other.
\section fitcards The Fit Card
For this very simple case so all that is required in the fit card is a single line to read in which sample we want to plot. For a list of samples see \ref samplelist.
-We want a set of Monte Carlo events to make the data/MC comparison so first you will need to generate this in Neut and NuWro seperately. No explicit tutorial is given for this, but please see \ref generators for tips on what generator output format the events need to be in.
+We want a set of Monte Carlo events to make the data/MC comparison so first you will need to generate this in Neut and NuWro separately. No explicit tutorial is given for this, but please see \ref generators for tips on what generator output format the events need to be in.
Once we have a set of events create a fit card "fittertutorial1.card" in the current directory and include the "MiniBooNE_CCQE_XSec_1DQ2_nu" sample as follows.
\code
# Identifier - Sample Name ----------------- Type - Events File Name ------------------- Normalisation
sample MiniBooNE_CCQE_XSec_1DQ2_nu FIX /path/to/miniboone_ccqe_events.root 1.0
\endcode
- The "sample" argument lets the fitter know we want to include a new sample in this fit. Multiple samples can be included if required assuming they are uncorrelated by creating multiple sample lines in the fit card.
- The Sample Name is a simple string identifier that lets the fitter know which dataset comparison should be performed, for a list of samples see \ref samplelist.
- The sample Type is used to specify any other options required to describe how this sample is handled. Common examples are "FIX - fix this samples overall normalisation", "SHAPE - normalise MC to data before doing calculations", "DIAG - use only uncorrelated bin errors", "NORM - Add a normalisation penalty term to the fit". Some samples have extra possible fit types so it is worth checking the doxygen documentation for a sample before using it.
-- The events file name is just simply the directory to the MC events you want to use for this fit. In the case of joint datasets that require multiple input MC files, the path to each can be provided in this field by passing a semi-colon seperated list, e.g. "/path/to/miniboone_ccqe_events1.root;/path/to/miniboone_ccqe_events2.root".
+- The events file name is just simply the directory to the MC events you want to use for this fit. In the case of joint datasets that require multiple input MC files, the path to each can be provided in this field by passing a semi-colon separated list, e.g. "/path/to/miniboone_ccqe_events1.root;/path/to/miniboone_ccqe_events2.root".
- The normalisation term is used to float the overall normalisation of this sample. The fitter will complain and scale the samples to 0.0 if you forget to include this!
\section fittingrun Running a Fit
Once we have a sample card produced it is possible to run a default Migrad fit by passing this fit card to the minimizer.
\code
-ExtFit_minimizer.exe -c fittertutorial1.card -o fittertutorial1_output.root
+nuismin -c fittertutorial1.card -o fittertutorial1_output.root
\endcode
Since we have not included any MC ReWeight dials to be minimized yet this should run relatively quickly, requiring only a single reconfigure.
The final output should look as follows:
\code
[LOG Fitter]: Making the minimizerFCN
[LOG Minmzr]: Initializing Samples
[LOG Minmzr]: MINERvA_CCQE_XSec_1DQ2_nu
[LOG Fitter]: Running Routine: Migrad
[LOG Fitter]: Fixed Param: MINERvA_CCQE_XSec_1DQ2_nu_norm
[LOG Fitter]: Setup Minimizer: 1(NDim) 0(NFree)
[LOG Minmzr]: Reconfiguring all samples in series
[LOG Minmzr]: Iteration = 1
[LOG Minmzr]: Time taken for this reconfigure: 40
[LOG Fitter]: Current Stat = 47.8123
[LOG Fitter]: Minimizer State:
[LOG Fitter]: # Parameter = Value +- Error Units (Sigma Variation)
[LOG Fitter]: 0 . MINERvA_CCQE_XSec_1DQ2_nu_norm = 1 Frac. (Fixed)
[LOG Fitter]: Running Routine: FixAtLim
[LOG Fitter]: Minimizer State:
[LOG Fitter]: # Parameter = Value +- Error Units (Sigma Variation)
[LOG Fitter]: 0 . MINERvA_CCQE_XSec_1DQ2_nu_norm = 1 Frac. (Fixed)
Error in : matrix not positive definite
Error in : matrix not positive definite
[LOG Fitter]: Saving current FCN predictions
[LOG Minmzr]: Reconfiguring all samples in series
[LOG Minmzr]: Iteration = 1
[LOG Minmzr]: Time taken for this reconfigure: 39
[LOG Minmzr]: Writing each of the data classes:
-------------------------------------
Minimizer Complete.
-------------------------------------
\endcode
- Note: The error messages about TDecompChol correspond to problems where teh minimizer didn't actually produce a good covariance matrix. This can happen if the fit fails, but also if you are fitting with 1 or 0 free parameters. If that is the case don't worry too much about it.
\section analysing Analysing the Output
The root file produced then contains the results from the fit. To list the contents run:
\code
root -l fittertutorial1_output.root
root[1]: _file0->ls();
TFile** fittertutorial1_output.root
TFile* fittertutorial1_output.root
KEY: TTree fit_result;1 fit_result
KEY: TH1D fit_dials;1 fit_dials
KEY: TH1D start_dials;1 start_dials
KEY: TH1D min_dials;1 min_dials
KEY: TH1D max_dials;1 max_dials
KEY: TH1D fit_status;1 fit_status
KEY: TH2D covariance;1 covariance
KEY: TH2D correlation;1 correlation
KEY: TH2D decomposition;1 decomposition
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_data;1 MINERvA_CCQE_XSec_1DQ2_nu_data
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC;1 47.812
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC_FINE;1 MINERvA_CCQE_XSec_1DQ2_nu_MC_FINE
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_FLUX;1 MINERvA_CCQE_XSec_1DQ2_nu
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_EVT;1 MINERvA_CCQE_XSec_1DQ2_nu_EVT
KEY: THStack MINERvA_CCQE_XSec_1DQ2_nu_MC_PDG;1 MINERvA_CCQE_XSec_1DQ2_nu_MC_PDG
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC_RATIO;1 47.812
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_data_RATIO;1 MINERvA_CCQE_XSec_1DQ2_nu_data
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC_SHAPE;1 47.812
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC_SHAPE_RATIO;1 47.812
KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_data_SHAPE_RATIO;1 MINERvA_CCQE_XSec_1DQ2_nu_data
KEY: TH1D sample_xsecs_MC;1 sample_xsecs_MC
KEY: TH1D sample_xsecs_data;1 sample_xsecs_data
root[2]: fit_result->Show(0);
======> EVENT:0
parameter_names = (vector*)0x1aa80e0
parameter_values = (vector*)0x1aa93b0
parameter_errors = (vector*)0x1aa9b40
parameter_min = (vector*)0x1aa9f30
parameter_max = (vector*)0x1aaa2f0
parameter_start = (vector*)0x1aaa6b0
parameter_fix = (vector*)0x1aaacb0
parameter_startfix = (vector*)0x1aab690
CHI2 = 47.8123
NDOF = 8
NBINS = 8
NDIM = 1
NFREE = 0
\endcode
Each of the following plots are added to every output file following a minimization fit.
- fit_results -> A TTree containing each of the dial names, values, limits, etc. The best fit chi2 point and number of fit degrees of freedom is given in this tree.
- fit_dials -> Best fit results and fit errors for each dial in units of 1-sigam variation. Dials with 0.0 bin errors are fixed.
- start_dials -> Nominal values for these fit parameters in units of 1-sigma variation.
- min_dials -> Mnimium limit for each dial in units of 1-sigma variation. (If a dial is fit very close to the limit within fit error... worry)
- max_dials -> Maximum limit for each dial in units of 1-sigma variation. (If a dial is fit very close to the limit within fit error... worry)
- fit_status -> Plot of some variables from the fit, mostly unimportant.
- covariance -> Fit result covariance that the ROOT minimizer gives out.
- correlation -> Correlation matrix form the fit
- decomposition -> Decomposed covariance matrix from the fit, useful for fake data studies and producing error bands for correlated parameters..
The following plots are specific to a given fit depending on what samples where included. The structure is generally the same, and the sample identifier used in the fit card will correspond to which sample made these plots. By default the following distributions should be created, but whether they are saved is determined by the configuration option "drawOpts" given in the config file.
- MiniBooNE_CCQE_XSec_1DQ2_data -> Data distribution for the sample that was loaded in the fit.
- MiniBooNE_CCQE_XSec_1DQ2_MC -> Best fit MC distribution after the fit has been ran. Titles on these plots give the best fit Chi2 for that single sample which is useful when running joint fits. Error bands show the statistical errors only for the MC prediction.
- MiniBooNE_CCQE_XSec_1DQ2_MC_Fine -> Finely binned MC distribution at best fit (Can sometimes disagree with coarse MC histogram because of scaling factors..)
- MiniBooNE_CCQE_XSec_1DQ2_MC_Shape -> MC plot normalised to match the data normalisation
- MiniBooNE_CCQE_XSec_1DQ2_data_Ratio -> Data/MC Ratio Plot
- MiniBooNE_CCQE_XSec_1DQ2_MC_Ratio -> Baseline for Data/MC Ratio (Unity)
- MiniBooNE_CCQE_XSec_1DQ2_data_Shape_Ratio -> Data/MC Ratio where the MC is normalised to match the dataset before the ratio is calculated.
*/
diff --git a/event_gen/CMakeLists.txt b/event_gen/CMakeLists.txt
new file mode 100644
index 0000000..05b3bb7
--- /dev/null
+++ b/event_gen/CMakeLists.txt
@@ -0,0 +1,7 @@
+install(PROGRAMS
+ ${CMAKE_CURRENT_SOURCE_DIR}/nuis_genev_neut
+ ${CMAKE_CURRENT_SOURCE_DIR}/nuis_genev_genie
+ ${CMAKE_CURRENT_SOURCE_DIR}/nuis_get_flux_descriptor
+ ${CMAKE_CURRENT_SOURCE_DIR}/nuis_get_NEUT_target_descriptor
+ ${CMAKE_CURRENT_SOURCE_DIR}/nuis_get_GENIE_target_descriptor
+ DESTINATION bin)
\ No newline at end of file
diff --git a/event_gen/genie/MiniBooNE/thrownuCH2.sh b/event_gen/genie/MiniBooNE/thrownuCH2.sh
deleted file mode 100755
index fe9c0fb..0000000
--- a/event_gen/genie/MiniBooNE/thrownuCH2.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-if [ -z $1 ]; then
- echo "Please pass a number of events to generate."
- exit 1
-fi
-
-if [ -z $GENIE_XSEC_FILE ] || [ ! -e $GENIE_XSEC_FILE ]; then
- echo "Cannot find GENIE xsec file @ \$ENV{GENIE_XSEC_FILE}."
- exit 1
-fi
-
-NEVS=$1
-
-BEAMMODE="FHC"
-NU_PDG=14
-FLUX_FILE=${NUISANCE}/data/flux/MiniBooNE_numu_flux.root
-FLUX_HIST=numu_mb
-if [ ! -z $2 ] && [ "${2}" == "RHC" ]; then
- echo "Running with "
- NU_PDG=-14
- FLUX_FILE=${NUISANCE}/data/flux/MiniBooNE_numubar_flux.root
- FLUX_HIST=numub_mb
- BEAMMODE="RHC"
-fi
-
-RUNNUM=${RANDOM}
-
-if [ -e gntp.${RUNNUM}.ghep.root ]; then
- echo "Already have file: gntp.${RUNNUM}.ghep.root, not overwriting."
- exit 1
-fi
-
-if [ -e MiniBooNE.CH2.${BEAMMODE}.prep.root ]; then
- echo "Already have file: MiniBooNE.CH2.${BEAMMODE}.prep.root, not overwriting."
- exit 1
-fi
-
-CH2TARGET="1000060120[0.85714286],1000010010[0.14285714]"
-
-gevgen \
- -p ${NU_PDG} -t ${CH2TARGET} \
- -r ${RUNNUM} -e 0.1,10 \
- -f ${FLUX_FILE},${FLUX_HIST} \
- -n ${NEVS} --seed ${RUNNUM} \
- --cross-sections ${GENIE_XSEC_FILE} \
- --event-generator-list Default+MEC \
- --message-thresholds Messenger_whisper.xml
-
-if [ -e gntp.${RUNNUM}.ghep.root ]; then
- rm -f input-flux.root
- rm -f genie-mcjob-${RUNNUM}.status
-
- mv gntp.${RUNNUM}.ghep.root MiniBooNE.CH2.${BEAMMODE}.prep.root
- PrepareGENIE -i MiniBooNE.CH2.${BEAMMODE}.prep.root \
- -f ${FLUX_FILE},${FLUX_HIST} \
- -t ${CHTARGET}
-else
- echo "Failed to produce expected output file: gntp.${RUNNUM}.ghep.root"
- exit 1
-fi
diff --git a/event_gen/genie/SciBooNE/thrownuCH.sh b/event_gen/genie/SciBooNE/thrownuCH.sh
deleted file mode 100755
index b5572a8..0000000
--- a/event_gen/genie/SciBooNE/thrownuCH.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-
-if [ -z $1 ]; then
- echo "Please pass a number of events to generate."
- exit 1
-fi
-
-if [ -z $GENIE_XSEC_FILE ] || [ ! -e $GENIE_XSEC_FILE ]; then
- echo "Cannot find GENIE xsec file @ \$ENV{GENIE_XSEC_FILE}."
- exit 1
-fi
-
-NEVS=$1
-
-BEAMMODE="FHC"
-NU_PDG=14
-FLUX_FILE=${NUISANCE}/data/flux/sciboone_fhc.root
-FLUX_HIST=flux_numu
-if [ ! -z $2 ] && [ "${2}" == "RHC" ]; then
- echo "Do not have SciBooNE RHC Flux."
- exit 1
-fi
-
-RUNNUM=${RANDOM}
-
-if [ -e gntp.${RUNNUM}.ghep.root ]; then
- echo "Already have file: gntp.${RUNNUM}.ghep.root, not overwriting."
- exit 1
-fi
-
-if [ -e SciBooNE.CH.${BEAMMODE}.prep.root ]; then
- echo "Already have file: SciBooNE.CH.${BEAMMODE}.prep.root, not overwriting."
- exit 1
-fi
-
-CHTARGET="1000060120[.923076],1000010010[.076924]"
-
-gevgen \
- -p ${NU_PDG} -t ${CHTARGET} \
- -r ${RUNNUM} -e 0.1,10 \
- -f ${FLUX_FILE},${FLUX_HIST} \
- -n ${NEVS} --seed ${RUNNUM} \
- --cross-sections ${GENIE_XSEC_FILE} \
- --event-generator-list Default+MEC \
- --message-thresholds Messenger_whisper.xml
-
-if [ -e gntp.${RUNNUM}.ghep.root ]; then
- rm -f input-flux.root
- rm -f genie-mcjob-${RUNNUM}.status
-
- mv gntp.${RUNNUM}.ghep.root SciBooNE.CH.${BEAMMODE}.prep.root
- PrepareGENIE -i SciBooNE.CH.${BEAMMODE}.prep.root \
- -f ${FLUX_FILE},${FLUX_HIST} \
- -t ${CHTARGET}
-else
- echo "Failed to produce expected output file: gntp.${RUNNUM}.ghep.root"
- exit 1
-fi
diff --git a/event_gen/nuis_genev_genie b/event_gen/nuis_genev_genie
new file mode 100644
index 0000000..7c310c1
--- /dev/null
+++ b/event_gen/nuis_genev_genie
@@ -0,0 +1,179 @@
+#!/bin/bash
+
+set -e
+
+if [ -z ${NUISANCE} ]; then
+ echo "[ERROR]: We need to be in a NUISANCE environment (\$NUISANCE should be set)."
+ exit 1
+fi
+
+PROBE="14"
+FLUX=""
+TARG=""
+NEVENTS=""
+OUPNAME=""
+
+while [[ ${#} -gt 0 ]]; do
+
+ key="$1"
+ case $key in
+
+ -p|--probe)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ PROBE="$2"
+ echo "[OPT]: Using Probe PDG: ${PROBE}"
+ shift # past argument
+ ;;
+
+ -t|--target)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ TARG="$2"
+ echo "[OPT]: Using target declaration: ${TARG}"
+ shift # past argument
+ ;;
+
+ -f|--flux)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ FLUX="$2"
+ echo "[OPT]: Using flux declaration: ${FLUX}"
+ shift # past argument
+ ;;
+
+ -n|--nevents)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ NEVENTS="$2"
+ echo "[OPT]: Throwing ${NEVENTS} events."
+ shift # past argument
+ ;;
+
+ -o|--output-file)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ OUPNAME="$2"
+ echo "[OPT]: Writing to file: ${OUPNAME}"
+ shift # past argument
+ ;;
+
+ -?|--help)
+ # unknown option
+ echo "Arguments:"
+ echo -e "\tRequired:"
+ echo -e "\t -t|--target : e.g. \"CH\""
+ echo -e "\t -f|--flux : hint: use nuis_get_flux_descriptor for a simple interface."
+ echo -e "\t -n|--nevents <#num events>"
+ echo -e "\tOptional:"
+ echo -e "\t -p|--probe : defaults to 14"
+ echo -e "\t -o|--output-file : defaults to GENIE.....ghep.root"
+ echo -e ""
+ echo -e "\t -?|--help"
+ exit 0
+ ;;
+
+
+ *)
+ # unknown option
+ echo "Unknown option $1"
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+
+if [ -z ${FLUX} ]; then
+ echo "Please pass a flux declaration with the -f flag."
+ exit 2
+fi
+
+if [ -z ${NEVENTS} ]; then
+ echo "Please pass a number of events to generate with the -n flag."
+ exit 2
+fi
+
+OLDIFS=${IFS}
+IFS=","
+set -- ${FLUX}
+IFS=${OLDIFS}
+
+FLUX_FILE=${1}
+FLUX_HIST=${2}
+
+if [ -z {$FLUX_FILE} ] || [ -z {$FLUX_HIST} ]; then
+ echo -e "Please pass a flux declaration with the -f flag in the form \"-f file.root,histo_name\""
+ exit 2
+fi
+
+FLUX_FILE_NAME=${FLUX_FILE##*/}
+if [ ! -e ./${FLUX_FILE} ]; then
+ cp ${FLUX_FILE} ./
+fi
+
+SEED=${RANDOM}
+
+if [ -z ${OUPNAME} ]; then
+ OUPNAME=${GEN}.nu${PROBE}.${SEED}.${FLUX_HIST}.${FLUX_FILE_NAME%%.root}.root
+fi
+
+if [ -e ${OUPNAME} ]; then
+ echo "Already have file: ${OUPNAME}, not overwriting."
+ exit 1
+fi
+
+TARG=$(nuis_get_GENIE_target_descriptor ${TARG})
+
+if [ -z ${GENIE_XSEC_FILE} ]; then
+ echo "Environment not set up correctly, GENIE_XSEC_FILE is empty"
+ exit 1
+fi
+if [ -z ${GENIE_XSEC_TUNE} ]; then
+ echo "Environment not set up correctly, GENIE_XSEC_TUNE is empty"
+ exit 1
+fi
+
+gevgen \
+ -p ${PROBE} -t ${TARG} \
+ -r ${SEED} -e 0.1,10 \
+ -f ${FLUX_FILE},${FLUX_HIST} \
+ -n ${NEVENTS} --seed ${SEED} \
+ --cross-sections ${GENIE_XSEC_FILE} \
+ --tune ${GENIE_XSEC_TUNE} \
+ --event-generator-list Default \
+ --message-thresholds Messenger_whisper.xml
+
+if [ -e gntp.${SEED}.ghep.root ]; then
+ rm -f input-flux.root
+ rm -f genie-mcjob-${SEED}.status
+
+ mv gntp.${SEED}.ghep.root ${OUPNAME}
+ PrepareGENIE -i ${OUPNAME} \
+ -f ${FLUX_FILE},${FLUX_HIST} \
+ -t ${TARG}
+else
+ echo "Failed to produce expected output file: gntp.${SEED}.ghep.root"
+ exit 1
+fi
+
diff --git a/event_gen/nuis_genev_neut b/event_gen/nuis_genev_neut
new file mode 100755
index 0000000..442291d
--- /dev/null
+++ b/event_gen/nuis_genev_neut
@@ -0,0 +1,373 @@
+#!/bin/bash
+
+set -e
+
+if [ -z ${NUISANCE} ]; then
+ echo "[ERROR]: We need to be in a NUISANCE environment (\$NUISANCE should be set)."
+ exit 1
+fi
+
+
+PROBE="14"
+FLUX_DESCRIPTOR=""
+TARG=""
+NEVENTS=""
+OUPNAME=""
+MDLQE=""
+MAQE=""
+FSIOFF="no"
+NUCEFFOFF="no"
+QEONLY="no"
+RESONLY="no"
+
+while [[ ${#} -gt 0 ]]; do
+
+ key="$1"
+ case $key in
+
+ -p|--probe)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ PROBE="$2"
+ echo "[OPT]: Using Probe PDG: ${PROBE}"
+ shift # past argument
+ ;;
+
+ -t|--target)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ TARG="$2"
+ echo "[OPT]: Using target declaration: ${TARG}"
+ shift # past argument
+ ;;
+
+ -f|--flux)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ FLUX_DESCRIPTOR="$2"
+ echo "[OPT]: Using flux declaration: ${FLUX_DESCRIPTOR}"
+ shift # past argument
+ ;;
+
+ -n|--nevents)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ NEVENTS="$2"
+ echo "[OPT]: Throwing ${NEVENTS} events."
+ shift # past argument
+ ;;
+
+ -o|--output-file)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ OUPNAME="$2"
+ echo "[OPT]: Writing to file: ${OUPNAME}"
+ shift # past argument
+ ;;
+
+ --MDLQE)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ MDLQE="$2"
+ echo "[OPT]: Using MDLQE = ${MDLQE}"
+ shift # past argument
+ ;;
+
+ --MAQE)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ MAQE="$2"
+ echo "[OPT]: Attempting to generate with MAQE = ${MAQE}"
+ shift # past argument
+ ;;
+
+ --QE-only)
+
+ echo "[OPT]: Only generating true QE events."
+ QEONLY="yes"
+ ;;
+
+ --RES-only)
+
+ echo "[OPT]: Only generating true RES 1pi events."
+ RESONLY="yes"
+ ;;
+
+ --no-FSI)
+
+ echo "[OPT]: Disabling hadronic FSI."
+ FSIOFF="yes"
+ ;;
+
+ --no-nuc-eff)
+
+ echo "[OPT]: Disabling nuclear effects."
+ NUCEFFOFF="yes"
+ ;;
+
+ -?|--help)
+ # unknown option
+ echo "Arguments:"
+ echo -e "\tRequired:"
+ echo -e "\t -t|--target : e.g. \"CH\""
+ echo -e "\t -f|--flux : hint: use nuis_get_flux_descriptor for a simple interface."
+ echo -e "\t -n|--nevents <#num events>"
+ echo -e "\tOptional:"
+ echo -e "\t -p|--probe : defaults to 14"
+ echo -e "\t -o|--output-file : defaults to NEUT.....neutvect.root"
+ echo -e "\tModel options:"
+ echo -e "\t --MDLQE : If unspecified left up to NEUT default"
+ echo -e "\t --MAQE : If unspecified left up to NEUT default"
+ echo -e "\t --QE-only : Only generate QE events."
+ echo -e "\t --RES-only : Only generate RES 1pi events."
+ echo -e "\t --no-FSI : disable hadronic FSI"
+ echo -e "\t --no-nuc-eff : try to disable all nuclear effects"
+ echo -e ""
+ echo -e "\t -?|--help"
+ exit 0
+ ;;
+
+
+ *)
+ # unknown option
+ echo "Unknown option $1"
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+
+if [ -z ${FLUX_DESCRIPTOR} ]; then
+ echo "Please pass a flux declaration with the -f flag."
+ exit 2
+fi
+
+if [ -z ${NEVENTS} ]; then
+ echo "Please pass a number of events to generate with the -n flag."
+ exit 2
+fi
+
+OLDIFS=${IFS}
+IFS=","
+set -- ${FLUX_DESCRIPTOR}
+IFS=${OLDIFS}
+
+FLUX_FILE=${1}
+FLUX_HIST=${2}
+
+if [ -z {$FLUX_FILE} ] || [ -z {$FLUX_HIST} ]; then
+ echo -e "Please pass a flux declaration with the -f flag in the form \"-f file.root,histo_name\""
+ exit 2
+fi
+
+FLUX_FILE_NAME=${FLUX_FILE##*/}
+if [ ! -e ./${FLUX_FILE} ]; then
+ cp ${FLUX_FILE} ./
+fi
+
+if [ -z ${NEVENTS} ] ; then
+ echo "Please pass an integer number of events to run with the -n flag."
+ exit 3
+fi
+
+SEED=${RANDOM}
+
+if [ -z ${OUPNAME} ]; then
+ OUPNAME=neutvect.${PROBE}.${FLUX_HIST}.${FLUX_FILE_NAME%%.root}.${SEED}.root
+fi
+
+if [ -e ${OUPNAME} ]; then
+ echo "Already have file: ${OUPNAME}, not overwriting."
+ exit 1
+fi
+
+TARG_DESCRIPTOR=$(nuis_get_NEUT_target_descriptor ${TARG})
+
+OLDIFS=${IFS}
+IFS=":"
+set -- ${TARG_DESCRIPTOR}
+IFS=${OLDIFS}
+
+TARG_N=${1}
+TARG_Z=${2}
+TARG_H=${3}
+TARG_A=${4}
+
+
+CARDNAME=neutvect.${PROBE}.${FLUX_HIST}.${FLUX_FILE_NAME%%.root}.${SEED}.card
+
+echo "EVCT-NEVT ${NEVENTS}" > ${CARDNAME}
+
+echo "EVCT-IDPT ${PROBE}" >> ${CARDNAME}
+
+echo "EVCT-MPOS 1" >> ${CARDNAME}
+echo "EVCT-POS 0. 0. 0." >> ${CARDNAME}
+
+echo "EVCT-MDIR 1" >> ${CARDNAME}
+echo "EVCT-DIR 0. 0. 1." >> ${CARDNAME}
+
+echo "EVCT-MPV 3" >> ${CARDNAME}
+echo -e "EVCT-FILENM '${FLUX_FILE_NAME}'" >> ${CARDNAME}
+echo -e "EVCT-HISTNM '${FLUX_HIST}'" >> ${CARDNAME}
+echo "EVCT-INMEV 0" >> ${CARDNAME}
+
+echo "NEUT-NUMBNDN ${TARG_N}" >> ${CARDNAME}
+echo "NEUT-NUMBNDP ${TARG_Z}" >> ${CARDNAME}
+echo "NEUT-NUMFREP ${TARG_H}" >> ${CARDNAME}
+echo "NEUT-NUMATOM ${TARG_A}" >> ${CARDNAME}
+
+if [ "${QEONLY}" == "yes" ] && [ "${RESONLY}" == "yes" ]; then
+ echo "[ERROR]: Both --QE-only and --RES-only passed. Please pass one or neither."
+ exit 1
+fi
+
+
+if [ "${TARG}" = "H" ] || [ "${TARG}" = "D" ] || [ "${NUCEFFOFF}" = "yes" ]; then
+ MDLQE="02"
+ # nu nub
+ # 1: CC Q.E. CC Q.E.( Free )
+ # 2-4: CC 1pi CC 1pi
+ # 5: CC DIS 1320 CC DIS 1.3 < W < 2.0
+ # 6-9: NC 1pi NC 1pi
+ # 10: NC DIS 1320 NC DIS 1.3 < W < 2.0
+ # 11: NC els CC Q.E.( Bound )
+ # 12: NC els NC els
+ # 13: NC els NC els
+ # 14: coherent NC els
+ # 15: coherent coherent
+ # 16: CC eta coherent
+ # 17 NC eta CC eta
+ # 18: NC eta NC eta
+ # 19: CC K NC eta
+ # 20 NC K CC K
+ # 21: NC K NC K
+ # 22: N/A NC K
+ # 23: CC DIS CC DIS (W > 2.0)
+ # 24: NC DIS NC DIS (W > 2.0)
+ # 25: CC 1 gamma CC 1 gamma
+ # 26,27: NC 1 gamma NC 1 gamma
+ # 28 CC 2p2h CC 2p2h
+ # 29 CC Difract. CC Difract
+ # 30 NC Difract. NC Difract
+ #
+ #
+ # CRS : Multiplied factor to cross section on each mode. ( neu )
+ # CSRB : Multiplied factor to cross section on each mode. ( neu-bar )
+
+ echo "NEUT-MODE -1" >> ${CARDNAME}
+
+ if [ "${QEONLY}" == "yes" ]; then
+ # 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
+ echo "NEUT-CRS 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0." >> ${CARDNAME}
+ echo "NEUT-CRSB 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0." >> ${CARDNAME}
+ elif [ "${RESONLY}" == "yes" ];then
+ # 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
+ echo "NEUT-CRS 0. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0." >> ${CARDNAME}
+ echo "NEUT-CRSB 0. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0." >> ${CARDNAME}
+ else
+ # 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
+ echo "NEUT-CRS 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 0. 1. 1." >> ${CARDNAME}
+ echo "NEUT-CRSB 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 0. 1. 1." >> ${CARDNAME}
+ fi
+else
+ if [ "${QEONLY}" == "yes" ]; then
+ echo "NEUT-MODE -1" >> ${CARDNAME}
+ # 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
+ echo "NEUT-CRS 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0." >> ${CARDNAME}
+ echo "NEUT-CRSB 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0." >> ${CARDNAME}
+ elif [ "${RESONLY}" == "yes" ];then
+ echo "NEUT-MODE -1" >> ${CARDNAME}
+ # 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
+ echo "NEUT-CRS 0. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0." >> ${CARDNAME}
+ echo "NEUT-CRSB 0. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0." >> ${CARDNAME}
+ fi
+fi
+
+echo "NEUT-MDL2P2H 1" >> ${CARDNAME}
+
+if [ ! -z "${MDLQE}" ]; then
+ echo "NEUT-MDLQE ${MDLQE}" >> ${CARDNAME}
+fi
+if [ ! -z "${MAQE}" ]; then
+ echo "NEUT-MAQE ${MAQE}" >> ${CARDNAME}
+fi
+
+#disable nuclear effects if running on H/D
+if [ "${TARG}" = "H" ] || [ "${TARG}" = "D" ] || [ "${NUCEFFOFF}" = "yes" ]; then
+ echo "NEUT-PFSURF 0.000001" >> ${CARDNAME}
+ echo "NEUT-PFMAX 0.000001" >> ${CARDNAME}
+ echo "NEUT-VNUINI 0.000001" >> ${CARDNAME}
+ echo "NEUT-VNUFIN 0.000001" >> ${CARDNAME}
+
+ echo "NEUT-FERM 1" >> ${CARDNAME}
+ echo "NEUT-PAUL 1" >> ${CARDNAME}
+ echo "NEUT-NEFF 1" >> ${CARDNAME}
+ echo "NEUT-IFORMLEN 0" >> ${CARDNAME}
+ echo "NEUT-IPILESSDCY 0" >> ${CARDNAME}
+
+ echo "NEUT-ABSPIEMIT 0" >> ${CARDNAME}
+fi
+
+if [ "${TARG}" = "H" ] || [ "${TARG}" = "D" ] || [ "${FSIOFF}" = "yes" ]; then
+ echo "NUCRES-RESCAT 0" >> ${CARDNAME}
+
+ echo "NEUT-FEFQE 0." >> ${CARDNAME}
+ echo "NEUT-FEFQEH 0." >> ${CARDNAME}
+ echo "NEUT-FEFINEL 0." >> ${CARDNAME}
+ echo "NEUT-FEFABS 0." >> ${CARDNAME}
+ echo "NEUT-FEFCOH 0." >> ${CARDNAME}
+ echo "NEUT-FEFCX 0." >> ${CARDNAME}
+ echo "NEUT-FEFCXH 0." >> ${CARDNAME}
+ echo "NEUT-FEFQEHF 0." >> ${CARDNAME}
+ echo "NEUT-FEFCXHF 0." >> ${CARDNAME}
+ echo "NEUT-FEFCOHF 0." >> ${CARDNAME}
+ echo "NEUT-FEFCOUL 0." >> ${CARDNAME}
+ echo "NEUT-FEFALL 0." >> ${CARDNAME}
+fi
+
+echo "NEUT-RAND 1" >> ${CARDNAME}
+
+
+echo "Running neutroot2 ${CARDNAME} ${OUPNAME} for ${NEVS} events."
+neutroot2 ${CARDNAME} ${OUPNAME%%.root}.gen.root
+
+if [ -e ${OUPNAME%%.root}.gen.root ]; then
+ rm -f fort.77
+
+ mv ${OUPNAME%%.root}.gen.root ${OUPNAME}
+
+ PrepareNEUT -i ${OUPNAME} \
+ -f ${FLUX_FILE},${FLUX_HIST} -G
+else
+ echo "Failed to produce expected output file: ${OUPNAME}"
+ exit 1
+fi
\ No newline at end of file
diff --git a/event_gen/nuis_get_GENIE_target_descriptor b/event_gen/nuis_get_GENIE_target_descriptor
new file mode 100755
index 0000000..dc00d02
--- /dev/null
+++ b/event_gen/nuis_get_GENIE_target_descriptor
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+TARG=${1}
+
+if [ -z "${TARG}" ]; then
+ echo "[ERROR]: Please pass target materical descriptor, e.g. CH"
+ exit 1
+fi
+
+if [ "${TARG}" = "H" ]; then
+ echo "1000010010[1]"
+elif [ "${TARG}" = "D" ]; then
+ echo "1000010020[1]"
+elif [ "${TARG}" = "C" ]; then
+ echo "1000060120[1]"
+elif [ "${TARG}" = "CH" ]; then
+ echo "1000060120[.923076],1000010010[.076924]"
+elif [ "${TARG}" = "CH2" ]; then
+ echo "1000060120[.8571],1000010010[.14285]"
+elif [ "${TARG}" = "O" ]; then
+ echo "1000060120[1]"
+elif [ "${TARG}" = "H2O" ]; then
+ echo "1000080160[.888888],1000010010[.111112]"
+elif [ "${TARG}" = "Ar" ]; then
+ echo "1000180400[1]"
+elif [ "${TARG}" = "Fe" ]; then
+ echo "1000260560[1]"
+elif [ "${TARG}" = "Pb" ]; then
+ echo "1000822080[1]"
+else
+ echo "[ERROR]: Invalid target material: \"${TARG}\" for NEUT."
+fi
\ No newline at end of file
diff --git a/event_gen/nuis_get_NEUT_target_descriptor b/event_gen/nuis_get_NEUT_target_descriptor
new file mode 100755
index 0000000..11eb833
--- /dev/null
+++ b/event_gen/nuis_get_NEUT_target_descriptor
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+TARG=${1}
+
+if [ -z "${TARG}" ]; then
+ echo "[ERROR]: Please pass target materical descriptor, e.g. CH"
+ exit 1
+fi
+
+TARG_N=""
+TARG_Z=""
+TARG_H=""
+TARG_A=""
+
+if [ "${TARG}" = "H" ]; then
+ TARG_N="0"
+ TARG_Z="1"
+ TARG_H="0"
+ TARG_A="1"
+elif [ "${TARG}" = "D" ]; then
+ TARG_N="1"
+ TARG_Z="1"
+ TARG_H="0"
+ TARG_A="2"
+elif [ "${TARG}" = "C" ]; then
+ TARG_N="6"
+ TARG_Z="6"
+ TARG_H="0"
+ TARG_A="12"
+elif [ "${TARG}" = "CH" ]; then
+ TARG_N="6"
+ TARG_Z="6"
+ TARG_H="1"
+ TARG_A="12"
+elif [ "${TARG}" = "CH2" ]; then
+ TARG_N="6"
+ TARG_Z="6"
+ TARG_H="2"
+ TARG_A="12"
+elif [ "${TARG}" = "O" ]; then
+ TARG_N="8"
+ TARG_Z="8"
+ TARG_H="0"
+ TARG_A="16"
+elif [ "${TARG}" = "H2O" ]; then
+ TARG_N="8"
+ TARG_Z="8"
+ TARG_H="2"
+ TARG_A="16"
+elif [ "${TARG}" = "Ar" ]; then
+ TARG_N="22"
+ TARG_Z="18"
+ TARG_H="0"
+ TARG_A="40"
+elif [ "${TARG}" = "Fe" ]; then
+ TARG_N="30"
+ TARG_Z="26"
+ TARG_H="0"
+ TARG_A="56"
+elif [ "${TARG}" = "Pb" ]; then
+ TARG_N="126"
+ TARG_Z="82"
+ TARG_H="0"
+ TARG_A="208"
+else
+ echo "[ERROR]: Invalid target material: \"${TARG}\" for NEUT."
+fi
+
+echo "${TARG_N}:${TARG_Z}:${TARG_H}:${TARG_A}"
\ No newline at end of file
diff --git a/event_gen/nuis_get_flux_descriptor b/event_gen/nuis_get_flux_descriptor
new file mode 100755
index 0000000..75f4d87
--- /dev/null
+++ b/event_gen/nuis_get_flux_descriptor
@@ -0,0 +1,303 @@
+#!/bin/bash
+
+if [ -z ${NUISANCE} ]; then
+ echo "[ERROR]: We need to be in a NUISANCE environment (\$NUISANCE should be set)."
+ exit 1
+fi
+
+EXPERIMENT=""
+PROBE="14"
+BEAMMODE="nu"
+
+
+while [[ ${#} -gt 0 ]]; do
+
+ key="$1"
+ case $key in
+
+ -e|--experiment)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ EXPERIMENT="$2"
+ shift # past argument
+ ;;
+
+ -p|--probe)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ PROBE="$2"
+ shift # past argument
+ ;;
+
+ -m|--beam-mode)
+
+ if [[ ${#} -lt 2 ]]; then
+ echo "[ERROR]: ${1} expected a value."
+ exit 1
+ fi
+
+ BEAMMODE="$2"
+ shift # past argument
+ ;;
+
+ -AE|--all-experiments)
+
+ echo -e "Experimental Fluxes Available:"
+ echo -e " ANL_77 (ANL)"
+ echo -e " ArgoNeut"
+ echo -e " BEBC"
+ echo -e " BNL_81"
+ echo -e " BNL_86"
+ echo -e " BNL_02 (BNL)"
+ echo -e " FNAL_82"
+ echo -e " FNAL_93 (FNAL)"
+ echo -e " GGM"
+ echo -e " K2K"
+ echo -e " MicroBooNE"
+ echo -e " MINERvA_LE (MINERvA)"
+ echo -e " MINERvA_ME"
+ echo -e " MiniBooNE"
+ echo -e " NOvA_ND"
+ echo -e " SciBooNE"
+ echo -e " T2K_ND"
+ exit 0
+ ;;
+
+ -?|--help)
+ # unknown option
+ echo "Arguments:"
+ echo -e "\tRequired:"
+ echo -e "\t -e|--experiment "
+ echo -e "\tOptional:"
+ echo -e "\t -p|--probe : defaults to 14"
+ echo -e "\t -m|--beam-mode : defaults to nu"
+ echo -e "\t -AE|--all-experiments : List all experiments"
+ echo -e "\t -?|--help"
+ exit 0
+ ;;
+
+
+ *)
+ # unknown option
+ echo "Unknown option $1"
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+if [ -z "${EXPERIMENT}" ]; then
+ echo "[ERROR]: No experiment requested, please pass experiment name with -e CLI option."
+ exit 1
+fi
+
+if [ "${PROBE}" != "14" ] && [ "${PROBE}" != "-14" ] && [ "${PROBE}" != "12" ] \
+ && [ "${PROBE}" != "-12" ]; then
+ echo "[ERROR]: Invalid probe pdg requested, please use one of 14 (numu), -14, 12 (nue), or -12."
+ exit 1
+fi
+
+case $EXPERIMENT in
+ ANL)
+ # Bash 4 fallthrough
+ ;&
+ ANL_77)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/ANL_1977_2horn_rescan.root,numu_flux"
+ exit 0
+ fi
+ ;;
+ ArgoNeut)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/ArgoNeut_numu_flux.root,numu"
+ exit 0
+ elif [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/ArgoNeut_numub_flux.root,numub"
+ exit 0
+ fi
+ ;;
+ BEBC)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/BEBC_Wachsmuth_numu_table.root,numu_flux"
+ exit 0
+ elif [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/BEBC_Wachsmuth_numubar_table.root,numu_flux"
+ exit 0
+ fi
+ ;;
+ BNL_81)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/BNL_CCQE_1981_rescan-ALTERNATIVE.root,numu_flux"
+ exit 0
+ fi
+ ;;
+ BNL_86)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/BNL_1986_flux-ALTERNATIVE.root,numu_flux"
+ exit 0
+ fi
+ ;;
+ BNL)
+ # Bash 4 fallthrough
+ ;&
+ BNL_02)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/BNL_NuInt02_rescan.root,numu_flux"
+ exit 0
+ fi
+ ;;
+ FNAL_82)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/FNAL_CCinc_1982_nu_MCadj.root,numu_flux"
+ exit 0
+ fi
+ ;;
+ FNAL)
+ # Bash 4 fallthrough
+ ;&
+ FNAL_93)
+ if [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/FNAL_coh_1993_anu.root,numu_flux"
+ exit 0
+ fi
+ ;;
+ GGM)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/GGM_nu_flux_1979_rescan.root,numu_flux"
+ exit 0
+ fi
+ ;;
+ K2K)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/K2K_flux.root,numu_flux"
+ exit 0
+ fi
+ ;;
+ MicroBooNE)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/MicroBooNE_CCInc2019_numode_numu_flux.root,flux_numu"
+ exit 0
+ fi
+ ;;
+ MINERvA)
+ ;&
+ MINERvA_LE)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/minerva_le_flux.root,numu_fhc"
+ exit 0
+ elif [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/minerva_le_flux.root,numubar_fhc"
+ exit 0
+ elif [ "${PROBE}" == "12" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/minerva_le_flux.root,nue_fhc"
+ exit 0
+ elif [ "${PROBE}" == "-12" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/minerva_le_flux.root,nuebar_fhc"
+ exit 0
+ elif [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/minerva_le_flux.root,numu_rhc"
+ exit 0
+ elif [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/minerva_le_flux.root,numubar_rhc"
+ exit 0
+ elif [ "${PROBE}" == "12" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/minerva_le_flux.root,nue_rhc"
+ exit 0
+ elif [ "${PROBE}" == "-12" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/minerva_le_flux.root,nuebar_rhc"
+ exit 0
+ fi
+ ;;
+ MINERvA_ME)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/MINERvA_ME_Flux_No_Constraint.root,reweightedflux_rebinned_CV_WithStatErr"
+ exit 0
+ fi
+ ;;
+ MiniBooNE)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/MiniBooNE_numu_flux.root,numu_mb"
+ exit 0
+ elif [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/MiniBooNE_numu_flux.root,numub_mb"
+ exit 0
+ elif [ "${PROBE}" == "12" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/MiniBooNE_numu_flux.root,nue_mb"
+ exit 0
+ elif [ "${PROBE}" == "-12" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/MiniBooNE_numu_flux.root,nueb_mb"
+ exit 0
+ elif [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/MiniBooNE_numubar_flux.root,numu_mb"
+ exit 0
+ elif [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/MiniBooNE_numubar_flux.root,numub_mb"
+ exit 0
+ elif [ "${PROBE}" == "12" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/MiniBooNE_numubar_flux.root,nue_mb"
+ exit 0
+ elif [ "${PROBE}" == "-12" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/MiniBooNE_numubar_flux.root,nueb_mb"
+ exit 0
+ fi
+ ;;
+ NOvA_ND)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/FHC_Flux_NOvA_ND_2017.root,flux_numu"
+ exit 0
+ elif [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/FHC_Flux_NOvA_ND_2017.root,flux_numubar"
+ exit 0
+ elif [ "${PROBE}" == "12" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/FHC_Flux_NOvA_ND_2017.root,flux_nue"
+ exit 0
+ elif [ "${PROBE}" == "-12" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/FHC_Flux_NOvA_ND_2017.root,flux_nuebar"
+ exit 0
+ fi
+ ;;
+ SciBooNE)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/sciboone_fhc.root,flux_numu"
+ exit 0
+ fi
+ ;;
+ T2K_ND)
+ if [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/t2kflux_2016_plus250kA.root,enu_nd280_numu"
+ exit 0
+ elif [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/t2kflux_2016_plus250kA.root,enu_nd280_numub"
+ exit 0
+ elif [ "${PROBE}" == "12" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/t2kflux_2016_plus250kA.root,enu_nd280_nue"
+ exit 0
+ elif [ "${PROBE}" == "-12" ] && [ "${BEAMMODE}" == "nu" ]; then
+ echo "${NUISANCE}/data/flux/t2kflux_2016_plus250kA.root,enu_nd280_nueb"
+ exit 0
+ elif [ "${PROBE}" == "14" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/t2kflux_2016_minus250kA.root,enu_nd280_numu"
+ exit 0
+ elif [ "${PROBE}" == "-14" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/t2kflux_2016_minus250kA.root,enu_nd280_numub"
+ exit 0
+ elif [ "${PROBE}" == "12" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/t2kflux_2016_minus250kA.root,enu_nd280_nue"
+ exit 0
+ elif [ "${PROBE}" == "-12" ] && [ "${BEAMMODE}" == "nubar" ]; then
+ echo "${NUISANCE}/data/flux/t2kflux_2016_minus250kA.root,enu_nd280_nueb"
+ exit 0
+ fi
+ ;;
+esac
+
+echo "[ERROR]: Could not find flux for Experiment: \"${EXPERIMENT}\", in Mode: \"${BEAMMODE}\" for neutrino species pdg: \"${PROBE}\"."
+exit 1
\ No newline at end of file
diff --git a/event_gen/nuwro/ArgoNeuT/ArgoNeut_nu.params b/event_gen/nuwro/ArgoNeuT/ArgoNeut_nu.params
deleted file mode 100644
index 78a8857..0000000
--- a/event_gen/nuwro/ArgoNeuT/ArgoNeut_nu.params
+++ /dev/null
@@ -1,132 +0,0 @@
-random_seed = 0
-number_of_events = 250000
-number_of_test_events = 1000000
-save_test_events = 0
-OutputEvtHistogram = 1
-user_events = 0
-user_params =
-beam_type = 0
-beam_energy = 0 50E3 8.0E3 4.2E4 6.9E4 6.9E4 2.8E4 8.9E3 4.7E3 3.3E3 2.4E3 1.9E3 1.6E3 1.2E3 1.1E3 8.3E2 6.8E2 5.6E2 4.8E2 3.7E2 3.1E2 2.6E2 0.3E2 0.3E2 0.3E2 0.3E2 0.3E2 12.2 12.2 12.2 12.2 12.2 5.8 5.8 5.8 5.8 5.8 2.8 2.8 2.8 2.8 2.8 1.5 1.5 1.5 1.5 1.5 0.88 0.88 0.88 0.88 0.88
-beam_particle = 14
-beam_direction = 0 0 1
-beam_content =
-beam_folder = flux
-beam_file = 1
-beam_file_first = 1
-beam_file_limit = 0
-beam_weighted = 0
-beam_offset = 0 0 0
-beam_placement = 0
-beam_test_only = 0
-target_type = 0
-nucleus_p = 18
-nucleus_n = 22
-nucleus_E_b = 34
-nucleus_kf = 220
-target_content =
-geo_file = target/ND280_v9r7p5.root
-geo_name = ND280Geometry_v9r7p5
-geo_volume =
-geo_o = 0 0 0
-geo_d = 2000 2000 5000
-nucleus_target = 2
-nucleus_model = 1
-nucleus_LFGkfScale = 1
-dyn_qel_cc = 1
-dyn_qel_nc = 1
-dyn_res_cc = 1
-dyn_res_nc = 1
-dyn_dis_cc = 1
-dyn_dis_nc = 1
-dyn_coh_cc = 1
-dyn_coh_nc = 1
-dyn_mec_cc = 0
-dyn_mec_nc = 0
-qel_kinematics = 0
-qel_vector_ff_set = 2
-bba07_AEp1 = 1
-bba07_AEp2 = 0.9927
-bba07_AEp3 = 0.9898
-bba07_AEp4 = 0.9975
-bba07_AEp5 = 0.9812
-bba07_AEp6 = 0.934
-bba07_AEp7 = 1
-bba07_AMp1 = 1
-bba07_AMp2 = 1.0011
-bba07_AMp3 = 0.9992
-bba07_AMp4 = 0.9974
-bba07_AMp5 = 1.001
-bba07_AMp6 = 1.0003
-bba07_AMp7 = 1
-bba07_AEn1 = 1
-bba07_AEn2 = 1.011
-bba07_AEn3 = 1.1392
-bba07_AEn4 = 1.0203
-bba07_AEn5 = 1.1093
-bba07_AEn6 = 1.5429
-bba07_AEn7 = 0.9706
-bba07_AMn1 = 1
-bba07_AMn2 = 0.9958
-bba07_AMn3 = 0.9877
-bba07_AMn4 = 1.0193
-bba07_AMn5 = 1.035
-bba07_AMn6 = 0.9164
-bba07_AMn7 = 0.73
-bba07_AAx1 = 1
-bba07_AAx2 = 0.9958
-bba07_AAx3 = 0.9877
-bba07_AAx4 = 1.0193
-bba07_AAx5 = 1.035
-bba07_AAx6 = 0.9164
-bba07_AAx7 = 0.73
-qel_axial_ff_set = 1
-qel_rpa = 0
-qel_strange = 1
-qel_strangeEM = 0
-delta_s = -0.15
-qel_cc_vector_mass = 1000
-qel_cc_axial_mass = 1200
-qel_nc_axial_mass = 1350
-qel_s_axial_mass = 1200
-qel_axial_2comp_gamma = 0.15
-qel_axial_2comp_alpha = 2
-qel_axial_3comp_theta = 0.15
-qel_axial_3comp_beta = 2
-flux_correction = 0
-sf_method = 0
-sf_pb = 0
-cc_smoothing = 0
-delta_FF_set = 1
-pion_axial_mass = 0.94
-pion_C5A = 1.19
-SPPBkgScale = 0
-delta_angular = 0
-spp_precision = 500
-res_dis_cut = 1600
-bkgrscaling = 0
-coh_mass_correction = 1
-coh_new = 1
-coh_kind = 2
-mec_kind = 1
-mec_ratio_pp = 0.9
-mec_ratio_ppp = 0.8
-mec_central_motion = 100
-mec_back_to_back_smearing = 0.15
-mec_pb_trials = 25
-MEC_pauli_blocking = 1
-MEC_cm_direction = 0
-kaskada_on = 1
-kaskada_w = 7
-kaskada_redo = 0
-kaskada_writeall = 0
-kaskada_newangle = 0
-formation_zone = fz
-tau = 8
-formation_length = 1
-first_step = 1
-step = 0.2
-xsec = 1
-pauli_blocking = 1
-mixed_order = 1
-rmin = 1
-rmax = 1
diff --git a/event_gen/nuwro/ND280/ND280_CH_FHC.params b/event_gen/nuwro/ND280/ND280_CH_FHC.params
deleted file mode 100644
index 22b3124..0000000
--- a/event_gen/nuwro/ND280/ND280_CH_FHC.params
+++ /dev/null
@@ -1,136 +0,0 @@
-random_seed = 0
-number_of_events = 50000
-number_of_test_events = 1000000
-save_test_events = 0
-OutputEvtHistogram = 1
-user_events = 0
-user_params =
-beam_type = 1
-beam_energy =1000
-beam_particle = 14
-beam_direction = 0 0 1
-beam_content = 14 92.8% 50 9450 38571.4 82467.5 134286 208016 291786 389464 496786 601825 747946 945238 1.09036e+06 1.13119e+06 1.07349e+06 915000 676786 455000 293571 194048 141464 110714 91904.8 78285.7 68015.9 60918.4 53954.1 48452.4 43035.7 39365.1 35754 33992.3 32251.3 30510.2 28769.1 27028.1 25287 24085.1 22989.6 21894.1 20798.6 19703 18607.5 17512 16416.5 15321 14266.5 13917.1 13567.6 13218.1 12868.7 12519.2 12169.7 11820.3 11470.8 11121.4 10771.9 10507.9 10260.8 10013.6 9766.52 9519.39 9272.26 9025.14 8778.01 8530.88 8308.78 8206.78 8104.78 8002.77 7900.77 7798.77 7696.77 7594.77 7492.77 7390.76 7288.76 7196.35 7105.94 7015.53 6925.12 6834.71 6744.3 6653.89 6563.47 6473.06 6382.65 6245.64 6098.92 5952.2 5805.48 5658.75 5512.03 5365.31 5218.59 5071.87 4925.15 4787.18 4651.05 4514.91 4378.77 4242.63 4106.49 3970.35 3834.22 3698.08 3561.94 3425.8 3289.66 3153.53 3017.39 2881.25 2767.77 2704.64 2641.51 2578.38 2515.25 2452.12 2389 2325.87 2262.74 2199.61 2136.48 2073.35 2010.22 1947.09 1883.97 1820.84 1757.71 1694.58 1631.45 1568.32 1524.02 1489.62 1455.22 1420.82 1386.42 1352.02 1317.63 1283.23 1248.83 1214.43 1180.03 1145.63 1111.24 1076.84 1042.44 1008.04 973.643 939.245 904.847 870.448 847.568 830.749 813.93 797.111 780.292 763.473 746.654 729.835 713.016 696.197 679.377 662.558 645.739 628.92 612.101 595.282 578.463 561.644 544.825 528.006 514.286 502.196 490.106 478.017 465.927 453.837 441.748 429.658 417.568 405.478 393.389 381.299 369.209 357.12 345.03 332.94 320.85 308.761 296.671
-beam_content += -14 5.9% 50 9450 30264.9 34305.2 34028.6 30703.8 26975.1 27044.5 27369.6 27746.9 28126.5 27779.2 27413.1 26882.3 26331.1 24512 22578 20644.1 18710.1 17191.8 15675.9 14695.9 13768.4 12933.3 12098.2 11433.4 10770.2 9830.67 8891.1 8107.64 7336.35 6880.7 6439.43 6213.76 5990.46 5520.28 5050.11 4809.09 4587.31 4365.54 4143.76 3868.78 3592.18 3381.59 3171.36 2938.91 2705.28 2495.05 2284.81 2307.97 2341.74 2375.5 2270.61 2164.19 2057.77 1951.34 1840.22 1728.04 1615.85 1503.66 1491 1494.39 1497.78 1482.94 1388.2 1293.45 1198.71 1138.77 1134.57 1130.36 1126.16 1108.57 1048.01 987.446 926.886 869.666 845.929 822.193 798.457 774.72 749.48 724.151 698.822 673.492 648.163 622.833 597.859 583.501 569.143 554.785 540.427 526.068 511.71 497.352 482.994 468.636 454.31 443.006 431.702 420.398 409.093 397.789 386.485 375.181 363.877 352.572 341.268 329.964 318.66 307.355 296.051 285.453 278.819 272.185 265.551 258.917 252.283 245.648 239.014 232.38 225.746 219.112 212.478 205.844 199.21 192.575 185.941 179.307 172.673 166.039 159.405 152.771 147.274 143.367 139.46 135.554 131.647 127.741 123.834 119.928 116.021 112.114 108.208 104.301 100.395 96.4881 92.5816 88.675 84.7684 80.8618 76.9553 73.0487 70.0752 68.666 67.2567 65.8475 64.4382 63.029 61.6197 60.2105 58.8012 57.392 55.9827 54.5735 53.1642 51.755 50.3457 48.9365 47.5272 46.118 44.7087 43.2995 42.5277 42.0615 41.5953 41.129 40.6628 40.1966 39.7303 39.2641 38.7979 38.3316 37.8654 37.3991 36.9329 36.4667 36.0004 35.5342 35.068 34.6017 34.1355
-beam_content += 12 1.1% 50 9450 682.68 1614.26 2547.81 3539.18 4497.06 4879.09 5261.12 5389.59 5493.08 5447.68 5400.58 5199.56 4992.35 4603.48 4214.62 3951.77 3690.69 3362.89 3035.08 2856.57 2678.66 2405.14 2135.59 1982.91 1833.19 1734.37 1635.54 1523.59 1411.2 1357.52 1304.49 1222.73 1139.13 1093.73 1048.33 1030.99 1015.27 983.975 952.147 928.287 904.697 897.463 890.229 866.417 841.434 820.08 798.725 782.205 766.49 750.775 731.959 712.76 693.561 674.362 651.394 627.623 603.851 580.08 558.781 537.857 516.933 496.01 477.714 460.207 442.699 425.192 409.079 393.749 378.419 363.089 352.524 342.774 333.024 323.273 310.985 297.728 284.472 271.215 259.332 251.523 243.713 235.904 228.094 220.285 212.476 204.683 197.583 190.483 183.383 176.282 169.182 162.082 154.982 147.882 140.782 135.001 131.267 127.533 123.799 120.065 116.331 112.597 108.863 105.129 101.396 97.6616 93.9277 90.1938 86.4599 82.7259 79.3897 77.2714 75.1531 73.0348 70.9164 68.7981 66.6798 64.5615 62.4431 60.3248 58.2065 56.0882 53.9698 51.8515 49.7332 47.6149 45.4965 43.3782 41.2599 39.1416 37.3594 36.4119 35.4644 34.5169 33.5694 32.6219 31.6744 30.7269 29.7794 28.8319 27.8844 26.9369 25.9894 25.042 24.0945 23.147 22.1995 21.252 20.3045 19.357 18.4095 17.8893 17.38 16.8706 16.3612 15.8519 15.3425 14.8332 14.3238 13.8145 13.3051 12.7958 12.2864 11.7771 11.2677 10.7583 10.249 9.73964 9.23028 8.72093 8.34094 8.18991 8.03887 7.88783 7.73679 7.58575 7.43471 7.28368 7.13264 6.9816 6.83056 6.67952 6.52848 6.37745 6.22641 6.07537 5.92433 5.77329 5.62226
-beam_content += -12 0.2% 50 9450 69.169 148.438 227.629 291.149 353.265 382.617 411.969 463.842 510.51 499.004 487.645 486.89 486.136 481.116 475.782 511.634 539.866 479.616 419.964 403.28 387.281 387.244 385.393 358.873 333.381 317.574 302.12 312.118 322.116 311.572 299.771 291.411 283.23 276.741 270.206 260.333 250.926 252.401 252.375 231.908 213.194 211.007 208.89 211.879 214.122 198.952 184.749 183.703 182.657 181.116 175.558 169.999 164.44 159.004 155.67 152.336 149.002 145.669 142.772 139.884 136.996 134.108 130.574 126.825 123.076 119.326 113.526 107.593 101.661 95.7284 94.1626 93.803 93.4434 93.0838 90.1456 87.1387 84.1318 81.1249 78.5051 76.3185 74.1319 71.9453 69.7588 67.5722 65.3856 63.899 62.4974 61.0958 59.6942 58.2926 56.891 55.4894 54.0878 52.6862 51.2846 49.8847 48.4864 47.0881 45.6899 44.2916 42.8933 41.4951 40.0968 38.6985 37.3003 35.902 34.5037 33.1055 31.7072 30.3089 29.547 28.8139 28.0808 27.3477 26.6146 25.8816 25.1485 24.4154 23.6823 22.9492 22.2161 21.483 20.7499 20.0168 19.2837 18.5506 17.8175 17.0844 16.3513 15.6873 15.2732 14.8591 14.445 14.031 13.6169 13.2028 12.7887 12.3747 11.9606 11.5465 11.1324 10.7184 10.3043 9.89021 9.47614 9.06206 8.64799 8.23391 7.81984 7.40576 7.17193 6.98789 6.80385 6.61981 6.43577 6.25173 6.06769 5.88365 5.69961 5.51557 5.33153 5.14749 4.96345 4.77941 4.59537 4.41133 4.22728 4.04324 3.8592 3.68106 3.63326 3.58546 3.53767 3.48987 3.44207 3.39427 3.34647 3.29868 3.25088 3.20308 3.15528 3.10748 3.05968 3.01189 2.96409 2.91629 2.86849 2.82069 2.77289
-beam_folder = flux
-beam_file = 1
-beam_file_first = 1
-beam_file_limit = 0
-beam_weighted = 0
-beam_offset = 0 0 0
-beam_placement = 0
-beam_test_only = 0
-target_type = 1
-nucleus_p = 6
-nucleus_n = 6
-nucleus_E_b = 34
-nucleus_kf = 220
-target_content = 1 0 1x 0 0 0
-target_content += 6 6 1x 27 220 2
-geo_file = target/ND280_v9r7p5.root
-geo_name = ND280Geometry_v9r7p5
-geo_volume =
-geo_o = 0 0 0
-geo_d = 2000 2000 5000
-nucleus_target = 2
-nucleus_model = 1
-nucleus_LFGkfScale = 1
-dyn_qel_cc = 1
-dyn_qel_nc = 0
-dyn_res_cc = 1
-dyn_res_nc = 0
-dyn_dis_cc = 1
-dyn_dis_nc = 0
-dyn_coh_cc = 0
-dyn_coh_nc = 0
-dyn_mec_cc = 1
-dyn_mec_nc = 0
-qel_kinematics = 0
-qel_vector_ff_set = 2
-bba07_AEp1 = 1
-bba07_AEp2 = 0.9927
-bba07_AEp3 = 0.9898
-bba07_AEp4 = 0.9975
-bba07_AEp5 = 0.9812
-bba07_AEp6 = 0.934
-bba07_AEp7 = 1
-bba07_AMp1 = 1
-bba07_AMp2 = 1.0011
-bba07_AMp3 = 0.9992
-bba07_AMp4 = 0.9974
-bba07_AMp5 = 1.001
-bba07_AMp6 = 1.0003
-bba07_AMp7 = 1
-bba07_AEn1 = 1
-bba07_AEn2 = 1.011
-bba07_AEn3 = 1.1392
-bba07_AEn4 = 1.0203
-bba07_AEn5 = 1.1093
-bba07_AEn6 = 1.5429
-bba07_AEn7 = 0.9706
-bba07_AMn1 = 1
-bba07_AMn2 = 0.9958
-bba07_AMn3 = 0.9877
-bba07_AMn4 = 1.0193
-bba07_AMn5 = 1.035
-bba07_AMn6 = 0.9164
-bba07_AMn7 = 0.73
-bba07_AAx1 = 1
-bba07_AAx2 = 0.9958
-bba07_AAx3 = 0.9877
-bba07_AAx4 = 1.0193
-bba07_AAx5 = 1.035
-bba07_AAx6 = 0.9164
-bba07_AAx7 = 0.73
-qel_axial_ff_set = 1
-qel_rpa = 0
-qel_strange = 1
-qel_strangeEM = 0
-delta_s = -0.15
-qel_cc_vector_mass = 1000
-qel_cc_axial_mass = 1200
-qel_nc_axial_mass = 1350
-qel_s_axial_mass = 1200
-qel_axial_2comp_gamma = 0.15
-qel_axial_2comp_alpha = 2
-qel_axial_3comp_theta = 0.15
-qel_axial_3comp_beta = 2
-flux_correction = 0
-sf_method = 0
-sf_pb = 0
-cc_smoothing = 0
-delta_FF_set = 1
-pion_axial_mass = 0.94
-pion_C5A = 1.19
-SPPBkgScale = 0
-delta_angular = 0
-spp_precision = 500
-res_dis_cut = 1600
-bkgrscaling = 0
-coh_mass_correction = 1
-coh_new = 1
-coh_kind = 2
-mec_kind = 3
-mec_ratio_pp = 0.6
-mec_ratio_ppp = 0.8
-mec_central_motion = 0
-mec_back_to_back_smearing = 0
-mec_pb_trials = 25
-MEC_pauli_blocking = 1
-MEC_cm_direction = 0
-kaskada_on = 1
-kaskada_w = 7
-kaskada_redo = 0
-kaskada_writeall = 0
-kaskada_newangle = 0
-formation_zone = fz
-tau = 8
-formation_length = 1
-first_step = 1
-step = 0.2
-xsec = 1
-pauli_blocking = 1
-mixed_order = 1
-rmin = 1
-rmax = 1
diff --git a/myenv.sh b/myenv.sh
deleted file mode 100644
index c089872..0000000
--- a/myenv.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-#############
-## ROOT RELATED BUSINESS
-source /vols/t2k/users/cvw09/software/root/bin/thisroot.sh
-
-
-
-#############
-## NEUT RELATED BUSINESS
-#export NEUT_ROOT=/vols/t2k/users/cvw09/software/neut-devel/trunk
-#export NEUT_ROOT=~/ssd/neut-devel/branches/neut_5.4.0.1
-#export NEUT_VERSION=5.4.0.1
-#export NEUT_VERSION=5.4.0.1
-
-#export NEUT_ROOT=/vols/build/t2k/cvw09/neut-devel/branches/neut_5.4.1_alpha
-#export NEUT_VERSION=5.4.1
-#export NEUT_ROOT=~/ssd/neut_5.3.6_minoo
-#export CERN=~/ssd/CERNLIB
-#export CERN_LEVEL=2005
-#export LD_LIBRARY_PATH=${NEUT_ROOT}/src/reweight:${LD_LIBRARY_PATH}
-
-#############
-## GENIE RELATED BUSINESS
-#source ~/ssd/lamp/environment_setup.sh
-#source ~/ssd/lamp/environment_setup_2.8.4.sh
-#source ~/ssd/lamp/environment_setup_2.10.10.sh
-
-export NUISANCE=$(pwd -P)
diff --git a/parameters/config.xml b/parameters/config.xml
index 6766fb4..7fc8c97 100644
--- a/parameters/config.xml
+++ b/parameters/config.xml
@@ -1,234 +1,235 @@
-
+
+
-
+
diff --git a/parameters/fitter.config.dat b/parameters/fitter.config.dat
index a0c71d0..b138dae 100644
--- a/parameters/fitter.config.dat
+++ b/parameters/fitter.config.dat
@@ -1,158 +1,158 @@
# ######################################################
# NUISANCE CONFIGURATION OPTIONS
# This file is read in by default at runtime
# If you want to override on a case by case bases use -q at runtime
# ######################################################
# MAIN Configs
# ######################################################
# Logger goes from
# 1 Quiet
# 2 Fitter
# 3 Samples
# 4 Reconfigure Loops
# 5 Every Event print out (SHOUT)
# -1 DEBUGGING
config verbosity 2
config VERBOSITY 2
# ERROR goes from
#Â 0 NONE
# 1 FATAL
# 2 WARN
config ERROR 2
# Input Configs
# ######################################################
# Default Requirements file for the externalDataFitter Package
# MAX Events : -1 is no cut. Events will be scaled automatically to give good xsec predictions.
config input.maxevents -1
config MAXEVENTS -1
config input.MAXEVENTS -1
# Turn on/off event manager
# EventManager enables us to only loop number of events once for multiple projections of the same measurements
# e.g. MiniBooNE CC1pi+ Q2 and MiniBooNE CC1pi+ Tmu would ordinarily require 2 reconfigures, but with this enabled it requires only one
config input.eventmanager 0
config EventManager 0
# Event Directories
# Can setup default directories and use @EVENT_DIR/path to link to it
config EVENT_DIR /data2/stowell/NIWG/
config NEUT_EVENT_DIR /data2/stowell/NIWG/neut/fit_samples_neut5.3.3/
config GENIE_EVENT_DIR /data2/stowell/NIWG/genie/fit_samples_R.2.10.0/
config NUWRO_EVENT_DIR /data2/stowell/NIWG/nuwro/fit_samples/
config GIBUU_EVENT_DIR /data/GIBUU/DIR/
# In PrepareGENIE the reconstructed splines can be saved into the file
config save_genie_splines 1
# In InputHandler the option to regenerate NuWro flux/xsec plots is available
# Going to move this to its own app soon
config input.regen_nuwro_plots 0
# DEVEL CONFIG OPTION, don't touch!
config cachesize 0
# ReWeighting Configuration Options
# ######################################################
# Set absolute twkdial for parameters
config params.setabstwk 0
# Convert Dials in output statements using dial conversion card
config convert_dials 0
# Make RW Calculations be quiet
condif params.silentweighting 0
# Vetos can be used to specify RW dials NOT to be loaded in
#Â Useful if one specific one has an issue
config FitWeight.fNIWGRW_veto ''
config FitWeight.fNuwroRW_veto ''
config FitWeight.fNeutRW_veto ''
config FitWeight.fGenieRW_veto ''
# Output Options
# ######################################################
# Save Nominal prediction with all rw engines at default
config savenominal 0
# Save prefit with values at starting values
config saveprefit 0
# Here's the full list of drawing options
# See src/FitBase/Measurement1D::Write for more info
#config drawopts DATA/MC/EVT/FINE/RATIO/MODES/SHAPE/RESIDUAL/MATRIX/FLUX/MASK/MAP
#config drawopts DATA/MC
-config drawopts DATA/MC/EVT/FINE/RATIO/MODES/SHAPE/FLUX/XSEC/MASK/COV/INVCOV/DECOMP/CANVPDG/CANVMC
+config drawopts DATA/MC/EVT/FINE/RATIO/MODES/SHAPE/FLUX/XSEC/MASK/MAP/COV/INVCOV/DECOMP/CANVPDG/CANVMC
# Save the shape scaling applied with option SHAPE into the main MC hist
config saveshapescaling 0
# Set style of 1D output histograms
config linecolour 1
config linestyle 1
config linewidth 1
# For GenericFlux
config isLiteMode 0
# Statistical Options
# ######################################################
# Add MC Statistical error to likelihoods
config statutils.addmcerror 0
# NUISMIN Configurations
# ######################################################
config minimizer.maxcalls 1000000
config minimizer.maxiterations 1000000
config minimizer.tolerance 0.001
# Number of events required in low stats routines
config minimizer.lowstatevents 25000
# Error band generator configs
# ######################################################
# For -f ErrorBands creates error bands for given measurements
# How many throws do we want (The higher the better precision)
config error_throws 250
# Are we throwing uniform or according to Gaussian?
# Only use uniform if wanting to study the limits of a dial.
config error_uniform 0
# Other Individual Case Configs
# ######################################################
# Covariance throw options for fake data studies with MiniBooNE data.
config thrown_covariance FULL
config throw_mc_stat 0.0
config throw_diag_syst 0
config throw_corr_syst 0
config throw_mc_stat 0
# Apply a shift to the muon momentum before calculation of Q2
config muon_momentum_shift 0.0
config muon_momentum_throw 0
# MINERvA Specific Configs
config MINERvA_XSec_CCinc_2DEavq3_nu.hadron_cut 0
config MINERvA_CCinc_XSec_2DEavq3_nu.useq3true 0
config Modes.split_PN_NN 0
# SciBooNE specific
config SciBarDensity 1.04
#config SciBarDensity 2.00
config SciBarRecoDist 10.0
config PenetratingMuonEnergy 1.4
config NumRangeSteps 50
diff --git a/scripts/nuiscardcreator.py b/scripts/nuiscardcreator.py
index a1f61d1..43f5174 100755
--- a/scripts/nuiscardcreator.py
+++ b/scripts/nuiscardcreator.py
@@ -1,280 +1,280 @@
import argparse
from ROOT import *
import os, sys
import xml.etree.ElementTree as ET
from subprocess import call
import inspect
def PrintCard():
inputlist = {}
inputtype = {}
i = ET.parse('mysample.xml')
for itype in i.findall('input'):
filetype = itype.get('type')
filename = itype.get('file')
if filetype and filename:
filegen = filename.split(":")[0]
filename = filename.split(":")[1]
if not filename: continue
inputlist[filetype] = filename
inputtype[filetype] = filegen
e = ET.parse('sample_list.xml')
for atype in e.findall('input'):
samplename = atype.get('sample')
sampletype = atype.get('type')
newgen = ""
typesplit = sampletype.replace(",",";").split(";")
oldf = len(typesplit)
newf = 0
for obj in typesplit:
newobj = obj.replace("TYPE:","").replace("(","").replace(")","")
if newobj in inputlist:
sampletype = sampletype.replace(newobj, inputlist[newobj])
sampletype = sampletype.replace("TYPE", inputtype[newobj])
newf += 1
if newf != oldf: continue
def PrintTypes():
print ""
objlist = []
e = ET.parse('sample_list.xml')
for atype in e.findall('input'):
sampletype = atype.get('type')
sampletype = sampletype.replace("TYPE:","").replace("(","").replace(")","")
typesplit = sampletype.replace(",",";").split(";")
for obj in typesplit:
if obj not in objlist:
objlist.append(obj)
print '< type="'+obj+'" file="TYPE:" />'
print ""
forceful = False
xmlformat = True
def CreateBlankInputXML(outputcard):
# Parse Sample List
samplelist = str(os.environ['NUISANCE']) + '/src/FCN/sample_list.xml'
samplelistxml = ET.parse(samplelist)
# Keep track of unique ids
idlist = []
commentlist = []
# Loop over all samples and find unique ids
for sample in samplelistxml.findall('input'):
# Read Comments
comment = sample.get('eventcomment')
if (comment):
commentlist.append(comment)
continue
# Read Inputs
inputid = sample.get('type')
if (inputid):
inputid = inputid.replace("TYPE:","").replace("(","").replace(")","")
# Get all unique ids after split
inputsplit = inputid.replace(",",";").split(";")
for id in inputsplit:
if id not in idlist:
idlist.append(id)
# Check for output card
if os.path.isfile(outputcard) and not forceful:
print "File:", outputcard, "already exists. Use -f flag to overwrite."
sys.exit(-1)
# Save out unique ids to xml (by writing manually...)
f = open(outputcard,"w")
f.write("\n\n")
f.write(' \n')
for comment in commentlist:
f.write(' \n')
f.write('\n\n')
for id in idlist:
f.write(' \n')
f.write("")
# Print out useage
print "Created a new blank input example inside :", outputcard
print "Fill in all the data files you care about, and then run: \n"
print " $ nuiscardcreator -inputs " + outputcard + " -output nuisance.card \n"
print "to generate a working nuisance card file. "
sys.exit(0)
def CheckComment(checks, comparison):
for check in checks.split("/"):
found = True
for obj2 in check.split("+"):
if obj2 not in comparison: found = False
if found: return True
return False
def GenerateCardXML(inputs, outputs):
inputfiles = {}
inputtypes = {}
# Parse our input card first
inputlistxml = ET.parse(inputs)
for inputfile in inputlistxml.findall('input'):
# Get type and file
filetype = inputfile.get('type')
filename = inputfile.get('file')
# Check valid
if not filetype or not filename: continue
# Split by path and type
filegenr, filepath = filename.split(":")
# Check both valid
if not filegenr or not filepath: continue
# Fill our containers
inputfiles[filetype] = filepath
inputtypes[filetype] = filegenr
print inputfiles
# Parse Sample List
samplelist = str(os.environ['NUISANCE']) + '/src/FCN/sample_list.xml'
samplelistxml = ET.parse(samplelist)
# container for output lines
sampleoutputs = []
allsamples = ''
# Parser
for sample in samplelistxml.findall('input'):
# Allow for actions + comments
if (sample.get('comment')):
# Add to list
sampleoutputs.append( ['@COMMENT', sample.get('comment'), sample.get('check')] )
continue
if (sample.get('action')):
sampleoutputs.append( ['@ACTION', sample.get('action')] )
continue
# Get information
samplename = sample.get('sample')
sampletype = sample.get('type')
# Check valid
if not samplename or not sampletype: continue
- # Seperate into uids
+ # Separate into uids
typesplit = sampletype.replace(",",";").split(";")
# Make sure we can replace all uids
startlength = len(typesplit)
endlength = 0
# Loop over all ids
for uid in typesplit:
parseduid = uid.replace("TYPE:","").replace("(","").replace(")","")
# Check we have this file given
if not parseduid in inputfiles: continue
# Replace UID in samplelist with file given by user
sampletype = sampletype.replace(parseduid, inputfiles[parseduid])
sampletype = sampletype.replace("TYPE", inputtypes[parseduid])
# Count how many uids replaced
endlength += 1
# If not all uids caught, skip
if startlength != endlength: continue
sampleoutputs.append( [samplename, sampletype] )
allsamples += " " + samplename
# Setup outputs
outputfile = outputs
if not outputfile:
outputfile = inputs.replace(".xml","") + ".nuisance.xml"
if os.path.isfile(outputfile) and not forceful:
print "File:", outputfile, "already exists. Use -f flag to overwrite."
sys.exit(-1)
f = open(outputfile,"w")
f.write("\n")
for id in sampleoutputs:
# Actions
if id[0] == '@ACTION':
if id[1] == 'BREAK':
f.write(' \n' )
if id[1] == 'SKIP':
f.write(' \n' )
continue
# Comments
if id[0] == '@COMMENT':
if id[2] and not CheckComment(id[2],allsamples): continue
f.write( ' \n')
continue
# Main Writing
f.write(' \n')
f.write("")
sys.exit(0)
if __name__ == '__main__':
searchdescrip = "Set of tools used to generate nuisance card files"
parser = argparse.ArgumentParser(description=searchdescrip)
parser.add_argument('-blankinput' , help='Produce blank input file.')
parser.add_argument('-blankcard' , help='Copies src/FCN/sample_list.xml to current directory')
parser.add_argument('-f' , help='Force overwrites', action='store_true')
parser.add_argument('-generate' , help='Generates a cardfile')
parser.add_argument('-output' , help='Output')
parser.add_argument('-format' , help='Format')
args = parser.parse_args()
if (args.f):
forceful = True
if (args.format):
if args.format == "xml": xmlformat = True
elif args.format == "txt": xmlformat = False
if (xmlformat):
if (args.blankinput):
CreateBlankInputXML(args.blankinput)
if (args.generate):
GenerateCardXML(args.generate, args.output)
diff --git a/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.cxx b/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.cxx
index bf5b664..88c5b5b 100644
--- a/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.cxx
@@ -1,106 +1,106 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_CC1npip_Evt_1DQ2_nu.h"
//********************************************************************
ANL_CC1npip_Evt_1DQ2_nu::ANL_CC1npip_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1npip Event Rate 1DQ2 nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CC#pi} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 1.5);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.DefineAllowedSpecies("numu");
// Hadronic Cut Info
HadCut = fSettings.Found("name", "W14Cut") ? 1.4 : 10.0;
if (HadCut == 1.4) {
fSettings.SetDataInput( FitPar::GetDataBase()
+ "/ANL/CC1pip_on_n/ANL_CC1pip_on_n_noEvents_Q2_W14GeV_rebin_firstQ2rem.txt" );
} else {
fSettings.SetDataInput( FitPar::GetDataBase()
+ "/ANL/CC1pip_on_n/ANL_CC1pip_on_n_noEvents_Q2_noWcut_HighQ2Gone.txt" );
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral() / double(fNEvents));
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
//********************************************************************
void ANL_CC1npip_Evt_1DQ2_nu::FillEventVariables(FitEvent *event) {
//********************************************************************
if (event->NumFSParticle(2112) == 0 || event->NumFSParticle(211) == 0 || event->NumFSParticle(13) == 0) {
return;
}
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pn, Ppip);
double q2CCpip;
// ANL has a M(pi, p) < 1.4 GeV cut imposed (also no cut measurement but not useful for delta tuning)
if (hadMass < HadCut * 1000.) {
q2CCpip = -1.0 * (Pnu - Pmu).Mag2() / 1.E6;
} else {
q2CCpip = -1.0;
}
fXVar = q2CCpip;
return;
};
//********************************************************************
bool ANL_CC1npip_Evt_1DQ2_nu::isSignal(FitEvent *event) {
//********************************************************************
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.h b/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.h
index e99fc2b..786ce2d 100644
--- a/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.h
@@ -1,40 +1,40 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1NPIP_EVT_1DQ2_NU_H_SEEN
#define ANL_CC1NPIP_EVT_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
//********************************************************************
class ANL_CC1npip_Evt_1DQ2_nu : public Measurement1D {
//********************************************************************
//
public:
ANL_CC1npip_Evt_1DQ2_nu(nuiskey samplekey);
virtual ~ANL_CC1npip_Evt_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
double HadCut;
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx b/src/ANL/ANL_CC1npip_Evt_1DWNmu_nu.cxx
similarity index 66%
copy from src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
copy to src/ANL/ANL_CC1npip_Evt_1DWNmu_nu.cxx
index 696f074..49ec81e 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
+++ b/src/ANL/ANL_CC1npip_Evt_1DWNmu_nu.cxx
@@ -1,94 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-#include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
+
+#include "ANL_CC1npip_Evt_1DWNmu_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dthpr_nu::ANL_CC1ppip_Evt_1Dthpr_nu(nuiskey samplekey) {
+ANL_CC1npip_Evt_1DWNmu_nu::ANL_CC1npip_Evt_1DWNmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "ANL CC1npip Event Rate 1D W(N mu) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos #theta_{p}");
- fSettings.SetYTitle("Number of events");
- fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 1.5);
- fSettings.DefineAllowedTargets("D,H");
- // CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_thProt.csv" );
+ fSettings.SetXTitle("W(N#mu) (GeV)");
+ fSettings.SetYTitle("Number of events");
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
+ fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_n/ANL_CC1npip_WNmu_per_0.04GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
+void ANL_CC1npip_Evt_1DWNmu_nu::FillEventVariables(FitEvent *event) {
-
-void ANL_CC1ppip_Evt_1Dthpr_nu::FillEventVariables(FitEvent *event) {
-
- if (event->NumFSParticle(2212) == 0 ||
+ if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
+ TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double costhpr = -999;
+ double hadMass = (Pn+Pmu).Mag()/1000.;
- // This measurement has M(Npi) = W < 1.4GeV
- if (hadMass < 1400) costhpr = cos(FitUtils::th(Pnu, Pp));
-
- fXVar = costhpr;
+ fXVar = hadMass;
return;
};
-
-bool ANL_CC1ppip_Evt_1Dthpr_nu::isSignal(FitEvent *event) {
- return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
+bool ANL_CC1npip_Evt_1DWNmu_nu::isSignal(FitEvent *event) {
+ return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h b/src/ANL/ANL_CC1npip_Evt_1DWNmu_nu.h
similarity index 76%
copy from src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
copy to src/ANL/ANL_CC1npip_Evt_1DWNmu_nu.h
index d9cd6a0..9df6234 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1npip_Evt_1DWNmu_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
-#define ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
+#ifndef ANL_CC1NPIP_EVT_1DWNMU_NU_H_SEEN
+#define ANL_CC1NPIP_EVT_1DWNMU_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
+class ANL_CC1npip_Evt_1DWNmu_nu : public Measurement1D {
public:
- ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
- virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
+ ANL_CC1npip_Evt_1DWNmu_nu(nuiskey samplekey);
+ virtual ~ANL_CC1npip_Evt_1DWNmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx b/src/ANL/ANL_CC1npip_Evt_1DWNpi_nu.cxx
similarity index 66%
copy from src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
copy to src/ANL/ANL_CC1npip_Evt_1DWNpi_nu.cxx
index 696f074..72c007c 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
+++ b/src/ANL/ANL_CC1npip_Evt_1DWNpi_nu.cxx
@@ -1,94 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-#include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
+
+#include "ANL_CC1npip_Evt_1DWNpi_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dthpr_nu::ANL_CC1ppip_Evt_1Dthpr_nu(nuiskey samplekey) {
+ANL_CC1npip_Evt_1DWNpi_nu::ANL_CC1npip_Evt_1DWNpi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "ANL CC1npip Event Rate 1D W(N pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos #theta_{p}");
- fSettings.SetYTitle("Number of events");
- fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 1.5);
- fSettings.DefineAllowedTargets("D,H");
- // CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_thProt.csv" );
+ fSettings.SetXTitle("W(N#pi) (GeV)");
+ fSettings.SetYTitle("Number of events");
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
+ fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_n/ANL_CC1npip_WNpi_per_0.02GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
+void ANL_CC1npip_Evt_1DWNpi_nu::FillEventVariables(FitEvent *event) {
-
-void ANL_CC1ppip_Evt_1Dthpr_nu::FillEventVariables(FitEvent *event) {
-
- if (event->NumFSParticle(2212) == 0 ||
+ if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
+ TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
- TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double costhpr = -999;
+ double hadMass = (Pn+Ppip).Mag()/1000.;
- // This measurement has M(Npi) = W < 1.4GeV
- if (hadMass < 1400) costhpr = cos(FitUtils::th(Pnu, Pp));
-
- fXVar = costhpr;
+ fXVar = hadMass;
return;
};
-
-bool ANL_CC1ppip_Evt_1Dthpr_nu::isSignal(FitEvent *event) {
- return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
+bool ANL_CC1npip_Evt_1DWNpi_nu::isSignal(FitEvent *event) {
+ return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h b/src/ANL/ANL_CC1npip_Evt_1DWNpi_nu.h
similarity index 76%
copy from src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
copy to src/ANL/ANL_CC1npip_Evt_1DWNpi_nu.h
index d9cd6a0..433b3f7 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1npip_Evt_1DWNpi_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
-#define ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
+#ifndef ANL_CC1NPIP_EVT_1DWNPI_NU_H_SEEN
+#define ANL_CC1NPIP_EVT_1DWNPI_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
+class ANL_CC1npip_Evt_1DWNpi_nu : public Measurement1D {
public:
- ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
- virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
+ ANL_CC1npip_Evt_1DWNpi_nu(nuiskey samplekey);
+ virtual ~ANL_CC1npip_Evt_1DWNpi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx b/src/ANL/ANL_CC1npip_Evt_1DWmupi_nu.cxx
similarity index 67%
copy from src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
copy to src/ANL/ANL_CC1npip_Evt_1DWmupi_nu.cxx
index 696f074..639dd5b 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
+++ b/src/ANL/ANL_CC1npip_Evt_1DWmupi_nu.cxx
@@ -1,94 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-#include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
+
+#include "ANL_CC1npip_Evt_1DWmupi_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dthpr_nu::ANL_CC1ppip_Evt_1Dthpr_nu(nuiskey samplekey) {
+ANL_CC1npip_Evt_1DWmupi_nu::ANL_CC1npip_Evt_1DWmupi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "ANL CC1npip Event Rate 1D W(mu pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos #theta_{p}");
- fSettings.SetYTitle("Number of events");
- fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 1.5);
- fSettings.DefineAllowedTargets("D,H");
- // CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_thProt.csv" );
+ fSettings.SetXTitle("W(#mu#pi) (GeV)");
+ fSettings.SetYTitle("Number of events");
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
+ fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_n/ANL_CC1npip_Wmupi_per_0.04GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
+void ANL_CC1npip_Evt_1DWmupi_nu::FillEventVariables(FitEvent *event) {
-
-void ANL_CC1ppip_Evt_1Dthpr_nu::FillEventVariables(FitEvent *event) {
-
- if (event->NumFSParticle(2212) == 0 ||
+ if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double costhpr = -999;
-
- // This measurement has M(Npi) = W < 1.4GeV
- if (hadMass < 1400) costhpr = cos(FitUtils::th(Pnu, Pp));
+ double hadMass = (Pmu+Ppip).Mag()/1000.;
- fXVar = costhpr;
+ fXVar = hadMass;
return;
};
-
-bool ANL_CC1ppip_Evt_1Dthpr_nu::isSignal(FitEvent *event) {
- return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
+bool ANL_CC1npip_Evt_1DWmupi_nu::isSignal(FitEvent *event) {
+ return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h b/src/ANL/ANL_CC1npip_Evt_1DWmupi_nu.h
similarity index 75%
copy from src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
copy to src/ANL/ANL_CC1npip_Evt_1DWmupi_nu.h
index 6acf1fd..30ce401 100644
--- a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1npip_Evt_1DWmupi_nu.h
@@ -1,38 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef ANL_CC1NPIP_EVT_1DWMUPI_NU_H_SEEN
+#define ANL_CC1NPIP_EVT_1DWMUPI_NU_H_SEEN
#include "Measurement1D.h"
-class FNAL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class ANL_CC1npip_Evt_1DWmupi_nu : public Measurement1D {
public:
- FNAL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~FNAL_CC1ppip_Evt_1DQ2_nu() {};
+ ANL_CC1npip_Evt_1DWmupi_nu(nuiskey samplekey);
+ virtual ~ANL_CC1npip_Evt_1DWmupi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
-
private:
-
};
#endif
diff --git a/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.cxx b/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.cxx
index 7e7f5ab..18b3178 100644
--- a/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.cxx
+++ b/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.cxx
@@ -1,97 +1,97 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_CC1npip_Evt_1DcosmuStar_nu.h"
//********************************************************************
ANL_CC1npip_Evt_1DcosmuStar_nu::ANL_CC1npip_Evt_1DcosmuStar_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
"Target: D2 \n" \
"Flux: ANL fhc numu \n" \
"Signal: CC1pi 3 Prong (SignalDef::isCC1pi3Prong) \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.SetDescription(descrip);
fSettings.SetXTitle("cos(#theta*)");
fSettings.SetYTitle("Number of events");
fSettings.SetEnuRange(0.0, 1.5);
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_n/ANL_CC1npip_cosmuStar.csv" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1npip_Evt_1DcosmuStar_nu::FillEventVariables(FitEvent *event) {
if (event->NumISParticle(2112) == 0 || // Initial state particles
event->NumFSParticle(2112) == 0 || event->NumFSParticle(211) == 0 || event->NumFSParticle(13) == 0) { // Final state particles
return;
}
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pin = event->GetHMISParticle(2112)->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pn, Ppip);
double cosmuStar = -999;
// Now need to boost into center-of-mass frame
TLorentzVector CMS = Pnu + Pin;
// Boost the muon backwards
Pmu.Boost(-CMS.BoostVector());
// Boost the neutrino forwards
Pnu.Boost(CMS.BoostVector());
// ANL has a M(pi, p) < 1.4 GeV cut imposed
// Find angle in CMS frame
if (hadMass < 1400) cosmuStar = cos(FitUtils::th(Pmu, Pnu));
fXVar = cosmuStar;
return;
};
bool ANL_CC1npip_Evt_1DcosmuStar_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.h b/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.h
index b963bf3..127feef 100644
--- a/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.h
+++ b/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1NPIP_EVT_1DCOSMUSTAR_NU_H_SEEN
#define ANL_CC1NPIP_EVT_1DCOSMUSTAR_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1npip_Evt_1DcosmuStar_nu : public Measurement1D {
public:
ANL_CC1npip_Evt_1DcosmuStar_nu(nuiskey samplekey);
virtual ~ANL_CC1npip_Evt_1DcosmuStar_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.cxx b/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.cxx
index cb561db..ffa2c2e 100644
--- a/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.cxx
@@ -1,85 +1,85 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_CC1npip_Evt_1Dppi_nu.h"
//********************************************************************
ANL_CC1npip_Evt_1Dppi_nu::ANL_CC1npip_Evt_1Dppi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC1npip_Evt_1Dppi_nu sample. \n" \
"Dist : Pion Momentum : p_{#pi} \n" \
"Signal : numuCC1pi+1p : #nu_{#mu}-CC-1#pi^{+}-1p \n" \
"Target : Deuterium : D2 \n" \
"Flux : ANL FHC numu \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
fSettings.SetXTitle("p_{#pi} (MeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetEnuRange(0.0, 1.5);
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( FitPar::GetDataBase() + "/ANL/CC1pip_on_n/ANL_ppi_CC1npip.csv" );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1npip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pn, Ppip);
double ppip;
// This measurement has a 1.4 GeV M(Npi) constraint
if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
else ppip = -1.0;
fXVar = ppip;
return;
}
bool ANL_CC1npip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.h b/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.h
index a3adb06..8707d69 100644
--- a/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.h
+++ b/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.h
@@ -1,37 +1,37 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1NPIP_EVT_1DPPI_NU_H_SEEN
#define ANL_CC1NPIP_EVT_1DPPI_NU_H_SEEN
// Fit Includes
#include "Measurement1D.h"
class ANL_CC1npip_Evt_1Dppi_nu : public Measurement1D {
public:
ANL_CC1npip_Evt_1Dppi_nu(nuiskey samplekey);
virtual ~ANL_CC1npip_Evt_1Dppi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.cxx
index 070d4dc..4b9feaa 100644
--- a/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.cxx
@@ -1,142 +1,142 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Radecky et al. Phys Rev D, 3rd series, volume 25, number 5, 1 March 1982, p
* 1161-1173
*/
#include "ANL_CC1npip_XSec_1DEnu_nu.h"
//********************************************************************
ANL_CC1npip_XSec_1DEnu_nu::ANL_CC1npip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1npip Event Rate 1DQ2 nu sample. \n"
"Target: D2 \n"
"Flux: \n"
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma (cm^{2}/nucleon)");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX,FREE,SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 1.5);
fSettings.SetS("norm_error", "0.20");
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.DefineAllowedSpecies("numu");
// User can specifiy to use uncorrected data
UseCorrectedData = !fSettings.Found("name", "Uncorr");
// User can specify "W14" for W < 1.4 GeV cut
// "W16" for W < 1.6 GeV cut
// The default is W < 2.0
if (fSettings.Found("name", "W14Cut"))
wTrueCut = 1.4;
else if (fSettings.Found("name", "W16Cut"))
wTrueCut = 1.6;
else
wTrueCut = 10.0;
// Flag for bad combo
if (UseCorrectedData && wTrueCut == 1.6) {
NUIS_ERR(WRN, "Can not run ANL CC1pi+1n W < 1.6 GeV with CORRECTION, because "
"the data DOES NOT EXIST");
NUIS_ERR(WRN, "Correction exists for W < 1.4 GeV and no W cut data ONLY");
NUIS_ERR(WRN, "Reverting to using uncorrected data!");
UseCorrectedData = false;
}
// Now read in different data depending on what the user has specified
std::string DataLocation =
GeneralUtils::GetTopLevelDir() + "/data/ANL/CC1pip_on_n/";
// If we're using corrected data
if (UseCorrectedData) {
if (wTrueCut == 1.4) {
DataLocation += "anl82corr-numu-n-to-mu-n-piplus-lowW_edges.txt";
// No W cut
} else {
DataLocation += "anl82corr-numu-n-to-mu-n-piplus-noW_edges.txt";
}
// If we're using raw uncorrected data
} else {
if (wTrueCut == 1.4) {
DataLocation += "anl82-numu-cc1npip-14Wcut.txt";
} else if (wTrueCut == 1.6) {
DataLocation += "anl82-numu-cc1npip-16Wcut.txt";
} else if (wTrueCut == 10.0) {
DataLocation += "anl82-numu-cc1npip-noWcut.txt";
}
}
fSettings.SetDataInput(DataLocation);
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 * 2.0 / 1.0 /
(fNEvents + 0.));
// Plot Setup -------------------------------------------------------
SetDataFromTextFile(fSettings.GetDataInput());
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1npip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0 || event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0) {
return;
}
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pn, Ppip);
double Enu = -1.0;
// ANL has a W cuts at 1.4, 1.6 and no w cut
// This is set by user, or defaults to 2.0
if (hadMass < wTrueCut * 1000.) {
Enu = Pnu.E() / 1.E3;
}
fXVar = Enu;
return;
};
bool ANL_CC1npip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.h b/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.h
index 26336aa..8a5bcaf 100644
--- a/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.h
@@ -1,40 +1,40 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1NPIP_XSEC_1DENU_NU_H_SEEN
#define ANL_CC1NPIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1npip_XSec_1DEnu_nu : public Measurement1D {
public:
ANL_CC1npip_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~ANL_CC1npip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
// What W cut are we imposing
double wTrueCut;
// Are we using corrected data?
bool UseCorrectedData;
};
#endif
diff --git a/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.cxx b/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.cxx
index 1cbb60d..9dcbd72 100644
--- a/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.cxx
@@ -1,121 +1,97 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_CC1pi0_Evt_1DQ2_nu.h"
//********************************************************************
ANL_CC1pi0_Evt_1DQ2_nu::ANL_CC1pi0_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1pi0 Event Rate 1DQ2 nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CC#pi} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 1.5);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CC1#pi^{0}");
fSettings.DefineAllowedSpecies("numu");
// Hadronic Cut Info
HadCut = fSettings.Found("name", "W14Cut") ? 1.4 : 10.0;
if (HadCut == 1.4) {
fSettings.SetDataInput( FitPar::GetDataBase()
+ "/ANL/CC1pi0_on_n/ANL_CC1pi0_on_n_noEvents_Q2_W14GeV_rebin_firstQ2rem.txt" );
} else {
fSettings.SetDataInput( FitPar::GetDataBase()
+ "/ANL/CC1pi0_on_n/ANL_CC1pi0_on_n_noEvents_Q2_noWcut_HighQ2Gone.txt" );
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral() / double(fNEvents));
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1pi0_Evt_1DQ2_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 || event->NumFSParticle(111) == 0 || event->NumFSParticle(13) == 0) {
return;
}
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppi0);
double q2CCpi0 = -1.0;
// ANL has a M(pi, p) < 1.4 GeV cut imposed
if (hadMass < HadCut * 1000.) {
q2CCpi0 = -1.0 * (Pnu - Pmu).Mag2() / 1.E6;
}
fXVar = q2CCpi0;
return;
};
bool ANL_CC1pi0_Evt_1DQ2_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
-
-/*
-void ANL_CC1pi0_Evt_1DQ2_nu::FillHistograms() {
-
- if (makeHadronicMassHist) {
- hadMassHist->Fill(hadMass);
- }
-
- Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC1pi0_Evt_1DQ2_nu::ScaleEvents() {
-
- // PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram());
- //PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram());
-
- fMCHist->Scale(fScaleFactor);
- fMCFine->Scale(fScaleFactor);
-
- return;
-}
-*/
diff --git a/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.h b/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.h
index d318924..3fdaca3 100644
--- a/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PI0_EVT_1DQ2_NU_H_SEEN
#define ANL_CC1PI0_EVT_1DQ2_NU_H_SEEN
// Fit Includes
#include "Measurement1D.h"
class ANL_CC1pi0_Evt_1DQ2_nu : public Measurement1D {
public:
ANL_CC1pi0_Evt_1DQ2_nu(nuiskey samplekey);
virtual ~ANL_CC1pi0_Evt_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
double HadCut;
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx b/src/ANL/ANL_CC1pi0_Evt_1DWNmu_nu.cxx
similarity index 65%
copy from src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
copy to src/ANL/ANL_CC1pi0_Evt_1DWNmu_nu.cxx
index 044b181..5a74500 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_CC1pi0_Evt_1DWNmu_nu.cxx
@@ -1,96 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-
-#include "ANL_CC1ppip_Evt_1Dppi_nu.h"
-
+#include "ANL_CC1pi0_Evt_1DWNmu_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dppi_nu::ANL_CC1ppip_Evt_1Dppi_nu(nuiskey samplekey) {
+ANL_CC1pi0_Evt_1DWNmu_nu::ANL_CC1pi0_Evt_1DWNmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "ANL CC1pi0 Event Rate 1D W(N mu) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
- fSettings.SetXTitle("p_{#pi} (MeV)");
+ fSettings.SetTitle("ANL #nu_mu CC1p#pi^{0}");
+ fSettings.SetXTitle("W(N#mu) (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetEnuRange(0.0, 10);
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_ppi.csv" );
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pi0_on_n/ANL_CC1pi0_WNmu_per_0.04GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC1ppip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
+void ANL_CC1pi0_Evt_1DWNmu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
- event->NumFSParticle(211) == 0 ||
+ event->NumFSParticle(111) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- // std::cout << "MASS NU P PIP MU = " << Pnu.Mag() << " " << Pp.Mag() << " " << Ppip.Mag() << " " << Pmu.Mag() << std::endl;
-
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double ppip = -1.0;
-
- // This has a hadMass constraint of 1.4 GeV
- if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
+ double hadMass = (Pmu+Pp).Mag()/1000.;
- fXVar = ppip;
+ fXVar = hadMass;
return;
};
-bool ANL_CC1ppip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
- return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
+bool ANL_CC1pi0_Evt_1DWNmu_nu::isSignal(FitEvent *event) {
+ return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h b/src/ANL/ANL_CC1pi0_Evt_1DWNmu_nu.h
similarity index 76%
copy from src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
copy to src/ANL/ANL_CC1pi0_Evt_1DWNmu_nu.h
index d2f883e..5e07524 100644
--- a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1pi0_Evt_1DWNmu_nu.h
@@ -1,37 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef ANL_CC1PPI0_EVT_1DWNMU_NU_H_SEEN
+#define ANL_CC1PPI0_EVT_1DWNMU_NU_H_SEEN
#include "Measurement1D.h"
-class GGM_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class ANL_CC1pi0_Evt_1DWNmu_nu : public Measurement1D {
public:
- GGM_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~GGM_CC1ppip_Evt_1DQ2_nu() {};
+ ANL_CC1pi0_Evt_1DWNmu_nu(nuiskey samplekey);
+ virtual ~ANL_CC1pi0_Evt_1DWNmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
-
};
#endif
diff --git a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CC1pi0_Evt_1DWNpi_nu.cxx
similarity index 65%
copy from src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx
copy to src/ANL/ANL_CC1pi0_Evt_1DWNpi_nu.cxx
index 3f31236..ebac262 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC1pi0_Evt_1DWNpi_nu.cxx
@@ -1,86 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#include "BEBC_CC1pi0_XSec_1DEnu_nu.h"
-
+#include "ANL_CC1pi0_Evt_1DWNpi_nu.h"
//********************************************************************
-BEBC_CC1pi0_XSec_1DEnu_nu::BEBC_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey) {
+ANL_CC1pi0_Evt_1DWNpi_nu::ANL_CC1pi0_Evt_1DWNpi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "BEBC_CC1pi0_XSec_1DEnu_nu sample. \n" \
+ std::string descrip = "ANL CC1pi0 Event Rate 1D W(N pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("E_{#nu} (GeV)");
- fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/neutron)");
- fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
- fSettings.SetEnuRange(5.0, 200.0);
- fSettings.DefineAllowedTargets("D,H");
- // plot information
- fSettings.SetTitle("BEBC_CC1pi0_XSec_1DEnu_nu");
+ fSettings.SetTitle("ANL #nu_mu CC1p#pi^{0}");
+ fSettings.SetXTitle("W(N#pi) (GeV)");
+ fSettings.SetYTitle("Number of events");
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
+ fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/theses/BEBC_theses_CC1pi0_W14.txt");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pi0_on_n/ANL_CC1pi0_WNpi_per_0.03GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
- fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
+ fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
+ SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void BEBC_CC1pi0_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
+
+void ANL_CC1pi0_Evt_1DWNpi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
- event->NumFSParticle(111) == 0)
+ event->NumFSParticle(111) == 0 ||
+ event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
-
- double hadMass = FitUtils::MpPi(Pp, Ppi0);
- double Enu = -1.0;
+ TLorentzVector Ppip = event->GetHMFSParticle(111)->fP;
- if (hadMass < 1400) Enu = Pnu.E()/1.E3;
+ double hadMass = (Pp+Ppip).Mag()/1000.;
- fXVar = Enu;
+ fXVar = hadMass;
return;
};
-
-bool BEBC_CC1pi0_XSec_1DEnu_nu::isSignal(FitEvent *event) {
+bool ANL_CC1pi0_Evt_1DWNpi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h b/src/ANL/ANL_CC1pi0_Evt_1DWNpi_nu.h
similarity index 76%
copy from src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
copy to src/ANL/ANL_CC1pi0_Evt_1DWNpi_nu.h
index d2f883e..f913372 100644
--- a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1pi0_Evt_1DWNpi_nu.h
@@ -1,37 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef ANL_CC1PPI0_EVT_1DWNPI_NU_H_SEEN
+#define ANL_CC1PPI0_EVT_1DWNPI_NU_H_SEEN
#include "Measurement1D.h"
-class GGM_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class ANL_CC1pi0_Evt_1DWNpi_nu : public Measurement1D {
public:
- GGM_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~GGM_CC1ppip_Evt_1DQ2_nu() {};
+ ANL_CC1pi0_Evt_1DWNpi_nu(nuiskey samplekey);
+ virtual ~ANL_CC1pi0_Evt_1DWNpi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
-
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx b/src/ANL/ANL_CC1pi0_Evt_1DWmupi_nu.cxx
similarity index 63%
copy from src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
copy to src/ANL/ANL_CC1pi0_Evt_1DWmupi_nu.cxx
index 696f074..d32ece4 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
+++ b/src/ANL/ANL_CC1pi0_Evt_1DWmupi_nu.cxx
@@ -1,94 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-#include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
+
+#include "ANL_CC1pi0_Evt_1DWmupi_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dthpr_nu::ANL_CC1ppip_Evt_1Dthpr_nu(nuiskey samplekey) {
+ANL_CC1pi0_Evt_1DWmupi_nu::ANL_CC1pi0_Evt_1DWmupi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "ANL CC1pi0 Event Rate 1D W(mu pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos #theta_{p}");
+
+ fSettings.SetTitle("ANL #nu_mu CC1p#pi^{0}");
+ fSettings.SetXTitle("W(#mu#pi) (GeV)");
fSettings.SetYTitle("Number of events");
- fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
-
- // CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_thProt.csv" );
fSettings.DefineAllowedSpecies("numu");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pi0_on_n/ANL_CC1pi0_Wmupi_per_0.04GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-
-
-void ANL_CC1ppip_Evt_1Dthpr_nu::FillEventVariables(FitEvent *event) {
+void ANL_CC1pi0_Evt_1DWmupi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
- event->NumFSParticle(211) == 0 ||
+ event->NumFSParticle(111) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Ppip = event->GetHMFSParticle(111)->fP;
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double costhpr = -999;
+ double hadMass = (Pmu+Ppip).Mag()/1000.;
- // This measurement has M(Npi) = W < 1.4GeV
- if (hadMass < 1400) costhpr = cos(FitUtils::th(Pnu, Pp));
-
- fXVar = costhpr;
+ fXVar = hadMass;
return;
};
-
-bool ANL_CC1ppip_Evt_1Dthpr_nu::isSignal(FitEvent *event) {
- return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
+bool ANL_CC1pi0_Evt_1DWmupi_nu::isSignal(FitEvent *event) {
+ return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h b/src/ANL/ANL_CC1pi0_Evt_1DWmupi_nu.h
similarity index 76%
copy from src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
copy to src/ANL/ANL_CC1pi0_Evt_1DWmupi_nu.h
index 6acf1fd..e1aaf57 100644
--- a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1pi0_Evt_1DWmupi_nu.h
@@ -1,38 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef ANL_CC1PPI0_EVT_1DWMUPI_NU_H_SEEN
+#define ANL_CC1PPI0_EVT_1DWMUPI_NU_H_SEEN
#include "Measurement1D.h"
-class FNAL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class ANL_CC1pi0_Evt_1DWmupi_nu : public Measurement1D {
public:
- FNAL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~FNAL_CC1ppip_Evt_1DQ2_nu() {};
+ ANL_CC1pi0_Evt_1DWmupi_nu(nuiskey samplekey);
+ virtual ~ANL_CC1pi0_Evt_1DWmupi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
-
private:
-
};
#endif
diff --git a/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.cxx b/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.cxx
index 919263e..8177b45 100644
--- a/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.cxx
+++ b/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.cxx
@@ -1,97 +1,97 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_CC1pi0_Evt_1DcosmuStar_nu.h"
//********************************************************************
ANL_CC1pi0_Evt_1DcosmuStar_nu::ANL_CC1pi0_Evt_1DcosmuStar_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1pi0 Event Rate 1DcosmuStar nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("cos(#theta*)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 1.5);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1#pi^{0}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pi0_on_n/ANL_CC1pi0_cosmuStar.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1pi0_Evt_1DcosmuStar_nu::FillEventVariables(FitEvent *event) {
if (event->NumISParticle(2112) == 0 ||
event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(111) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pin = event->GetHMISParticle(2112)->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppi0);
double cosmuStar = -999;
// Now need to boost into center-of-mass frame
TLorentzVector CMS = Pnu + Pin;
// Boost the muon backwards
Pmu.Boost(-CMS.BoostVector());
// Boost the neutrino forwards
Pnu.Boost(CMS.BoostVector());
// ANL has a M(pi, p) < 1.4 GeV cut imposed
// Find angle in CMS frame
if (hadMass < 1400) cosmuStar = cos(FitUtils::th(Pmu, Pnu));
fXVar = cosmuStar;
return;
};
bool ANL_CC1pi0_Evt_1DcosmuStar_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.h b/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.h
index c2bc2fa..1ca1ba6 100644
--- a/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.h
+++ b/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.h
@@ -1,40 +1,40 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PI0_EVT_1DCOSMUSTAR_NU_H_SEEN
#define ANL_CC1PI0_EVT_1DCOSMUSTAR_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1pi0_Evt_1DcosmuStar_nu : public Measurement1D {
public:
ANL_CC1pi0_Evt_1DcosmuStar_nu(nuiskey samplekey);
virtual ~ANL_CC1pi0_Evt_1DcosmuStar_nu() {};
void FillEventVariables(FitEvent *event);
//void ScaleEvents();
bool isSignal(FitEvent *event);
//void FillHistograms();
private:
};
#endif
diff --git a/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.cxx
index fe39e89..c2cae37 100644
--- a/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.cxx
@@ -1,137 +1,137 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Radecky et al. Phys Rev D, 3rd series, volume 25, number 5, 1 March 1982, p 1161-1173
*/
#include "ANL_CC1pi0_XSec_1DEnu_nu.h"
//********************************************************************
ANL_CC1pi0_XSec_1DEnu_nu::ANL_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1pi0 Event Rate 1DQ2 nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma (cm^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX,FREE,SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 1.5);
fSettings.SetS("norm_error", "0.20");
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CC1#pi^{0}");
fSettings.DefineAllowedSpecies("numu");
// User can specifiy to use uncorrected data
UseCorrectedData = !fSettings.Found("name", "Uncorr");
// User can specify "W14" for W < 1.4 GeV cut
// "W16" for W < 1.6 GeV cut
// The default is W < 2.0
if (fSettings.Found("name", "W14Cut")) wTrueCut = 1.4;
else if (fSettings.Found("name", "W16Cut")) wTrueCut = 1.6;
else wTrueCut = 10.0;
// Flag for bad combo
if (UseCorrectedData && wTrueCut == 1.6) {
NUIS_ERR(WRN, "Can not run ANL CC1pi0 W < 1.6 GeV with CORRECTION, because "
"the data DOES NOT EXIST");
NUIS_ERR(WRN, "Correction exists for W < 1.4 GeV and no W cut data ONLY");
NUIS_ERR(WRN, "Reverting to using uncorrected data!");
UseCorrectedData = false;
}
// Now read in different data depending on what the user has specified
std::string DataLocation = GeneralUtils::GetTopLevelDir() + "/data/ANL/CC1pi0_on_n/";
// If we're using corrected data
if (UseCorrectedData) {
if (wTrueCut == 1.4) {
DataLocation += "anl82corr-numu-n-to-mu-p-pi0-lowW_edges.txt";
} else if (wTrueCut == 10.0) {
DataLocation += "anl82corr-numu-n-to-mu-p-pi0-noW_edges.txt";
}
// If we're using raw uncorrected data
} else {
if (wTrueCut == 1.4) {
DataLocation += "anl82-numu-cc1pi0-14Wcut.txt";
} else if (wTrueCut == 1.6) {
DataLocation += "anl82-numu-cc1pi0-16Wcut.txt";
} else if (wTrueCut == 10.0) {
DataLocation += "anl82-numu-cc1pi0-noWcut.txt";
}
}
fSettings.SetDataInput(DataLocation);
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 * 2.0 / 1.0 / (fNEvents + 0.));
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1pi0_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 || event->NumFSParticle(111) == 0 || event->NumFSParticle(13) == 0) {
return;
}
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppi0);
double Enu = -1.0;
if (hadMass/1000. < wTrueCut) {
Enu = Pnu.E()/1.E3;
}
fXVar = Enu;
return;
};
bool ANL_CC1pi0_XSec_1DEnu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.h b/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.h
index 4a9d65a..b8f3c58 100644
--- a/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.h
@@ -1,41 +1,41 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PI0_XSEC_1DENU_NU_H_SEEN
#define ANL_CC1PI0_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1pi0_XSec_1DEnu_nu : public Measurement1D {
public:
ANL_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~ANL_CC1pi0_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
// Are we using corrected data?
bool UseCorrectedData;
// What W cut are we imposing
double wTrueCut;
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.cxx
index 4b7b236..8ea4ed3 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.cxx
@@ -1,104 +1,104 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Radecky et al. Phys Rev D, 3rd series, volume 25, number 5, 1 March 1982, p 1161-1173
*/
#include "ANL_CC1ppip_Evt_1DQ2_nu.h"
//********************************************************************
ANL_CC1ppip_Evt_1DQ2_nu::ANL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1ppip Event Rate 1DQ2 nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CC#pi} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.DefineAllowedSpecies("numu");
// Hadronic Cut Info
HadCut = fSettings.Found("name", "W14Cut") ? 1.4 : 10.0;
if (HadCut == 1.4) {
fSettings.SetDataInput( FitPar::GetDataBase()
+ "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_Q2_W14GeV_rebin_firstQ2rem.txt" );
} else {
fSettings.SetDataInput( FitPar::GetDataBase()
+ "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_Q2_noW_HighQ2Gone.txt" );
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral() / double(fNEvents));
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1ppip_Evt_1DQ2_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 || event->NumFSParticle(211) == 0 || event->NumFSParticle(13) == 0) {
return;
}
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppip);
double q2CCpip = -1.0;
// ANL has a M(pi, p) < 1.4 GeV cut imposed or no W cut
if (hadMass < HadCut * 1000.) {
q2CCpip = -1 * (Pnu - Pmu).Mag2() / 1.E6;
}
fXVar = q2CCpip;
return;
};
bool ANL_CC1ppip_Evt_1DQ2_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.h b/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.h
index b6f2464..140f979 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.h
@@ -1,39 +1,39 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
#define ANL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
public:
ANL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
virtual ~ANL_CC1ppip_Evt_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
double HadCut;
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1DWNmu_nu.cxx
similarity index 70%
copy from src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
copy to src/ANL/ANL_CC1ppip_Evt_1DWNmu_nu.cxx
index 044b181..1e14a21 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1DWNmu_nu.cxx
@@ -1,96 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-
-#include "ANL_CC1ppip_Evt_1Dppi_nu.h"
-
+#include "ANL_CC1ppip_Evt_1DWNmu_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dppi_nu::ANL_CC1ppip_Evt_1Dppi_nu(nuiskey samplekey) {
+ANL_CC1ppip_Evt_1DWNmu_nu::ANL_CC1ppip_Evt_1DWNmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "ANL CC1ppip Event Rate 1D W(N mu) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
- fSettings.SetXTitle("p_{#pi} (MeV)");
+ fSettings.SetXTitle("W(N#mu) (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetEnuRange(0.0, 10);
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_ppi.csv" );
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1ppip_WNmu_per_0.04GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC1ppip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
+void ANL_CC1ppip_Evt_1DWNmu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- // std::cout << "MASS NU P PIP MU = " << Pnu.Mag() << " " << Pp.Mag() << " " << Ppip.Mag() << " " << Pmu.Mag() << std::endl;
-
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double ppip = -1.0;
-
- // This has a hadMass constraint of 1.4 GeV
- if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
+ double hadMass = (Pmu+Pp).Mag()/1000.;
- fXVar = ppip;
+ fXVar = hadMass;
return;
};
-bool ANL_CC1ppip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
+bool ANL_CC1ppip_Evt_1DWNmu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h b/src/ANL/ANL_CC1ppip_Evt_1DWNmu_nu.h
similarity index 76%
copy from src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
copy to src/ANL/ANL_CC1ppip_Evt_1DWNmu_nu.h
index d9cd6a0..5afc2a3 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1DWNmu_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
-#define ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
+#ifndef ANL_CC1PPIP_EVT_1DWNMU_NU_H_SEEN
+#define ANL_CC1PPIP_EVT_1DWNMU_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
+class ANL_CC1ppip_Evt_1DWNmu_nu : public Measurement1D {
public:
- ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
- virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
+ ANL_CC1ppip_Evt_1DWNmu_nu(nuiskey samplekey);
+ virtual ~ANL_CC1ppip_Evt_1DWNmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1DWNpi_nu.cxx
similarity index 70%
copy from src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
copy to src/ANL/ANL_CC1ppip_Evt_1DWNpi_nu.cxx
index 044b181..66f5c5a 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1DWNpi_nu.cxx
@@ -1,96 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-
-#include "ANL_CC1ppip_Evt_1Dppi_nu.h"
-
+#include "ANL_CC1ppip_Evt_1DWNpi_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dppi_nu::ANL_CC1ppip_Evt_1Dppi_nu(nuiskey samplekey) {
+ANL_CC1ppip_Evt_1DWNpi_nu::ANL_CC1ppip_Evt_1DWNpi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "ANL CC1ppip Event Rate 1D W(N pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
- fSettings.SetXTitle("p_{#pi} (MeV)");
+ fSettings.SetXTitle("W(N#pi) (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetEnuRange(0.0, 10);
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_ppi.csv" );
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1ppip_WNpi_per_0.02GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC1ppip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
+void ANL_CC1ppip_Evt_1DWNpi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
- TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
-
- // std::cout << "MASS NU P PIP MU = " << Pnu.Mag() << " " << Pp.Mag() << " " << Ppip.Mag() << " " << Pmu.Mag() << std::endl;
-
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double ppip = -1.0;
- // This has a hadMass constraint of 1.4 GeV
- if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
+ double hadMass = (Pp+Ppip).Mag()/1000.;
- fXVar = ppip;
+ fXVar = hadMass;
return;
};
-bool ANL_CC1ppip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
+bool ANL_CC1ppip_Evt_1DWNpi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h b/src/ANL/ANL_CC1ppip_Evt_1DWNpi_nu.h
similarity index 76%
copy from src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
copy to src/ANL/ANL_CC1ppip_Evt_1DWNpi_nu.h
index d9cd6a0..86e0692 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1DWNpi_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
-#define ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
+#ifndef ANL_CC1PPIP_EVT_1DWNPI_NU_H_SEEN
+#define ANL_CC1PPIP_EVT_1DWNPI_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
+class ANL_CC1ppip_Evt_1DWNpi_nu : public Measurement1D {
public:
- ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
- virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
+ ANL_CC1ppip_Evt_1DWNpi_nu(nuiskey samplekey);
+ virtual ~ANL_CC1ppip_Evt_1DWNpi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1DWmupi_nu.cxx
similarity index 71%
copy from src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
copy to src/ANL/ANL_CC1ppip_Evt_1DWmupi_nu.cxx
index 044b181..9ddd4e2 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1DWmupi_nu.cxx
@@ -1,96 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-
-#include "ANL_CC1ppip_Evt_1Dppi_nu.h"
-
+#include "ANL_CC1ppip_Evt_1DWmupi_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dppi_nu::ANL_CC1ppip_Evt_1Dppi_nu(nuiskey samplekey) {
+ANL_CC1ppip_Evt_1DWmupi_nu::ANL_CC1ppip_Evt_1DWmupi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "ANL CC1ppip Event Rate 1D W(mu pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
- fSettings.SetXTitle("p_{#pi} (MeV)");
+ fSettings.SetXTitle("W(#mu#pi) (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetEnuRange(0.0, 10);
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_ppi.csv" );
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1ppip_Wmupi_per_0.02GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC1ppip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
+void ANL_CC1ppip_Evt_1DWmupi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
- // std::cout << "MASS NU P PIP MU = " << Pnu.Mag() << " " << Pp.Mag() << " " << Ppip.Mag() << " " << Pmu.Mag() << std::endl;
-
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double ppip = -1.0;
-
- // This has a hadMass constraint of 1.4 GeV
- if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
+ double hadMass = (Pmu+Ppip).Mag()/1000.;
- fXVar = ppip;
+ fXVar = hadMass;
return;
};
-bool ANL_CC1ppip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
+bool ANL_CC1ppip_Evt_1DWmupi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h b/src/ANL/ANL_CC1ppip_Evt_1DWmupi_nu.h
similarity index 75%
copy from src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
copy to src/ANL/ANL_CC1ppip_Evt_1DWmupi_nu.h
index 6acf1fd..526171d 100644
--- a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1DWmupi_nu.h
@@ -1,38 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef ANL_CC1PPIP_EVT_1DWMUPI_NU_H_SEEN
+#define ANL_CC1PPIP_EVT_1DWMUPI_NU_H_SEEN
#include "Measurement1D.h"
-class FNAL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class ANL_CC1ppip_Evt_1DWmupi_nu : public Measurement1D {
public:
- FNAL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~FNAL_CC1ppip_Evt_1DQ2_nu() {};
+ ANL_CC1ppip_Evt_1DWmupi_nu(nuiskey samplekey);
+ virtual ~ANL_CC1ppip_Evt_1DWmupi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
-
private:
-
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.cxx
index 4f08b57..074885a 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.cxx
@@ -1,105 +1,105 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Radecky et al. Phys Rev D, 3rd series, Vol 25, No 5, 1 March 1982, p 1161-1173
*/
#include "ANL_CC1ppip_Evt_1DcosmuStar_nu.h"
//********************************************************************
ANL_CC1ppip_Evt_1DcosmuStar_nu::ANL_CC1ppip_Evt_1DcosmuStar_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("cos(#theta*)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_cosmuStar_1982.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1ppip_Evt_1DcosmuStar_nu::FillEventVariables(FitEvent *event) {
if (event->NumISParticle(2212) == 0 ||
event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pin = event->GetHMISParticle(2212)->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppip);
double cosmuStar = -999;
// Now need to boost into center-of-mass frame
TLorentzVector CMS = Pnu + Pin;
// Boost the muon backwards
Pmu.Boost(-CMS.BoostVector());
// Boost the neutrino forwards
Pnu.Boost(CMS.BoostVector());
// ANL has a M(pi, p) < 1.4 GeV cut imposed
// Find angle in CMS frame
if (hadMass < 1400) cosmuStar = cos(FitUtils::th(Pmu, Pnu));
fXVar = cosmuStar;
return;
};
bool ANL_CC1ppip_Evt_1DcosmuStar_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.h b/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.h
index 1823533..07e02db 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PPIP_EVT_1DCOSMUSTAR_NU_H_SEEN
#define ANL_CC1PPIP_EVT_1DCOSMUSTAR_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1ppip_Evt_1DcosmuStar_nu : public Measurement1D {
public:
ANL_CC1ppip_Evt_1DcosmuStar_nu(nuiskey samplekey);
virtual ~ANL_CC1ppip_Evt_1DcosmuStar_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.cxx
index 6e52217..429f8f7 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.cxx
@@ -1,118 +1,118 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Radecky et al. Phys Rev D, 3rd series, Vol 25, No 5, 1 March 1982, p 1161-1173
*/
#include "ANL_CC1ppip_Evt_1DcosthAdler_nu.h"
//********************************************************************
ANL_CC1ppip_Evt_1DcosthAdler_nu::ANL_CC1ppip_Evt_1DcosthAdler_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1ppip Event Rate 1DcosmuStar nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("cos#theta_{Adler}");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_costhAdler_1982.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1ppip_Evt_1DcosthAdler_nu::FillEventVariables(FitEvent *event) {
fXVar = -999.99;
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
// Get the hadronic mass
double hadMass = FitUtils::MpPi(Pp, Ppip);
if (hadMass > 1400) return;
// Get Adler cos theta
double cosThAdler = FitUtils::CosThAdler(Pnu, Pmu, Ppip, Pp);
fXVar = cosThAdler;
};
bool ANL_CC1ppip_Evt_1DcosthAdler_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
/*
void ANL_CC1ppip_Evt_1DcosthAdler_nu::FillHistograms() {
if (makeHadronicMassHist) {
hadMassHist->Fill(hadMass);
}
Measurement1D::FillHistograms();
}
void ANL_CC1ppip_Evt_1DcosthAdler_nu::ScaleEvents() {
PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram());
PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram());
fMCHist->Scale(fScaleFactor);
fMCFine->Scale(fScaleFactor);
return;
}
*/
diff --git a/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.h b/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.h
index 100af15..1953086 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PPIP_EVT_1DCOSTHADLER_NU_H_SEEN
#define ANL_CC1PPIP_EVT_1DCOSTHADLER_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1ppip_Evt_1DcosthAdler_nu : public Measurement1D {
public:
ANL_CC1ppip_Evt_1DcosthAdler_nu(nuiskey samplekey);
virtual ~ANL_CC1ppip_Evt_1DcosthAdler_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.cxx
index c4a27c7..05f6f52 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.cxx
@@ -1,117 +1,117 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Radecky et al. Phys Rev D, 3rd series, Vol 25, No 5, 1 March 1982, p 1161-1173
*/
#include "ANL_CC1ppip_Evt_1Dphi_nu.h"
//********************************************************************
ANL_CC1ppip_Evt_1Dphi_nu::ANL_CC1ppip_Evt_1Dphi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle(" #phi_{Adler}");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_phiAdler_1982.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1ppip_Evt_1Dphi_nu::FillEventVariables(FitEvent *event) {
fXVar = -999.99;
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
// Get the hadronic mass
double hadMass = FitUtils::MpPi(Pp, Ppip);
if (hadMass > 1400) return;
// Get phi Adler
double phi = FitUtils::PhiAdler(Pnu, Pmu, Ppip, Pp);
fXVar = phi;
};
bool ANL_CC1ppip_Evt_1Dphi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
/*
void ANL_CC1ppip_Evt_1Dphi_nu::FillHistograms() {
if (makeHadronicMassHist) {
hadMassHist->Fill(hadMass);
}
Measurement1D::FillHistograms();
}
void ANL_CC1ppip_Evt_1Dphi_nu::ScaleEvents() {
PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram());
PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram());
fMCHist->Scale(fScaleFactor);
fMCFine->Scale(fScaleFactor);
return;
}
*/
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.h b/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.h
index 80a304e..b7d7317 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.h
@@ -1,41 +1,41 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PPIP_EVT_1DPHI_NU_H_SEEN
#define ANL_CC1PPIP_EVT_1DPHI_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1ppip_Evt_1Dphi_nu : public Measurement1D {
public:
ANL_CC1ppip_Evt_1Dphi_nu(nuiskey samplekey);
virtual ~ANL_CC1ppip_Evt_1Dphi_nu() {};
void FillEventVariables(FitEvent *event);
//void ScaleEvents();
bool isSignal(FitEvent *event);
//void FillHistograms();
private:
TRandom3 rand;
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
index 044b181..8e410aa 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
@@ -1,96 +1,96 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
*/
#include "ANL_CC1ppip_Evt_1Dppi_nu.h"
//********************************************************************
ANL_CC1ppip_Evt_1Dppi_nu::ANL_CC1ppip_Evt_1Dppi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
fSettings.SetXTitle("p_{#pi} (MeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetEnuRange(0.0, 1.5);
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_ppi.csv" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1ppip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
// std::cout << "MASS NU P PIP MU = " << Pnu.Mag() << " " << Pp.Mag() << " " << Ppip.Mag() << " " << Pmu.Mag() << std::endl;
double hadMass = FitUtils::MpPi(Pp, Ppip);
double ppip = -1.0;
// This has a hadMass constraint of 1.4 GeV
if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
fXVar = ppip;
return;
};
bool ANL_CC1ppip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.h b/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.h
index 01e1fe0..e546be7 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.h
@@ -1,39 +1,39 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PPIP_EVT_1DPPI_NU_H_SEEN
#define ANL_CC1PPIP_EVT_1DPPI_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1ppip_Evt_1Dppi_nu : public Measurement1D {
public:
ANL_CC1ppip_Evt_1Dppi_nu(nuiskey samplekey);
virtual ~ANL_CC1ppip_Evt_1Dppi_nu() {};
void FillEventVariables(FitEvent *event);
//void ScaleEvents();
bool isSignal(FitEvent *event);
//void FillHistograms();
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
index 696f074..9f2afa3 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
@@ -1,94 +1,94 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
*/
#include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
//********************************************************************
ANL_CC1ppip_Evt_1Dthpr_nu::ANL_CC1ppip_Evt_1Dthpr_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("cos #theta_{p}");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 1.5);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_thProt.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1ppip_Evt_1Dthpr_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppip);
double costhpr = -999;
// This measurement has M(Npi) = W < 1.4GeV
if (hadMass < 1400) costhpr = cos(FitUtils::th(Pnu, Pp));
fXVar = costhpr;
return;
};
bool ANL_CC1ppip_Evt_1Dthpr_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.h b/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.h
index 488a52c..95ca73c 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.h
@@ -1,39 +1,39 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PPIP_EVT_1DTHPR_NU_H_SEEN
#define ANL_CC1PPIP_EVT_1DTHPR_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1ppip_Evt_1Dthpr_nu : public Measurement1D {
public:
ANL_CC1ppip_Evt_1Dthpr_nu(nuiskey samplekey);
virtual ~ANL_CC1ppip_Evt_1Dthpr_nu() {};
void FillEventVariables(FitEvent *event);
// void ScaleEvents();
bool isSignal(FitEvent *event);
//void FillHistograms();
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.cxx
index fa5af57..fa96289 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.cxx
@@ -1,139 +1,139 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Radecky et al. Phys Rev D, 3rd series, volume 25, number 5, 1 March 1982, p 1161-1173
*/
#include "ANL_CC1ppip_XSec_1DEnu_nu.h"
//********************************************************************
ANL_CC1ppip_XSec_1DEnu_nu::ANL_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1pip XSec Enu nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma (cm^{2}/nucleon)");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX,FREE,SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.SetS("norm_error", "0.20");
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CC1#pi^{0}");
fSettings.DefineAllowedSpecies("numu");
// User can specifiy to use uncorrected data
UseCorrectedData = !fSettings.Found("name", "Uncorr");
// User can specify "W14" for W < 1.4 GeV cut
// "W16" for W < 1.6 GeV cut
// The default is no W cut
if (fSettings.Found("name", "W14Cut")) wTrueCut = 1.4;
else if (fSettings.Found("name", "W16Cut")) wTrueCut = 1.6;
else wTrueCut = 10.0;
// Flag for bad combo
if (UseCorrectedData && wTrueCut == 1.6) {
NUIS_ERR(WRN, "Can not run ANL CC1pi+1p W < 1.6 GeV with CORRECTION, because "
"the data DOES NOT EXIST");
NUIS_ERR(WRN, "Correction exists for W < 1.4 GeV and no W cut data ONLY");
NUIS_ERR(WRN, "Reverting to using uncorrected data!");
UseCorrectedData = false;
}
// Now read in different data depending on what the user has specified
std::string DataLocation = GeneralUtils::GetTopLevelDir() + "/data/ANL/CC1pip_on_p/";
// If we're using corrected data
if (UseCorrectedData) {
if (wTrueCut == 1.4) {
DataLocation += "anl82corr-numu-p-to-mu-p-piplus-lowW_edges.txt";
} else if (wTrueCut == 10.0) {
DataLocation += "anl82corr-numu-p-to-mu-p-piplus-noW_edges.txt";
}
// If we're using raw uncorrected data
} else {
if (wTrueCut == 1.4) {
DataLocation += "anl82-numu-cc1ppip-14Wcut.txt";
} else if (wTrueCut == 1.6) {
DataLocation += "anl82-numu-cc1ppip-16Wcut.txt";
} else if (wTrueCut == 10.0) {
DataLocation += "anl82-numu-cc1ppip-noWcut.txt";
}
}
fSettings.SetDataInput(DataLocation);
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 * 2.0 / 1.0 / (fNEvents + 0.));
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1ppip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 || event->NumFSParticle(211) == 0 || event->NumFSParticle(13) == 0) {
return;
}
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppip);
double Enu = -1.0;
// ANL has a W cuts at 1.4, 1.6 and no w cut
// This is set by user, or defaults to 2.0
if (hadMass/1000. < wTrueCut) {
Enu = Pnu.E()/1.E3;
}
fXVar = Enu;
return;
}
bool ANL_CC1ppip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.h b/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.h
index 367d07a..dfd1e9f 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.h
@@ -1,42 +1,42 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PPIP_XSEC_1DENU_NU_H_SEEN
#define ANL_CC1PPIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1ppip_XSec_1DEnu_nu : public Measurement1D {
public:
ANL_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~ANL_CC1ppip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
// What W cut are we imposing
double wTrueCut;
// Are we using corrected data?
bool UseCorrectedData;
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.cxx b/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.cxx
index d73714b..b96b5d6 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.cxx
@@ -1,121 +1,92 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* Radecky et al. Phys Rev D, 3rd series, volume 25, number 5, 1 March 1982, p 1161-1173
*/
#include "ANL_CC1ppip_XSec_1DQ2_nu.h"
//********************************************************************
ANL_CC1ppip_XSec_1DQ2_nu::ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CC1ppip XSec 1DQ2 nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CC#pi} (GeV^{2})");
- fSettings.SetYTitle("d#sigma/dQ^{2}_{CC#pi} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
+ fSettings.SetYTitle("d#sigma/dQ^{2} (GeV^{2})");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.5, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase()
+ "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_dSigdQ2_W14_1982.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
- // this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*TotalIntegratedFlux("width"))*16./8.;
fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / ((fNEvents + 0.) * TotalIntegratedFlux("width")) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC1ppip_XSec_1DQ2_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppip);
double q2CCpip = -1.0;
// I use the W < 1.4GeV cut ANL data to isolate single pion
// there is also a W < 1.6 GeV and an uncut spectrum ANL 1982
if (hadMass < 1400) q2CCpip = -1 * (Pnu - Pmu).Mag2() / 1.E6;
fXVar = q2CCpip;
return;
};
bool ANL_CC1ppip_XSec_1DQ2_nu::isSignal(FitEvent *event) {
- // std::cout << "CC1ppip Enu " << EnuMin << " " << EnuMax << std::endl;
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
-// void ANL_CC1ppip_XSec_1DQ2_nu::FillEventVariables(FitEvent *event) {
-// 46
-// 47 if (event->NumFSParticle(2212) == 0 ||
-// 48 event->NumFSParticle(211) == 0 ||
-// 49 event->NumFSParticle(13) == 0)
-// 50 return;
-// 51
-// 52 TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
-// 53 TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
-// 54 TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
-// 55 TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
-// 56
-// 57 double hadMass = FitUtils::MpPi(Pp, Ppip);
-// 58 double q2CCpip = -1.0;
-// 59
-// 60 // I use the W < 1.4GeV cut ANL data to isolate single pion
-// 61 // there is also a W < 1.6 GeV and an uncut spectrum ANL 1982
-// 62 if (hadMass < 1400) q2CCpip = -1*(Pnu-Pmu).Mag2()/1.E6;
-// 63
-// 64 fXVar = q2CCpip;
-// 65
-// 66 return;
-// 67 };
-// 68
-// 69 bool ANL_CC1ppip_XSec_1DQ2_nu::isSignal(FitEvent *event) {
-// 70 return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
-// 71 }
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h b/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
index d9cd6a0..17dfd36 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
#define ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
public:
ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.cxx b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.cxx
index 70bc38a..12f2917 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.cxx
@@ -1,114 +1,114 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.h"
//********************************************************************
ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu::ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{#mu} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_pMu_weight.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(13) == 0)
return;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double pmu = FitUtils::p(Pmu);
this->fXVar = pmu;
return;
}
// Signal asks for 1pi-, 1pi+, 1mu-, 1p
bool ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
/*
void ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu::FillHistograms() {
if (makeHadronicMassHist) {
hadMassHist->Fill(hadMass);
}
Measurement1D::FillHistograms();
}
void ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu::ScaleEvents() {
PlotUtils::FluxUnfoldedScaling(mcHist, GetFluxHistogram());
PlotUtils::FluxUnfoldedScaling(mcFine, GetFluxHistogram());
mcHist->Scale(fScaleFactor);
mcFine->Scale(fScaleFactor);
return;
}
*/
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.h b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.h
index a75a153..65f293e 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.h
@@ -1,41 +1,41 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPMU_NU_H_SEEN
#define ANL_CC2PI_1PIM1PIP_EVT_1DPMU_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu : public Measurement1D {
public:
ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
//void ScaleEvents();
//void FillHistograms();
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.cxx b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.cxx
index 78b7e6d..d30f2bb 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h"
//********************************************************************
ANL_CC2pi_1pim1pip_Evt_1Dppim_nu::ANL_CC2pi_1pim1pip_Evt_1Dppim_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pim1pip_Evt_1Dppim_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("p_{#pi-} (GeV)");
+ fSettings.SetXTitle("p_{#pi^{-}} (GeV)");
fSettings.SetYTitle("Number of events (area norm.)");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_ppim_weight.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pim1pip_Evt_1Dppim_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(-211) == 0)
return;
TLorentzVector Ppim = event->GetHMFSParticle(-211)->fP;
double ppim = FitUtils::p(Ppim);
this->fXVar = ppim;
return;
}
// Signal asks for 1pi-, 1pi+, 1mu-, 1p
bool ANL_CC2pi_1pim1pip_Evt_1Dppim_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h
index 450d21b..a6eeea3 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPPIM_NU_H_SEEN
#define ANL_CC2PI_1PIM1PIP_EVT_1DPPIM_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pim1pip_Evt_1Dppim_nu : public Measurement1D {
public:
ANL_CC2pi_1pim1pip_Evt_1Dppim_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pim1pip_Evt_1Dppim_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.cxx b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.cxx
index 0749bc7..64f9a72 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h"
//********************************************************************
ANL_CC2pi_1pim1pip_Evt_1Dppip_nu::ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pim1pip_Evt_1Dppip_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("p_{#pi+} (GeV)");
+ fSettings.SetXTitle("p_{#pi^{+}} (GeV)");
fSettings.SetYTitle("Number of events (area norm.)");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi^{+-}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_ppip_weight.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pim1pip_Evt_1Dppip_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(211) == 0)
return;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
double ppip = FitUtils::p(Ppip);
this->fXVar = ppip;
return;
}
// Signal asks for 1pi-, 1pi+, 1mu-, 1p
bool ANL_CC2pi_1pim1pip_Evt_1Dppip_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
index 574972e..60ca6ef 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPPIP_NU_H_SEEN
#define ANL_CC2PI_1PIM1PIP_EVT_1DPPIP_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pim1pip_Evt_1Dppip_nu : public Measurement1D {
public:
ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pim1pip_Evt_1Dppip_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
index 3c63f4d..407e82b 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
@@ -1,89 +1,89 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h"
//********************************************************************
ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos(#theta*)");
+ fSettings.SetXTitle("p_{pr} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
+ fSettings.SetTitle("ANL #nu_mu CC1#pi^{+}1#pi^{-}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_pProt_weight.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0)
return;
TLorentzVector Pprot = event->GetHMFSParticle(2212)->fP;
double pprot = FitUtils::p(Pprot);
this->fXVar = pprot;
return;
}
// Signal asks for 1pi-, 1pi+, 1mu-, 1p
bool ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
index fb465d9..3c0447e 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPROT_NU_H_SEEN
#define ANL_CC2PI_1PIM1PIP_EVT_1DPROT_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu : public Measurement1D {
public:
ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
index 9e36fa9..019be75 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h"
//********************************************************************
ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG", "FIX,FREE,SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip1p_xsec.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents) * 2.0 / 1.0 ;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
double Enu = Pnu.E()/1000.;
// No hadronic mass cut or similar here so very simple FillEventVariables
this->fXVar = Enu;
return;
}
// Signal asks for 1pi-, 1pi+, 1mu-, 1p
bool ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h b/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h
index a65aefb..518d841 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h
@@ -1,41 +1,41 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIM1PIP_XSEC_1DENU_NU_H_SEEN
#define ANL_CC2PI_1PIM1PIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pim1pip_XSec_1DEnu_nu : public Measurement1D {
public:
ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pim1pip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
//void ScaleEvents();
//void FillHistograms();
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.cxx
index afb2c8d..6dd01ee 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.cxx
@@ -1,88 +1,88 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu::ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{#mu} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi0_pMu_weight.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(13) == 0)
return;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double pmu = FitUtils::p(Pmu);
this->fXVar = pmu;
return;
}
// Signal asks for 1pi0, 1pi+, 1mu-, 1p
bool ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 111, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h
index 35751c0..d35641a 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PI0_EVT_1DPMU_NU_H_SEEN
#define ANL_CC2PI_1PIP1PI0_EVT_1DPMU_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.cxx
index 2800b13..d722f7d 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu::ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("p_{#pi0} (GeV)");
+ fSettings.SetXTitle("p_{#pi^{0}} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi0_ppi0_weight.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(111) == 0)
return;
TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
double ppi0 = FitUtils::p(Ppi0);
this->fXVar = ppi0;
return;
}
// Signal asks for 1pi0, 1pi+, 1mu-, 1p
bool ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 111, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h
index 9f9d0a4..f0eaf31 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PI0_EVT_1DPPI0_NU_H_SEEN
#define ANL_CC2PI_1PIP1PI0_EVT_1DPPI0_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.cxx
index 564c557..29e3481 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu::ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("p_{#pi+} (GeV)");
+ fSettings.SetXTitle("p_{#pi^{+}} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi0_ppip_weight.csv");
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(211) == 0)
return;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
double ppip = FitUtils::p(Ppip);
this->fXVar = ppip;
return;
}
// Signal asks for 1pi0, 1pi+, 1mu-, 1p
bool ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 111, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h
index ce19070..1769d26 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PI0_EVT_1DPPIP_NU_H_SEEN
#define ANL_CC2PI_1PIP1PI0_EVT_1DPPIP_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.cxx
index 797a1ad..5b56715 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.cxx
@@ -1,112 +1,112 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu::ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{prot} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi0_pProt_weight.csv");
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0)
return;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
double pprot = FitUtils::p(Pp);
this->fXVar = pprot;
return;
}
// Signal asks for 1pi0, 1pi+, 1mu-, 1p
bool ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 111, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
/*
void ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu::FillHistograms() {
if (makeHadronicMassHist) {
hadMassHist->Fill(hadMass);
}
Measurement1D::FillHistograms();
}
void ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu::ScaleEvents() {
PlotUtils::FluxUnfoldedScaling(mcHist, GetFluxHistogram());
PlotUtils::FluxUnfoldedScaling(mcFine, GetFluxHistogram());
mcHist->Scale(fScaleFactor);
mcFine->Scale(fScaleFactor);
return;
}
*/
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h
index 934beb4..816a3ec 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PI0_EVT_1DPPROT_NU_H_SEEN
#define ANL_CC2PI_1PIP1PI0_EVT_1DPPROT_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.cxx
index 9c115a5..cb2c4a0 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.cxx
@@ -1,85 +1,85 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu::ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG", "FIX,FREE,SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi01p_xsec.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
double Enu = Pnu.E()/1000.;
// No hadronic mass cut or similar here so very simple FillEventVariables
this->fXVar = Enu;
return;
}
// Signal asks for 1pi+, 1pi0, 1mu-, 1p
bool ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 111, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h b/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h
index 8b149ab..0bdbcc7 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PI0_XSEC_1DENU_NU_H_SEEN
#define ANL_CC2PI_1PIP1PI0_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.cxx
index 0a31a16..2a55d0a 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.cxx
@@ -1,88 +1,88 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu::ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{#mu} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_pMu_weight.csv");
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(13) == 0)
return;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double pmu = FitUtils::p(Pmu);
this->fXVar = pmu;
return;
}
// Signal asks for 2pi+, 1mu-, 1n
bool ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 211, 2112};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h
index 70d4f14..bf58356 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PIP_EVT_1DPMU_NU_H_SEEN
#define ANL_CC2PI_1PIP1PIP_EVT_1DPMU_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.cxx
index 2cd6926..09e2065 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.cxx
@@ -1,88 +1,88 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu::ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{n} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_pNeutron_weight.csv");
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0)
return;
TLorentzVector Pneutron = event->GetHMFSParticle(2112)->fP;
double pneut = FitUtils::p(Pneutron);
this->fXVar = pneut;
return;
}
// Signal asks for 2pi+, 1mu-, 1n
bool ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 211, 2112};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h
index 83b5da7..a536aec 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PIP_EVT_1DPNEUT_NU_H_SEEN
#define ANL_CC2PI_1PIP1PIP_EVT_1DPNEUT_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.cxx
index 91626cc..5a2402d 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.cxx
@@ -1,88 +1,88 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu::ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{#pi high} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_pHigh_weight.csv");
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(211) == 0)
return;
TLorentzVector Ppip_high = event->GetHMFSParticle(211)->fP;
double ppip_highest = FitUtils::p(Ppip_high);
this->fXVar = ppip_highest;
return;
}
// Signal asks for 2pi+, 1mu-, 1n
bool ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 211, 2112};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h
index 57a2cf6..e640b5b 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PIP_EVT_1DPPIPHIGH_NU_H_SEEN
#define ANL_CC2PI_1PIP1PIP_EVT_1DPPIPHIGH_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.cxx
index 215157a..3ecd8be 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.cxx
@@ -1,98 +1,98 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu::ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{#pi low} (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_pLow_weight.csv");
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu::FillEventVariables(FitEvent *event) {
// Because we're looking for a low momentum particle, let's initalise this to a very high momentum particle
TLorentzVector Ppip_low(1E5,1E5,1E5,1E5);
// Loop over the particle stack to find relevant particles
// start at 2 because 0=nu, 1=nucleon, by NEUT default
for (UInt_t j = 2; j < event->Npart(); ++j){
if (!(event->PartInfo(j))->fIsAlive && (event->PartInfo(j))->fNEUTStatusCode != 0 && (event->PartInfo(j)->fNEUTStatusCode != 2)) continue; //move on if NOT ALIVE and NOT NORMAL
int PID = (event->PartInfo(j))->fPID;
// Select highest momentum positive pion
if (PID == 211 && event->PartInfo(j)->fP.E() < Ppip_low.E()) {
Ppip_low = event->PartInfo(j)->fP;
}
}
double ppip_lowest = FitUtils::p(Ppip_low);
this->fXVar = ppip_lowest;
return;
}
// Signal asks for 2pi+, 1mu-, 1n
bool ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 211, 2112};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h
index 3046ce9..bbf7492 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PIP_EVT_1DPPIPLOW_NU_H_SEEN
#define ANL_CC2PI_1PIP1PIP_EVT_1DPPIPLOW_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.cxx
index 550807b..3f32bb0 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.cxx
@@ -1,85 +1,85 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
/**
* D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
* Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
*/
#include "ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h"
//********************************************************************
ANL_CC2pi_1pip1pip_XSec_1DEnu_nu::ANL_CC2pi_1pip1pip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_CC2pi_1pip1pip_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG", "FIX,FREE,SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC2#pi");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_xsec.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_CC2pi_1pip1pip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
double Enu = Pnu.E()/1000.;
// No hadronic mass cut or similar here so very simple FillEventVariables
this->fXVar = Enu;
return;
}
// Signal asks for 2pi+, 1mu-, 1n
bool ANL_CC2pi_1pip1pip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, 211, 2112};
return SignalDef::isCCWithFS(event, 14, pdgs, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h
index 8fc25af..9c0d60a 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CC2PI_1PIP1PIP_XSEC_1DENU_NU_H_SEEN
#define ANL_CC2PI_1PIP1PIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
class ANL_CC2pi_1pip1pip_XSec_1DEnu_nu : public Measurement1D {
public:
ANL_CC2pi_1pip1pip_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~ANL_CC2pi_1pip1pip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx
index 53b5b17..72957b0 100755
--- a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx
@@ -1,160 +1,160 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_CCQE_Evt_1DQ2_nu.h"
//********************************************************************
ANL_CCQE_Evt_1DQ2_nu::ANL_CCQE_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CCQ2 Event Rate 1DQ2 nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CCQE} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CCQE");
fSettings.DefineAllowedSpecies("numu");
// Hadronic Cut Info
if (fSettings.Found("name", "PRL31")) {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRL31_844.root;ANL_1DQ2_Data" );
fSettings.SetEnuRange(0.0, 3.0);
} else if (fSettings.Found("name", "PRD16")) {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRD16_3103.root;ANL_1DQ2_Data" );
} else {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_Data_PRD26_537.root;ANL_1DQ2_Data" );
}
// is Q2 Correction applied
applyQ2correction = fSettings.Found("type", "Q2CORR");
if (applyQ2correction) {
fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "/ANL/ANL_CCQE_Data_PRL31_844.root");
fSettings.SetS("q2correction_hist", "ANL_1DQ2_Correction");
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor for shape
fScaleFactor = 1.0;
// Plot Setup -------------------------------------------------------
SetDataFromRootFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Correction Histogram
if (applyQ2correction) {
// Correction Hist
CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
fSettings.GetS("q2correction_hist") );
SetAutoProcessTH1(CorrectionHist, kCMD_Write);
// Make uncorrected MC hist
fMCHist_NoCorr = (TH1D*) fDataHist->Clone();
fMCHist_NoCorr->Reset();
fMCHist_NoCorr->SetNameTitle( (fName + "_NOCORR").c_str(),
(fName + "_NOCORR").c_str());
SetAutoProcessTH1(fMCHist_NoCorr);
}
// Final setup ---------------------------------------------------
FinaliseMeasurement();
}
//********************************************************************
void ANL_CCQE_Evt_1DQ2_nu::FillEventVariables(FitEvent * event) {
//********************************************************************
if (event->NumFSParticle(13) == 0)
return;
// Fill histogram with reconstructed Q2 Distribution
fXVar = -999.9;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
fXVar = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
GetQ2Box()->fQ2 = fXVar;
return;
};
//********************************************************************
bool ANL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent * event) {
//********************************************************************
if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
// Q2 cut
if (GetQ2Box()->fQ2 <= 0) return false;
return true;
};
//********************************************************************
void ANL_CCQE_Evt_1DQ2_nu::FillHistograms() {
//********************************************************************
if (applyQ2correction) {
fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
}
Measurement1D::FillHistograms();
}
//********************************************************************
void ANL_CCQE_Evt_1DQ2_nu::ScaleEvents() {
//********************************************************************
Measurement1D::ScaleEvents();
// Flux unfold our extra histogram
if (applyQ2correction) {
if (fMCHist_NoCorr->Integral()) {
fMCHist_NoCorr->Scale(fDataHist->Integral() / fMCHist_NoCorr->Integral());
}
}
}
diff --git a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.h b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.h
index 80e4c43..0828512 100755
--- a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.h
@@ -1,66 +1,66 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CCQE_Evt_1DQ2_NU_H_SEEN
#define ANL_CCQE_Evt_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
#include "CustomVariableBoxes.h"
/// \brief ANL Charged Current Quasi-elastic Measurement.
/// 1D Event Rate in Q2QE
///
/// Class supports multiple published datasets: \n
/// - PRD.26.537 = ANL_CCQE_XSec_1DQ2_nu_PRD26, or ANL_CCQE_XSec_1DEnu_nu
/// - PRD.16.3103 = ANL_CCQE_XSec_1DQ2_nu_PRD16
/// - PRL.31.844 = ANL_CCQE_XSec_1DEQ2_nu_PRL31
class ANL_CCQE_Evt_1DQ2_nu : public Measurement1D {
public:
ANL_CCQE_Evt_1DQ2_nu(nuiskey samplekey);
virtual ~ANL_CCQE_Evt_1DQ2_nu() {};
/// \brief Fill Q2QE Event Information
void FillEventVariables(FitEvent *event);
/// \brief Selection only true CCQE
bool isSignal(FitEvent *event);
/// \brief Fill main histograms and correction histograms
void FillHistograms();
/// \brief scale normal MC and corrected MC
void ScaleEvents();
/// \brief Use Q2 Box to save correction info
inline Q2VariableBox1D* GetQ2Box(){ return static_cast(GetBox()); };
/// \brief Create Q2 Box to save correction info
inline MeasurementVariableBox* CreateBox(){ return new Q2VariableBox1D(); };
private:
bool applyQ2correction; ///< Flag of whether deut correction applied
TH1D* CorrectionHist; ///< Correction factor
TH1D* fMCHist_NoCorr; ///< Uncorrected fMCHist
};
#endif
diff --git a/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx
index aca2998..169213b 100644
--- a/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx
@@ -1,152 +1,152 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_CCQE_XSec_1DEnu_nu.h"
//********************************************************************
ANL_CCQE_XSec_1DEnu_nu::ANL_CCQE_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CCQ2 XSec 1DEnu nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
- fSettings.SetYTitle("#sigma(#E_{#nu}) (cm^{2}/neutron)");
+ fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/neutron)");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CCQE");
fSettings.DefineAllowedSpecies("numu");
// Hadronic Cut Info
if (fSettings.Found("name", "PRL31")) {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRL31_844.root;ANL_1DEnu_Data" );
fSettings.SetEnuRange(0.0, 3.0);
} else {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRD16_3103.root;ANL_1DEnu_fluxtuned_Data" );
}
// is Q2 Correction applied
applyQ2correction = fSettings.Found("type", "Q2CORR");
fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "/ANL/ANL_CCQE_Data_PRL31_844.root");
fSettings.SetS("q2correction_hist", "ANL_1DQ2_Correction");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor for shape
fScaleFactor = (GetEventHistogram()->Integral("width") * 2.0 / 1.0 * 1E-38 / (fNEvents + 0.));
// Plot Setup -------------------------------------------------------
SetDataFromRootFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Correction Histogram
if (applyQ2correction) {
// Correction Hist
CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
fSettings.GetS("q2correction_hist") );
SetAutoProcessTH1(CorrectionHist, kCMD_Write);
// Make uncorrected MC hist
fMCHist_NoCorr = (TH1D*) fDataHist->Clone();
fMCHist_NoCorr->Reset();
fMCHist_NoCorr->SetNameTitle( (fName + "_NOCORR").c_str(),
(fName + "_NOCORR").c_str());
SetAutoProcessTH1(fMCHist_NoCorr);
}
// Final setup ---------------------------------------------------
FinaliseMeasurement();
}
//********************************************************************
void ANL_CCQE_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
//********************************************************************
if (event->NumFSParticle(13) == 0)
return;
// Get Q2
double q2qe = 0.0;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
q2qe = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
Enu_rec = FitUtils::EnuQErec(Pmu, cos(ThetaMu), 0., true);
fXVar = Enu_rec;
GetQ2Box()->fQ2 = q2qe;
return;
};
//********************************************************************
bool ANL_CCQE_XSec_1DEnu_nu::isSignal(FitEvent *event) {
//********************************************************************
return SignalDef::isCCQE(event, 14, EnuMin, EnuMax);
};
//********************************************************************
void ANL_CCQE_XSec_1DEnu_nu::FillHistograms() {
//********************************************************************
if (applyQ2correction) {
fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
}
Measurement1D::FillHistograms();
}
//********************************************************************
void ANL_CCQE_XSec_1DEnu_nu::ScaleEvents() {
//********************************************************************
Measurement1D::ScaleEvents();
// Flux unfold our extra histogram
if (applyQ2correction) {
PlotUtils::FluxUnfoldedScaling(fMCHist_NoCorr, GetFluxHistogram(),
GetEventHistogram(), fScaleFactor,
fNEvents);
}
}
diff --git a/src/ANL/ANL_CCQE_XSec_1DEnu_nu.h b/src/ANL/ANL_CCQE_XSec_1DEnu_nu.h
index 08397e2..1c16bc0 100644
--- a/src/ANL/ANL_CCQE_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CCQE_XSec_1DEnu_nu.h
@@ -1,63 +1,63 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_CCQE_XSEC_1DENU_NU_H_SEEN
#define ANL_CCQE_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
#include "CustomVariableBoxes.h"
/// /brief ANL Charged Current Quasi-elastic Measurement
///
/// 1D Flux unfolded cross-section in Enu
/// Class supports multiple published datasets: \n
/// - PRD.16.3103 = ANL_CCQE_XSec_1DEnu_nu_PRD16, or ANL_CCQE_XSec_1DEnu_nu
/// - PRL.31.844 = ANL_CCQE_XSec_1DEnu_nu_PRL31
class ANL_CCQE_XSec_1DEnu_nu : public Measurement1D {
public:
ANL_CCQE_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~ANL_CCQE_XSec_1DEnu_nu() {};
/// \brief Get Q2 assuming QE scattering
void FillEventVariables(FitEvent *event);
/// \brief Selection only true CCQE
bool isSignal(FitEvent *event);
/// \brief fill normal MC and corrected MC
void FillHistograms();
/// \brief scale normal MC and corrected MC
void ScaleEvents();
/// \brief Use Q2 Box to save correction info
inline Q2VariableBox1D* GetQ2Box(){ return static_cast(GetBox()); };
/// \brief Create Q2 Box to save correction info
inline MeasurementVariableBox* CreateBox(){ return new Q2VariableBox1D(); };
private:
bool applyQ2correction; ///< Apply free nucleon to dueterium correction
TH1D* CorrectionHist; ///< Histogram to interpolate free nucleon correction
TH1D* fMCHist_NoCorr; ///< Uncorrected fMCHist
};
#endif
diff --git a/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.cxx b/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.cxx
index 568b693..c3eb39f 100644
--- a/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.cxx
@@ -1,86 +1,86 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_NC1npip_Evt_1Dppi_nu.h"
/**
* M. Derrick et al., "Study of single-pion production by weak neutral currents in low-energy \nu d interactions", Physical Review D, Volume 23, Number 3, 569, 1 February 1981
*/
//********************************************************************
ANL_NC1npip_Evt_1Dppi_nu::ANL_NC1npip_Evt_1Dppi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_NC1npip_Evt_1Dppi_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{#pi} (MeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 100.0); // No Enu Range given in v1r0p1
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu NC1n#pi^{+}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/NC1npip/ANL_ppi_NC1npip_weight.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
this->fScaleFactor = GetEventHistogram()->Integral("width")/((fNEvents+0.)*GetFluxHistogram()->Integral("width"))*(16./8.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_NC1npip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0 || event->NumFSParticle(211) == 0) return;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;;
double hadMass = FitUtils::MpPi(Pn, Ppip);
double ppip = -1.0;
// ANL has a M(pi, p) < 1.4 GeV cut imposed
if (hadMass < 1400) ppip = FitUtils::p(Ppip)*1000.;
fXVar = ppip;
return;
};
bool ANL_NC1npip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
return SignalDef::isNC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.h b/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.h
index e70fb45..c4d7b70 100644
--- a/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.h
+++ b/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.h
@@ -1,41 +1,41 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_NC1NPIP_EVT_1DPPI_NU_H_SEEN
#define ANL_NC1NPIP_EVT_1DPPI_NU_H_SEEN
#include "Measurement1D.h"
/*!
ANL Neutral Current 1npip Measurement. \n\n
1D Kinematics in pion momentum. \n
Raw event rates. \n
*/
class ANL_NC1npip_Evt_1Dppi_nu : public Measurement1D {
public:
ANL_NC1npip_Evt_1Dppi_nu(nuiskey samplekey);
virtual ~ANL_NC1npip_Evt_1Dppi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.cxx b/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.cxx
index 77856e1..7ef3420 100644
--- a/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.cxx
+++ b/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.cxx
@@ -1,94 +1,94 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_NC1ppim_Evt_1DcosmuStar_nu.h"
/**
* M. Derrick et al., "Study of the reaction \nu n \rightarrow \nu p \pi^-", Physics Letters, Volume 92B, Number 3,4, 363, 19 May 1980
*/
//********************************************************************
ANL_NC1ppim_Evt_1DcosmuStar_nu::ANL_NC1ppim_Evt_1DcosmuStar_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_NC1ppim_Evt_1DcosmuStar_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos*_{#mu}");
+ fSettings.SetXTitle("cos#theta*_{#mu}");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.3, 1.5);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/NC1ppim/ANL_NC1ppim_cosMuStar.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")/((fNEvents+0.)*GetFluxHistogram()->Integral("width"))*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_NC1ppim_Evt_1DcosmuStar_nu::FillEventVariables(FitEvent *event) {
if (event->NumISParticle(2112) == 0 || event->NumFSParticle(2212) == 0 || event->NumFSParticle(-211) == 0 || event->NumFSParticle(14) == 0) return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pin = event->GetHMISParticle(2112)->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppim = event->GetHMFSParticle(-211)->fP;
TLorentzVector PnuOut = event->GetHMFSParticle(14)->fP;
// Boost into centre of mass frame
TLorentzVector CMS = Pnu + Pin;
// Boost outgoing neutrino backwards CMS
PnuOut.Boost(-CMS.BoostVector());
// Boost incoming neutrino forwards by CMS
Pnu.Boost(CMS.BoostVector());
double cosmuStar = cos(FitUtils::th(PnuOut, Pnu));
this->fXVar = cosmuStar;
return;
};
bool ANL_NC1ppim_Evt_1DcosmuStar_nu::isSignal(FitEvent *event) {
return SignalDef::isNC1pi3Prong(event, 14, -211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.h b/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.h
index de8c258..22b2f3d 100644
--- a/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.h
+++ b/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.h
@@ -1,40 +1,40 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_NC1PPIM_EVT_1DCOSMUSTAR_NU_H_SEEN
#define ANL_NC1PPIM_EVT_1DCOSMUSTAR_NU_H_SEEN
#include "Measurement1D.h"
/*!
ANL Neutral Current 1p pi- Measurement. \n\n
1D total cross-section \n
*/
class ANL_NC1ppim_Evt_1DcosmuStar_nu : public Measurement1D {
public:
ANL_NC1ppim_Evt_1DcosmuStar_nu(nuiskey samplekey);
virtual ~ANL_NC1ppim_Evt_1DcosmuStar_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.cxx b/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.cxx
index f33f5b9..b9477d8 100644
--- a/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.cxx
@@ -1,76 +1,76 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ANL_NC1ppim_XSec_1DEnu_nu.h"
/**
* M. Derrick et al., "Study of the reaction \nu n \rightarrow \nu p \pi^-", Physics Letters, Volume 92B, Number 3,4, 363, 19 May 1980
*/
//********************************************************************
ANL_NC1ppim_XSec_1DEnu_nu::ANL_NC1ppim_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL_NC1ppim_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.3, 1.5);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("ANL #nu_mu NC1n#pi^{+}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/NC1ppim/ANL_NC1ppim_Enu_xsec.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * 1E-38 /(fNEvents+0)*(16./8.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ANL_NC1ppim_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
// Very simple here!
double Enu = event->GetNeutrinoIn()->fP.E()/1000.;
this->fXVar = Enu;
return;
};
bool ANL_NC1ppim_XSec_1DEnu_nu::isSignal(FitEvent *event) {
return SignalDef::isNC1pi3Prong(event, 14, -211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.h b/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.h
index d05fc61..69685cf 100644
--- a/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.h
@@ -1,40 +1,40 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ANL_NC1PPIM_XSEC_1DENU_NU_H_SEEN
#define ANL_NC1PPIM_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
/*!
ANL Neutral Current 1p pi- Measurement. \n\n
1D total cross-section \n
*/
class ANL_NC1ppim_XSec_1DEnu_nu : public Measurement1D {
public:
ANL_NC1ppim_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~ANL_NC1ppim_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ANL/CMakeLists.txt b/src/ANL/CMakeLists.txt
index ff37ba0..904405c 100644
--- a/src/ANL/CMakeLists.txt
+++ b/src/ANL/CMakeLists.txt
@@ -1,130 +1,149 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
set(IMPLFILES
ANL_CCQE_Evt_1DQ2_nu.cxx
ANL_CCQE_XSec_1DEnu_nu.cxx
ANL_CC1npip_Evt_1DcosmuStar_nu.cxx
ANL_CC1npip_Evt_1Dppi_nu.cxx
ANL_CC1npip_Evt_1DQ2_nu.cxx
ANL_CC1npip_XSec_1DEnu_nu.cxx
+ANL_CC1npip_Evt_1DWNpi_nu.cxx
+ANL_CC1npip_Evt_1DWNmu_nu.cxx
+ANL_CC1npip_Evt_1DWmupi_nu.cxx
ANL_CC1pi0_Evt_1DcosmuStar_nu.cxx
ANL_CC1pi0_Evt_1DQ2_nu.cxx
ANL_CC1pi0_XSec_1DEnu_nu.cxx
+ANL_CC1pi0_Evt_1DWNpi_nu.cxx
+ANL_CC1pi0_Evt_1DWNmu_nu.cxx
+ANL_CC1pi0_Evt_1DWmupi_nu.cxx
ANL_CC1ppip_Evt_1DcosmuStar_nu.cxx
ANL_CC1ppip_Evt_1Dppi_nu.cxx
ANL_CC1ppip_Evt_1DQ2_nu.cxx
ANL_CC1ppip_Evt_1Dthpr_nu.cxx
ANL_CC1ppip_XSec_1DEnu_nu.cxx
ANL_CC1ppip_XSec_1DQ2_nu.cxx
ANL_CC1ppip_Evt_1DcosthAdler_nu.cxx
ANL_CC1ppip_Evt_1Dphi_nu.cxx
+ANL_CC1ppip_Evt_1DWNpi_nu.cxx
+ANL_CC1ppip_Evt_1DWNmu_nu.cxx
+ANL_CC1ppip_Evt_1DWmupi_nu.cxx
ANL_NC1npip_Evt_1Dppi_nu.cxx
ANL_NC1ppim_XSec_1DEnu_nu.cxx
ANL_NC1ppim_Evt_1DcosmuStar_nu.cxx
ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.cxx
ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.cxx
ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.cxx
ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.cxx
ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.cxx
ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.cxx
ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.cxx
ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.cxx
ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.cxx
ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.cxx
ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.cxx
ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.cxx
ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.cxx
)
set(HEADERFILES
ANL_CCQE_Evt_1DQ2_nu.h
ANL_CCQE_XSec_1DEnu_nu.h
ANL_CC1npip_Evt_1DcosmuStar_nu.h
ANL_CC1npip_Evt_1Dppi_nu.h
ANL_CC1npip_Evt_1DQ2_nu.h
ANL_CC1npip_XSec_1DEnu_nu.h
+ANL_CC1npip_Evt_1DWNpi_nu.h
+ANL_CC1npip_Evt_1DWNmu_nu.h
+ANL_CC1npip_Evt_1DWmupi_nu.h
ANL_CC1pi0_Evt_1DcosmuStar_nu.h
ANL_CC1pi0_Evt_1DQ2_nu.h
ANL_CC1pi0_XSec_1DEnu_nu.h
+ANL_CC1pi0_Evt_1DWNpi_nu.h
+ANL_CC1pi0_Evt_1DWNmu_nu.h
+ANL_CC1pi0_Evt_1DWmupi_nu.h
ANL_CC1ppip_Evt_1DcosmuStar_nu.h
ANL_CC1ppip_Evt_1Dppi_nu.h
ANL_CC1ppip_Evt_1DQ2_nu.h
ANL_CC1ppip_Evt_1Dthpr_nu.h
ANL_CC1ppip_XSec_1DEnu_nu.h
ANL_CC1ppip_XSec_1DQ2_nu.h
ANL_CC1ppip_Evt_1DcosthAdler_nu.h
ANL_CC1ppip_Evt_1Dphi_nu.h
+ANL_CC1ppip_Evt_1DWNpi_nu.h
+ANL_CC1ppip_Evt_1DWNpi_nu.h
+ANL_CC1ppip_Evt_1DWNmu_nu.h
+ANL_CC1ppip_Evt_1DWmupi_nu.h
ANL_NC1npip_Evt_1Dppi_nu.h
ANL_NC1ppim_XSec_1DEnu_nu.h
ANL_NC1ppim_Evt_1DcosmuStar_nu.h
ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h
ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.h
ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h
ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h
ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h
ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h
ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h
ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h
ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h
ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h
ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h
ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h
ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h)
set(LIBNAME expANL)
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/ANL)
set(MODULETargets ${MODULETargets} ${LIBNAME} PARENT_SCOPE)
diff --git a/src/ANL/SAMPLEREADME b/src/ANL/SAMPLEREADME
deleted file mode 100644
index 2038655..0000000
--- a/src/ANL/SAMPLEREADME
+++ /dev/null
@@ -1,9 +0,0 @@
-Samples for this Measurement
-
-ANL_CCQE_Evt_1DQ2_nu : Event rate measurement in reconstructed Q2 for ANL numu data.
-
-ANL_CCQE_XSec_1DEnu_nu : Cross-section measurement as a fucntion of reconstructed Enu.
-
-ANL_CC1ppip:
-
-ANL_CC2pi:
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.cxx b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.cxx
index 4e53199..949311c 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.h"
//********************************************************************
ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu::ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: CC, single charged pion > 0.1 GeV/c, no other mesons. \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{#mu} (GeV)");
fSettings.SetYTitle("d#sigma/dp_{#mu} (cm^{2} Ar^{-1} GeV^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 100.0);
fSettings.DefineAllowedTargets("Ar");
// CC1Pi plot information
fSettings.SetTitle("ArgoNeut CC1#pi^{#pm} #bar#nu_{#mu} 1Dp_{#mu}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CC1Pi_dsig_dmumom_nubar.dat" );
fSettings.DefineAllowedSpecies("numubar");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) /
TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu::FillEventVariables(FitEvent *event) {
FitParticle* pmu = event->GetHMFSParticle(-13);
if (pmu) fXVar = pmu->fP.Vect().Mag() / 1000;
return;
};
//********************************************************************
bool ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu::isSignal(FitEvent *event)
//********************************************************************
{
if (!SignalDef::isCCINC(event, -14, EnuMin, EnuMax)) return false;
int nMesons = event->NumFSMesons();
int nLeptons = event->NumFSLeptons();
int nPiCharge = event->NumFSChargePions();
int nPiZero = event->NumFSPiZero();
if (nPiCharge != 1 || nMesons != 1 || nLeptons != 1 || nPiZero > 0) {
return false;
}
if (event->GetHMFSChargePions()->fP.Vect().Mag() < 100) return false;
return true;
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.h b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.h
index cbb3562..29844c1 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.h
@@ -1,35 +1,35 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu_H_SEEN
#define ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu_H_SEEN
#include "Measurement1D.h"
class ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu : public Measurement1D {
public:
ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu(nuiskey samplekey);
virtual ~ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.cxx b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.cxx
index 5a60f73..7e33eb1 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.h"
//********************************************************************
ArgoNeuT_CC1Pi_XSec_1Dpmu_nu::ArgoNeuT_CC1Pi_XSec_1Dpmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CC1Pi_XSec_1Dpmu_nu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: CC, single charged pion > 0.1 GeV/c, no other mesons. \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{#mu} (GeV)");
fSettings.SetYTitle("d#sigma/dp_{#mu} (cm^{2} Ar^{-1} GeV^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 100.0);
fSettings.DefineAllowedTargets("Ar");
// CC1Pi plot information
fSettings.SetTitle("ArgoNeut CC1#pi^{#pm} #nu_{#mu} 1Dp_{#mu}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CC1Pi_dsig_dmumom_nu.dat" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) /
TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CC1Pi_XSec_1Dpmu_nu::FillEventVariables(FitEvent *event) {
FitParticle* pmu = event->GetHMFSParticle(13);
if (pmu) fXVar = pmu->fP.Vect().Mag() / 1000;
return;
};
//********************************************************************
bool ArgoNeuT_CC1Pi_XSec_1Dpmu_nu::isSignal(FitEvent *event)
//********************************************************************
{
if (!SignalDef::isCCINC(event, 14, EnuMin, EnuMax)) return false;
int nMesons = event->NumFSMesons();
int nLeptons = event->NumFSLeptons();
int nPiCharge = event->NumFSChargePions();
int nPiZero = event->NumFSPiZero();
if (nPiCharge != 1 || nMesons != 1 || nLeptons != 1 || nPiZero > 0) {
return false;
}
if (event->GetHMFSChargePions()->fP.Vect().Mag() < 100) return false;
return true;
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.h b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.h
index 3a6309f..df5a986 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.h
@@ -1,35 +1,35 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ArgoNeuT_CC1Pi_XSec_1Dpmu_nu_H_SEEN
#define ArgoNeuT_CC1Pi_XSec_1Dpmu_nu_H_SEEN
#include "Measurement1D.h"
class ArgoNeuT_CC1Pi_XSec_1Dpmu_nu : public Measurement1D {
public:
ArgoNeuT_CC1Pi_XSec_1Dpmu_nu(nuiskey samplekey);
virtual ~ArgoNeuT_CC1Pi_XSec_1Dpmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.cxx b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.cxx
index c6cbce8..00146f2 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.h"
//********************************************************************
ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu::ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: CC, single charged pion > 0.1 GeV/c, no other mesons. \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("#theta_{#mu} (GeV)");
fSettings.SetYTitle("d#sigma/d#theta_{#mu} (cm^{2} nucleon^{-1} degree^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 100.0);
fSettings.DefineAllowedTargets("Ar");
// CC1Pi plot information
fSettings.SetTitle("ArgoNeut CC1#pi^{#pm} #bar#nu_{#mu} 1D#theta_{#mu}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CC1Pi_dsig_dthetamu_nubar.dat" );
fSettings.DefineAllowedSpecies("numubar");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) /
TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu::FillEventVariables(FitEvent *event) {
FitParticle* pmu = event->GetHMFSParticle(-13);
if (pmu) fXVar = pmu->fP.Vect().Theta() * 180.0 / TMath::Pi();
return;
};
//********************************************************************
bool ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu::isSignal(FitEvent *event)
//********************************************************************
{
if (!SignalDef::isCCINC(event, -14, EnuMin, EnuMax)) return false;
int nMesons = event->NumFSMesons();
int nLeptons = event->NumFSLeptons();
int nPiCharge = event->NumFSChargePions();
int nPiZero = event->NumFSPiZero();
if (nPiCharge != 1 || nMesons != 1 || nLeptons != 1 || nPiZero > 0) {
return false;
}
if (event->GetHMFSChargePions()->fP.Vect().Mag() < 100) return false;
return true;
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.h b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.h
index 2af9178..76ffc2b 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.h
@@ -1,35 +1,35 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu_H_SEEN
#define ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu_H_SEEN
#include "Measurement1D.h"
class ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu : public Measurement1D {
public:
ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu(nuiskey samplekey);
virtual ~ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.cxx b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.cxx
index 3629843..ee22ad0 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.h"
//********************************************************************
ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu::ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: CC, single charged pion > 0.1 GeV/c, no other mesons. \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("#theta_{#mu} (GeV)");
fSettings.SetYTitle("d#sigma/d#theta_{#mu} (cm^{2} nucleon^{-1} degree^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 100.0);
fSettings.DefineAllowedTargets("Ar");
// CC1Pi plot information
fSettings.SetTitle("ArgoNeut CC1#pi^{#pm} #nu_{#mu} 1D#theta_{#mu}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CC1Pi_dsig_dthetamu_nu.dat" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) /
TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu::FillEventVariables(FitEvent *event) {
FitParticle* pmu = event->GetHMFSParticle(13);
if (pmu) fXVar = pmu->fP.Vect().Theta() * 180.0 / TMath::Pi();
return;
};
//********************************************************************
bool ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu::isSignal(FitEvent *event)
//********************************************************************
{
if (!SignalDef::isCCINC(event, 14, EnuMin, EnuMax)) return false;
int nMesons = event->NumFSMesons();
int nLeptons = event->NumFSLeptons();
int nPiCharge = event->NumFSChargePions();
int nPiZero = event->NumFSPiZero();
if (nPiCharge != 1 || nMesons != 1 || nLeptons != 1 || nPiZero > 0) {
return false;
}
if (event->GetHMFSChargePions()->fP.Vect().Mag() < 100) return false;
return true;
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.h b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.h
index 21438a3..a149343 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.h
@@ -1,35 +1,35 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu_H_SEEN
#define ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu_H_SEEN
#include "Measurement1D.h"
class ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu : public Measurement1D {
public:
ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu(nuiskey samplekey);
virtual ~ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.cxx b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.cxx
index 13d90ec..f590df3 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.cxx
@@ -1,88 +1,88 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.h"
//********************************************************************
ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu::ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: CC, single charged pion > 0.1 GeV/c, no other mesons. \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("#theta_{#mu#pi} (GeV)");
fSettings.SetYTitle("d#sigma/d#theta_{#mu#pi} (cm^{2} nucleon^{-1} degree^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 100.0);
fSettings.DefineAllowedTargets("Ar");
// CC1Pi plot information
fSettings.SetTitle("ArgoNeut CC1#pi^{#pm} #bar#nu_{#mu} 1D#theta_{#mu#pi}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CC1Pi_dsig_dthetamupi_nubar.dat" );
fSettings.DefineAllowedSpecies("numubar");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) /
TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu::FillEventVariables(FitEvent *event) {
FitParticle* pmu = event->GetHMFSParticle(-13);
FitParticle* ppi = event->GetHMFSChargePions();
if (pmu && ppi) fXVar = pmu->fP.Vect().Angle(ppi->fP.Vect()) * 180.0 / TMath::Pi();
return;
};
//********************************************************************
bool ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu::isSignal(FitEvent *event)
//********************************************************************
{
if (!SignalDef::isCCINC(event, -14, EnuMin, EnuMax)) return false;
int nMesons = event->NumFSMesons();
int nLeptons = event->NumFSLeptons();
int nPiCharge = event->NumFSChargePions();
int nPiZero = event->NumFSPiZero();
if (nPiCharge != 1 || nMesons != 1 || nLeptons != 1 || nPiZero > 0) {
return false;
}
if (event->GetHMFSChargePions()->fP.Vect().Mag() < 100) return false;
return true;
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.h b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.h
index 1cab874..6c77d44 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.h
@@ -1,35 +1,35 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu_H_SEEN
#define ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu_H_SEEN
#include "Measurement1D.h"
class ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu : public Measurement1D {
public:
ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu(nuiskey samplekey);
virtual ~ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.cxx b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.cxx
index 19350ad..1f8fd72 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.cxx
@@ -1,88 +1,88 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.h"
//********************************************************************
ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu::ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: CC, single charged pion > 0.1 GeV/c, no other mesons. \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("#theta_{#mu#pi} (GeV)");
fSettings.SetYTitle("d#sigma/d#theta_{#mu#pi} (cm^{2} nucleon^{-1} degree^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 100.0);
fSettings.DefineAllowedTargets("Ar");
// CC1Pi plot information
fSettings.SetTitle("ArgoNeut CC1#pi^{#pm} #nu_{#mu} 1D#theta_{#mu#pi}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CC1Pi_dsig_dthetamupi_nu.dat" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) /
TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu::FillEventVariables(FitEvent *event) {
FitParticle* pmu = event->GetHMFSParticle(13);
FitParticle* ppi = event->GetHMFSChargePions();
if (pmu && ppi) fXVar = pmu->fP.Vect().Angle(ppi->fP.Vect()) * 180.0 / TMath::Pi();
return;
};
//********************************************************************
bool ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu::isSignal(FitEvent *event)
//********************************************************************
{
if (!SignalDef::isCCINC(event, 14, EnuMin, EnuMax)) return false;
int nMesons = event->NumFSMesons();
int nLeptons = event->NumFSLeptons();
int nPiCharge = event->NumFSChargePions();
int nPiZero = event->NumFSPiZero();
if (nPiCharge != 1 || nMesons != 1 || nLeptons != 1 || nPiZero > 0) {
return false;
}
if (event->GetHMFSChargePions()->fP.Vect().Mag() < 100) return false;
return true;
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.h b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.h
index b9f3a0e..2f68776 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.h
@@ -1,35 +1,35 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu_H_SEEN
#define ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu_H_SEEN
#include "Measurement1D.h"
class ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu : public Measurement1D {
public:
ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu(nuiskey samplekey);
virtual ~ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.cxx b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.cxx
index d037562..b83886e 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.h"
//********************************************************************
ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu::ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: CC, single charged pion > 0.1 GeV/c, no other mesons. \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("#theta_{#pi} (GeV)");
fSettings.SetYTitle("d#sigma/d#theta_{#pi} (cm^{2} nucleon^{-1} degree^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 100.0);
fSettings.DefineAllowedTargets("Ar");
// CC1Pi plot information
fSettings.SetTitle("ArgoNeut CC1#pi^{#pm} #bar#nu_{#mu} 1D#theta_{#pi}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CC1Pi_dsig_dthetapi_nubar.dat" );
fSettings.DefineAllowedSpecies("numubar");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) /
TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu::FillEventVariables(FitEvent *event) {
FitParticle* p = event->GetHMFSChargePions();
if (p) fXVar = p->fP.Vect().Theta() * 180.0 / TMath::Pi();
return;
};
//********************************************************************
bool ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu::isSignal(FitEvent *event)
//********************************************************************
{
if (!SignalDef::isCCINC(event, -14, EnuMin, EnuMax)) return false;
int nMesons = event->NumFSMesons();
int nLeptons = event->NumFSLeptons();
int nPiCharge = event->NumFSChargePions();
int nPiZero = event->NumFSPiZero();
if (nPiCharge != 1 || nMesons != 1 || nLeptons != 1 || nPiZero > 0) {
return false;
}
if (event->GetHMFSChargePions()->fP.Vect().Mag() < 100) return false;
return true;
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.h b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.h
index 8444f08..ad6c052 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.h
@@ -1,35 +1,35 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu_H_SEEN
#define ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu_H_SEEN
#include "Measurement1D.h"
class ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu : public Measurement1D {
public:
ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu(nuiskey samplekey);
virtual ~ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.cxx b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.cxx
index f357f6b..8651ed8 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.cxx
@@ -1,87 +1,87 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.h"
//********************************************************************
ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu::ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: CC, single charged pion > 0.1 GeV/c, no other mesons. \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("#theta_{#pi} (GeV)");
fSettings.SetYTitle("d#sigma/d#theta_{#pi} (cm^{2} nucleon^{-1} degree^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 100.0);
fSettings.DefineAllowedTargets("Ar");
// CC1Pi plot information
fSettings.SetTitle("ArgoNeut CC1#pi^{#pm} #nu_{#mu} 1D#theta_{#pi}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CC1Pi_dsig_dthetapi_nu.dat" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) /
TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu::FillEventVariables(FitEvent *event) {
FitParticle* p = event->GetHMFSChargePions();
if (p) fXVar = p->fP.Vect().Theta() * 180.0 / TMath::Pi();
return;
};
//********************************************************************
bool ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu::isSignal(FitEvent *event)
//********************************************************************
{
if (!SignalDef::isCCINC(event, 14, EnuMin, EnuMax)) return false;
int nMesons = event->NumFSMesons();
int nLeptons = event->NumFSLeptons();
int nPiCharge = event->NumFSChargePions();
int nPiZero = event->NumFSPiZero();
if (nPiCharge != 1 || nMesons != 1 || nLeptons != 1 || nPiZero > 0) {
return false;
}
if (event->GetHMFSChargePions()->fP.Vect().Mag() < 100) return false;
return true;
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.h b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.h
index eb14af9..b659311 100644
--- a/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.h
@@ -1,35 +1,35 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu_H_SEEN
#define ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu_H_SEEN
#include "Measurement1D.h"
class ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu : public Measurement1D {
public:
ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu(nuiskey samplekey);
virtual ~ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
};
#endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.cxx b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.cxx
index 20cfb61..0f0959a 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.cxx
@@ -1,74 +1,74 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "ArgoNeuT_CCInc_XSec_1Dpmu_nu.h"
//********************************************************************
ArgoNeuT_CCInc_XSec_1Dpmu_nu::ArgoNeuT_CCInc_XSec_1Dpmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CCInc_XSec_1Dpmu_nu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("p_{#mu} (GeV)");
fSettings.SetYTitle("d#sigma/dp_{#mu} (cm^{2} Ar^{-1} GeV^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 50.0);
fSettings.DefineAllowedTargets("Ar");
// CCQELike plot information
fSettings.SetTitle("ArgoNeut CC-INC numu 1Dp_{#mu}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CCInc_dsig_dmumom_nu.dat" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) *
(40.0 /*Data is /Ar */) / TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CCInc_XSec_1Dpmu_nu::FillEventVariables(FitEvent *event) {
FitParticle* pmu = event->GetHMFSParticle(13);
if (pmu) fXVar = pmu->fP.Vect().Mag()/1000.0;
return;
};
//********************************************************************
bool ArgoNeuT_CCInc_XSec_1Dpmu_nu::isSignal(FitEvent *event)
//********************************************************************
{
return SignalDef::isCCINC(event, 14, EnuMin, EnuMax);
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.h b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.h
index c02159e..c7cd929 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef ArgoNeuT_CCInc_XSec_1Dpmu_nu_H_SEEN
#define ArgoNeuT_CCInc_XSec_1Dpmu_nu_H_SEEN
#include "Measurement1D.h"
class ArgoNeuT_CCInc_XSec_1Dpmu_nu : public Measurement1D {
public:
ArgoNeuT_CCInc_XSec_1Dpmu_nu(nuiskey samplekey);
virtual ~ArgoNeuT_CCInc_XSec_1Dpmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.cxx b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.cxx
index bfb6101..3fd3dc4 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.cxx
@@ -1,56 +1,56 @@
#include "ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.h"
//********************************************************************
ArgoNeuT_CCInc_XSec_1Dthetamu_antinu::ArgoNeuT_CCInc_XSec_1Dthetamu_antinu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CCInc_XSec_1Dthetamu_antinu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("theta_{#mu} (degrees)");
+ fSettings.SetXTitle("#theta_{#mu} (degrees)");
fSettings.SetYTitle("d#sigma/d#theta_{#mu} (cm^{2} Ar^{-1} degrees^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 50.0);
fSettings.DefineAllowedTargets("Ar");
// CCQELike plot information
fSettings.SetTitle("ArgoNeut CC-INC antinumu 1D#theta_{#mu}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CCInc_dsig_dthetamu_nubar.dat" );
fSettings.DefineAllowedSpecies("numub");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) *
(40.0 /*Data is /Ar */) / TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CCInc_XSec_1Dthetamu_antinu::FillEventVariables(FitEvent *event) {
FitParticle* pmu = event->GetHMFSParticle(-13);
if (pmu) fXVar = 180.*pmu->fP.Vect().Theta()/TMath::Pi();
return;
};
//********************************************************************
bool ArgoNeuT_CCInc_XSec_1Dthetamu_antinu::isSignal(FitEvent *event)
//********************************************************************
{
return SignalDef::isCCINC(event, -14, EnuMin, EnuMax);
}
diff --git a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.cxx b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.cxx
index 94acc32..a77d50d 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.cxx
@@ -1,59 +1,59 @@
#include "ArgoNeuT_CCInc_XSec_1Dthetamu_nu.h"
//********************************************************************
ArgoNeuT_CCInc_XSec_1Dthetamu_nu::ArgoNeuT_CCInc_XSec_1Dthetamu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ArgoNeuT_CCInc_XSec_1Dthetamu_antinu sample. \n" \
"Target: Ar40 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("theta_{#mu} (degrees)");
+ fSettings.SetXTitle("#theta_{#mu} (degrees)");
fSettings.SetYTitle("d#sigma/d#theta_{#mu} (cm^{2} Ar^{-1} degrees^{-1})");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(0.0, 50.0);
fSettings.DefineAllowedTargets("Ar");
// CCQELike plot information
fSettings.SetTitle("ArgoNeut CC-INC numu 1D#theta_{#mu}");
fSettings.SetDataInput( FitPar::GetDataBase() + "/ArgoNeuT/CCInc_dsig_dthetamu_nu.dat");
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) *
(40.0 /*Data is /Ar */) / TotalIntegratedFlux("width");
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void ArgoNeuT_CCInc_XSec_1Dthetamu_nu::FillEventVariables(FitEvent *event) {
FitParticle* pmu = event->GetHMFSParticle(13);
if (pmu) fXVar = 180.*pmu->fP.Vect().Theta()/TMath::Pi();
return;
};
//********************************************************************
bool ArgoNeuT_CCInc_XSec_1Dthetamu_nu::isSignal(FitEvent *event)
//********************************************************************
{
return SignalDef::isCCINC(event, 14, EnuMin, EnuMax);
}
diff --git a/src/ArgoNeuT/CMakeLists.txt b/src/ArgoNeuT/CMakeLists.txt
index 40f9e95..476b09a 100644
--- a/src/ArgoNeuT/CMakeLists.txt
+++ b/src/ArgoNeuT/CMakeLists.txt
@@ -1,72 +1,72 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
set(IMPLFILES
ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.cxx
ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.cxx
ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.cxx
ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.cxx
ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.cxx
ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.cxx
ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.cxx
ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.cxx
ArgoNeuT_CCInc_XSec_1Dpmu_antinu.cxx
ArgoNeuT_CCInc_XSec_1Dpmu_nu.cxx
ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.cxx
ArgoNeuT_CCInc_XSec_1Dthetamu_nu.cxx
)
set(HEADERFILES
ArgoNeuT_CC1Pi_XSec_1Dpmu_nu.h
ArgoNeuT_CC1Pi_XSec_1Dpmu_antinu.h
ArgoNeuT_CC1Pi_XSec_1Dthetamu_nu.h
ArgoNeuT_CC1Pi_XSec_1Dthetamu_antinu.h
ArgoNeuT_CC1Pi_XSec_1Dthetapi_nu.h
ArgoNeuT_CC1Pi_XSec_1Dthetapi_antinu.h
ArgoNeuT_CC1Pi_XSec_1Dthetamupi_nu.h
ArgoNeuT_CC1Pi_XSec_1Dthetamupi_antinu.h
ArgoNeuT_CCInc_XSec_1Dpmu_antinu.h
ArgoNeuT_CCInc_XSec_1Dpmu_nu.h
ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.h
ArgoNeuT_CCInc_XSec_1Dthetamu_nu.h
)
set(LIBNAME expArgoNeuT)
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})
# Add Extra Links
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/ArgoNeuT/)
set(MODULETargets ${MODULETargets} ${LIBNAME} PARENT_SCOPE)
diff --git a/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.cxx b/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.cxx
index ead028f..d251525 100644
--- a/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.cxx
+++ b/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.cxx
@@ -1,89 +1,89 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1npim_XSec_1DEnu_antinu.h"
//********************************************************************
BEBC_CC1npim_XSec_1DEnu_antinu::BEBC_CC1npim_XSec_1DEnu_antinu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1npim_XSec_1DEnu_antinu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1npim_XSec_1DEnu_antinu");
fSettings.DefineAllowedSpecies("numub");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/theses/BEBC_theses_ANU_CC1pi-_nFin_W14.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1npim_XSec_1DEnu_antinu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(-211) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppim = event->GetHMFSParticle(-211)->fP;
double hadMass = FitUtils::MpPi(Pn, Ppim);
double Enu = -1.0;
if (hadMass < 1400) Enu = Pnu.E()/1.E3;
fXVar = Enu;
return;
};
bool BEBC_CC1npim_XSec_1DEnu_antinu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, -14, -211, 2112, EnuMin, EnuMax);
}
diff --git a/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.h b/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.h
index b0c2b91..9816d3a 100644
--- a/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.h
+++ b/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.h
@@ -1,37 +1,37 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1NPIM_XSEC_1DENU_ANTINU_H_SEEN
#define BEBC_CC1NPIM_XSEC_1DENU_ANTINU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1npim_XSec_1DEnu_antinu : public Measurement1D {
public:
BEBC_CC1npim_XSec_1DEnu_antinu(nuiskey samplekey);
virtual ~BEBC_CC1npim_XSec_1DEnu_antinu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.cxx b/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.cxx
index 9cdb865..6047aab 100644
--- a/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.cxx
+++ b/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.cxx
@@ -1,109 +1,109 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1npim_XSec_1DQ2_antinu.h"
//********************************************************************
BEBC_CC1npim_XSec_1DQ2_antinu::BEBC_CC1npim_XSec_1DQ2_antinu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1npim_XSec_1DQ2_antinu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("d#sigma/dQ^{2} (cm^{2}/GeV^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1npim_XSec_1DQ2_antinu");
fSettings.DefineAllowedSpecies("numub");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/Dfill/BEBC_Dfill_CC1pi-_on_n_W14_edit.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*TotalIntegratedFlux("width"))*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
hadMassHist = new TH1D((fName+"_Wrec").c_str(),(fName+"_Wrec").c_str(), 100, 1000, 2000);
hadMassHist->SetTitle((fName+"; W_{rec} (GeV/c^{2}); Area norm. # of events").c_str());
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1npim_XSec_1DQ2_antinu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(-211) == 0 ||
event->NumFSParticle(-13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppim = event->GetHMFSParticle(-211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(-13)->fP;
hadMass = FitUtils::MpPi(Pn, Ppim);
double q2CCpip = -1.0;
if (hadMass < 1400) q2CCpip = -1*(Pnu-Pmu).Mag2()/1.E6;
fXVar = q2CCpip;
return;
};
bool BEBC_CC1npim_XSec_1DQ2_antinu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, -14, -211, 2112, EnuMin, EnuMax);
}
void BEBC_CC1npim_XSec_1DQ2_antinu::FillHistograms() {
Measurement1D::FillHistograms();
hadMassHist->Fill(hadMass);
return;
}
void BEBC_CC1npim_XSec_1DQ2_antinu::Write(std::string drawOpt) {
Measurement1D::Write(drawOpt);
hadMassHist->Scale(1/hadMassHist->Integral());
hadMassHist->Write();
return;
}
diff --git a/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.h b/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.h
index 72bc15e..5fadab6 100644
--- a/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.h
+++ b/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.h
@@ -1,42 +1,42 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1NPIM_XSEC_1DQ2_ANTINU_H_SEEN
#define BEBC_CC1NPIM_XSEC_1DQ2_ANTINU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1npim_XSec_1DQ2_antinu : public Measurement1D {
public:
BEBC_CC1npim_XSec_1DQ2_antinu(nuiskey samplekey);
virtual ~BEBC_CC1npim_XSec_1DQ2_antinu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
void FillHistograms();
void Write(std::string drawOpts);
private:
TH1D *hadMassHist;
double hadMass;
};
#endif
diff --git a/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.cxx b/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.cxx
index 74fb299..9955574 100644
--- a/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.cxx
+++ b/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.cxx
@@ -1,86 +1,86 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1npip_XSec_1DEnu_nu.h"
//********************************************************************
BEBC_CC1npip_XSec_1DEnu_nu::BEBC_CC1npip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1npip_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1npip_XSec_1DEnu_nu");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/theses/BEBC_theses_CC1pip_on_n_W14.txt");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1npip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(211) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
double hadMass = FitUtils::MpPi(Pn, Ppip);
double Enu = -1.0;
if (hadMass < 1400) Enu = Pnu.E()/1.E3;
fXVar = Enu;
return;
};
bool BEBC_CC1npip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.h b/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.h
index e9f2345..c96f938 100644
--- a/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.h
+++ b/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.h
@@ -1,37 +1,37 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1NPIP_XSEC_1DENU_NU_H_SEEN
#define BEBC_CC1NPIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1npip_XSec_1DEnu_nu : public Measurement1D {
public:
BEBC_CC1npip_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~BEBC_CC1npip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.cxx b/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.cxx
index c486408..2c2311a 100644
--- a/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.cxx
+++ b/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.cxx
@@ -1,108 +1,108 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1npip_XSec_1DQ2_nu.h"
//********************************************************************
BEBC_CC1npip_XSec_1DQ2_nu::BEBC_CC1npip_XSec_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1npip_XSec_1DQ2_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("d#sigma/dQ^{2} (cm^{2}/GeV^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1npip_XSec_1DQ2_nu");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/Dfill/BEBC_Dfill_CC1pi+_on_n_W14_edit.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*TotalIntegratedFlux("width"))*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
hadMassHist = new TH1D((fName+"_Wrec").c_str(),(fName+"_Wrec").c_str(), 100, 1000, 2000);
hadMassHist->SetTitle((fName+"; W_{rec} (GeV/c^{2}); Area norm. # of events").c_str());
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1npip_XSec_1DQ2_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
hadMass = FitUtils::MpPi(Pn, Ppip);
double q2CCpip = -1.0;
// BEBC has a 1.1GeV < M(pi, p) < 1.4 GeV cut imposed (also no cut measurement but not useful for delta tuning)
if (hadMass < 1400) q2CCpip = -1*(Pnu-Pmu).Mag2()/1.E6;
fXVar = q2CCpip;
return;
};
bool BEBC_CC1npip_XSec_1DQ2_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
void BEBC_CC1npip_XSec_1DQ2_nu::FillHistograms() {
Measurement1D::FillHistograms();
hadMassHist->Fill(hadMass);
return;
}
void BEBC_CC1npip_XSec_1DQ2_nu::Write(std::string drawOpt) {
Measurement1D::Write(drawOpt);
hadMassHist->Scale(1/hadMassHist->Integral());
hadMassHist->Write();
return;
}
diff --git a/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.h b/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.h
index 1581a1c..d185fce 100644
--- a/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.h
+++ b/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.h
@@ -1,42 +1,42 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1NPIP_XSEC_1DQ2_NU_H_SEEN
#define BEBC_CC1NPIP_XSEC_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1npip_XSec_1DQ2_nu : public Measurement1D {
public:
BEBC_CC1npip_XSec_1DQ2_nu(nuiskey samplekey);
virtual ~BEBC_CC1npip_XSec_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
void FillHistograms();
void Write(std::string drawOpts);
private:
TH1D *hadMassHist;
double hadMass;
};
#endif
diff --git a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx b/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx
index 3f31236..9220600 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx
+++ b/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx
@@ -1,86 +1,86 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1pi0_XSec_1DEnu_nu.h"
//********************************************************************
BEBC_CC1pi0_XSec_1DEnu_nu::BEBC_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1pi0_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1pi0_XSec_1DEnu_nu");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/theses/BEBC_theses_CC1pi0_W14.txt");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1pi0_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(111) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppi0);
double Enu = -1.0;
if (hadMass < 1400) Enu = Pnu.E()/1.E3;
fXVar = Enu;
return;
};
bool BEBC_CC1pi0_XSec_1DEnu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.h b/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.h
index 5ec66b8..822a9e7 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.h
+++ b/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.h
@@ -1,37 +1,37 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1PI0_XSEC_1DENU_NU_H_SEEN
#define BEBC_CC1PI0_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1pi0_XSec_1DEnu_nu : public Measurement1D {
public:
BEBC_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~BEBC_CC1pi0_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.cxx b/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.cxx
index 31a4725..64bd2bb 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.cxx
+++ b/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.cxx
@@ -1,108 +1,108 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1pi0_XSec_1DQ2_nu.h"
//********************************************************************
BEBC_CC1pi0_XSec_1DQ2_nu::BEBC_CC1pi0_XSec_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1pi0_XSec_1DQ2_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("d#sigma/dQ^{2} (cm^{2}/GeV^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1pi0_XSec_1DQ2_nu");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/Dfill/BEBC_Dfill_CC1pi0_on_n_W14_edit.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*TotalIntegratedFlux("width"))*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
hadMassHist = new TH1D((fName+"_Wrec").c_str(),(fName+"_Wrec").c_str(), 100, 1000, 2000);
hadMassHist->SetTitle((fName+"; W_{rec} (GeV/c^{2}); Area norm. # of events").c_str());
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1pi0_XSec_1DQ2_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(111) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
hadMass = FitUtils::MpPi(Pp, Ppi0);
double q2CCpi0 = -1.0;
if (hadMass < 1400) q2CCpi0 = -1*(Pnu-Pmu).Mag2()/1.E6;
fXVar = q2CCpi0;
return;
};
bool BEBC_CC1pi0_XSec_1DQ2_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
void BEBC_CC1pi0_XSec_1DQ2_nu::FillHistograms() {
Measurement1D::FillHistograms();
hadMassHist->Fill(hadMass);
return;
}
void BEBC_CC1pi0_XSec_1DQ2_nu::Write(std::string drawOpt) {
Measurement1D::Write(drawOpt);
hadMassHist->Scale(1/hadMassHist->Integral());
hadMassHist->Write();
return;
}
diff --git a/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.h b/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.h
index d6172ef..874812b 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.h
+++ b/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.h
@@ -1,42 +1,42 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1PI0_XSEC_1DQ2_NU_H_SEEN
#define BEBC_CC1PI0_XSEC_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1pi0_XSec_1DQ2_nu : public Measurement1D {
public:
BEBC_CC1pi0_XSec_1DQ2_nu(nuiskey samplekey);
virtual ~BEBC_CC1pi0_XSec_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
void FillHistograms();
void Write(std::string drawOpts);
private:
TH1D *hadMassHist;
double hadMass;
};
#endif
diff --git a/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.cxx b/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.cxx
index 0503e31..0a381ce 100644
--- a/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.cxx
+++ b/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.cxx
@@ -1,88 +1,88 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1ppim_XSec_1DEnu_antinu.h"
//********************************************************************
BEBC_CC1ppim_XSec_1DEnu_antinu::BEBC_CC1ppim_XSec_1DEnu_antinu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1ppim_XSec_1DEnu_antinu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/proton)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1ppim_XSec_1DEnu_antinu");
fSettings.DefineAllowedSpecies("numub");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/theses/BEBC_theses_ANU_CC1pi-_pFin_W14.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1ppim_XSec_1DEnu_antinu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(-211) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppim = event->GetHMFSParticle(-211)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppim);
double Enu = -1.0;
if (hadMass < 1400) Enu = Pnu.E()/1.E3;
fXVar = Enu;
return;
};
bool BEBC_CC1ppim_XSec_1DEnu_antinu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, -14, -211, 2212, EnuMin, EnuMax);
}
diff --git a/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.h b/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.h
index d8b3c47..2d85022 100644
--- a/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.h
+++ b/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1PPIM_XSEC_1DENU_ANTINU_H_SEEN
#define BEBC_CC1PPIM_XSEC_1DENU_ANTINU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1ppim_XSec_1DEnu_antinu : public Measurement1D {
public:
BEBC_CC1ppim_XSec_1DEnu_antinu(nuiskey samplekey);
virtual ~BEBC_CC1ppim_XSec_1DEnu_antinu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.cxx b/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.cxx
index d7f376f..20e742b 100644
--- a/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.cxx
+++ b/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.cxx
@@ -1,107 +1,107 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1ppim_XSec_1DQ2_antinu.h"
//********************************************************************
BEBC_CC1ppim_XSec_1DQ2_antinu::BEBC_CC1ppim_XSec_1DQ2_antinu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1ppim_XSec_1DQ2_antinu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("d#sigma/dQ^{2} (cm^{2}/GeV^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1ppim_XSec_1DQ2_antinu");
fSettings.DefineAllowedSpecies("numub");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/Dfill/BEBC_Dfill_CC1pi-_on_p_W14_edit.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*TotalIntegratedFlux("width"))*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
hadMassHist = new TH1D((fName+"_Wrec").c_str(),(fName+"_Wrec").c_str(), 100, 1000, 2000);
hadMassHist->SetTitle((fName+"; W_{rec} (GeV/c^{2}); Area norm. # of events").c_str());
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1ppim_XSec_1DQ2_antinu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(-211) == 0 ||
event->NumFSParticle(-13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppim = event->GetHMFSParticle(-211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(-13)->fP;
hadMass = FitUtils::MpPi(Pp, Ppim);
double q2CCpip = -1.0;
if (hadMass < 1400) q2CCpip = -1*(Pnu-Pmu).Mag2()/1.E6;
fXVar = q2CCpip;
return;
};
bool BEBC_CC1ppim_XSec_1DQ2_antinu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, -14, -211, 2212, EnuMin, EnuMax);
}
void BEBC_CC1ppim_XSec_1DQ2_antinu::FillHistograms() {
Measurement1D::FillHistograms();
hadMassHist->Fill(hadMass);
return;
}
void BEBC_CC1ppim_XSec_1DQ2_antinu::Write(std::string drawOpt) {
Measurement1D::Write(drawOpt);
hadMassHist->Scale(1/hadMassHist->Integral());
hadMassHist->Write();
return;
}
diff --git a/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.h b/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.h
index 027824b..f1f6040 100644
--- a/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.h
+++ b/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.h
@@ -1,43 +1,43 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1PPIM_XSEC_1DQ2_ANTINU_H_SEEN
#define BEBC_CC1PPIM_XSEC_1DQ2_ANTINU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1ppim_XSec_1DQ2_antinu : public Measurement1D {
public:
BEBC_CC1ppim_XSec_1DQ2_antinu(nuiskey samplekey);
virtual ~BEBC_CC1ppim_XSec_1DQ2_antinu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
void FillHistograms();
void Write(std::string drawOpts);
private:
TH1D *hadMassHist;
double hadMass;
};
#endif
diff --git a/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.cxx b/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.cxx
index ca501fc..e8bb93e 100644
--- a/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.cxx
+++ b/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.cxx
@@ -1,86 +1,86 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1ppip_XSec_1DEnu_nu.h"
//********************************************************************
BEBC_CC1ppip_XSec_1DEnu_nu::BEBC_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1ppip_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/proton)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1ppip_XSec_1DEnu_nu");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/theses/BEBC_theses_CC1pip_on_p_W14.txt");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1ppip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppip);
double Enu = -1.0;
if (hadMass < 1400) Enu = Pnu.E()/1.E3;
fXVar = Enu;
return;
};
bool BEBC_CC1ppip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.h b/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.h
index d4b100f..fa303be 100644
--- a/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.h
+++ b/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1PPIP_XSEC_1DENU_NU_H_SEEN
#define BEBC_CC1PPIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1ppip_XSec_1DEnu_nu : public Measurement1D {
public:
BEBC_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~BEBC_CC1ppip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.cxx b/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.cxx
index 3bc4a93..6f5c9da 100644
--- a/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.cxx
+++ b/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.cxx
@@ -1,112 +1,112 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CC1ppip_XSec_1DQ2_nu.h"
//********************************************************************
BEBC_CC1ppip_XSec_1DQ2_nu::BEBC_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CC1ppip_XSec_1DQ2_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("d#sigma/dQ^{2} (cm^{2}/GeV^{2}/proton)");
fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
fSettings.SetEnuRange(5.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CC1ppip_XSec_1DQ2_nu");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/Dfill/BEBC_Dfill_CC1pi+_on_p_W14_edit.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*TotalIntegratedFlux("width"))*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
hadMassHist = new TH1D((fName+"_Wrec").c_str(),(fName+"_Wrec").c_str(), 100, 1000, 2000);
hadMassHist->SetTitle((fName+"; W_{rec} (GeV/c^{2}); Area norm. # of events").c_str());
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BEBC_CC1ppip_XSec_1DQ2_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
hadMass = FitUtils::MpPi(Pp, Ppip);
double q2CCpip = -1.0;
// BEBC has a M(pi, p) < 1.4 GeV cut imposed only on this channel
if (hadMass < 1400) q2CCpip = -1*(Pnu-Pmu).Mag2()/1.E6;
fXVar = q2CCpip;
return;
};
bool BEBC_CC1ppip_XSec_1DQ2_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
void BEBC_CC1ppip_XSec_1DQ2_nu::FillHistograms() {
Measurement1D::FillHistograms();
hadMassHist->Fill(hadMass);
return;
}
void BEBC_CC1ppip_XSec_1DQ2_nu::Write(std::string drawOpt) {
Measurement1D::Write(drawOpt);
hadMassHist->Scale(1/hadMassHist->Integral());
hadMassHist->Write();
return;
}
diff --git a/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.h b/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.h
index 7c3e913..6e87efa 100644
--- a/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.h
@@ -1,41 +1,41 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
#define BEBC_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
class BEBC_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
public:
BEBC_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
virtual ~BEBC_CC1ppip_XSec_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
void FillHistograms();
void Write(std::string drawOpts);
private:
TH1D *hadMassHist;
double hadMass;
};
#endif
diff --git a/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.cxx b/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.cxx
index b1b323f..2d71de9 100755
--- a/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.cxx
+++ b/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.cxx
@@ -1,132 +1,132 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BEBC_CCQE_XSec_1DQ2_nu.h"
//********************************************************************
BEBC_CCQE_XSec_1DQ2_nu::BEBC_CCQE_XSec_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BEBC_CCQE_XSec_1DQ2_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CCQE} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
fSettings.SetEnuRange(0.0, 200.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BEBC_CCQE_XSec_1DQ2_nu");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "BEBC/BEBC_CCQE_Data_NPB343_285.root;BEBC_1DQ2_Data");
// is Q2 Correction applied
applyQ2correction = fSettings.Found("type", "Q2CORR");
if (applyQ2correction) {
fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "/data/ANL/ANL_CCQE_Data_PRL31_844.root");
fSettings.SetS("q2correction_hist", "ANL_XSec_1DQ2_Correction");
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor for shape
fScaleFactor = (GetEventHistogram()->Integral("width")/(fNEvents+0.))*1E-38 / (TotalIntegratedFlux("width"));
// Plot Setup -------------------------------------------------------
SetDataFromRootFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Correction Histogram
if (applyQ2correction) {
// Correction Hist
CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
fSettings.GetS("q2correction_hist") );
SetAutoProcessTH1(CorrectionHist, kCMD_Write);
// Make uncorrected MC hist
fMCHist_NoCorr = (TH1D*) fDataHist->Clone();
fMCHist_NoCorr->Reset();
fMCHist_NoCorr->SetNameTitle( (fName + "_NOCORR").c_str(),
(fName + "_NOCORR").c_str());
SetAutoProcessTH1(fMCHist_NoCorr);
}
// Final setup ---------------------------------------------------
FinaliseMeasurement();
}
//********************************************************************
void BEBC_CCQE_XSec_1DQ2_nu::FillEventVariables(FitEvent * event) {
//********************************************************************
if (event->NumFSParticle(13) == 0)
return;
// Fill histogram with reconstructed Q2 Distribution
fXVar = -999.9;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
fXVar = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
GetQ2Box()->fQ2 = fXVar;
return;
};
//********************************************************************
bool BEBC_CCQE_XSec_1DQ2_nu::isSignal(FitEvent * event) {
//********************************************************************
if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
// Q2 cut
if (GetQ2Box()->fQ2 <= 0) return false;
return true;
};
//********************************************************************
void BEBC_CCQE_XSec_1DQ2_nu::FillHistograms() {
//********************************************************************
if (applyQ2correction) {
fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
}
Measurement1D::FillHistograms();
}
diff --git a/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h b/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h
index 3e10cce..90dd722 100755
--- a/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h
+++ b/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h
@@ -1,57 +1,57 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BEBC_CCQE_XSEC_1DQ2_NU_H_SEEN
#define BEBC_CCQE_XSEC_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
#include "CustomVariableBoxes.h"
//********************************************************************
class BEBC_CCQE_XSec_1DQ2_nu : public Measurement1D {
//********************************************************************
public:
BEBC_CCQE_XSec_1DQ2_nu(nuiskey samplekey);
virtual ~BEBC_CCQE_XSec_1DQ2_nu() {};
/// \brief Fill Q2QE Event Information
void FillEventVariables(FitEvent *event);
/// \brief Selection only true CCQE
bool isSignal(FitEvent *event);
/// \brief Fill main histograms and correction histograms
void FillHistograms();
/// \brief Use Q2 Box to save correction info
inline Q2VariableBox1D* GetQ2Box(){ return static_cast(GetBox()); };
/// \brief Create Q2 Box to save correction info
inline MeasurementVariableBox* CreateBox(){ return new Q2VariableBox1D(); };
private:
bool applyQ2correction; ///< Flag of whether deut correction applied
TH1D* CorrectionHist; ///< Correction factor
TH1D* fMCHist_NoCorr; ///< Uncorrected fMCHist
};
#endif
diff --git a/src/BEBC/CMakeLists.txt b/src/BEBC/CMakeLists.txt
index 86dd94a..f2b2715 100644
--- a/src/BEBC/CMakeLists.txt
+++ b/src/BEBC/CMakeLists.txt
@@ -1,67 +1,67 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
set(IMPLFILES
BEBC_CC1npim_XSec_1DEnu_antinu.cxx
BEBC_CC1npim_XSec_1DQ2_antinu.cxx
BEBC_CC1npip_XSec_1DEnu_nu.cxx
BEBC_CC1npip_XSec_1DQ2_nu.cxx
BEBC_CC1pi0_XSec_1DEnu_nu.cxx
BEBC_CC1pi0_XSec_1DQ2_nu.cxx
BEBC_CC1ppim_XSec_1DEnu_antinu.cxx
BEBC_CC1ppim_XSec_1DQ2_antinu.cxx
BEBC_CC1ppip_XSec_1DEnu_nu.cxx
BEBC_CC1ppip_XSec_1DQ2_nu.cxx
BEBC_CCQE_XSec_1DQ2_nu.cxx
)
set(HEADERFILES
BEBC_CC1npim_XSec_1DEnu_antinu.h
BEBC_CC1npim_XSec_1DQ2_antinu.h
BEBC_CC1npip_XSec_1DEnu_nu.h
BEBC_CC1npip_XSec_1DQ2_nu.h
BEBC_CC1pi0_XSec_1DEnu_nu.h
BEBC_CC1pi0_XSec_1DQ2_nu.h
BEBC_CC1ppim_XSec_1DEnu_antinu.h
BEBC_CC1ppim_XSec_1DQ2_antinu.h
BEBC_CC1ppip_XSec_1DEnu_nu.h
BEBC_CC1ppip_XSec_1DQ2_nu.h
BEBC_CCQE_XSec_1DQ2_nu.h
)
set(LIBNAME expBEBC)
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/BNL)
set(MODULETargets ${MODULETargets} ${LIBNAME} PARENT_SCOPE)
diff --git a/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.cxx b/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.cxx
index df844bb..84ab4b1 100644
--- a/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.cxx
+++ b/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.cxx
@@ -1,93 +1,93 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BNL_CC1npip_Evt_1DQ2_nu.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 3
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
//********************************************************************
BNL_CC1npip_Evt_1DQ2_nu::BNL_CC1npip_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CC1npip_Evt_1DQ2_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CC#pi} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 3.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("BNL_CC1npip_Evt_1DQ2_nu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pip_on_n/BNL_CC1pip_on_n_noEvents_q2_noWcut_HighQ2Gone.txt" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor =GetEventHistogram()->Integral("width")/(fNEvents+0.)*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BNL_CC1npip_Evt_1DQ2_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(13) == 0) return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
// No hadronic mass constraint in BNL CC1n1pi+
// This Q2 is Q2 true
double q2CCpip = -1*(Pnu-Pmu).Mag2()/1.E6;
fXVar = q2CCpip;
return;
};
bool BNL_CC1npip_Evt_1DQ2_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.h b/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.h
index 4a85f6a..4921f4d 100644
--- a/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.h
@@ -1,47 +1,47 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CC1NPIP_EVT_1DQ2_NU_H_SEEN
#define BNL_CC1NPIP_EVT_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 3
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
class BNL_CC1npip_Evt_1DQ2_nu : public Measurement1D {
public:
BNL_CC1npip_Evt_1DQ2_nu(nuiskey samplekey);
virtual ~BNL_CC1npip_Evt_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.cxx b/src/BNL/BNL_CC1npip_Evt_1DWNmu_nu.cxx
similarity index 64%
copy from src/ANL/ANL_CC1npip_Evt_1Dppi_nu.cxx
copy to src/BNL/BNL_CC1npip_Evt_1DWNmu_nu.cxx
index cb561db..ccb5c92 100644
--- a/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.cxx
+++ b/src/BNL/BNL_CC1npip_Evt_1DWNmu_nu.cxx
@@ -1,85 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#include "ANL_CC1npip_Evt_1Dppi_nu.h"
+#include "BNL_CC1npip_Evt_1DWNmu_nu.h"
//********************************************************************
-ANL_CC1npip_Evt_1Dppi_nu::ANL_CC1npip_Evt_1Dppi_nu(nuiskey samplekey) {
+BNL_CC1npip_Evt_1DWNmu_nu::BNL_CC1npip_Evt_1DWNmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL_CC1npip_Evt_1Dppi_nu sample. \n" \
- "Dist : Pion Momentum : p_{#pi} \n" \
- "Signal : numuCC1pi+1p : #nu_{#mu}-CC-1#pi^{+}-1p \n" \
- "Target : Deuterium : D2 \n" \
- "Flux : ANL FHC numu \n";
+ std::string descrip = "BNL CC1npip Event Rate 1D W(N mu) nu sample. \n" \
+ "Target: D2 \n" \
+ "Flux: \n" \
+ "Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
- fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
- fSettings.SetXTitle("p_{#pi} (MeV)");
+ fSettings.SetDescription(descrip);
+
+ fSettings.SetTitle("BNL #nu_mu CC1n#pi^{+}");
+ fSettings.SetXTitle("W(N#mu) (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pip_on_n/BNL_CC1npip_WNmu_per_0.05GeV.txt" );
+
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
- SetDataFromTextFile( FitPar::GetDataBase() + "/ANL/CC1pip_on_n/ANL_ppi_CC1npip.csv" );
+ SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC1npip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
+
+void BNL_CC1npip_Evt_1DWNmu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
- double hadMass = FitUtils::MpPi(Pn, Ppip);
- double ppip;
+ double hadMass = (Pn+Pmu).Mag()/1000.;
- // This measurement has a 1.4 GeV M(Npi) constraint
- if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
- else ppip = -1.0;
-
- fXVar = ppip;
+ fXVar = hadMass;
return;
-}
+};
-bool ANL_CC1npip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
+bool BNL_CC1npip_Evt_1DWNmu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h b/src/BNL/BNL_CC1npip_Evt_1DWNmu_nu.h
similarity index 76%
copy from src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
copy to src/BNL/BNL_CC1npip_Evt_1DWNmu_nu.h
index d9cd6a0..cf2351d 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1npip_Evt_1DWNmu_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
-#define ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
+#ifndef BNL_CC1NPIP_EVT_1DWNMU_NU_H_SEEN
+#define BNL_CC1NPIP_EVT_1DWNMU_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
+class BNL_CC1npip_Evt_1DWNmu_nu : public Measurement1D {
public:
- ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
- virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
+ BNL_CC1npip_Evt_1DWNmu_nu(nuiskey samplekey);
+ virtual ~BNL_CC1npip_Evt_1DWNmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC1npip_Evt_1DWNpi_nu.cxx
similarity index 65%
copy from src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.cxx
copy to src/BNL/BNL_CC1npip_Evt_1DWNpi_nu.cxx
index 74fb299..14d4bd3 100644
--- a/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC1npip_Evt_1DWNpi_nu.cxx
@@ -1,86 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#include "BEBC_CC1npip_XSec_1DEnu_nu.h"
-
+#include "BNL_CC1npip_Evt_1DWNpi_nu.h"
//********************************************************************
-BEBC_CC1npip_XSec_1DEnu_nu::BEBC_CC1npip_XSec_1DEnu_nu(nuiskey samplekey) {
+BNL_CC1npip_Evt_1DWNpi_nu::BNL_CC1npip_Evt_1DWNpi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "BEBC_CC1npip_XSec_1DEnu_nu sample. \n" \
+ std::string descrip = "BNL CC1npip Event Rate 1D W(N pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("E_{#nu} (GeV)");
- fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/neutron)");
- fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
- fSettings.SetEnuRange(5.0, 200.0);
- fSettings.DefineAllowedTargets("D,H");
- // plot information
- fSettings.SetTitle("BEBC_CC1npip_XSec_1DEnu_nu");
+ fSettings.SetTitle("BNL #nu_mu CC1n#pi^{+}");
+ fSettings.SetXTitle("W(N#pi) (GeV)");
+ fSettings.SetYTitle("Number of events");
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
+ fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/theses/BEBC_theses_CC1pip_on_n_W14.txt");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pip_on_n/BNL_CC1npip_WNpi_per_0.05GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
- fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
+ fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
+ SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-
-void BEBC_CC1npip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC1npip_Evt_1DWNpi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2112) == 0 ||
- event->NumFSParticle(211) == 0)
+ event->NumFSParticle(211) == 0 ||
+ event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pn = event->GetHMFSParticle(2112)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
- double hadMass = FitUtils::MpPi(Pn, Ppip);
- double Enu = -1.0;
+ double hadMass = (Pn+Ppip).Mag()/1000.;
- if (hadMass < 1400) Enu = Pnu.E()/1.E3;
- fXVar = Enu;
+ fXVar = hadMass;
return;
};
-bool BEBC_CC1npip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
+bool BNL_CC1npip_Evt_1DWNpi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h b/src/BNL/BNL_CC1npip_Evt_1DWNpi_nu.h
similarity index 76%
copy from src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
copy to src/BNL/BNL_CC1npip_Evt_1DWNpi_nu.h
index d9cd6a0..19be2ac 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1npip_Evt_1DWNpi_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
-#define ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
+#ifndef BNL_CC1NPIP_EVT_1DWNPI_NU_H_SEEN
+#define BNL_CC1NPIP_EVT_1DWNPI_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
+class BNL_CC1npip_Evt_1DWNpi_nu : public Measurement1D {
public:
- ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
- virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
+ BNL_CC1npip_Evt_1DWNpi_nu(nuiskey samplekey);
+ virtual ~BNL_CC1npip_Evt_1DWNpi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx b/src/BNL/BNL_CC1npip_Evt_1DWmupi_nu.cxx
similarity index 64%
copy from src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
copy to src/BNL/BNL_CC1npip_Evt_1DWmupi_nu.cxx
index 044b181..f0443e4 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
+++ b/src/BNL/BNL_CC1npip_Evt_1DWmupi_nu.cxx
@@ -1,96 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-
-#include "ANL_CC1ppip_Evt_1Dppi_nu.h"
-
+#include "BNL_CC1npip_Evt_1DWmupi_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dppi_nu::ANL_CC1ppip_Evt_1Dppi_nu(nuiskey samplekey) {
+BNL_CC1npip_Evt_1DWmupi_nu::BNL_CC1npip_Evt_1DWmupi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "BNL CC1npip Event Rate 1D W(mu pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
- fSettings.SetXTitle("p_{#pi} (MeV)");
+ fSettings.SetTitle("BNL #nu_mu CC1n#pi^{+}");
+ fSettings.SetXTitle("W(#mu#pi) (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetEnuRange(0.0, 10);
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_ppi.csv" );
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pip_on_n/BNL_CC1npip_Wmupi_per_0.05GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC1ppip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC1npip_Evt_1DWmupi_nu::FillEventVariables(FitEvent *event) {
- if (event->NumFSParticle(2212) == 0 ||
+ if (event->NumFSParticle(2112) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
- // std::cout << "MASS NU P PIP MU = " << Pnu.Mag() << " " << Pp.Mag() << " " << Ppip.Mag() << " " << Pmu.Mag() << std::endl;
-
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double ppip = -1.0;
-
- // This has a hadMass constraint of 1.4 GeV
- if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
+ double hadMass = (Pmu+Ppip).Mag()/1000.;
- fXVar = ppip;
+ fXVar = hadMass;
return;
};
-bool ANL_CC1ppip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
- return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
+bool BNL_CC1npip_Evt_1DWmupi_nu::isSignal(FitEvent *event) {
+ return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h b/src/BNL/BNL_CC1npip_Evt_1DWmupi_nu.h
similarity index 75%
copy from src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
copy to src/BNL/BNL_CC1npip_Evt_1DWmupi_nu.h
index 6acf1fd..649fd1b 100644
--- a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1npip_Evt_1DWmupi_nu.h
@@ -1,38 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef BNL_CC1NPIP_EVT_1DWMUPI_NU_H_SEEN
+#define BNL_CC1NPIP_EVT_1DWMUPI_NU_H_SEEN
#include "Measurement1D.h"
-class FNAL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class BNL_CC1npip_Evt_1DWmupi_nu : public Measurement1D {
public:
- FNAL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~FNAL_CC1ppip_Evt_1DQ2_nu() {};
+ BNL_CC1npip_Evt_1DWmupi_nu(nuiskey samplekey);
+ virtual ~BNL_CC1npip_Evt_1DWmupi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
-
private:
-
};
#endif
diff --git a/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.cxx
index a2f8080..9f55212 100644
--- a/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.cxx
@@ -1,114 +1,114 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BNL_CC1npip_XSec_1DEnu_nu.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 7
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
//********************************************************************
BNL_CC1npip_XSec_1DEnu_nu::BNL_CC1npip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CC1npip_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma (cm^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX,FREE,SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 3.0);
fSettings.SetS("norm_error", "0.15");
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BNL_CC1npip_XSec_1DEnu_nu");
fSettings.DefineAllowedSpecies("numu");
// User can specifiy to use uncorrected data
UseCorrectedData = !fSettings.Found("name", "Uncorr");
// Now read in different data depending on what the user has specified
std::string DataLocation = GeneralUtils::GetTopLevelDir() + "/data/BNL/CC1pip_on_n/";
// If we're using corrected data
if (UseCorrectedData) {
DataLocation += "BNL_CC1pip_on_n_1986_corr.txt";
// If we're using raw uncorrected data
} else {
DataLocation += "BNL_CC1pip_on_n_1986.txt";
}
fSettings.SetDataInput(DataLocation);
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/proton
fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / ((fNEvents + 0.)) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BNL_CC1npip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
// No W cut for BNL CC1pi+ on neutron (I'm happy if you can find it!!!)
double Enu = Pnu.E()/1000.;
fXVar = Enu;
return;
};
bool BNL_CC1npip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
// BNL has somewhat tricky signal definition for the selection:
// P_visible = visible 4-momentum, so the three tracks total momentum
// P_visible > 150 MeV/c2
// Theta_Pvis_nu (angle between visible momentum and neutrino direction) < 50 degrees
// At least one negative track leaves chamber without interacting or stops consistent with muon
// THESE ARE NOT IMPLEMENTED BUT SHOULD BE KNOWN BY ANYONE WHO FITS THIS DATA! (see Kitagaki et al. 2556)
//
// The only actual restriction seems to be the final state particles. There's no mention of E_nu restrictions either (events span to 10GeV in fig 2, Kitagaki)
// There's a mention of uncertainity in the neutrino flux for Enu > 6.0 GeV
return SignalDef::isCC1pi3Prong(event, 14, 211, 2112, EnuMin, EnuMax);
}
diff --git a/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.h b/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.h
index 0770b35..0c54565 100644
--- a/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.h
+++ b/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.h
@@ -1,48 +1,48 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CC1NPIP_XSEC_1DENU_NU_H_SEEN
#define BNL_CC1NPIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 7
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
class BNL_CC1npip_XSec_1DEnu_nu : public Measurement1D {
public:
BNL_CC1npip_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~BNL_CC1npip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
bool UseCorrectedData;
};
#endif
diff --git a/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.cxx b/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.cxx
index 11ff3c4..9507b05 100644
--- a/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.cxx
+++ b/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.cxx
@@ -1,95 +1,95 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BNL_CC1pi0_Evt_1DQ2_nu.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 3
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
//********************************************************************
BNL_CC1pi0_Evt_1DQ2_nu::BNL_CC1pi0_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CC1pi0_Evt_1DQ2_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CC#pi} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("BNL_CC1pi0_Evt_1DQ2_nu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pi0_on_n/BNL_CC1pi0_on_n_noEvents_q2_noWcut_HighQ2Gone.txt" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BNL_CC1pi0_Evt_1DQ2_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(13) == 0) return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
// No W cut on BNL CC1pi0
// Want true Q2
double q2CCpi0 = -1*(Pnu-Pmu).Mag2()/1.E6;
fXVar = q2CCpi0;
return;
};
bool BNL_CC1pi0_Evt_1DQ2_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.h b/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.h
index 87d137a..c9237f8 100644
--- a/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.h
@@ -1,47 +1,47 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CC1PI0_EVT_1DQ2_NU_H_SEEN
#define BNL_CC1PI0_EVT_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 3
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
class BNL_CC1pi0_Evt_1DQ2_nu : public Measurement1D {
public:
BNL_CC1pi0_Evt_1DQ2_nu(nuiskey samplekey);
virtual ~BNL_CC1pi0_Evt_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx b/src/BNL/BNL_CC1pi0_Evt_1DWNmu_nu.cxx
similarity index 65%
copy from src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
copy to src/BNL/BNL_CC1pi0_Evt_1DWNmu_nu.cxx
index 044b181..2eb4d32 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
+++ b/src/BNL/BNL_CC1pi0_Evt_1DWNmu_nu.cxx
@@ -1,96 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-
-#include "ANL_CC1ppip_Evt_1Dppi_nu.h"
-
+#include "BNL_CC1pi0_Evt_1DWNmu_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dppi_nu::ANL_CC1ppip_Evt_1Dppi_nu(nuiskey samplekey) {
+BNL_CC1pi0_Evt_1DWNmu_nu::BNL_CC1pi0_Evt_1DWNmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "BNL CC1pi0 Event Rate 1D W(N mu) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
- fSettings.SetXTitle("p_{#pi} (MeV)");
+ fSettings.SetTitle("BNL #nu_mu CC1p#pi^{0}");
+ fSettings.SetXTitle("W(N#mu) (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetEnuRange(0.0, 10);
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_ppi.csv" );
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pi0_on_n/BNL_CC1pi0_WNmu_per_0.05GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC1ppip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC1pi0_Evt_1DWNmu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
- event->NumFSParticle(211) == 0 ||
+ event->NumFSParticle(111) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- // std::cout << "MASS NU P PIP MU = " << Pnu.Mag() << " " << Pp.Mag() << " " << Ppip.Mag() << " " << Pmu.Mag() << std::endl;
-
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double ppip = -1.0;
-
- // This has a hadMass constraint of 1.4 GeV
- if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
+ double hadMass = (Pmu+Pp).Mag()/1000.;
- fXVar = ppip;
+ fXVar = hadMass;
return;
};
-bool ANL_CC1ppip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
- return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
+bool BNL_CC1pi0_Evt_1DWNmu_nu::isSignal(FitEvent *event) {
+ return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h b/src/BNL/BNL_CC1pi0_Evt_1DWNmu_nu.h
similarity index 76%
copy from src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
copy to src/BNL/BNL_CC1pi0_Evt_1DWNmu_nu.h
index d2f883e..a87bd26 100644
--- a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1pi0_Evt_1DWNmu_nu.h
@@ -1,37 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef BNL_CC1PPI0_EVT_1DWNMU_NU_H_SEEN
+#define BNL_CC1PPI0_EVT_1DWNMU_NU_H_SEEN
#include "Measurement1D.h"
-class GGM_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class BNL_CC1pi0_Evt_1DWNmu_nu : public Measurement1D {
public:
- GGM_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~GGM_CC1ppip_Evt_1DQ2_nu() {};
+ BNL_CC1pi0_Evt_1DWNmu_nu(nuiskey samplekey);
+ virtual ~BNL_CC1pi0_Evt_1DWNmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
-
};
#endif
diff --git a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC1pi0_Evt_1DWNpi_nu.cxx
similarity index 65%
copy from src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx
copy to src/BNL/BNL_CC1pi0_Evt_1DWNpi_nu.cxx
index 3f31236..b26108b 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC1pi0_Evt_1DWNpi_nu.cxx
@@ -1,86 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#include "BEBC_CC1pi0_XSec_1DEnu_nu.h"
-
+#include "BNL_CC1pi0_Evt_1DWNpi_nu.h"
//********************************************************************
-BEBC_CC1pi0_XSec_1DEnu_nu::BEBC_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey) {
+BNL_CC1pi0_Evt_1DWNpi_nu::BNL_CC1pi0_Evt_1DWNpi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "BEBC_CC1pi0_XSec_1DEnu_nu sample. \n" \
+ std::string descrip = "BNL CC1pi0 Event Rate 1D W(N pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("E_{#nu} (GeV)");
- fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/neutron)");
- fSettings.SetAllowedTypes("FIX/FREE,SHAPE/DIAG", "FIX/DIAG");
- fSettings.SetEnuRange(5.0, 200.0);
- fSettings.DefineAllowedTargets("D,H");
- // plot information
- fSettings.SetTitle("BEBC_CC1pi0_XSec_1DEnu_nu");
+ fSettings.SetTitle("BNL #nu_mu CC1p#pi^{0}");
+ fSettings.SetXTitle("W(N#pi) (GeV)");
+ fSettings.SetYTitle("Number of events");
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
+ fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/BEBC/theses/BEBC_theses_CC1pi0_W14.txt");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pi0_on_n/BNL_CC1pi0_WNpi_per_0.05GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
- fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
+ fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
+ SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void BEBC_CC1pi0_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
+
+void BNL_CC1pi0_Evt_1DWNpi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
- event->NumFSParticle(111) == 0)
+ event->NumFSParticle(111) == 0 ||
+ event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
-
- double hadMass = FitUtils::MpPi(Pp, Ppi0);
- double Enu = -1.0;
+ TLorentzVector Ppip = event->GetHMFSParticle(111)->fP;
- if (hadMass < 1400) Enu = Pnu.E()/1.E3;
+ double hadMass = (Pp+Ppip).Mag()/1000.;
- fXVar = Enu;
+ fXVar = hadMass;
return;
};
-
-bool BEBC_CC1pi0_XSec_1DEnu_nu::isSignal(FitEvent *event) {
+bool BNL_CC1pi0_Evt_1DWNpi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h b/src/BNL/BNL_CC1pi0_Evt_1DWNpi_nu.h
similarity index 76%
copy from src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
copy to src/BNL/BNL_CC1pi0_Evt_1DWNpi_nu.h
index d2f883e..3f07a1c 100644
--- a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1pi0_Evt_1DWNpi_nu.h
@@ -1,37 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef BNL_CC1PPI0_EVT_1DWNPI_NU_H_SEEN
+#define BNL_CC1PPI0_EVT_1DWNPI_NU_H_SEEN
#include "Measurement1D.h"
-class GGM_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class BNL_CC1pi0_Evt_1DWNpi_nu : public Measurement1D {
public:
- GGM_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~GGM_CC1ppip_Evt_1DQ2_nu() {};
+ BNL_CC1pi0_Evt_1DWNpi_nu(nuiskey samplekey);
+ virtual ~BNL_CC1pi0_Evt_1DWNpi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
-
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx b/src/BNL/BNL_CC1pi0_Evt_1DWmupi_nu.cxx
similarity index 63%
copy from src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
copy to src/BNL/BNL_CC1pi0_Evt_1DWmupi_nu.cxx
index 696f074..2f9bdee 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
+++ b/src/BNL/BNL_CC1pi0_Evt_1DWmupi_nu.cxx
@@ -1,94 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-#include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
+
+#include "BNL_CC1pi0_Evt_1DWmupi_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dthpr_nu::ANL_CC1ppip_Evt_1Dthpr_nu(nuiskey samplekey) {
+BNL_CC1pi0_Evt_1DWmupi_nu::BNL_CC1pi0_Evt_1DWmupi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "BNL CC1pi0 Event Rate 1D W(mu pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos #theta_{p}");
+
+ fSettings.SetTitle("BNL #nu_mu CC1p#pi^{0}");
+ fSettings.SetXTitle("W(#mu#pi) (GeV)");
fSettings.SetYTitle("Number of events");
- fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
-
- // CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_thProt.csv" );
fSettings.DefineAllowedSpecies("numu");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pi0_on_n/BNL_CC1pi0_Wmupi_per_0.05GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-
-
-void ANL_CC1ppip_Evt_1Dthpr_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC1pi0_Evt_1DWmupi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
- event->NumFSParticle(211) == 0 ||
+ event->NumFSParticle(111) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Ppip = event->GetHMFSParticle(111)->fP;
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double costhpr = -999;
+ double hadMass = (Pmu+Ppip).Mag()/1000.;
- // This measurement has M(Npi) = W < 1.4GeV
- if (hadMass < 1400) costhpr = cos(FitUtils::th(Pnu, Pp));
-
- fXVar = costhpr;
+ fXVar = hadMass;
return;
};
-
-bool ANL_CC1ppip_Evt_1Dthpr_nu::isSignal(FitEvent *event) {
- return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
+bool BNL_CC1pi0_Evt_1DWmupi_nu::isSignal(FitEvent *event) {
+ return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h b/src/BNL/BNL_CC1pi0_Evt_1DWmupi_nu.h
similarity index 76%
copy from src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
copy to src/BNL/BNL_CC1pi0_Evt_1DWmupi_nu.h
index 6acf1fd..48d9484 100644
--- a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1pi0_Evt_1DWmupi_nu.h
@@ -1,38 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef BNL_CC1PPI0_EVT_1DWMUPI_NU_H_SEEN
+#define BNL_CC1PPI0_EVT_1DWMUPI_NU_H_SEEN
#include "Measurement1D.h"
-class FNAL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class BNL_CC1pi0_Evt_1DWmupi_nu : public Measurement1D {
public:
- FNAL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~FNAL_CC1ppip_Evt_1DQ2_nu() {};
+ BNL_CC1pi0_Evt_1DWmupi_nu(nuiskey samplekey);
+ virtual ~BNL_CC1pi0_Evt_1DWmupi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
-
private:
-
};
#endif
diff --git a/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.cxx
index 30330cf..d267027 100644
--- a/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.cxx
@@ -1,107 +1,107 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BNL_CC1pi0_XSec_1DEnu_nu.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 7
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
//********************************************************************
BNL_CC1pi0_XSec_1DEnu_nu::BNL_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CC1pi0_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma (cm^{2}/neutron)");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX,FREE,SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.SetS("norm_error", "0.15");
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BNL_CC1pi0_XSec_1DEnu_nu");
fSettings.DefineAllowedSpecies("numu");
// User can specifiy to use uncorrected data
UseCorrectedData = !fSettings.Found("name", "Uncorr");
// Now read in different data depending on what the user has specified
std::string DataLocation = GeneralUtils::GetTopLevelDir() + "/data/BNL/CC1pi0_on_n/";
// If we're using corrected data
if (UseCorrectedData) {
DataLocation += "BNL_CC1pi0_on_n_1986_corr.txt";
// If we're using raw uncorrected data
} else {
DataLocation += "BNL_CC1pi0_on_n_1986.txt";
}
fSettings.SetDataInput(DataLocation);
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/proton
fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BNL_CC1pi0_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
//BNL doesn't have a W cut for CC1pi0 sadly (I'm super happy if you can find it!)
double Enu = Pnu.E() / 1000.;
fXVar = Enu;
return;
}
bool BNL_CC1pi0_XSec_1DEnu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 111, 2212, EnuMin, EnuMax);
}
diff --git a/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.h b/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.h
index ede614d..7ad2e75 100644
--- a/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.h
+++ b/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.h
@@ -1,47 +1,47 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CC1PI0_XSEC_1DENU_NU_H_SEEN
#define BNL_CC1PI0_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 7
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
class BNL_CC1pi0_XSec_1DEnu_nu : public Measurement1D {
public:
BNL_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~BNL_CC1pi0_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
bool UseCorrectedData;
};
#endif
diff --git a/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.cxx b/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.cxx
index b303d44..5037cdf 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.cxx
@@ -1,114 +1,114 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 3
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
// Figure 8
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
#include "BNL_CC1ppip_Evt_1DQ2_nu.h"
//********************************************************************
BNL_CC1ppip_Evt_1DQ2_nu::BNL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CC1ppip_Evt_1DQ2_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CC#pi} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.5, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BNL #nu_mu CC1n#pi^{+}");
fSettings.DefineAllowedSpecies("numu");
// Hadronic Cut Info
HadCut = fSettings.Found("name", "W14Cut") ? 1.4 : 10.0;
if (HadCut == 1.4) {
fSettings.SetDataInput( FitPar::GetDataBase()
+ "/BNL/CC1pip_on_p/BNL_CC1pip_on_p_noEvents_q2_w14_enu05to6_firstQ2rem.txt" );
} else {
fSettings.SetDataInput( FitPar::GetDataBase()
+ "/BNL/CC1pip_on_p/BNL_CC1pip_on_p_noEvents_q2_noWcut_HighQ2Gone.txt");
fSettings.SetEnuRange(0.0, 10.0);
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.);
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BNL_CC1ppip_Evt_1DQ2_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 || event->NumFSParticle(211) == 0 || event->NumFSParticle(13) == 0) {
return;
}
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppip);
double q2CCpip = -1.0;
// BNL has a M(pi, p) < 1.4 GeV cut and no W cut.
// This should be specified by user in "type" field
// Reverts to 10 GeV (essentially no W cut!)
if (hadMass < HadCut * 1000.) {
q2CCpip = -1 * (Pnu - Pmu).Mag2() / 1.E6;
}
fXVar = q2CCpip;
return;
};
bool BNL_CC1ppip_Evt_1DQ2_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.h b/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.h
index d8d435e..8f6951c 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.h
@@ -1,48 +1,48 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
#define BNL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 3
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
// Figure 8
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
class BNL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
public:
BNL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
virtual ~BNL_CC1ppip_Evt_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
double HadCut; // Hadronic mass cut, specified by user (W < 1.4 or no W cut)
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx b/src/BNL/BNL_CC1ppip_Evt_1DWNmu_nu.cxx
similarity index 67%
copy from src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
copy to src/BNL/BNL_CC1ppip_Evt_1DWNmu_nu.cxx
index 696f074..764239a 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_Evt_1DWNmu_nu.cxx
@@ -1,94 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-#include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
+
+#include "BNL_CC1ppip_Evt_1DWNmu_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dthpr_nu::ANL_CC1ppip_Evt_1Dthpr_nu(nuiskey samplekey) {
+BNL_CC1ppip_Evt_1DWNmu_nu::BNL_CC1ppip_Evt_1DWNmu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "BNL CC1ppip Event Rate 1D W(N mu) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos #theta_{p}");
+
+ fSettings.SetTitle("BNL #nu_mu CC1p#pi^{+}");
+ fSettings.SetXTitle("W(N#mu) (GeV)");
fSettings.SetYTitle("Number of events");
- fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
-
- // CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_thProt.csv" );
fSettings.DefineAllowedSpecies("numu");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pip_on_p/BNL_CC1ppip_WNmu_per_0.05GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-
-
-void ANL_CC1ppip_Evt_1Dthpr_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC1ppip_Evt_1DWNmu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double costhpr = -999;
-
- // This measurement has M(Npi) = W < 1.4GeV
- if (hadMass < 1400) costhpr = cos(FitUtils::th(Pnu, Pp));
+ double hadMass = (Pmu+Pp).Mag()/1000.;
- fXVar = costhpr;
+ fXVar = hadMass;
return;
};
-
-bool ANL_CC1ppip_Evt_1Dthpr_nu::isSignal(FitEvent *event) {
+bool BNL_CC1ppip_Evt_1DWNmu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h b/src/BNL/BNL_CC1ppip_Evt_1DWNmu_nu.h
similarity index 76%
copy from src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
copy to src/BNL/BNL_CC1ppip_Evt_1DWNmu_nu.h
index d9cd6a0..7962f99 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1ppip_Evt_1DWNmu_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
-#define ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
+#ifndef BNL_CC1PPIP_EVT_1DWNMU_NU_H_SEEN
+#define BNL_CC1PPIP_EVT_1DWNMU_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
+class BNL_CC1ppip_Evt_1DWNmu_nu : public Measurement1D {
public:
- ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
- virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
+ BNL_CC1ppip_Evt_1DWNmu_nu(nuiskey samplekey);
+ virtual ~BNL_CC1ppip_Evt_1DWNmu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx b/src/BNL/BNL_CC1ppip_Evt_1DWNpi_nu.cxx
similarity index 67%
copy from src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
copy to src/BNL/BNL_CC1ppip_Evt_1DWNpi_nu.cxx
index 696f074..8a2bcc1 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_Evt_1DWNpi_nu.cxx
@@ -1,94 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-#include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
+
+#include "BNL_CC1ppip_Evt_1DWNpi_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dthpr_nu::ANL_CC1ppip_Evt_1Dthpr_nu(nuiskey samplekey) {
+BNL_CC1ppip_Evt_1DWNpi_nu::BNL_CC1ppip_Evt_1DWNpi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "BNL CC1ppip Event Rate 1D W(N pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos #theta_{p}");
+
+ fSettings.SetTitle("BNL #nu_mu CC1p#pi^{+}");
+ fSettings.SetXTitle("W(N#pi) (GeV)");
fSettings.SetYTitle("Number of events");
- fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
-
- // CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_thProt.csv" );
fSettings.DefineAllowedSpecies("numu");
+ fSettings.SetEnuRange(0.0, 10);
+
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pip_on_p/BNL_CC1ppip_WNpi_per_0.05GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-
-
-void ANL_CC1ppip_Evt_1Dthpr_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC1ppip_Evt_1DWNpi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
- TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double costhpr = -999;
+ double hadMass = (Pp+Ppip).Mag()/1000.;
- // This measurement has M(Npi) = W < 1.4GeV
- if (hadMass < 1400) costhpr = cos(FitUtils::th(Pnu, Pp));
-
- fXVar = costhpr;
+ fXVar = hadMass;
return;
};
-
-bool ANL_CC1ppip_Evt_1Dthpr_nu::isSignal(FitEvent *event) {
+bool BNL_CC1ppip_Evt_1DWNpi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h b/src/BNL/BNL_CC1ppip_Evt_1DWNpi_nu.h
similarity index 76%
copy from src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
copy to src/BNL/BNL_CC1ppip_Evt_1DWNpi_nu.h
index d9cd6a0..01635f1 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1ppip_Evt_1DWNpi_nu.h
@@ -1,36 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
-#define ANL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
+#ifndef BNL_CC1PPIP_EVT_1DWNPI_NU_H_SEEN
+#define BNL_CC1PPIP_EVT_1DWNPI_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
+class BNL_CC1ppip_Evt_1DWNpi_nu : public Measurement1D {
public:
- ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
- virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
+ BNL_CC1ppip_Evt_1DWNpi_nu(nuiskey samplekey);
+ virtual ~BNL_CC1ppip_Evt_1DWNpi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx b/src/BNL/BNL_CC1ppip_Evt_1DWmupi_nu.cxx
similarity index 68%
copy from src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
copy to src/BNL/BNL_CC1ppip_Evt_1DWmupi_nu.cxx
index 044b181..81e1942 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_Evt_1DWmupi_nu.cxx
@@ -1,96 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
-*/
-
-#include "ANL_CC1ppip_Evt_1Dppi_nu.h"
-
+#include "BNL_CC1ppip_Evt_1DWmupi_nu.h"
//********************************************************************
-ANL_CC1ppip_Evt_1Dppi_nu::ANL_CC1ppip_Evt_1Dppi_nu(nuiskey samplekey) {
+BNL_CC1ppip_Evt_1DWmupi_nu::BNL_CC1ppip_Evt_1DWmupi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL CC1npip Event Rate 1DcosmuStar nu sample. \n" \
+ std::string descrip = "BNL CC1ppip Event Rate 1D W(mu pi) nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetTitle("ANL #nu_mu CC1p#pi^{+}");
- fSettings.SetXTitle("p_{#pi} (MeV)");
+ fSettings.SetTitle("BNL #nu_mu CC1p#pi^{+}");
+ fSettings.SetXTitle("W(#mu#pi) (GeV)");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
fSettings.DefineAllowedTargets("D,H");
fSettings.DefineAllowedSpecies("numu");
- fSettings.SetEnuRange(0.0, 1.5);
+ fSettings.SetEnuRange(0.0, 10);
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_ppi.csv" );
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pip_on_p/BNL_CC1ppip_Wmupi_per_0.05GeV.txt" );
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC1ppip_Evt_1Dppi_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC1ppip_Evt_1DWmupi_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
- TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
- TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+ TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
- // std::cout << "MASS NU P PIP MU = " << Pnu.Mag() << " " << Pp.Mag() << " " << Ppip.Mag() << " " << Pmu.Mag() << std::endl;
-
- double hadMass = FitUtils::MpPi(Pp, Ppip);
- double ppip = -1.0;
-
- // This has a hadMass constraint of 1.4 GeV
- if (hadMass < 1400) ppip = FitUtils::p(Ppip) * 1000.;
+ double hadMass = (Pmu+Ppip).Mag()/1000.;
- fXVar = ppip;
+ fXVar = hadMass;
return;
};
-bool ANL_CC1ppip_Evt_1Dppi_nu::isSignal(FitEvent *event) {
+bool BNL_CC1ppip_Evt_1DWmupi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h b/src/BNL/BNL_CC1ppip_Evt_1DWmupi_nu.h
similarity index 75%
copy from src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
copy to src/BNL/BNL_CC1ppip_Evt_1DWmupi_nu.h
index 6acf1fd..61083f8 100644
--- a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1ppip_Evt_1DWmupi_nu.h
@@ -1,38 +1,36 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
-#define FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
+#ifndef BNL_CC1PPIP_EVT_1DWMUPI_NU_H_SEEN
+#define BNL_CC1PPIP_EVT_1DWMUPI_NU_H_SEEN
#include "Measurement1D.h"
-class FNAL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
+class BNL_CC1ppip_Evt_1DWmupi_nu : public Measurement1D {
public:
- FNAL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
- virtual ~FNAL_CC1ppip_Evt_1DQ2_nu() {};
+ BNL_CC1ppip_Evt_1DWmupi_nu(nuiskey samplekey);
+ virtual ~BNL_CC1ppip_Evt_1DWmupi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
-
private:
-
};
#endif
diff --git a/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.cxx b/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.cxx
index 7ae0582..7baf744 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.cxx
@@ -1,100 +1,100 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BNL_CC1ppip_Evt_1DcosthAdler_nu.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 12 and related
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
//********************************************************************
BNL_CC1ppip_Evt_1DcosthAdler_nu::BNL_CC1ppip_Evt_1DcosthAdler_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CC1ppip_Evt_1DcosthAdler_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("cos#theta_{Adler}");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.5, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("BNL_CC1ppip_Evt_1DcosthAdler_nu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pip_on_p/BNL_CC1ppip_W14_cosThAdler.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor =GetEventHistogram()->Integral("width")/(fNEvents+0.)*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BNL_CC1ppip_Evt_1DcosthAdler_nu::FillEventVariables(FitEvent *event) {
fXVar = -999.99;
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
// Get the hadronic mass
double hadMass = FitUtils::MpPi(Pp, Ppip);
if (hadMass > 1400) return;
// Get Adler cos theta
double cosThAdler = FitUtils::CosThAdler(Pnu, Pmu, Ppip, Pp);
fXVar = cosThAdler;
};
bool BNL_CC1ppip_Evt_1DcosthAdler_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212,EnuMin,EnuMax);
}
diff --git a/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h b/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h
index 8db8ed7..07aaa33 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h
+++ b/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h
@@ -1,48 +1,48 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CC1PPIP_EVT_1DCOSTHADLER_NU_H_SEEN
#define BNL_CC1PPIP_EVT_1DCOSTHADLER_NU_H_SEEN
#include "Measurement1D.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 12 and related
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
class BNL_CC1ppip_Evt_1DcosthAdler_nu : public Measurement1D {
public:
BNL_CC1ppip_Evt_1DcosthAdler_nu(nuiskey samplekey);
virtual ~BNL_CC1ppip_Evt_1DcosthAdler_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.cxx b/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.cxx
index dd39272..9e490f2 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.cxx
@@ -1,123 +1,123 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BNL_CC1ppip_Evt_1Dphi_nu.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 12 and related
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
//********************************************************************
BNL_CC1ppip_Evt_1Dphi_nu::BNL_CC1ppip_Evt_1Dphi_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CC1ppip_Evt_1Dphi_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("#phi_{Adler}");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
fSettings.SetTitle("BNL_CC1ppip_Evt_1Dphi_nu");
fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CC1pip_on_p/BNL_CC1ppip_W14_phiAdler.csv" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor =GetEventHistogram()->Integral("width")/(fNEvents+0.)*2./1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BNL_CC1ppip_Evt_1Dphi_nu::FillEventVariables(FitEvent *event) {
fXVar = -999.99;
if (event->NumFSParticle(2212) == 0 ||
event->NumFSParticle(211) == 0 ||
event->NumFSParticle(13) == 0)
return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
// Get the hadronic mass
double hadMass = FitUtils::MpPi(Pp, Ppip);
if (hadMass > 1400) return;
// Get phi Adler
double phi = FitUtils::PhiAdler(Pnu, Pmu, Ppip, Pp);
fXVar = phi;
};
bool BNL_CC1ppip_Evt_1Dphi_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212,EnuMin,EnuMax);
}
/*
void BNL_CC1ppip_Evt_1Dphi_nu::FillHistograms() {
if (makeHadronicMassHist) {
hadMassHist->Fill(hadMass);
}
Measurement1D::FillHistograms();
}
void BNL_CC1ppip_Evt_1Dphi_nu::ScaleEvents() {
PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram());
PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram());
fMCHist->Scale(fScaleFactor);
fMCFine->Scale(fScaleFactor);
return;
}
*/
diff --git a/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.h b/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.h
index d9b077f..0bd9554 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.h
+++ b/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.h
@@ -1,49 +1,49 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CC1PPIP_EVT_1DPHI_NU_H_SEEN
#define BNL_CC1PPIP_EVT_1DPHI_NU_H_SEEN
#include "Measurement1D.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 12 and related
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
class BNL_CC1ppip_Evt_1Dphi_nu : public Measurement1D {
public:
BNL_CC1ppip_Evt_1Dphi_nu(nuiskey samplekey);
virtual ~BNL_CC1ppip_Evt_1Dphi_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
TRandom3 rand;
};
#endif
diff --git a/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.cxx
index cf78d78..14aa5d9 100644
--- a/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.cxx
@@ -1,128 +1,128 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BNL_CC1ppip_XSec_1DEnu_nu.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 7
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
//********************************************************************
BNL_CC1ppip_XSec_1DEnu_nu::BNL_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CC1ppip_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma (cm^{2}/proton)");
fSettings.SetAllowedTypes("FIX/DIAG", "FIX,FREE,SHAPE/DIAG");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.SetS("norm_error", "0.15");
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BNL_CC1ppip_XSec_1DEnu_nu");
fSettings.DefineAllowedSpecies("numu");
// User can specifiy to use uncorrected data
UseCorrectedData = !fSettings.Found("name", "Uncorr");
// User can specify 1.4 or no W cut
if (fSettings.Found("name", "W14Cut")) wTrueCut = 1.4;
else wTrueCut = 10.0;
// Now read in different data depending on what the user has specified
std::string DataLocation = GeneralUtils::GetTopLevelDir() + "/data/BNL/CC1pip_on_p/";
// If we're using corrected data
if (UseCorrectedData) {
if (wTrueCut == 1.4) {
DataLocation += "BNL_CC1pip_on_p_W14_1986_corr.txt";
fSettings.SetEnuRange(0.5, 3.0);
} else {
DataLocation += "BNL_CC1pip_on_p_1986_corr.txt";
fSettings.SetEnuRange(0.4, 4.0);
}
// If we're using raw uncorrected data
} else {
if (wTrueCut == 1.4) {
DataLocation += "BNL_CC1pip_on_p_W14_1986.txt";
fSettings.SetEnuRange(0.6, 3.0);
} else {
DataLocation += "BNL_CC1pip_on_p_1986.txt";
fSettings.SetEnuRange(0.5, 14.0);
}
}
fSettings.SetDataInput(DataLocation);
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/proton
fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / ((fNEvents + 0.)) * 2. / 1.;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
void BNL_CC1ppip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
if (event->NumFSParticle(2212) == 0 || event->NumFSParticle(211) == 0 || event->NumFSParticle(13) == 0) return;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pp = event->GetHMFSParticle(2212)->fP;
TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
double hadMass = FitUtils::MpPi(Pp, Ppip);
double Enu = -1.0;
if (hadMass/1000. < wTrueCut) {
Enu = Pnu.E() / 1000.;
}
fXVar = Enu;
return;
};
bool BNL_CC1ppip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
}
diff --git a/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.h b/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.h
index a69c357..d8e2916 100644
--- a/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.h
+++ b/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.h
@@ -1,48 +1,48 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CC1PPIP_XSEC_1DENU_NU_H_SEEN
#define BNL_CC1PPIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
// T. Kitagaki et al. "Charged-current exclusive pion production in neutrino-deuterium interactions"
// Physical Review D, Volume 34, Number 9, 1 Nov 1986
// Figure 7
//
// Also see
// N. J. Baker et al. "Study of the isospin structure of single-pion production in charged-current neutrino interactions"
// Physical Review D, Volume 23, Number 11, 1 June 1981
//
// K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints.
// KEK Preprint 2003-48, RCNS-03-01, September 2003
class BNL_CC1ppip_XSec_1DEnu_nu : public Measurement1D {
public:
BNL_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~BNL_CC1ppip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
double wTrueCut;
bool UseCorrectedData;
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx b/src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu.cxx
similarity index 60%
copy from src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
copy to src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu.cxx
index 3c63f4d..ff10007 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
+++ b/src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu.cxx
@@ -1,89 +1,82 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
- * Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
-*/
-
-#include "ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h"
-
-
+#include "BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu.h"
//********************************************************************
-ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(nuiskey samplekey) {
+BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu::BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu sample. \n" \
+ std::string descrip = "BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos(#theta*)");
+ fSettings.SetXTitle("W(#pi^{+}#pi^{-}) (GeV)");
fSettings.SetYTitle("Number of events");
- fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 6.0);
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
+ fSettings.SetEnuRange(0.0, 15.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_pProt_weight.csv" );
+ fSettings.SetTitle("BNL #nu_mu CC2#pi");
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CCmultipi/BNL_CC1pim1pip1p_Wpimpip_per_0.05GeV.txt" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
- fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
+ fScaleFactor = GetEventHistogram()->Integral("width")/double(fNEvents) * 2.0 / 1.0 ;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::FillEventVariables(FitEvent *event) {
- if (event->NumFSParticle(2212) == 0)
- return;
-
- TLorentzVector Pprot = event->GetHMFSParticle(2212)->fP;
- double pprot = FitUtils::p(Pprot);
+void BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu::FillEventVariables(FitEvent *event) {
- this->fXVar = pprot;
+ if (event->NumFSParticle(211) == 0 ||
+ event->NumFSParticle(-211) == 0)
+ return;
+ TLorentzVector Ppim = event->GetHMFSParticle(-211)->fP;
+ TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
+ fXVar = (Ppim+Ppip).Mag()/1000;
return;
}
// Signal asks for 1pi-, 1pi+, 1mu-, 1p
-bool ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::isSignal(FitEvent *event) {
+bool BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h b/src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu.h
similarity index 73%
copy from src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h
copy to src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu.h
index 3046ce9..5dc482a 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h
+++ b/src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC2PI_1PIP1PIP_EVT_1DPPIPLOW_NU_H_SEEN
-#define ANL_CC2PI_1PIP1PIP_EVT_1DPPIPLOW_NU_H_SEEN
+#ifndef BNL_CC2PI_1PIM1PIP_EVT_1DWPIPPIM_NU_H_SEEN
+#define BNL_CC2PI_1PIM1PIP_EVT_1DWPIPPIM_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu : public Measurement1D {
+class BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu : public Measurement1D {
public:
- ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu(nuiskey samplekey);
- virtual ~ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu() {};
+ BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu(nuiskey samplekey);
+ virtual ~BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx b/src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu.cxx
similarity index 60%
copy from src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
copy to src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu.cxx
index 3c63f4d..d651fe5 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
+++ b/src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu.cxx
@@ -1,89 +1,83 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
- * Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
-*/
-
-#include "ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h"
-
+#include "BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu.h"
//********************************************************************
-ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(nuiskey samplekey) {
+BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu::BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu sample. \n" \
+ std::string descrip = "BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("cos(#theta*)");
+ fSettings.SetXTitle("W(#pi^{+}#pi^{-}) (GeV)");
fSettings.SetYTitle("Number of events");
- fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 6.0);
+ fSettings.SetAllowedTypes("EVT/SHAPE/DIAG","EVT/SHAPE/DIAG");
+ fSettings.SetEnuRange(0.0, 15.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_pProt_weight.csv" );
+ fSettings.SetTitle("BNL #nu_mu CC2#pi");
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CCmultipi/BNL_CC1pim1pip1p_Wppip_per_0.05GeV.txt" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
- fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
+ fScaleFactor = GetEventHistogram()->Integral("width")/double(fNEvents) * 2.0 / 1.0 ;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::FillEventVariables(FitEvent *event) {
- if (event->NumFSParticle(2212) == 0)
- return;
+void BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu::FillEventVariables(FitEvent *event) {
- TLorentzVector Pprot = event->GetHMFSParticle(2212)->fP;
- double pprot = FitUtils::p(Pprot);
-
- this->fXVar = pprot;
+ if (event->NumFSParticle(211) == 0 ||
+ event->NumFSParticle(2212) == 0)
+ return;
+ TLorentzVector Ppr = event->GetHMFSParticle(2212)->fP;
+ TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
+ fXVar = (Ppr+Ppip).Mag()/1000;
return;
}
// Signal asks for 1pi-, 1pi+, 1mu-, 1p
-bool ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::isSignal(FitEvent *event) {
+bool BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h b/src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu.h
similarity index 73%
copy from src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h
copy to src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu.h
index 450d21b..ae000cb 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h
+++ b/src/BNL/BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPPIM_NU_H_SEEN
-#define ANL_CC2PI_1PIM1PIP_EVT_1DPPIM_NU_H_SEEN
+#ifndef BNL_CC2PI_1PIM1PIP_EVT_1DWPIPPR_NU_H_SEEN
+#define BNL_CC2PI_1PIM1PIP_EVT_1DWPIPPR_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC2pi_1pim1pip_Evt_1Dppim_nu : public Measurement1D {
+class BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu : public Measurement1D {
public:
- ANL_CC2pi_1pim1pip_Evt_1Dppim_nu(nuiskey samplekey);
- virtual ~ANL_CC2pi_1pim1pip_Evt_1Dppim_nu() {};
+ BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu(nuiskey samplekey);
+ virtual ~BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
similarity index 67%
copy from src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
copy to src/BNL/BNL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
index 9e36fa9..34f72c3 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
@@ -1,87 +1,78 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
- * Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
-*/
-
-#include "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h"
+#include "BNL_CC2pi_1pim1pip_XSec_1DEnu_nu.h"
//********************************************************************
-ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(nuiskey samplekey) {
+BNL_CC2pi_1pim1pip_XSec_1DEnu_nu::BNL_CC2pi_1pim1pip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu sample. \n" \
+ std::string descrip = "BNL_CC2pi_1pim1pip_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
- fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
+ fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2})");
fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG", "FIX,FREE,SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 6.0);
+ fSettings.SetEnuRange(0.0, 15.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC2#pi");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip1p_xsec.csv" );
+ fSettings.SetTitle("BNL #nu_mu CC2#pi");
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CCmultipi/BNL_CC1pim1pip1p_xsec.txt" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents) * 2.0 / 1.0 ;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
+ ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC2pi_1pim1pip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- double Enu = Pnu.E()/1000.;
-
- // No hadronic mass cut or similar here so very simple FillEventVariables
-
- this->fXVar = Enu;
-
+ this->fXVar = Pnu.E()/1000.;
return;
}
// Signal asks for 1pi-, 1pi+, 1mu-, 1p
-bool ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
+bool BNL_CC2pi_1pim1pip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
int pdgs[] = {13, 211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h b/src/BNL/BNL_CC2pi_1pim1pip_XSec_1DEnu_nu.h
similarity index 74%
copy from src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
copy to src/BNL/BNL_CC2pi_1pim1pip_XSec_1DEnu_nu.h
index 574972e..3a31dc7 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
+++ b/src/BNL/BNL_CC2pi_1pim1pip_XSec_1DEnu_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPPIP_NU_H_SEEN
-#define ANL_CC2PI_1PIM1PIP_EVT_1DPPIP_NU_H_SEEN
+#ifndef BNL_CC2PI_1PIM1PIP_XSEC_1DENU_NU_H_SEEN
+#define BNL_CC2PI_1PIM1PIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC2pi_1pim1pip_Evt_1Dppip_nu : public Measurement1D {
+class BNL_CC2pi_1pim1pip_XSec_1DEnu_nu : public Measurement1D {
public:
- ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(nuiskey samplekey);
- virtual ~ANL_CC2pi_1pim1pip_Evt_1Dppip_nu() {};
+ BNL_CC2pi_1pim1pip_XSec_1DEnu_nu(nuiskey samplekey);
+ virtual ~BNL_CC2pi_1pim1pip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC3pi_1pim2pip_XSec_1DEnu_nu.cxx
similarity index 65%
copy from src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
copy to src/BNL/BNL_CC3pi_1pim2pip_XSec_1DEnu_nu.cxx
index 9e36fa9..63f5009 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC3pi_1pim2pip_XSec_1DEnu_nu.cxx
@@ -1,87 +1,78 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
- * Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
-*/
-
-#include "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h"
+#include "BNL_CC3pi_1pim2pip_XSec_1DEnu_nu.h"
//********************************************************************
-ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(nuiskey samplekey) {
+BNL_CC3pi_1pim2pip_XSec_1DEnu_nu::BNL_CC3pi_1pim2pip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu sample. \n" \
+ std::string descrip = "BNL_CC3pi_1pim2pip_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
- fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
+ fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2})");
fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG", "FIX,FREE,SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 6.0);
+ fSettings.SetEnuRange(0.0, 15.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC2#pi");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip1p_xsec.csv" );
+ fSettings.SetTitle("BNL #nu_mu CC3#pi");
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CCmultipi/BNL_CC2pip1pim1p_xsec.txt" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents) * 2.0 / 1.0 ;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
+ ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC3pi_1pim2pip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- double Enu = Pnu.E()/1000.;
-
- // No hadronic mass cut or similar here so very simple FillEventVariables
-
- this->fXVar = Enu;
-
+ this->fXVar = Pnu.E()/1000.;
return;
}
-// Signal asks for 1pi-, 1pi+, 1mu-, 1p
-bool ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
- int pdgs[] = {13, 211, -211, 2212};
+// Signal asks for 1pi-, 2pi+, 1mu-, 1p
+bool BNL_CC3pi_1pim2pip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
+ int pdgs[] = {13, 211, 211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h b/src/BNL/BNL_CC3pi_1pim2pip_XSec_1DEnu_nu.h
similarity index 74%
copy from src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
copy to src/BNL/BNL_CC3pi_1pim2pip_XSec_1DEnu_nu.h
index 574972e..2c6a6a0 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
+++ b/src/BNL/BNL_CC3pi_1pim2pip_XSec_1DEnu_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPPIP_NU_H_SEEN
-#define ANL_CC2PI_1PIM1PIP_EVT_1DPPIP_NU_H_SEEN
+#ifndef BNL_CC3PI_1PIM2PIP_XSEC_1DENU_NU_H_SEEN
+#define BNL_CC3PI_1PIM2PIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC2pi_1pim1pip_Evt_1Dppip_nu : public Measurement1D {
+class BNL_CC3pi_1pim2pip_XSec_1DEnu_nu : public Measurement1D {
public:
- ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(nuiskey samplekey);
- virtual ~ANL_CC2pi_1pim1pip_Evt_1Dppip_nu() {};
+ BNL_CC3pi_1pim2pip_XSec_1DEnu_nu(nuiskey samplekey);
+ virtual ~BNL_CC3pi_1pim2pip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC4pi_2pim2pip_XSec_1DEnu_nu.cxx
similarity index 65%
copy from src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
copy to src/BNL/BNL_CC4pi_2pim2pip_XSec_1DEnu_nu.cxx
index 9e36fa9..48cd166 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC4pi_2pim2pip_XSec_1DEnu_nu.cxx
@@ -1,87 +1,78 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-/**
- * D.Day et al, "Study of \nud charged-current two-pion production in the threshold region", Physical Review D, Volume 28, Number 11, 1 December 1983 \n
- * Derrick, Musgrave, Ammar, Day, Kafka and Mann, "Two- and three-pion productin by \nu\mud recations nears threshold: The implication for nucleon-decay experiments", Physical Review D, Vol 30, Number 7, 1 October 1984
-*/
-
-#include "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h"
+#include "BNL_CC4pi_2pim2pip_XSec_1DEnu_nu.h"
//********************************************************************
-ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(nuiskey samplekey) {
+BNL_CC4pi_2pim2pip_XSec_1DEnu_nu::BNL_CC4pi_2pim2pip_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
- std::string descrip = "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu sample. \n" \
+ std::string descrip = "BNL_CC4pi_2pim2pip_XSec_1DEnu_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
- fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
+ fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2})");
fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG", "FIX,FREE,SHAPE/DIAG");
- fSettings.SetEnuRange(0.0, 6.0);
+ fSettings.SetEnuRange(0.0, 15.0);
fSettings.DefineAllowedTargets("D,H");
// CCQELike plot information
- fSettings.SetTitle("ANL #nu_mu CC2#pi");
- fSettings.SetDataInput( FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip1p_xsec.csv" );
+ fSettings.SetTitle("BNL #nu_mu CC4#pi");
+ fSettings.SetDataInput( FitPar::GetDataBase() + "/BNL/CCmultipi/BNL_CC2pim2pip1p_xsec.txt" );
fSettings.DefineAllowedSpecies("numu");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents) * 2.0 / 1.0 ;
// Plot Setup -------------------------------------------------------
SetDataFromTextFile( fSettings.GetDataInput() );
+ ScaleData(1E-38);
SetCovarFromDiagonal();
// Final setup ---------------------------------------------------
FinaliseMeasurement();
};
-void ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
+void BNL_CC4pi_2pim2pip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
- double Enu = Pnu.E()/1000.;
-
- // No hadronic mass cut or similar here so very simple FillEventVariables
-
- this->fXVar = Enu;
-
+ this->fXVar = Pnu.E()/1000.;
return;
}
-// Signal asks for 1pi-, 1pi+, 1mu-, 1p
-bool ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
- int pdgs[] = {13, 211, -211, 2212};
+// Signal asks for 2pi-, 2pi+, 1mu-, 1p
+bool BNL_CC4pi_2pim2pip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
+ int pdgs[] = {13, 211, 211, -211, -211, 2212};
return SignalDef::isCCWithFS(event, 14, pdgs,
EnuMin, EnuMax);
}
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h b/src/BNL/BNL_CC4pi_2pim2pip_XSec_1DEnu_nu.h
similarity index 74%
copy from src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
copy to src/BNL/BNL_CC4pi_2pim2pip_XSec_1DEnu_nu.h
index 574972e..79e60cd 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
+++ b/src/BNL/BNL_CC4pi_2pim2pip_XSec_1DEnu_nu.h
@@ -1,38 +1,38 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
-#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPPIP_NU_H_SEEN
-#define ANL_CC2PI_1PIM1PIP_EVT_1DPPIP_NU_H_SEEN
+#ifndef BNL_CC4PI_2PIM2PIP_XSEC_1DENU_NU_H_SEEN
+#define BNL_CC4PI_2PIM2PIP_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
-class ANL_CC2pi_1pim1pip_Evt_1Dppip_nu : public Measurement1D {
+class BNL_CC4pi_2pim2pip_XSec_1DEnu_nu : public Measurement1D {
public:
- ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(nuiskey samplekey);
- virtual ~ANL_CC2pi_1pim1pip_Evt_1Dppip_nu() {};
+ BNL_CC4pi_2pim2pip_XSec_1DEnu_nu(nuiskey samplekey);
+ virtual ~BNL_CC4pi_2pim2pip_XSec_1DEnu_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
diff --git a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx
index 6e91ddb..6f9c32b 100755
--- a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx
+++ b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx
@@ -1,148 +1,148 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BNL_CCQE_Evt_1DQ2_nu.h"
//********************************************************************
BNL_CCQE_Evt_1DQ2_nu::BNL_CCQE_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CCQE_Evt_1DQ2_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
- fSettings.SetXTitle("Q^{2}_{CCQE} (GeV^{2})");
+ fSettings.SetXTitle("Q^{2} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BNL #nu_mu CCQE");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "BNL/BNL_Data_PRD23_2499.root;BNL_1DQ2_Data");
// is Q2 Correction applied
applyQ2correction = fSettings.Found("type", "Q2CORR");
if (applyQ2correction) {
fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRL31_844.root");
fSettings.SetS("q2correction_hist", "ANL_1DQ2_Correction");
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor for shape
fScaleFactor = 1.0;
// Plot Setup -------------------------------------------------------
SetDataFromRootFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Correction Histogram
if (applyQ2correction) {
// Correction Hist
CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
fSettings.GetS("q2correction_hist") );
SetAutoProcessTH1(CorrectionHist, kCMD_Write);
// Make uncorrected MC hist
fMCHist_NoCorr = (TH1D*) fDataHist->Clone();
fMCHist_NoCorr->Reset();
fMCHist_NoCorr->SetNameTitle( (fName + "_NOCORR").c_str(),
(fName + "_NOCORR").c_str());
SetAutoProcessTH1(fMCHist_NoCorr);
}
// Final setup ---------------------------------------------------
FinaliseMeasurement();
}
//********************************************************************
void BNL_CCQE_Evt_1DQ2_nu::FillEventVariables(FitEvent * event) {
//********************************************************************
if (event->NumFSParticle(13) == 0)
return;
// Fill histogram with reconstructed Q2 Distribution
fXVar = -999.9;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
fXVar = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
GetQ2Box()->fQ2 = fXVar;
return;
};
//********************************************************************
bool BNL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent * event) {
//********************************************************************
if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
// Q2 cut
if (GetQ2Box()->fQ2 <= 0) return false;
return true;
};
//********************************************************************
void BNL_CCQE_Evt_1DQ2_nu::FillHistograms() {
//********************************************************************
if (applyQ2correction) {
fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
}
Measurement1D::FillHistograms();
}
//********************************************************************
void BNL_CCQE_Evt_1DQ2_nu::ScaleEvents() {
//********************************************************************
Measurement1D::ScaleEvents();
// Flux unfold our extra histogram
if (applyQ2correction) {
if (fMCHist_NoCorr->Integral()) {
fMCHist_NoCorr->Scale(fDataHist->Integral() / fMCHist_NoCorr->Integral());
}
}
}
diff --git a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h
index acfc74f..8b37a3b 100755
--- a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h
@@ -1,64 +1,64 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CCQE_Evt_1DQ2_NU_H_SEEN
#define BNL_CCQE_Evt_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
#include "CustomVariableBoxes.h"
//********************************************************************
class BNL_CCQE_Evt_1DQ2_nu : public Measurement1D {
//********************************************************************
public:
BNL_CCQE_Evt_1DQ2_nu(nuiskey samplekey);
virtual ~BNL_CCQE_Evt_1DQ2_nu() {};
/// \brief Get Q2 assuming QE
void FillEventVariables(FitEvent *event);
/// \brief Get True CCQE
bool isSignal(FitEvent *event);
/// \brief Fill main histograms and correction histograms
void FillHistograms();
/// \brief scale the MC Hist and correction histograms
void ScaleEvents();
/// \brief Use Q2 Box to save correction info
inline Q2VariableBox1D* GetQ2Box(){ return static_cast(GetBox()); };
/// \brief Create Q2 Box to save correction info
inline MeasurementVariableBox* CreateBox(){ return new Q2VariableBox1D(); };
private:
bool applyQ2correction; ///< Flag of whether deut correction applied
TH1D* CorrectionHist; ///< Correction factor
TH1D* fMCHist_NoCorr; ///< Uncorrected fMCHist
double ThetaMu;
double q2qe;
};
#endif
diff --git a/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx
index fad5e99..e0af822 100644
--- a/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx
@@ -1,147 +1,147 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "BNL_CCQE_XSec_1DEnu_nu.h"
//********************************************************************
BNL_CCQE_XSec_1DEnu_nu::BNL_CCQE_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL CCQ2 XSec 1DEnu nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
- fSettings.SetYTitle("#sigma(#E_{#nu}) (cm^{2}/neutron)");
+ fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/neutron)");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BNL #nu_mu CCQE");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "BNL/BNL_Data_PRD23_2499.root;BNL_1DEnu_Data");
// is Q2 Correction applied
applyQ2correction = fSettings.Found("type", "Q2CORR");
if (applyQ2correction) {
fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "/ANL/ANL_CCQE_Data_PRL31_844.root");
fSettings.SetS("q2correction_hist", "ANL_1DQ2_Correction");
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor for shape
fScaleFactor = (GetEventHistogram()->Integral("width") * (2.0 / 1.0) * 1E-38 / (fNEvents + 0.));
// Plot Setup -------------------------------------------------------
SetDataFromRootFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Correction Histogram
if (applyQ2correction) {
// Correction Hist
CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
fSettings.GetS("q2correction_hist") );
SetAutoProcessTH1(CorrectionHist, kCMD_Write);
// Make uncorrected MC hist
fMCHist_NoCorr = (TH1D*) fDataHist->Clone();
fMCHist_NoCorr->Reset();
fMCHist_NoCorr->SetNameTitle( (fName + "_NOCORR").c_str(),
(fName + "_NOCORR").c_str());
SetAutoProcessTH1(fMCHist_NoCorr);
}
// Final setup ---------------------------------------------------
FinaliseMeasurement();
}
//********************************************************************
void BNL_CCQE_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
//********************************************************************
if (event->NumFSParticle(13) == 0)
return;
// Get Q2
double q2qe = 0.0;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
q2qe = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
Enu_rec = FitUtils::EnuQErec(Pmu, cos(ThetaMu), 0., true);
fXVar = Enu_rec;
GetQ2Box()->fQ2 = q2qe;
return;
};
//********************************************************************
bool BNL_CCQE_XSec_1DEnu_nu::isSignal(FitEvent *event) {
//********************************************************************
return SignalDef::isCCQE(event, 14, EnuMin, EnuMax);
};
//********************************************************************
void BNL_CCQE_XSec_1DEnu_nu::FillHistograms() {
//********************************************************************
if (applyQ2correction) {
fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
}
Measurement1D::FillHistograms();
}
//********************************************************************
void BNL_CCQE_XSec_1DEnu_nu::ScaleEvents() {
//********************************************************************
Measurement1D::ScaleEvents();
// Flux unfold our extra histogram
if (applyQ2correction) {
PlotUtils::FluxUnfoldedScaling(fMCHist_NoCorr, GetFluxHistogram(),
GetEventHistogram(), fScaleFactor,
fNEvents);
}
}
diff --git a/src/BNL/BNL_CCQE_XSec_1DEnu_nu.h b/src/BNL/BNL_CCQE_XSec_1DEnu_nu.h
index 6adb6ea..645dba0 100644
--- a/src/BNL/BNL_CCQE_XSec_1DEnu_nu.h
+++ b/src/BNL/BNL_CCQE_XSec_1DEnu_nu.h
@@ -1,58 +1,58 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef BNL_CCQE_XSEC_1DENU_NU_H_SEEN
#define BNL_CCQE_XSEC_1DENU_NU_H_SEEN
#include "Measurement1D.h"
#include "CustomVariableBoxes.h"
//********************************************************************
class BNL_CCQE_XSec_1DEnu_nu : public Measurement1D {
//********************************************************************
public:
BNL_CCQE_XSec_1DEnu_nu(nuiskey samplekey);
virtual ~BNL_CCQE_XSec_1DEnu_nu() {};
/// \brief Get Q2 assuming QE scattering
void FillEventVariables(FitEvent *event);
/// \brief Selection only true CCQE
bool isSignal(FitEvent *event);
/// \brief fill normal MC and corrected MC
void FillHistograms();
/// \brief scale normal MC and corrected MC
void ScaleEvents();
/// \brief Use Q2 Box to save correction info
inline Q2VariableBox1D* GetQ2Box(){ return static_cast(GetBox()); };
/// \brief Create Q2 Box to save correction info
inline MeasurementVariableBox* CreateBox(){ return new Q2VariableBox1D(); };
private:
bool applyQ2correction; ///< Apply free nucleon to dueterium correction
TH1D* CorrectionHist; ///< Histogram to interpolate free nucleon correction
TH1D* fMCHist_NoCorr; ///< Uncorrected fMCHist
};
#endif
diff --git a/src/BNL/CMakeLists.txt b/src/BNL/CMakeLists.txt
index 0bb7faf..644e8a2 100644
--- a/src/BNL/CMakeLists.txt
+++ b/src/BNL/CMakeLists.txt
@@ -1,65 +1,93 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
set(IMPLFILES
BNL_CC1npip_Evt_1DQ2_nu.cxx
BNL_CC1npip_XSec_1DEnu_nu.cxx
+BNL_CC1npip_Evt_1DWmupi_nu.cxx
+BNL_CC1npip_Evt_1DWNpi_nu.cxx
+BNL_CC1npip_Evt_1DWNmu_nu.cxx
BNL_CC1pi0_Evt_1DQ2_nu.cxx
BNL_CC1pi0_XSec_1DEnu_nu.cxx
+BNL_CC1pi0_Evt_1DWmupi_nu.cxx
+BNL_CC1pi0_Evt_1DWNpi_nu.cxx
+BNL_CC1pi0_Evt_1DWNmu_nu.cxx
BNL_CC1ppip_Evt_1DQ2_nu.cxx
BNL_CC1ppip_XSec_1DEnu_nu.cxx
+BNL_CC1ppip_Evt_1DWmupi_nu.cxx
+BNL_CC1ppip_Evt_1DWNpi_nu.cxx
+BNL_CC1ppip_Evt_1DWNmu_nu.cxx
BNL_CCQE_Evt_1DQ2_nu.cxx
BNL_CCQE_XSec_1DEnu_nu.cxx
BNL_CC1ppip_Evt_1DcosthAdler_nu.cxx
BNL_CC1ppip_Evt_1Dphi_nu.cxx
+BNL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
+BNL_CC3pi_1pim2pip_XSec_1DEnu_nu.cxx
+BNL_CC4pi_2pim2pip_XSec_1DEnu_nu.cxx
+BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu.cxx
+BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu.cxx
)
set(HEADERFILES
BNL_CC1npip_Evt_1DQ2_nu.h
BNL_CC1npip_XSec_1DEnu_nu.h
+BNL_CC1npip_Evt_1DWmupi_nu.h
+BNL_CC1npip_Evt_1DWNpi_nu.h
+BNL_CC1npip_Evt_1DWNmu_nu.h
BNL_CC1pi0_Evt_1DQ2_nu.h
BNL_CC1pi0_XSec_1DEnu_nu.h
+BNL_CC1pi0_Evt_1DWmupi_nu.h
+BNL_CC1pi0_Evt_1DWNpi_nu.h
+BNL_CC1pi0_Evt_1DWNmu_nu.h
BNL_CC1ppip_Evt_1DQ2_nu.h
BNL_CC1ppip_XSec_1DEnu_nu.h
+BNL_CC1ppip_Evt_1DWmupi_nu.h
+BNL_CC1ppip_Evt_1DWNpi_nu.h
+BNL_CC1ppip_Evt_1DWNmu_nu.h
BNL_CCQE_Evt_1DQ2_nu.h
BNL_CCQE_XSec_1DEnu_nu.h
BNL_CC1ppip_Evt_1DcosthAdler_nu.h
BNL_CC1ppip_Evt_1Dphi_nu.h
+BNL_CC2pi_1pim1pip_XSec_1DEnu_nu.h
+BNL_CC3pi_1pim2pip_XSec_1DEnu_nu.h
+BNL_CC4pi_2pim2pip_XSec_1DEnu_nu.h
+BNL_CC2pi_1pim1pip_Evt_1DWpippim_nu.h
+BNL_CC2pi_1pim1pip_Evt_1DWpippr_nu.h
)
set(LIBNAME expBNL)
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/BNL/SAMPLEREADME b/src/BNL/SAMPLEREADME
deleted file mode 100644
index be822fc..0000000
--- a/src/BNL/SAMPLEREADME
+++ /dev/null
@@ -1,2 +0,0 @@
-./BNL_CCQE_Evt_1DQ2_nu.cxx
-./BNL_CCQE_XSec_1DEnu_nu.cxx
diff --git a/src/Config/CMakeLists.txt b/src/Config/CMakeLists.txt
index 64464af..34a0c37 100644
--- a/src/Config/CMakeLists.txt
+++ b/src/Config/CMakeLists.txt
@@ -1,52 +1,52 @@
-# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+# Copyright 2016-2021 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 .
################################################################################
set(HEADERFILES
NuisConfig.h
NuisKey.h
)
set(IMPLFILES
NuisConfig.cxx
NuisKey.cxx
)
set(LIBNAME Config)
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/Config)
set(MODULETargets ${MODULETargets} ${LIBNAME} PARENT_SCOPE)
diff --git a/src/Config/NuisConfig.cxx b/src/Config/NuisConfig.cxx
index 4a33b29..ab69cb0 100644
--- a/src/Config/NuisConfig.cxx
+++ b/src/Config/NuisConfig.cxx
@@ -1,817 +1,817 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#include "NuisConfig.h"
#include "FitLogger.h"
#include "GeneralUtils.h"
#include "TXMLEngine.h"
namespace Config {
nuisconfig &Get() { return nuisconfig::GetConfig(); };
std::string GetPar(std::string const &name) { return Get().GetConfig(name); }
bool HasPar(std::string const &name) { return Get().HasConfig(name); }
std::string GetParS(std::string const &name) { return Get().GetConfigS(name); }
int GetParI(std::string const &name) { return Get().GetConfigI(name); }
bool GetParB(std::string const &name) { return Get().GetConfigB(name); }
float GetParF(std::string const &name) { return Get().GetConfigF(name); }
double GetParD(std::string const &name) { return Get().GetConfigD(name); }
void SetPar(std::string const &name, std::string const &val) {
Get().SetConfig(name, val);
}
void SetPar(std::string const &name, char const *val) {
Get().SetConfig(name, val);
}
void SetPar(std::string const &name, bool val) { Get().SetConfig(name, val); }
void SetPar(std::string const &name, int val) { Get().SetConfig(name, val); }
void SetPar(std::string const &name, float val) { Get().SetConfig(name, val); }
void SetPar(std::string const &name, double val) { Get().SetConfig(name, val); }
}
namespace FitPar {
std::string GetDataBase() { return GeneralUtils::GetTopLevelDir() + "/data/"; };
nuisconfig &Config() { return Config::Get(); };
}
nuisconfig *nuisconfig::m_nuisconfigInstance = NULL;
nuisconfig &nuisconfig::GetConfig(void) {
if (!m_nuisconfigInstance) m_nuisconfigInstance = new nuisconfig;
return *m_nuisconfigInstance;
};
// Main Class Definition
nuisconfig::nuisconfig() {
// Load default Parameters
std::string filename =
(GeneralUtils::GetTopLevelDir() + "/parameters/config.xml");
std::cout << "[ NUISANCE ]: Loading DEFAULT settings from : " << filename << std::endl;
// Create XML Engine
fXML = new TXMLEngine;
fXML->SetSkipComments(true);
// Load in documents
fXMLDocs.push_back(fXML->ParseFile(filename.c_str(), 1000000));
if (!fXMLDocs[0]) {
NUIS_ABORT("Cannot Read Parameters File!");
}
// Setup Main XML Node to be the first file read
fMainNode = fXML->DocGetRootElement(fXMLDocs[0]);
// Print result
std::cout << "[ NUISANCE ]: Finished nuisconfig." << std::endl;
}
nuisconfig::~nuisconfig() {
// Should really delete XML objects here but we don't
}
void nuisconfig::LoadSettings(std::string const &filename,
std::string const &state) {
// Open file and see if its XML
std::cout << "[ NUISANCE ]: Trying to parse file : " << filename;
- StopTalking();
+ // StopTalking();
XMLDocPointer_t readdoc = fXML->ParseFile(filename.c_str(), 1000000);
- StartTalking();
+ // StartTalking();
// If it is parse it as a nice XML config file
if (readdoc) {
std::cout << " -> Found XML file." << std::endl;
LoadXMLSettings(filename, state);
// Otherwise its an old simple card file
} else {
std::cout << " -> Assuming its a simple card file." << std::endl;
LoadCardSettings(filename, state);
}
}
void nuisconfig::LoadXMLSettings(std::string const &filename,
std::string const &state) {
std::cout << "[ NUISANCE ]: Loading XML settings from : " << filename
<< std::endl;
// Add new file to xml docs list
fXMLDocs.push_back(fXML->ParseFile(filename.c_str(), 1000000));
if (!fXMLDocs.back()) {
NUIS_ABORT("Failed to read: " << filename);
}
// Loop over children and add
XMLNodePointer_t child =
fXML->GetChild(fXML->DocGetRootElement(fXMLDocs.back()));
// // Here we manually load all the children from the card file into our root
// node
if (!child) {
NUIS_ABORT("CANNOT Find child inside settings file!");
}
while (child) {
// SPECIAL CONFIG CASE
// If its a config node, then remove previous attributes, overriding old
// value
if (!std::string(fXML->GetNodeName(child)).compare("config")) {
// Loop over attribues
XMLAttrPointer_t attr1 = fXML->GetFirstAttr(child);
while (attr1) {
// If a valid attribute name is given then compare
if (!GetConfigS(fXML->GetAttrName(attr1)).empty()) {
// Get full list of present configs
std::vector confignodes = GetNodes("config");
// Loop over present configs and compare
for (size_t i = 0; i < confignodes.size(); i++) {
// If we already have this config, free the old attribute
if (fXML->HasAttr(confignodes[i], fXML->GetAttrName(attr1))) {
fXML->FreeAttr(confignodes[i], fXML->GetAttrName(attr1));
break;
}
}
}
// Move onto next config attribute
attr1 = fXML->GetNextAttr(attr1);
}
}
TString nodeStr;
fXML->SaveSingleNode(child, &nodeStr);
XMLNodePointer_t copyNode = fXML->ReadSingleNode(nodeStr.Data());
// std::cout << "copying node..." << std::endl;
// PrintXML(copyNode);
// Add this child to the main config list
fXML->AddChild(fMainNode, copyNode);
// std::cout << "Done, was it added?" << std::endl;
// PrintXML(fMainNode);
// Get Next Child
child = fXML->GetNext(child);
}
std::cout << "[ NUISANCE ]: Finished loading XML settings" << std::endl;
}
void nuisconfig::LoadCardSettings(std::string const &filename,
std::string const &state) {
std::cout << "[ NUISANCE ]: Loading simple config from : " << filename << std::endl;
// Build XML Config from the card file by parsing each line
std::vector cardlines =
GeneralUtils::ParseFileToStr(filename, "\n");
int linecount = 0;
// Loop over all input lines
for (std::vector::iterator iter = cardlines.begin();
iter != cardlines.end(); iter++) {
std::string line = (*iter);
linecount++;
// Skip Comments
if (line.empty()) continue;
if (line.c_str()[0] == '#') continue;
// Parse whitespace
std::vector strvct = GeneralUtils::ParseToStr(line, " ");
if (strvct.empty()) continue;
// Get Identifier
std::string id = strvct[0];
// Build backwards compatible xml configs
// Sample structure
if (!id.compare("sample")) {
CreateSampleNodeFromLine(line);
}
// Any parameter structure
if (id.find("_parameter") != std::string::npos) {
CreateParameterNodeFromLine(line);
}
// Any covar structure
if (!id.compare("covar") || !id.compare("pull") || !id.compare("throw")) {
CreatePullNodeFromLine(line);
}
// Any config structure
if (!id.compare("config")) {
CreateOldConfigNodeFromLine(line);
}
}
std::cout << "[ NUISANCE ]: Finished loading simple config" << std::endl;
}
XMLNodePointer_t nuisconfig::CreateSampleNodeFromLine(std::string const &line) {
// Create new node entry
XMLNodePointer_t samplenode = CreateNode("sample");
// Parse line
std::vector strvct = GeneralUtils::ParseToStr(line, " ");
// Add line elements to the node
// name input type norm
if (strvct.size() > 1) Set(samplenode, "name", strvct[1]);
if (strvct.size() > 2) Set(samplenode, "input", strvct[2]);
if (strvct.size() > 3) Set(samplenode, "type", strvct[3]);
if (strvct.size() > 4) Set(samplenode, "norm", strvct[4]);
return samplenode;
}
XMLNodePointer_t nuisconfig::CreateParameterNodeFromLine(
std::string const &line) {
// Create new node entry
XMLNodePointer_t parnode = CreateNode("parameter");
// Parse line
std::vector strvct = GeneralUtils::ParseToStr(line, " ");
// Add line elements to the node
// type name nominal [low] [high] [step] state
if (strvct.size() > 0) Set(parnode, "type", strvct[0]);
if (strvct.size() > 1) Set(parnode, "name", strvct[1]);
if (strvct.size() > 2) Set(parnode, "nominal", strvct[2]);
// If free structure
if (strvct.size() == 7) {
Set(parnode, "low", strvct[3]);
Set(parnode, "high", strvct[4]);
Set(parnode, "step", strvct[5]);
Set(parnode, "state", strvct[6]);
// Fixed param structure
} else if (strvct.size() == 3) {
Set(parnode, "state", "FIX");
} else if (strvct.size() == 4) {
Set(parnode, "state", strvct[3]);
}
return parnode;
}
XMLNodePointer_t nuisconfig::CreatePullNodeFromLine(std::string const &line) {
// Create new node entry
XMLNodePointer_t parnode = CreateNode("covar");
// Parse line
std::vector strvct = GeneralUtils::ParseToStr(line, " ");
// Add line elements to the node
// name input type
if (strvct.size() > 1) Set(parnode, "name", strvct[1]);
if (strvct.size() > 2) Set(parnode, "input", strvct[2]);
if (strvct.size() > 3) Set(parnode, "type", strvct[3]);
return parnode;
}
XMLNodePointer_t nuisconfig::CreateOldConfigNodeFromLine(
std::string const &line) {
// Create new node entry
XMLNodePointer_t confignode = CreateNode("config");
// Parse line
std::vector strvct = GeneralUtils::ParseToStr(line, " ");
// Add line elements to the node
// name value
if (strvct.size() > 2) Set(confignode, strvct[1], strvct[2]);
return confignode;
}
void nuisconfig::FinaliseSettings(std::string const &name) {
std::cout << "[ NUISANCE ]: Finalising run settings" << std::endl;
WriteSettings(name);
// Save full config to file
RemoveEmptyNodes();
RemoveIdenticalNodes();
std::cout << "[ NUISANCE ]: Finished finalising run settings" << std::endl;
}
void nuisconfig::WriteSettings(std::string const &outputname) {
// Create a New XML Doc
XMLDocPointer_t newxmldoc = fXML->NewDoc();
fXML->DocSetRootElement(newxmldoc, fMainNode);
// Save document to file
if (GetConfigB("SaveParsedXMLFile")) {
fXML->SaveDoc(newxmldoc, outputname.c_str());
}
}
void nuisconfig::PrintXML(XMLNodePointer_t node, int indent) {
if (!node) {
node = fMainNode;
}
std::stringstream ss("");
for (int i = 0; i < indent; ++i) {
ss << " ";
}
std::cout << ss.str() << "<" << fXML->GetNodeName(node) << std::flush;
XMLAttrPointer_t attr = fXML->GetFirstAttr(node);
while (attr) {
std::cout << " " << fXML->GetAttrName(attr) << "=\""
<< fXML->GetAttrValue(attr) << "\"" << std::flush;
attr = fXML->GetNextAttr(attr);
}
if (!fXML->GetChild(node)) {
std::cout << " />" << std::endl;
return;
}
std::cout << " >" << std::endl;
XMLNodePointer_t child = fXML->GetChild(node);
while (child) {
PrintXML(child, indent + 1);
child = fXML->GetNext(child);
}
std::cout << ss.str() << "" << fXML->GetNodeName(node) << ">" << std::endl;
}
XMLNodePointer_t nuisconfig::CreateNode(std::string const &name) {
return fXML->NewChild(fMainNode, 0, name.c_str());
}
XMLNodePointer_t nuisconfig::CreateNode(XMLNodePointer_t node,
std::string const &name) {
return fXML->NewChild(node, 0, name.c_str());
}
XMLNodePointer_t nuisconfig::GetNode(XMLNodePointer_t node,
std::string const &type) {
/// Loop over all children
XMLNodePointer_t child = fXML->GetChild(node);
while (child != 0) {
/// Get nodes for given type (if type empty return all)
if (std::string(fXML->GetNodeName(child)) == type.c_str() or type.empty()) {
return child;
}
// Next child
child = fXML->GetNext(child);
}
// Child not found
return 0;
}
void nuisconfig::RemoveEmptyNodes() {
std::vector nodelist = Config::Get().GetNodes();
for (size_t i = 0; i < nodelist.size(); i++) {
if (fXML->IsEmptyNode(nodelist[i])) {
std::cout << "Removing empty node: " << fXML->GetNodeName(nodelist[i])
<< ", with child ?" << bool(fXML->GetChild(nodelist[i]))
<< std::endl;
RemoveNode(nodelist[i]);
}
}
}
void nuisconfig::RemoveIdenticalNodes() {
std::vector removed;
// Loop over all nodes and check for identical nodes
std::vector nodelist = Config::Get().GetNodes();
for (size_t i = 0; i < nodelist.size(); i++) {
for (size_t j = 0; j < nodelist.size(); j++) {
if (i == j) continue;
XMLNodePointer_t node1 = nodelist[i];
XMLNodePointer_t node2 = nodelist[j];
// Check node already removed.
if (std::find(removed.begin(), removed.end(), node1) != removed.end()) {
continue;
}
if (std::find(removed.begin(), removed.end(), node2) != removed.end()) {
continue;
}
// Check matching
if (!MatchingNodes(node1, node2)) {
continue;
}
if (std::string(fXML->GetNodeName(node1)).compare("config") and
fXML->IsEmptyNode(node1)) {
// Matching so print out warning
std::cout << "Matching nodes given! Removing node1!" << std::endl
<< "Node 1" << std::endl;
PrintNode(node1);
std::cout << "Node 2" << std::endl;
PrintNode(node2);
}
// Remove node
removed.push_back(node1);
}
}
// Now go through and remove this node.
for (size_t i = 0; i < removed.size(); i++) {
RemoveNode(removed.at(i));
}
return;
}
void nuisconfig::RemoveNode(XMLNodePointer_t node) {
- std::cout << "[INFO]: Removing node: " << fXML->GetNodeName(node)
- << std::endl;
+ // std::cout << "[ CONFIG ]: Removing node: ";
+ // PrintNode(node);
fXML->FreeAllAttr(node);
fXML->CleanNode(node);
fXML->FreeNode(node);
fXML->UnlinkNode(node);
}
void nuisconfig::PrintNode(XMLNodePointer_t node) {
// Print Node Name
std::cout << fXML->GetNodeName(node) << std::endl;
// Loop and print all attributes
XMLAttrPointer_t attr = fXML->GetFirstAttr(node);
while (attr != 0) {
- std::cout << " -> " << fXML->GetAttrName(attr) << " : "
+ std::cout << "\t\t|-> " << fXML->GetAttrName(attr) << " : "
<< fXML->GetAttrValue(attr) << std::endl;
attr = fXML->GetNextAttr(attr);
}
}
bool nuisconfig::MatchingNodes(XMLNodePointer_t node1, XMLNodePointer_t node2) {
bool matching = true;
XMLAttrPointer_t attr = fXML->GetFirstAttr(node1);
while (attr != 0) {
if (GetS(node2, fXML->GetAttrName(attr)) != fXML->GetAttrValue(attr))
matching = false;
attr = fXML->GetNextAttr(attr);
}
return matching;
}
XMLNodePointer_t nuisconfig::GetNode(std::string const &type) {
return GetNode(fMainNode, type);
}
std::vector nuisconfig::GetNodes(XMLNodePointer_t node,
std::string const &type) {
// Create new vector for nodes
std::vector nodelist;
/// Loop over all children
XMLNodePointer_t child = fXML->GetChild(node);
while (child != 0) {
/// Get nodes for given type (if type empty return all)
if (std::string(fXML->GetNodeName(child)) == type.c_str() or type.empty()) {
nodelist.push_back(child);
}
// Next child
child = fXML->GetNext(child);
}
// return list
return nodelist;
}
std::vector nuisconfig::GetNodes(std::string const &type) {
return GetNodes(fMainNode, type);
}
void nuisconfig::Set(XMLNodePointer_t node, std::string const &name,
std::string const &val) {
// Remove and re-add attribute
if (fXML->HasAttr(node, name.c_str())) {
fXML->FreeAttr(node, name.c_str());
}
fXML->NewAttr(node, 0, name.c_str(), val.c_str());
}
void nuisconfig::Set(XMLNodePointer_t node, std::string const &name,
char const *val) {
Set(node, name, std::string(val));
}
void nuisconfig::Set(XMLNodePointer_t node, std::string const &name, bool val) {
Set(node, name, GeneralUtils::BoolToStr(val));
}
void nuisconfig::Set(XMLNodePointer_t node, std::string const &name, int val) {
Set(node, name, GeneralUtils::IntToStr(val));
}
void nuisconfig::Set(XMLNodePointer_t node, std::string const &name,
float val) {
Set(node, name, GeneralUtils::DblToStr(val));
}
void nuisconfig::Set(XMLNodePointer_t node, std::string const &name,
double val) {
Set(node, name, GeneralUtils::DblToStr(val));
}
void nuisconfig::SetS(XMLNodePointer_t node, std::string const &name,
std::string const &val) {
Set(node, name, val);
}
void nuisconfig::SetB(XMLNodePointer_t node, std::string const &name,
bool val) {
Set(node, name, GeneralUtils::BoolToStr(val));
}
void nuisconfig::SetI(XMLNodePointer_t node, std::string const &name, int val) {
Set(node, name, GeneralUtils::IntToStr(val));
}
void nuisconfig::SetF(XMLNodePointer_t node, std::string const &name,
float val) {
Set(node, name, GeneralUtils::DblToStr(val));
}
void nuisconfig::SetD(XMLNodePointer_t node, std::string const &name,
double val) {
Set(node, name, GeneralUtils::DblToStr(val));
}
bool nuisconfig::Has(XMLNodePointer_t node, std::string const &name) {
// If node empty return empty
if (node == 0) return false;
// Search attributes
XMLAttrPointer_t attr = fXML->GetFirstAttr(node);
bool found = false;
// Loop over all attributes
while (attr != 0) {
// Find value of correct name
if (std::string(fXML->GetAttrName(attr)) == name.c_str()) {
found = true;
break;
}
// Next Attribute
attr = fXML->GetNextAttr(attr);
}
return found;
}
std::string nuisconfig::Get(XMLNodePointer_t node, std::string const &name) {
// If node empty return empty
if (node == 0) return "";
// Get Attribute from child with name
XMLAttrPointer_t attr = fXML->GetFirstAttr(node);
std::string temp = "";
// Loop over all attributes
while (attr != 0) {
// If valid match then save
if (std::string(fXML->GetAttrName(attr)) == name.c_str()) {
temp = fXML->GetAttrValue(attr);
}
// Next Attribute
attr = fXML->GetNextAttr(attr);
}
return temp;
}
std::string nuisconfig::GetS(XMLNodePointer_t node, std::string const &name) {
return Get(node, name);
}
bool nuisconfig::GetB(XMLNodePointer_t node, std::string const &name) {
std::string tempattr = Get(node, name);
return GeneralUtils::StrToBool(tempattr);
}
int nuisconfig::GetI(XMLNodePointer_t node, std::string const &name) {
std::string tempattr = Get(node, name);
return GeneralUtils::StrToInt(tempattr);
}
float nuisconfig::GetF(XMLNodePointer_t node, std::string const &name) {
std::string tempattr = Get(node, name);
return GeneralUtils::StrToDbl(tempattr);
}
double nuisconfig::GetD(XMLNodePointer_t node, std::string const &name) {
std::string tempattr = Get(node, name);
return GeneralUtils::StrToDbl(tempattr);
}
std::vector nuisconfig::GetVS(XMLNodePointer_t node,
std::string const &name,
const char *del) {
std::string tempattr = Get(node, name);
return GeneralUtils::ParseToStr(tempattr, del);
}
// std::vector nuisconfig::GetVB(XMLNodePointer_t node,
// std::string name,
// const char* del) {
// std::string tempattr = Get(node, name);
// return GeneralUtils::ParseToBool(tempattr, del);
// }
std::vector nuisconfig::GetVI(XMLNodePointer_t node,
std::string const &name, const char *del) {
std::string tempattr = Get(node, name);
return GeneralUtils::ParseToInt(tempattr, del);
}
// std::vector nuisconfig::GetVF(XMLNodePointer_t node,
// std::string name,
// const char* del) {
// std::string tempattr = Get(node, name);
// return GeneralUtils::ParseToDouble(tempattr, del);
// }
std::vector nuisconfig::GetVD(XMLNodePointer_t node,
std::string const &name,
char const *del) {
std::string tempattr = Get(node, name);
return GeneralUtils::ParseToDbl(tempattr, del);
}
std::vector nuisconfig::GetAllKeysForNode(XMLNodePointer_t node) {
//bool matching = true;
XMLAttrPointer_t attr = fXML->GetFirstAttr(node);
std::vector keys;
while (attr != 0) {
if (!std::string(fXML->GetAttrName(attr)).empty()) {
keys.push_back(std::string(fXML->GetAttrName(attr)));
}
attr = fXML->GetNextAttr(attr);
}
return keys;
}
XMLNodePointer_t nuisconfig::GetConfigNode(std::string const &name) {
// Loop over children and look for name
XMLNodePointer_t child = fXML->GetChild(fMainNode);
while (child != 0) {
// Select only config parameters
if (!std::string(fXML->GetNodeName(child)).compare("config")) {
// Loop over config attributes and search for name
XMLAttrPointer_t attr = fXML->GetFirstAttr(child);
while (attr != 0) {
// Save name value
if (std::string(fXML->GetAttrName(attr)) == name.c_str()) {
return child;
}
// Get Next Attribute
attr = fXML->GetNextAttr(attr);
}
}
// Next Child
child = fXML->GetNext(child);
}
return 0;
}
void nuisconfig::SetConfig(std::string const &name, std::string const &val) {
XMLNodePointer_t node = GetConfigNode(name);
if (!node) node = CreateNode("config");
Set(node, name, val);
}
void nuisconfig::SetConfig(std::string const &name, char const *val) {
SetConfig(name, std::string(val));
}
void nuisconfig::SetConfig(std::string const &name, bool val) {
XMLNodePointer_t node = GetConfigNode(name);
if (!node) node = CreateNode("config");
Set(node, name, val);
}
void nuisconfig::SetConfig(std::string const &name, int val) {
XMLNodePointer_t node = GetConfigNode(name);
if (!node) node = CreateNode("config");
Set(node, name, val);
}
void nuisconfig::SetConfig(std::string const &name, float val) {
XMLNodePointer_t node = GetConfigNode(name);
if (!node) node = CreateNode("config");
Set(node, name, val);
}
void nuisconfig::SetConfig(std::string const &name, double val) {
XMLNodePointer_t node = GetConfigNode(name);
if (!node) node = CreateNode("config");
Set(node, name, val);
}
void nuisconfig::OverrideConfig(std::string const &conf) {
std::vector opts = GeneralUtils::ParseToStr(conf, "=");
SetConfig(opts[0], opts[1]);
}
std::string nuisconfig::GetConfig(std::string const &name) {
XMLNodePointer_t node = GetConfigNode(name);
if (!node) return "";
XMLAttrPointer_t attr = fXML->GetFirstAttr(node);
std::string temp = "";
// Loop config attributes
while (attr != 0) {
// Find match
if (std::string(fXML->GetAttrName(attr)) == name.c_str()) {
temp = fXML->GetAttrValue(attr);
}
// Get Next Attribute
attr = fXML->GetNextAttr(attr);
}
return temp;
}
bool nuisconfig::HasConfig(std::string const &name) {
return bool(GetConfigNode(name));
}
std::string nuisconfig::GetConfigS(std::string const &name) {
return GetConfig(name);
}
bool nuisconfig::GetConfigB(std::string const &name) {
std::string pars = GetConfig(name);
return GeneralUtils::StrToBool(pars);
}
int nuisconfig::GetConfigI(std::string const &name) {
std::string pars = GetConfig(name);
return GeneralUtils::StrToInt(pars);
}
float nuisconfig::GetConfigF(std::string const &name) {
std::string pars = GetConfig(name);
return GeneralUtils::StrToDbl(pars);
}
double nuisconfig::GetConfigD(std::string const &name) {
std::string pars = GetConfig(name);
return GeneralUtils::StrToDbl(pars);
}
std::string nuisconfig::GetParDIR(std::string const &parName) {
std::string outstr = this->GetParS(parName);
// Make replacements in the string
const int nfiletypes = 2;
const std::string filetypes[nfiletypes] = {"@data", "@nuisance"};
std::string filerepl[nfiletypes] = {FitPar::GetDataBase(),
FitPar::GetDataBase() + "/../"};
for (int i = 0; i < nfiletypes; i++) {
std::string findstring = filetypes[i];
std::string replstring = filerepl[i];
if (outstr.find(findstring) != std::string::npos) {
outstr.replace(outstr.find(findstring), findstring.size(), filerepl[i]);
break;
}
}
return outstr;
};
diff --git a/src/Config/NuisConfig.h b/src/Config/NuisConfig.h
index d95795e..2df80e5 100644
--- a/src/Config/NuisConfig.h
+++ b/src/Config/NuisConfig.h
@@ -1,193 +1,193 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016-2021 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 .
*******************************************************************************/
#ifndef NUISCONFIG_H_SEEN
#define NUISCONFIG_H_SEEN
#include
#include